diff --git a/dist/b2b/discovery_intermediate_sessions.js b/dist/b2b/discovery_intermediate_sessions.js index 0592b59c..0ecf8271 100644 --- a/dist/b2b/discovery_intermediate_sessions.js +++ b/dist/b2b/discovery_intermediate_sessions.js @@ -24,8 +24,8 @@ class IntermediateSessions { * * This endpoint can be used to accept invites and create new members via domain matching. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/dist/b2b/discovery_organizations.js b/dist/b2b/discovery_organizations.js index 8ab31bcd..a8d2d319 100644 --- a/dist/b2b/discovery_organizations.js +++ b/dist/b2b/discovery_organizations.js @@ -26,8 +26,8 @@ class Organizations { * * This endpoint can also be used to start an initial session for the newly created member and organization. * - * (Coming Soon) If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly - * created Member will need to complete an MFA step to log in to the Organization. + * If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly created Member + * will need to complete an MFA step to log in to the Organization. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/dist/b2b/magic_links.js b/dist/b2b/magic_links.js index 611a0f84..ffd56321 100644 --- a/dist/b2b/magic_links.js +++ b/dist/b2b/magic_links.js @@ -29,8 +29,8 @@ class MagicLinks { * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute * duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/oauth.js b/dist/b2b/oauth.js index 620525c0..056047f2 100644 --- a/dist/b2b/oauth.js +++ b/dist/b2b/oauth.js @@ -25,8 +25,8 @@ class OAuth { * parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not * specified, a Stytch session will be created with a 60 minute duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/organizations_members.js b/dist/b2b/organizations_members.js index 632fc994..b2092501 100644 --- a/dist/b2b/organizations_members.js +++ b/dist/b2b/organizations_members.js @@ -59,6 +59,15 @@ class Members { } /** * Delete a Member's MFA phone number. + * + * To change a Member's phone number, you must first call this endpoint to delete the existing phone number. + * + * Existing Member Sessions that include a phone number authentication factor will not be revoked if the + * phone number is deleted, and MFA will not be enforced until the Member logs in again. + * If you wish to enforce MFA immediately after a phone number is deleted, you can do so by prompting the + * Member to enter a new phone number + * and calling the [OTP SMS send](https://stytch.com/docs/b2b/api/otp-sms-send) endpoint, then calling the + * [OTP SMS Authenticate](https://stytch.com/docs/b2b/api/authenticate-otp-sms) endpoint. * @param data {@link B2BOrganizationsMembersDeleteMFAPhoneNumberRequest} * @returns {@link B2BOrganizationsMembersDeleteMFAPhoneNumberResponse} * @async diff --git a/dist/b2b/otp_sms.js b/dist/b2b/otp_sms.js index 61e24c1c..0ff8adda 100644 --- a/dist/b2b/otp_sms.js +++ b/dist/b2b/otp_sms.js @@ -17,9 +17,13 @@ class Sms { this.fetchConfig = fetchConfig; } /** - * Send a one-time passcode (OTP) to a Member's phone number. If the Member already has a phone number, - * this will send an OTP to the number associated with their `member_id`. If not, then this will send an - * OTP to the `mfa_phone_number` provided and link the `mfa_phone_number` with the Member. + * Send a one-time passcode (OTP) to a Member's phone number. + * + * If the Member already has a phone number, the `mfa_phone_number` field is not needed; the endpoint will + * send an OTP to the number associated with the Member. + * If the Member does not have a phone number, the endpoint will send an OTP to the `mfa_phone_number` + * provided and link the `mfa_phone_number` with the Member. + * * An error will be thrown if the Member already has a phone number and the provided `mfa_phone_number` * does not match the existing one. * @@ -47,18 +51,29 @@ class Sms { }); } /** - * Authenticates a Member's OTP code. This endpoint verifies that the code is valid and hasn't expired or - * been previously used. A given Member may only have a single active OTP code at any given time. If a - * Member requests another OTP code before the first one has expired, the first one will be invalidated. + * SMS OTPs may not be used as a primary authentication mechanism. They can be used to complete an MFA + * requirement, or they can be used as a step-up factor to be added to an existing session. + * + * This endpoint verifies that the one-time passcode (OTP) is valid and hasn't expired or been previously + * used. A given Member may only have a single active OTP code at any given time. If a Member requests + * another OTP code before the first one has expired, the first one will be invalidated. * * Exactly one of `intermediate_session_token`, `session_token`, or `session_jwt` must be provided in the * request. * If an intermediate session token is provided, this operation will consume it. * + * Intermediate session tokens are generated upon successful calls to primary authenticate methods in the + * case where MFA is required, + * such as [email magic link authenticate](https://stytch.com/docs/b2b/api/authenticate-magic-link), + * or upon successful calls to discovery authenticate methods, such as + * [email magic link discovery authenticate](https://stytch.com/docs/b2b/api/authenticate-discovery-magic-link). + * * If the Organization's MFA policy is `REQUIRED_FOR_ALL`, a successful OTP authentication will change the * Member's `mfa_enrolled` status to `true` if it is not already `true`. * If the Organization's MFA policy is `OPTIONAL`, the Member's MFA enrollment can be toggled by passing in * a value for the `set_mfa_enrollment` field. + * The Member's MFA enrollment can also be toggled through the + * [Update Member](https://stytch.com/docs/b2b/api/update-member) endpoint. * * Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a duration diff --git a/dist/b2b/passwords.js b/dist/b2b/passwords.js index 2e4a0e73..6ad190fe 100644 --- a/dist/b2b/passwords.js +++ b/dist/b2b/passwords.js @@ -100,8 +100,8 @@ class Passwords { * account. To prevent this, any further email/password login attempts first require a password reset which * can only be accomplished by someone with access to the underlying email address. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/passwords_email.js b/dist/b2b/passwords_email.js index 0e8d3897..18c8a875 100644 --- a/dist/b2b/passwords_email.js +++ b/dist/b2b/passwords_email.js @@ -51,8 +51,8 @@ class Email { * with the password strength endpoint. If the token and password are accepted, the password is securely * stored for future authentication and the user is authenticated. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/passwords_existing_password.js b/dist/b2b/passwords_existing_password.js index 23db1a93..82ae0cfb 100644 --- a/dist/b2b/passwords_existing_password.js +++ b/dist/b2b/passwords_existing_password.js @@ -28,8 +28,8 @@ class ExistingPassword { * You may update your password strength configuration in the * [stytch dashboard](https://stytch.com/dashboard/password-strength-config). * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/sessions.js b/dist/b2b/sessions.js index 8cf306b6..ef26a49e 100644 --- a/dist/b2b/sessions.js +++ b/dist/b2b/sessions.js @@ -97,8 +97,8 @@ class Sessions { * SMS OTP factors can be used to fulfill MFA requirements for the target Organization if both the original * and target Member have the same phone number and the phone number is verified for both Members. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/dist/b2b/sso.js b/dist/b2b/sso.js index 2c69200a..c41c6303 100644 --- a/dist/b2b/sso.js +++ b/dist/b2b/sso.js @@ -66,8 +66,8 @@ class SSO { * To link this authentication event to an existing Stytch session, include either the `session_token` or * `session_jwt` param. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/discovery.ts b/lib/b2b/discovery.ts index 4c61ab2d..b5e60c49 100644 --- a/lib/b2b/discovery.ts +++ b/lib/b2b/discovery.ts @@ -21,12 +21,9 @@ export interface DiscoveredOrganization { organization?: Organization; // Information about the membership. membership?: Membership; - // (Coming Soon) Information about the primary authentication requirements of the Organization. + // Information about the primary authentication requirements of the Organization. primary_required?: PrimaryRequired; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } diff --git a/lib/b2b/discovery_intermediate_sessions.ts b/lib/b2b/discovery_intermediate_sessions.ts index 82a431d8..550a25c1 100644 --- a/lib/b2b/discovery_intermediate_sessions.ts +++ b/lib/b2b/discovery_intermediate_sessions.ts @@ -58,9 +58,9 @@ export interface B2BDiscoveryIntermediateSessionsExchangeRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -88,7 +88,10 @@ export interface B2BDiscoveryIntermediateSessionsExchangeResponse { session_token: string; // The JSON Web Token (JWT) for a given Stytch Session. session_jwt: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -117,10 +120,7 @@ export interface B2BDiscoveryIntermediateSessionsExchangeResponse { status_code: number; // The [Session object](https://stytch.com/docs/b2b/api/session-object). member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -139,8 +139,8 @@ export class IntermediateSessions { * * This endpoint can be used to accept invites and create new members via domain matching. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/lib/b2b/discovery_organizations.ts b/lib/b2b/discovery_organizations.ts index 7ef8b5c6..e39f9cc6 100644 --- a/lib/b2b/discovery_organizations.ts +++ b/lib/b2b/discovery_organizations.ts @@ -140,8 +140,7 @@ export interface B2BDiscoveryOrganizationsCreateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. @@ -166,7 +165,10 @@ export interface B2BDiscoveryOrganizationsCreateResponse { session_token: string; // The JSON Web Token (JWT) for a given Stytch Session. session_jwt: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; /** * Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step @@ -195,10 +197,7 @@ export interface B2BDiscoveryOrganizationsCreateResponse { member_session?: MemberSession; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization?: Organization; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -282,8 +281,8 @@ export class Organizations { * * This endpoint can also be used to start an initial session for the newly created member and organization. * - * (Coming Soon) If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly - * created Member will need to complete an MFA step to log in to the Organization. + * If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly created Member + * will need to complete an MFA step to log in to the Organization. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/lib/b2b/magic_links.ts b/lib/b2b/magic_links.ts index 69879f2d..ca480cc3 100644 --- a/lib/b2b/magic_links.ts +++ b/lib/b2b/magic_links.ts @@ -62,9 +62,9 @@ export interface B2BMagicLinksAuthenticateRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -102,7 +102,10 @@ export interface B2BMagicLinksAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // A secret token for a given Stytch Session. session_token: string; @@ -135,10 +138,7 @@ export interface B2BMagicLinksAuthenticateResponse { * 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. */ status_code: number; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -160,8 +160,8 @@ export class MagicLinks { * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute * duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/magic_links_email.ts b/lib/b2b/magic_links_email.ts index 492cae2f..b41b56f3 100644 --- a/lib/b2b/magic_links_email.ts +++ b/lib/b2b/magic_links_email.ts @@ -69,7 +69,10 @@ export interface B2BMagicLinksEmailInviteResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -152,7 +155,10 @@ export interface B2BMagicLinksEmailLoginOrSignupResponse { * existed. */ member_created: boolean; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; diff --git a/lib/b2b/oauth.ts b/lib/b2b/oauth.ts index 7bbd0107..6a94a15e 100644 --- a/lib/b2b/oauth.ts +++ b/lib/b2b/oauth.ts @@ -69,9 +69,9 @@ export interface B2BOAuthAuthenticateRequest { // A base64url encoded one time secret used to validate that the request starts and ends on the same device. pkce_code_verifier?: string; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -109,7 +109,10 @@ export interface B2BOAuthAuthenticateResponse { session_token: string; // The JSON Web Token (JWT) for a given Stytch Session. session_jwt: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; /** * Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to @@ -153,10 +156,7 @@ export interface B2BOAuthAuthenticateResponse { * returned by Microsoft. */ provider_values?: B2BOAuthProviderValues; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -175,8 +175,8 @@ export class OAuth { * parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not * specified, a Stytch session will be created with a 60 minute duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/organizations.ts b/lib/b2b/organizations.ts index 046a1731..0aad88f3 100644 --- a/lib/b2b/organizations.ts +++ b/lib/b2b/organizations.ts @@ -31,9 +31,12 @@ export interface Member { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; - // Globally unique UUID that identifies a specific Member. + /** + * Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform + * operations on a Member, so be sure to preserve this value. + */ member_id: string; - // The email address. + // The email address of the Member. email_address: string; // The status of the Member. The possible values are: `pending`, `invited`, `active`, or `deleted`. status: string; @@ -56,13 +59,17 @@ export interface Member { member_password_id: string; // A list of OAuth registrations for this member. oauth_registrations: OAuthRegistration[]; + // Whether or not the Member's email address is verified. + email_address_verified: boolean; + // Whether or not the Member's phone number is verified. + mfa_phone_number_verified: boolean; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled: boolean; - // (Coming Soon) The Member's phone number. A Member may only have one phone number. + // The Member's phone number. A Member may only have one phone number. mfa_phone_number: string; // An arbitrary JSON object for storing application-specific data or identity-provider-specific data. trusted_metadata?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any @@ -301,8 +308,7 @@ export interface B2BOrganizationsCreateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. @@ -522,8 +528,7 @@ export interface B2BOrganizationsUpdateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. diff --git a/lib/b2b/organizations_members.ts b/lib/b2b/organizations_members.ts index d3a30a77..d06ef714 100644 --- a/lib/b2b/organizations_members.ts +++ b/lib/b2b/organizations_members.ts @@ -48,12 +48,12 @@ export interface B2BOrganizationsMembersCreateRequest { * more details. */ is_breakglass?: boolean; - // (Coming Soon) The Member's phone number. A Member may only have one phone number. + // The Member's phone number. A Member may only have one phone number. mfa_phone_number?: string; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled?: boolean; } @@ -67,7 +67,10 @@ export interface B2BOrganizationsMembersCreateResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -101,7 +104,10 @@ export interface B2BOrganizationsMembersDeleteMFAPhoneNumberResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -132,7 +138,10 @@ export interface B2BOrganizationsMembersDeletePasswordResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -198,7 +207,10 @@ export interface B2BOrganizationsMembersGetResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -294,16 +306,16 @@ export interface B2BOrganizationsMembersUpdateRequest { */ is_breakglass?: boolean; /** - * (Coming Soon) Sets the Member's phone number. Throws an error if the Member already has a phone number. - * To change the Member's phone number, use the + * Sets the Member's phone number. Throws an error if the Member already has a phone number. To change the + * Member's phone number, use the * [Delete member phone number endpoint](https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number) to * delete the Member's existing phone number first. */ mfa_phone_number?: string; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled?: boolean; } @@ -317,7 +329,10 @@ export interface B2BOrganizationsMembersUpdateResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -380,6 +395,15 @@ export class Members { /** * Delete a Member's MFA phone number. + * + * To change a Member's phone number, you must first call this endpoint to delete the existing phone number. + * + * Existing Member Sessions that include a phone number authentication factor will not be revoked if the + * phone number is deleted, and MFA will not be enforced until the Member logs in again. + * If you wish to enforce MFA immediately after a phone number is deleted, you can do so by prompting the + * Member to enter a new phone number + * and calling the [OTP SMS send](https://stytch.com/docs/b2b/api/otp-sms-send) endpoint, then calling the + * [OTP SMS Authenticate](https://stytch.com/docs/b2b/api/authenticate-otp-sms) endpoint. * @param data {@link B2BOrganizationsMembersDeleteMFAPhoneNumberRequest} * @returns {@link B2BOrganizationsMembersDeleteMFAPhoneNumberResponse} * @async diff --git a/lib/b2b/otp_sms.ts b/lib/b2b/otp_sms.ts index d685f3e5..8b09c973 100644 --- a/lib/b2b/otp_sms.ts +++ b/lib/b2b/otp_sms.ts @@ -91,7 +91,10 @@ export interface B2BOTPSmsAuthenticateResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -148,7 +151,10 @@ export interface B2BOTPSmsSendResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -167,9 +173,13 @@ export class Sms { } /** - * Send a one-time passcode (OTP) to a Member's phone number. If the Member already has a phone number, - * this will send an OTP to the number associated with their `member_id`. If not, then this will send an - * OTP to the `mfa_phone_number` provided and link the `mfa_phone_number` with the Member. + * Send a one-time passcode (OTP) to a Member's phone number. + * + * If the Member already has a phone number, the `mfa_phone_number` field is not needed; the endpoint will + * send an OTP to the number associated with the Member. + * If the Member does not have a phone number, the endpoint will send an OTP to the `mfa_phone_number` + * provided and link the `mfa_phone_number` with the Member. + * * An error will be thrown if the Member already has a phone number and the provided `mfa_phone_number` * does not match the existing one. * @@ -196,18 +206,29 @@ export class Sms { } /** - * Authenticates a Member's OTP code. This endpoint verifies that the code is valid and hasn't expired or - * been previously used. A given Member may only have a single active OTP code at any given time. If a - * Member requests another OTP code before the first one has expired, the first one will be invalidated. + * SMS OTPs may not be used as a primary authentication mechanism. They can be used to complete an MFA + * requirement, or they can be used as a step-up factor to be added to an existing session. + * + * This endpoint verifies that the one-time passcode (OTP) is valid and hasn't expired or been previously + * used. A given Member may only have a single active OTP code at any given time. If a Member requests + * another OTP code before the first one has expired, the first one will be invalidated. * * Exactly one of `intermediate_session_token`, `session_token`, or `session_jwt` must be provided in the * request. * If an intermediate session token is provided, this operation will consume it. * + * Intermediate session tokens are generated upon successful calls to primary authenticate methods in the + * case where MFA is required, + * such as [email magic link authenticate](https://stytch.com/docs/b2b/api/authenticate-magic-link), + * or upon successful calls to discovery authenticate methods, such as + * [email magic link discovery authenticate](https://stytch.com/docs/b2b/api/authenticate-discovery-magic-link). + * * If the Organization's MFA policy is `REQUIRED_FOR_ALL`, a successful OTP authentication will change the * Member's `mfa_enrolled` status to `true` if it is not already `true`. * If the Organization's MFA policy is `OPTIONAL`, the Member's MFA enrollment can be toggled by passing in * a value for the `set_mfa_enrollment` field. + * The Member's MFA enrollment can also be toggled through the + * [Update Member](https://stytch.com/docs/b2b/api/update-member) endpoint. * * Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a duration diff --git a/lib/b2b/passwords.ts b/lib/b2b/passwords.ts index 1942d0ff..59403f38 100644 --- a/lib/b2b/passwords.ts +++ b/lib/b2b/passwords.ts @@ -101,9 +101,9 @@ export interface B2BPasswordsAuthenticateRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -132,7 +132,10 @@ export interface B2BPasswordsAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // A secret token for a given Stytch Session. session_token: string; @@ -161,10 +164,7 @@ export interface B2BPasswordsAuthenticateResponse { status_code: number; // The [Session object](https://stytch.com/docs/b2b/api/session-object). member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -233,7 +233,10 @@ export interface B2BPasswordsMigrateResponse { * existed. */ member_created: boolean; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -395,8 +398,8 @@ export class Passwords { * account. To prevent this, any further email/password login attempts first require a password reset which * can only be accomplished by someone with access to the underlying email address. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/passwords_email.ts b/lib/b2b/passwords_email.ts index c66085ed..6971a395 100644 --- a/lib/b2b/passwords_email.ts +++ b/lib/b2b/passwords_email.ts @@ -62,9 +62,9 @@ export interface B2BPasswordsEmailResetRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -95,7 +95,10 @@ export interface B2BPasswordsEmailResetResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // A secret token for a given Stytch Session. session_token: string; @@ -124,10 +127,7 @@ export interface B2BPasswordsEmailResetResponse { status_code: number; // The [Session object](https://stytch.com/docs/b2b/api/session-object). member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -247,8 +247,8 @@ export class Email { * with the password strength endpoint. If the token and password are accepted, the password is securely * stored for future authentication and the user is authenticated. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/passwords_existing_password.ts b/lib/b2b/passwords_existing_password.ts index 886bf6fb..2afed412 100644 --- a/lib/b2b/passwords_existing_password.ts +++ b/lib/b2b/passwords_existing_password.ts @@ -55,9 +55,9 @@ export interface B2BPasswordsExistingPasswordResetRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -81,7 +81,10 @@ export interface B2BPasswordsExistingPasswordResetResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // A secret token for a given Stytch Session. session_token: string; @@ -110,10 +113,7 @@ export interface B2BPasswordsExistingPasswordResetResponse { status_code: number; // The [Session object](https://stytch.com/docs/b2b/api/session-object). member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -136,8 +136,8 @@ export class ExistingPassword { * You may update your password strength configuration in the * [stytch dashboard](https://stytch.com/dashboard/password-strength-config). * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/passwords_session.ts b/lib/b2b/passwords_session.ts index 7683fa53..a9c03858 100644 --- a/lib/b2b/passwords_session.ts +++ b/lib/b2b/passwords_session.ts @@ -33,7 +33,10 @@ export interface B2BPasswordsSessionResetResponse { request_id: string; // Globally unique UUID that identifies a specific Member. member_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; diff --git a/lib/b2b/sessions.ts b/lib/b2b/sessions.ts index 09e4304f..43626f92 100644 --- a/lib/b2b/sessions.ts +++ b/lib/b2b/sessions.ts @@ -95,7 +95,10 @@ export interface B2BSessionsAuthenticateResponse { session_token: string; // The JSON Web Token (JWT) for a given Stytch Session. session_jwt: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -145,9 +148,9 @@ export interface B2BSessionsExchangeRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -177,7 +180,10 @@ export interface B2BSessionsExchangeResponse { session_token: string; // The JSON Web Token (JWT) for a given Stytch Session. session_jwt: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // The [Organization object](https://stytch.com/docs/b2b/api/organization-object). organization: Organization; @@ -204,10 +210,7 @@ export interface B2BSessionsExchangeResponse { * 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. */ status_code: number; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -381,8 +384,8 @@ export class Sessions { * SMS OTP factors can be used to fulfill MFA requirements for the target Organization if both the original * and target Member have the same phone number and the phone number is verified for both Members. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/lib/b2b/sso.ts b/lib/b2b/sso.ts index 0e292c36..6820bfda 100644 --- a/lib/b2b/sso.ts +++ b/lib/b2b/sso.ts @@ -87,9 +87,9 @@ export interface B2BSSOAuthenticateRequest { */ session_custom_claims?: Record; // eslint-disable-line @typescript-eslint/no-explicit-any /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -118,7 +118,10 @@ export interface B2BSSOAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; - // The [Member object](https://stytch.com/docs/b2b/api/member-object). + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; // A secret token for a given Stytch Session. session_token: string; @@ -154,10 +157,7 @@ export interface B2BSSOAuthenticateResponse { status_code: number; // The [Session object](https://stytch.com/docs/b2b/api/session-object). member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ + // Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. mfa_required?: MfaRequired; } @@ -275,8 +275,8 @@ export class SSO { * To link this authentication event to an existing Stytch session, include either the `session_token` or * `session_jwt` param. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/package-lock.json b/package-lock.json index aea61be2..b6f2eebd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "stytch", - "version": "8.1.0", + "version": "8.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "stytch", - "version": "8.1.0", + "version": "8.2.0", "license": "MIT", "dependencies": { "isomorphic-unfetch": "^3.1.0", diff --git a/package.json b/package.json index 6a5392e1..95f39647 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stytch", - "version": "8.1.0", + "version": "8.2.0", "description": "A wrapper for the Stytch API", "types": "./types/lib/index.d.ts", "main": "./dist/index.js", diff --git a/types/lib/b2b/discovery.d.ts b/types/lib/b2b/discovery.d.ts index 9a4af500..78672359 100644 --- a/types/lib/b2b/discovery.d.ts +++ b/types/lib/b2b/discovery.d.ts @@ -13,10 +13,6 @@ export interface DiscoveredOrganization { organization?: Organization; membership?: Membership; primary_required?: PrimaryRequired; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface Membership { diff --git a/types/lib/b2b/discovery_intermediate_sessions.d.ts b/types/lib/b2b/discovery_intermediate_sessions.d.ts index 2d2fdf81..6b559993 100644 --- a/types/lib/b2b/discovery_intermediate_sessions.d.ts +++ b/types/lib/b2b/discovery_intermediate_sessions.d.ts @@ -49,9 +49,9 @@ export interface B2BDiscoveryIntermediateSessionsExchangeRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -74,6 +74,10 @@ export interface B2BDiscoveryIntermediateSessionsExchangeResponse { member_id: string; session_token: string; session_jwt: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -100,10 +104,6 @@ export interface B2BDiscoveryIntermediateSessionsExchangeResponse { */ status_code: number; member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export declare class IntermediateSessions { @@ -117,8 +117,8 @@ export declare class IntermediateSessions { * * This endpoint can be used to accept invites and create new members via domain matching. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/types/lib/b2b/discovery_organizations.d.ts b/types/lib/b2b/discovery_organizations.d.ts index 9b2e0a12..88184130 100644 --- a/types/lib/b2b/discovery_organizations.d.ts +++ b/types/lib/b2b/discovery_organizations.d.ts @@ -129,8 +129,7 @@ export interface B2BDiscoveryOrganizationsCreateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. @@ -150,6 +149,10 @@ export interface B2BDiscoveryOrganizationsCreateResponse { member_id: string; session_token: string; session_jwt: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; /** * Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step @@ -176,10 +179,6 @@ export interface B2BDiscoveryOrganizationsCreateResponse { status_code: number; member_session?: MemberSession; organization?: Organization; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface B2BDiscoveryOrganizationsListRequest { @@ -251,8 +250,8 @@ export declare class Organizations { * * This endpoint can also be used to start an initial session for the newly created member and organization. * - * (Coming Soon) If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly - * created Member will need to complete an MFA step to log in to the Organization. + * If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly created Member + * will need to complete an MFA step to log in to the Organization. * The `intermediate_session_token` will not be consumed and instead will be returned in the response. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the diff --git a/types/lib/b2b/magic_links.d.ts b/types/lib/b2b/magic_links.d.ts index 9ff8f378..eea45a94 100644 --- a/types/lib/b2b/magic_links.d.ts +++ b/types/lib/b2b/magic_links.d.ts @@ -51,9 +51,9 @@ export interface B2BMagicLinksAuthenticateRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -87,6 +87,10 @@ export interface B2BMagicLinksAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; session_token: string; session_jwt: string; @@ -115,10 +119,6 @@ export interface B2BMagicLinksAuthenticateResponse { * 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. */ status_code: number; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export declare class MagicLinks { @@ -133,8 +133,8 @@ export declare class MagicLinks { * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute * duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/magic_links_email.d.ts b/types/lib/b2b/magic_links_email.d.ts index c5180335..60eb13ef 100644 --- a/types/lib/b2b/magic_links_email.d.ts +++ b/types/lib/b2b/magic_links_email.d.ts @@ -53,6 +53,10 @@ export interface B2BMagicLinksEmailInviteResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -128,6 +132,10 @@ export interface B2BMagicLinksEmailLoginOrSignupResponse { * existed. */ member_created: boolean; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** diff --git a/types/lib/b2b/oauth.d.ts b/types/lib/b2b/oauth.d.ts index a083fb62..b0fa15ab 100644 --- a/types/lib/b2b/oauth.d.ts +++ b/types/lib/b2b/oauth.d.ts @@ -53,9 +53,9 @@ export interface B2BOAuthAuthenticateRequest { session_custom_claims?: Record; pkce_code_verifier?: string; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -88,6 +88,10 @@ export interface B2BOAuthAuthenticateResponse { provider_type: string; session_token: string; session_jwt: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; /** * Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to @@ -129,10 +133,6 @@ export interface B2BOAuthAuthenticateResponse { * returned by Microsoft. */ provider_values?: B2BOAuthProviderValues; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export declare class OAuth { @@ -145,8 +145,8 @@ export declare class OAuth { * parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not * specified, a Stytch session will be created with a 60 minute duration. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/organizations.d.ts b/types/lib/b2b/organizations.d.ts index 6eaf5f8d..544efc96 100644 --- a/types/lib/b2b/organizations.d.ts +++ b/types/lib/b2b/organizations.d.ts @@ -18,6 +18,10 @@ export interface Member { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; + /** + * Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform + * operations on a Member, so be sure to preserve this value. + */ member_id: string; email_address: string; status: string; @@ -37,10 +41,12 @@ export interface Member { is_breakglass: boolean; member_password_id: string; oauth_registrations: OAuthRegistration[]; + email_address_verified: boolean; + mfa_phone_number_verified: boolean; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled: boolean; mfa_phone_number: string; @@ -260,8 +266,7 @@ export interface B2BOrganizationsCreateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. @@ -458,8 +463,7 @@ export interface B2BOrganizationsUpdateRequest { */ allowed_auth_methods?: string[]; /** - * (Coming Soon) The setting that controls the MFA policy for all Members in the Organization. The accepted - * values are: + * The setting that controls the MFA policy for all Members in the Organization. The accepted values are: * * `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time * they wish to log in. diff --git a/types/lib/b2b/organizations_members.d.ts b/types/lib/b2b/organizations_members.d.ts index e49eb2d8..14453939 100644 --- a/types/lib/b2b/organizations_members.d.ts +++ b/types/lib/b2b/organizations_members.d.ts @@ -33,9 +33,9 @@ export interface B2BOrganizationsMembersCreateRequest { is_breakglass?: boolean; mfa_phone_number?: string; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled?: boolean; } @@ -46,6 +46,10 @@ export interface B2BOrganizationsMembersCreateResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -73,6 +77,10 @@ export interface B2BOrganizationsMembersDeleteMFAPhoneNumberResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -96,6 +104,10 @@ export interface B2BOrganizationsMembersDeletePasswordResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -149,6 +161,10 @@ export interface B2BOrganizationsMembersGetResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -233,16 +249,16 @@ export interface B2BOrganizationsMembersUpdateRequest { */ is_breakglass?: boolean; /** - * (Coming Soon) Sets the Member's phone number. Throws an error if the Member already has a phone number. - * To change the Member's phone number, use the + * Sets the Member's phone number. Throws an error if the Member already has a phone number. To change the + * Member's phone number, use the * [Delete member phone number endpoint](https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number) to * delete the Member's existing phone number first. */ mfa_phone_number?: string; /** - * (Coming Soon) Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step - * whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA - * step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. + * Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they + * wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the + * Organization's MFA policy is set to `REQUIRED_FOR_ALL`. */ mfa_enrolled?: boolean; } @@ -253,6 +269,10 @@ export interface B2BOrganizationsMembersUpdateResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -284,6 +304,15 @@ export declare class Members { delete(data: B2BOrganizationsMembersDeleteRequest): Promise; /** * Delete a Member's MFA phone number. + * + * To change a Member's phone number, you must first call this endpoint to delete the existing phone number. + * + * Existing Member Sessions that include a phone number authentication factor will not be revoked if the + * phone number is deleted, and MFA will not be enforced until the Member logs in again. + * If you wish to enforce MFA immediately after a phone number is deleted, you can do so by prompting the + * Member to enter a new phone number + * and calling the [OTP SMS send](https://stytch.com/docs/b2b/api/otp-sms-send) endpoint, then calling the + * [OTP SMS Authenticate](https://stytch.com/docs/b2b/api/authenticate-otp-sms) endpoint. * @param data {@link B2BOrganizationsMembersDeleteMFAPhoneNumberRequest} * @returns {@link B2BOrganizationsMembersDeleteMFAPhoneNumberResponse} * @async diff --git a/types/lib/b2b/otp_sms.d.ts b/types/lib/b2b/otp_sms.d.ts index 35ded74e..10b71e43 100644 --- a/types/lib/b2b/otp_sms.d.ts +++ b/types/lib/b2b/otp_sms.d.ts @@ -76,6 +76,10 @@ export interface B2BOTPSmsAuthenticateResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; session_token: string; @@ -123,6 +127,10 @@ export interface B2BOTPSmsSendResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -135,9 +143,13 @@ export declare class Sms { private fetchConfig; constructor(fetchConfig: fetchConfig); /** - * Send a one-time passcode (OTP) to a Member's phone number. If the Member already has a phone number, - * this will send an OTP to the number associated with their `member_id`. If not, then this will send an - * OTP to the `mfa_phone_number` provided and link the `mfa_phone_number` with the Member. + * Send a one-time passcode (OTP) to a Member's phone number. + * + * If the Member already has a phone number, the `mfa_phone_number` field is not needed; the endpoint will + * send an OTP to the number associated with the Member. + * If the Member does not have a phone number, the endpoint will send an OTP to the `mfa_phone_number` + * provided and link the `mfa_phone_number` with the Member. + * * An error will be thrown if the Member already has a phone number and the provided `mfa_phone_number` * does not match the existing one. * @@ -157,18 +169,29 @@ export declare class Sms { */ send(data: B2BOTPSmsSendRequest): Promise; /** - * Authenticates a Member's OTP code. This endpoint verifies that the code is valid and hasn't expired or - * been previously used. A given Member may only have a single active OTP code at any given time. If a - * Member requests another OTP code before the first one has expired, the first one will be invalidated. + * SMS OTPs may not be used as a primary authentication mechanism. They can be used to complete an MFA + * requirement, or they can be used as a step-up factor to be added to an existing session. + * + * This endpoint verifies that the one-time passcode (OTP) is valid and hasn't expired or been previously + * used. A given Member may only have a single active OTP code at any given time. If a Member requests + * another OTP code before the first one has expired, the first one will be invalidated. * * Exactly one of `intermediate_session_token`, `session_token`, or `session_jwt` must be provided in the * request. * If an intermediate session token is provided, this operation will consume it. * + * Intermediate session tokens are generated upon successful calls to primary authenticate methods in the + * case where MFA is required, + * such as [email magic link authenticate](https://stytch.com/docs/b2b/api/authenticate-magic-link), + * or upon successful calls to discovery authenticate methods, such as + * [email magic link discovery authenticate](https://stytch.com/docs/b2b/api/authenticate-discovery-magic-link). + * * If the Organization's MFA policy is `REQUIRED_FOR_ALL`, a successful OTP authentication will change the * Member's `mfa_enrolled` status to `true` if it is not already `true`. * If the Organization's MFA policy is `OPTIONAL`, the Member's MFA enrollment can be toggled by passing in * a value for the `set_mfa_enrollment` field. + * The Member's MFA enrollment can also be toggled through the + * [Update Member](https://stytch.com/docs/b2b/api/update-member) endpoint. * * Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the * `session_duration_minutes` parameter is not specified, a Stytch session will be created with a duration diff --git a/types/lib/b2b/passwords.d.ts b/types/lib/b2b/passwords.d.ts index 4ccf9a41..3f2464c4 100644 --- a/types/lib/b2b/passwords.d.ts +++ b/types/lib/b2b/passwords.d.ts @@ -77,9 +77,9 @@ export interface B2BPasswordsAuthenticateRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -105,6 +105,10 @@ export interface B2BPasswordsAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; session_token: string; session_jwt: string; @@ -129,10 +133,6 @@ export interface B2BPasswordsAuthenticateResponse { */ status_code: number; member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface B2BPasswordsMigrateRequest { @@ -179,6 +179,10 @@ export interface B2BPasswordsMigrateResponse { * existed. */ member_created: boolean; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -306,8 +310,8 @@ export declare class Passwords { * account. To prevent this, any further email/password login attempts first require a password reset which * can only be accomplished by someone with access to the underlying email address. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/passwords_email.d.ts b/types/lib/b2b/passwords_email.d.ts index c6815594..eaaca713 100644 --- a/types/lib/b2b/passwords_email.d.ts +++ b/types/lib/b2b/passwords_email.d.ts @@ -50,9 +50,9 @@ export interface B2BPasswordsEmailResetRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -79,6 +79,10 @@ export interface B2BPasswordsEmailResetResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; session_token: string; session_jwt: string; @@ -103,10 +107,6 @@ export interface B2BPasswordsEmailResetResponse { */ status_code: number; member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface B2BPasswordsEmailResetStartRequest { @@ -204,8 +204,8 @@ export declare class Email { * with the password strength endpoint. If the token and password are accepted, the password is securely * stored for future authentication and the user is authenticated. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/passwords_existing_password.d.ts b/types/lib/b2b/passwords_existing_password.d.ts index c1481387..6c5ccec7 100644 --- a/types/lib/b2b/passwords_existing_password.d.ts +++ b/types/lib/b2b/passwords_existing_password.d.ts @@ -41,9 +41,9 @@ export interface B2BPasswordsExistingPasswordResetRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -64,6 +64,10 @@ export interface B2BPasswordsExistingPasswordResetResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; session_token: string; session_jwt: string; @@ -88,10 +92,6 @@ export interface B2BPasswordsExistingPasswordResetResponse { */ status_code: number; member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export declare class ExistingPassword { @@ -109,8 +109,8 @@ export declare class ExistingPassword { * You may update your password strength configuration in the * [stytch dashboard](https://stytch.com/dashboard/password-strength-config). * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/passwords_session.d.ts b/types/lib/b2b/passwords_session.d.ts index c5a81181..5b07fe59 100644 --- a/types/lib/b2b/passwords_session.d.ts +++ b/types/lib/b2b/passwords_session.d.ts @@ -18,6 +18,10 @@ export interface B2BPasswordsSessionResetResponse { */ request_id: string; member_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** diff --git a/types/lib/b2b/sessions.d.ts b/types/lib/b2b/sessions.d.ts index ee37fc9a..b7cfb232 100644 --- a/types/lib/b2b/sessions.d.ts +++ b/types/lib/b2b/sessions.d.ts @@ -73,6 +73,10 @@ export interface B2BSessionsAuthenticateResponse { member_session: MemberSession; session_token: string; session_jwt: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -117,9 +121,9 @@ export interface B2BSessionsExchangeRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -143,6 +147,10 @@ export interface B2BSessionsExchangeResponse { member_session: MemberSession; session_token: string; session_jwt: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; organization: Organization; /** @@ -168,10 +176,6 @@ export interface B2BSessionsExchangeResponse { * 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. */ status_code: number; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface B2BSessionsGetJWKSRequest { @@ -294,8 +298,8 @@ export declare class Sessions { * SMS OTP factors can be used to fulfill MFA requirements for the target Organization if both the original * and target Member have the same phone number and the phone number is verified for both Members. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session. diff --git a/types/lib/b2b/sso.d.ts b/types/lib/b2b/sso.d.ts index 54c4ec10..3f4fe7fe 100644 --- a/types/lib/b2b/sso.d.ts +++ b/types/lib/b2b/sso.d.ts @@ -71,9 +71,9 @@ export interface B2BSSOAuthenticateRequest { */ session_custom_claims?: Record; /** - * (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number, this - * endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale - * argument will be used to determine which language to use when sending the passcode. + * If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will + * pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will be + * used to determine which language to use when sending the passcode. * * Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), * e.g. `"en"`. @@ -99,6 +99,10 @@ export interface B2BSSOAuthenticateResponse { * perform operations on an Organization, so be sure to preserve this value. */ organization_id: string; + /** + * The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one + * does not. + */ member: Member; session_token: string; session_jwt: string; @@ -130,10 +134,6 @@ export interface B2BSSOAuthenticateResponse { */ status_code: number; member_session?: MemberSession; - /** - * (Coming Soon) Information about the MFA requirements of the Organization and the Member's options for - * fulfilling MFA. - */ mfa_required?: MfaRequired; } export interface B2BSSODeleteConnectionRequest { @@ -215,8 +215,8 @@ export declare class SSO { * To link this authentication event to an existing Stytch session, include either the `session_token` or * `session_jwt` param. * - * (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned - * value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. + * If the Member is required to complete MFA to log in to the Organization, the returned value of + * `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. * The `intermediate_session_token` can be passed into the * [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the * MFA step and acquire a full member session.