Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong continue_with enum declaration #3522

Merged
merged 3 commits into from
Sep 20, 2023
Merged

Conversation

jonas-jonas
Copy link
Member

@jonas-jonas jonas-jonas commented Sep 19, 2023

The generation of the continue_with items somehow broke, and I am not sure how it ever worked.

Before we generated

Before
/**
 * @type ContinueWith
 * @export
 */
export declare type ContinueWith = ContinueWithSetOrySessionToken | ContinueWithVerificationUi;
/**
 * Indicates that a session was issued, and the application should use this token for authenticated requests
 * @export
 * @interface ContinueWithSetOrySessionToken
 */
export type ContinueWithSetOrySessionToken {
    /**
     * Action will always be `set_ory_session_token` set_ory_session_token ContinueWithActionSetOrySessionToken show_verification_ui ContinueWithActionShowVerificationUI
     * @type {string}
     * @memberof ContinueWithSetOrySessionToken
     */
    'action': ContinueWithSetOrySessionTokenActionEnum;
    /**
     * Token is the token of the session
     * @type {string}
     * @memberof ContinueWithSetOrySessionToken
     */
    'ory_session_token': string;
}
export declare const ContinueWithSetOrySessionTokenActionEnum: {
    readonly SetOrySessionToken: "set_ory_session_token";
    readonly ShowVerificationUi: "show_verification_ui";
};
export declare type ContinueWithSetOrySessionTokenActionEnum = typeof ContinueWithSetOrySessionTokenActionEnum[keyof typeof ContinueWithSetOrySessionTokenActionEnum];
/**
 * Indicates, that the UI flow could be continued by showing a verification ui
 * @export
 * @interface ContinueWithVerificationUi
 */
export type ContinueWithVerificationUi {
    /**
     * Action will always be `show_verification_ui` set_ory_session_token ContinueWithActionSetOrySessionToken show_verification_ui ContinueWithActionShowVerificationUI
     * @type {string}
     * @memberof ContinueWithVerificationUi
     */
    'action': ContinueWithVerificationUiActionEnum;
    /**
     *
     * @type {ContinueWithVerificationUiFlow}
     * @memberof ContinueWithVerificationUi
     */
    'flow': {s: string};
}


export declare const ContinueWithVerificationUiActionEnum: {
    readonly SetOrySessionToken: "set_ory_session_token";
    readonly ShowVerificationUi: "show_verification_ui";
};
export declare type ContinueWithVerificationUiActionEnum = typeof ContinueWithVerificationUiActionEnum[keyof typeof ContinueWithVerificationUiActionEnum];

function main(c: ContinueWith) {
  if (c.action == "set_ory_session_token") {
    c.ory_session_token
  }
}

Which broke the discriminator values:

export declare const ContinueWithSetOrySessionTokenActionEnum: {
    readonly SetOrySessionToken: "set_ory_session_token";
    readonly ShowVerificationUi: "show_verification_ui";
};

should've been

export declare const ContinueWithSetOrySessionTokenActionEnum: {
    readonly SetOrySessionToken: "set_ory_session_token";
};

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #3522 (30ba71e) into master (30ba71e) will not change coverage.
The diff coverage is n/a.

❗ Current head 30ba71e differs from pull request most recent head 3c27763. Consider uploading reports for the commit 3c27763 to get more accurate results

@@           Coverage Diff           @@
##           master    #3522   +/-   ##
=======================================
  Coverage   78.34%   78.34%           
=======================================
  Files         341      341           
  Lines       22700    22700           
=======================================
  Hits        17785    17785           
  Misses       3587     3587           
  Partials     1328     1328           

@aeneasr aeneasr merged commit 4c34c24 into master Sep 20, 2023
26 checks passed
@aeneasr aeneasr deleted the jonas-jonas/fixContinueWith branch September 20, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants