import { NonNullablePaths } from '@wix/sdk-types'; interface StartResponse { /** the identifier of the verification process */ verificationId?: string; } interface StartRequest { /** * ID of the identity whose email address should be verified. The verification code is sent to this identity's * email. Currently required — the request fails if it is omitted. * @format GUID */ identityId?: string | null; /** Delivery channel for the verification code. Currently only `EMAIL` is supported. */ target?: TargetWithLiterals; } /** The delivery channel used to send the verification code. */ declare enum Target { /** Send the verification code to the identity's email address. */ EMAIL = "EMAIL" } /** @enumType */ type TargetWithLiterals = Target | 'EMAIL'; interface VerifyRequest { /** * the code to verify * @minLength 6 * @maxLength 6 */ code?: string; /** the identifier of the verification process */ verificationId?: string; } interface VerifyResponse { } interface VerifyDuringAuthenticationRequest { /** * The code to verify. * @minLength 6 * @maxLength 6 */ code: string; /** A state token representing the `REQUIRE_EMAIL_VERIFICATION` state. */ stateToken: string; } interface StateMachineResponse extends StateMachineResponseStateDataOneOf { /** @internal */ requireMfaData?: RequireMfaData; /** * User needs to solve an MFA challenge, such as providing the code that sent to them by SMS. * @internal */ mfaChallengeData?: MfaChallengeData; /** * Identity must prove a first factor before the IdP connection is merged. * @internal */ requireFirstFactorData?: RequireFirstFactorData; /** Current state of the login or registration process. */ state?: StateTypeWithLiterals; /** Session token. If `state` is not `SUCCESS`, this field is undefined. */ sessionToken?: string | null; /** Token that represents the current state of the login or registration process. */ stateToken?: string | null; /** Identity of the current member. */ identity?: Identity; /** Additional data relevant to the login or registration process. */ additionalData?: Record; } /** @oneof */ interface StateMachineResponseStateDataOneOf { /** @internal */ requireMfaData?: RequireMfaData; /** * User needs to solve an MFA challenge, such as providing the code that sent to them by SMS. * @internal */ mfaChallengeData?: MfaChallengeData; /** * Identity must prove a first factor before the IdP connection is merged. * @internal */ requireFirstFactorData?: RequireFirstFactorData; } declare enum StateType { /** Initial unknown state. */ UNKNOWN_STATE = "UNKNOWN_STATE", /** Login completed successfully. */ SUCCESS = "SUCCESS", /** Member needs the owner to approve their registration. */ REQUIRE_OWNER_APPROVAL = "REQUIRE_OWNER_APPROVAL", /** Member needs to verify their email. */ REQUIRE_EMAIL_VERIFICATION = "REQUIRE_EMAIL_VERIFICATION", /** The `status` is not one that prevents the member logging in, meaning it's not `OFFLINE`, `BLOCKED`, or `DELETED`. */ STATUS_CHECK = "STATUS_CHECK", /** * Multi-factor authentication is required to complete login. * @internal */ REQUIRE_MFA = "REQUIRE_MFA", /** * Indicates that the member needs to verify themselves using the selected verication factor type. * @internal */ MFA_CHALLENGE = "MFA_CHALLENGE", /** * User needs to provide the first factor authentication (e.g., password, webAuthN). * @internal */ REQUIRE_FIRST_FACTOR = "REQUIRE_FIRST_FACTOR", /** Member must submit the profile-completion form to continue registration. */ REQUIRE_PROFILE_COMPLETION = "REQUIRE_PROFILE_COMPLETION", /** * Registering identity must prove their sign-up factor (e.g. an emailed code) before the identity is created. * @internal */ REQUIRE_REGISTER_CHALLENGE = "REQUIRE_REGISTER_CHALLENGE", /** * Identity logging in must enter the code sent to their email before the login continues. * @internal */ REQUIRE_LOGIN_CHALLENGE = "REQUIRE_LOGIN_CHALLENGE" } /** @enumType */ type StateTypeWithLiterals = StateType | 'UNKNOWN_STATE' | 'SUCCESS' | 'REQUIRE_OWNER_APPROVAL' | 'REQUIRE_EMAIL_VERIFICATION' | 'STATUS_CHECK' | 'REQUIRE_PROFILE_COMPLETION'; interface Identity { /** * Identity ID. * @format GUID */ _id?: string | null; /** * Revision number, which increments by 1 each time the identity is updated. * To prevent conflicting changes, * the current revision must be passed when updating the identity. * * Ignored when creating an identity. */ revision?: string | null; /** * Date and time the identity was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the identity was updated. * @readonly */ _updatedDate?: Date | null; /** The identity configured connections to authenticate with. */ connections?: Connection[]; /** Identity profile. */ identityProfile?: IdentityProfile; /** * Additional information about the identity that can impact user access. * This data cannot be set. */ metadata?: Metadata; /** Identity email address. */ email?: Email; /** Identity's current status. */ status?: StatusV2; /** * Custom attributes. * @internal */ customAttributes?: Record | null; /** * Identity verification factors. * @maxSize 10 * @readonly */ factors?: Factor[]; } interface Connection extends ConnectionTypeOneOf { /** IDP connection. */ idpConnection?: IdpConnection; /** Authenticator connection. */ authenticatorConnection?: AuthenticatorConnection; } /** @oneof */ interface ConnectionTypeOneOf { /** IDP connection. */ idpConnection?: IdpConnection; /** Authenticator connection. */ authenticatorConnection?: AuthenticatorConnection; } interface IdpConnection { /** * IDP connection ID. * @format GUID */ idpConnectionId?: string; /** IDP user ID. */ idpUserId?: string; } interface AuthenticatorConnection { /** * Authenticator connection ID. * @format GUID */ authenticatorConnectionId?: string; /** Whether re-enrollment is required. */ reEnrollmentRequired?: boolean; } interface IdentityProfile { /** Member's first name. */ firstName?: string | null; /** Member's last name. */ lastName?: string | null; /** Member's display nickname. */ nickname?: string | null; /** URL to member's profile picture. */ picture?: string | null; /** * Deprecated. Use `secondaryEmails` instead. * @deprecated Deprecated. Use `secondaryEmails` instead. * @replacedBy secondary_emails * @targetRemovalDate 2023-11-01 */ emails?: string[]; /** * Deprecated. Use `phonesV2` instead. * @deprecated Deprecated. Use `phonesV2` instead. * @replacedBy phones_v2 * @targetRemovalDate 2023-11-01 */ phones?: string[]; /** * Labels associated with the member. * @maxSize 2000 */ labels?: string[]; /** * Member's preferred language code. * @format LANGUAGE */ language?: string | null; /** Member's profile visibility setting. */ privacyStatus?: PrivacyStatusWithLiterals; /** * Any number of custom fields. [Custom fields](https://support.wix.com/en/article/adding-custom-fields-to-contacts) * are used to store additional information about your site or app's contacts. */ customFields?: CustomField[]; /** Additional email addresses for the member. */ secondaryEmails?: SecondaryEmail[]; /** Phone numbers associated with the member. */ phonesV2?: Phone[]; /** Physical addresses for the member. */ addresses?: AddressWrapper[]; /** * Company name. * @maxLength 1000 */ company?: string | null; /** * Position within company. * @maxLength 1000 */ position?: string | null; /** * Member's birth date in `YYYY-MM-DD` format. * @format LOCAL_DATE */ birthdate?: string | null; /** * URL-friendly slug for the member's profile. * @maxLength 255 */ slug?: string | null; /** Whether the member consents to receive marketing communications. */ subscription?: boolean | null; /** * Tax ID or VAT number for personal or corporate use. * @maxLength 1000 */ vatId?: string | null; } declare enum PrivacyStatus { /** No privacy status defined. */ UNDEFINED = "UNDEFINED", /** Profile details are visible to other members. */ PUBLIC = "PUBLIC", /** Profile details are hidden from other members. */ PRIVATE = "PRIVATE" } /** @enumType */ type PrivacyStatusWithLiterals = PrivacyStatus | 'UNDEFINED' | 'PUBLIC' | 'PRIVATE'; interface CustomField { /** * Custom field name matching an extended field key (without `custom.` prefix). * * Must match a key from [`List Extended Fields`](https://dev.wix.com/docs/rest/api-reference/contacts/extended-fields/list-extended-fields). */ name?: string; /** Value for the custom field. */ value?: V1CustomValue; } interface V1CustomValue extends V1CustomValueValueOneOf { /** Text value. */ strValue?: string; /** Numeric value. */ numValue?: number; /** Date/time value. */ dateValue?: Date | null; /** List of values. */ listValue?: V1ListValue; /** Key-value pairs. */ mapValue?: V1MapValue; /** Bool value */ boolValue?: boolean; } /** @oneof */ interface V1CustomValueValueOneOf { /** Text value. */ strValue?: string; /** Numeric value. */ numValue?: number; /** Date/time value. */ dateValue?: Date | null; /** List of values. */ listValue?: V1ListValue; /** Key-value pairs. */ mapValue?: V1MapValue; /** Bool value */ boolValue?: boolean; } interface V1ListValue { /** List of custom values. */ value?: V1CustomValue[]; } interface V1MapValue { /** Map of custom field values. */ value?: Record; } interface SecondaryEmail { /** * Secondary email address. * @format EMAIL */ email?: string; /** Email tag. */ tag?: EmailTagWithLiterals; } declare enum EmailTag { UNTAGGED = "UNTAGGED", MAIN = "MAIN", HOME = "HOME", WORK = "WORK" } /** @enumType */ type EmailTagWithLiterals = EmailTag | 'UNTAGGED' | 'MAIN' | 'HOME' | 'WORK'; interface Phone { /** * Country code for the phone number. * @format COUNTRY */ countryCode?: string | null; /** * Phone number without country code. * @format PHONE */ phone?: string; /** Phone tag. */ tag?: PhoneTagWithLiterals; } declare enum PhoneTag { UNTAGGED = "UNTAGGED", MAIN = "MAIN", HOME = "HOME", MOBILE = "MOBILE", WORK = "WORK", FAX = "FAX" } /** @enumType */ type PhoneTagWithLiterals = PhoneTag | 'UNTAGGED' | 'MAIN' | 'HOME' | 'MOBILE' | 'WORK' | 'FAX'; interface AddressWrapper { /** Physical address details. */ address?: Address; /** Address tag. */ tag?: AddressTagWithLiterals; } /** Physical address */ interface Address { /** * Country code. * @format COUNTRY */ country?: string | null; /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */ subdivision?: string | null; /** City name. */ city?: string | null; /** Zip/postal code. */ postalCode?: string | null; /** Main address line, usually street and number as free text. */ addressLine1?: string | null; /** Free text providing more detailed address info. Usually contains apartment, suite, and floor. */ addressLine2?: string | null; /** * A string containing the full address of this location. * @internal */ formatted?: string | null; } declare enum AddressTag { UNTAGGED = "UNTAGGED", HOME = "HOME", WORK = "WORK", BILLING = "BILLING", SHIPPING = "SHIPPING" } /** @enumType */ type AddressTagWithLiterals = AddressTag | 'UNTAGGED' | 'HOME' | 'WORK' | 'BILLING' | 'SHIPPING'; interface Metadata { /** * General tags. For example, `"isOwner"`. * @internal * @readonly */ tags?: string[]; } interface Email { /** * Email address. * @format EMAIL */ address?: string; /** Whether the email address is verified. */ isVerified?: boolean; } interface StatusV2 { /** Descriptive name of the identity status. */ name?: StatusNameWithLiterals; /** Reasons for the current identity status. */ reasons?: ReasonWithLiterals[]; } declare enum StatusName { /** Unknown status. This value isn't used. */ UNKNOWN_STATUS = "UNKNOWN_STATUS", /** Identity is pending verification, owner approval, or both. */ PENDING = "PENDING", /** Identity is active and can log in. */ ACTIVE = "ACTIVE", /** Identity is deleted. This identity can't log in. */ DELETED = "DELETED", /** Identity is blocked. This identity can't log in. */ BLOCKED = "BLOCKED", /** Identity is offline. This identity can't log in. */ OFFLINE = "OFFLINE" } /** @enumType */ type StatusNameWithLiterals = StatusName | 'UNKNOWN_STATUS' | 'PENDING' | 'ACTIVE' | 'DELETED' | 'BLOCKED' | 'OFFLINE'; declare enum Reason { /** Unknown reason. This value isn't used. */ UNKNOWN_REASON = "UNKNOWN_REASON", /** The identity is waiting for admin approval. After the approval, the identity has an `ACTIVE` status. */ PENDING_ADMIN_APPROVAL_REQUIRED = "PENDING_ADMIN_APPROVAL_REQUIRED", /** The identity has to verify the email. After the verification, the identity has an `ACTIVE` status. */ PENDING_EMAIL_VERIFICATION_REQUIRED = "PENDING_EMAIL_VERIFICATION_REQUIRED", /** The identity must complete the site's profile-completion form. Other pending requirements may remain after completion. */ PENDING_PROFILE_COMPLETION_REQUIRED = "PENDING_PROFILE_COMPLETION_REQUIRED" } /** @enumType */ type ReasonWithLiterals = Reason | 'UNKNOWN_REASON' | 'PENDING_ADMIN_APPROVAL_REQUIRED' | 'PENDING_EMAIL_VERIFICATION_REQUIRED' | 'PENDING_PROFILE_COMPLETION_REQUIRED'; interface Factor { /** * Factor ID. * @format GUID */ factorId?: string; /** Factor type. */ type?: FactorTypeWithLiterals; /** Factor status. */ status?: StatusWithLiterals; } declare enum FactorType { /** Requires a password. */ PASSWORD = "PASSWORD", /** Requires a code sent via SMS. */ SMS = "SMS", /** Requires a code sent by phone call. */ CALL = "CALL", /** Requires a code sent by email. */ EMAIL = "EMAIL", /** Requires authentication via an authenticator app. */ TOTP = "TOTP", /** Requires authentication via a push notification. */ PUSH = "PUSH", /** Requires authentication via WebAuthn/passkey. */ WEBAUTHN = "WEBAUTHN", /** Requires a recovery code. */ RECOVERY_CODE = "RECOVERY_CODE" } /** @enumType */ type FactorTypeWithLiterals = FactorType | 'PASSWORD' | 'SMS' | 'CALL' | 'EMAIL' | 'TOTP' | 'PUSH' | 'WEBAUTHN' | 'RECOVERY_CODE'; declare enum Status { /** Factor requires activation. */ INACTIVE = "INACTIVE", /** Factor is active and can be used for authentication. */ ACTIVE = "ACTIVE", /** Factor is blocked and cannot be used for authentication. The user should reenroll the factor. */ REQUIRE_REENROLL = "REQUIRE_REENROLL" } /** @enumType */ type StatusWithLiterals = Status | 'INACTIVE' | 'ACTIVE' | 'REQUIRE_REENROLL'; interface CustomValue extends CustomValueValueOneOf { /** String value. */ strValue?: string; /** Number value. */ numValue?: number; /** Date value. */ dateValue?: Date | null; /** List value. */ listValue?: ListValue; /** Map value. */ mapValue?: MapValue; } /** @oneof */ interface CustomValueValueOneOf { /** String value. */ strValue?: string; /** Number value. */ numValue?: number; /** Date value. */ dateValue?: Date | null; /** List value. */ listValue?: ListValue; /** Map value. */ mapValue?: MapValue; } interface ListValue { /** Custom value. */ value?: CustomValue[]; } interface MapValue { /** Mapped custom value. */ value?: Record; } interface RequireMfaData { /** * The factors available for the user to perform the required MFA. * @maxSize 100 */ availableFactors?: V1Factor[]; /** The reason the user is required to perform MFA. */ reason?: MfaReasonWithLiterals; } interface V1Factor { /** Type of verification factor. */ factorType?: FactorTypeWithLiterals; /** Availability status for second factor */ factorStatus?: FactorStatusWithLiterals; } declare enum FactorStatus { ENABLED = "ENABLED", REQUIRE_ACTIVATION = "REQUIRE_ACTIVATION", REQUIRE_REENROLL = "REQUIRE_REENROLL", ENABLED_BY_RULE = "ENABLED_BY_RULE", DISABLED_BY_RULE = "DISABLED_BY_RULE" } /** @enumType */ type FactorStatusWithLiterals = FactorStatus | 'ENABLED' | 'REQUIRE_ACTIVATION' | 'REQUIRE_REENROLL' | 'ENABLED_BY_RULE' | 'DISABLED_BY_RULE'; declare enum MfaReason { /** Mfa is required due to user settings */ USER_SETTINGS = "USER_SETTINGS", /** Mfa is required due to high risk login */ HIGH_RISK_LOGIN = "HIGH_RISK_LOGIN" } /** @enumType */ type MfaReasonWithLiterals = MfaReason | 'USER_SETTINGS' | 'HIGH_RISK_LOGIN'; interface MfaChallengeData { /** Type of verifation factor. */ factorType?: FactorTypeWithLiterals; verificationChallengeData?: VerificationChallenge; /** * Factors types the user can choose from to verify themselves. * @maxSize 100 */ availableFactors?: V1Factor[]; /** The reason the user is required for verification. */ reason?: MfaReasonWithLiterals; } interface VerificationChallenge extends VerificationChallengeFactorChallengeDataOneOf { pushData?: PushChallengeData; webauthnData?: WebAuthnChallengeData; /** @maxLength 200 */ hint?: string | null; } /** @oneof */ interface VerificationChallengeFactorChallengeDataOneOf { pushData?: PushChallengeData; webauthnData?: WebAuthnChallengeData; } interface PushChallengeData { /** * This should be tied to a specific push notification. * It will be sent in subsequent requests to verify the factor. * @maxLength 36 */ transactionId?: string; } interface WebAuthnChallengeData { /** * A unique identifier for this challenge that will be used to correlate * the authentication response with this challenge. * This should be a cryptographically random GUID to prevent guessing attacks. * @format GUID */ challengeId?: string; /** * A PublicKeyCredentialRequestOptions JSON as defined in the WebAuthn spec (https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialrequestoptions). * @maxLength 40000 */ publicKeyCredentialRequestOptionsJson?: string; } interface RequireFirstFactorData { /** * Organization the identity is under. * @format GUID */ organizationId?: string; } /** @docsIgnore */ type VerifyDuringAuthenticationApplicationErrors = { code?: 'VERIFICATION_FAILED'; description?: string; data?: Record; }; /** * Starts an email verification process by sending a verification code to the identity's email address. * The code is sent to the email associated with the provided `identityId`, and the returned `verificationId` * identifies the verification process. * * Email verification is required when the registering member is already listed as a contact, or when it * is required by the site's member settings. * * During registration or authentication, the member then completes verification by calling * `VerifyDuringAuthentication` with the `state_token` of the `REQUIRE_EMAIL_VERIFICATION` state — not the * `verificationId` returned here, which `VerifyDuringAuthentication` does not accept. * @public * @permissionId IAM.START * @fqn wix.iam.verification.v1.VerificationService.Start */ declare function start(options?: StartOptions): Promise>; interface StartOptions { /** * ID of the identity whose email address should be verified. The verification code is sent to this identity's * email. Currently required — the request fails if it is omitted. * @format GUID */ identityId?: string | null; /** Delivery channel for the verification code. Currently only `EMAIL` is supported. */ target?: TargetWithLiterals; } /** * Continues the registration process when a member is required to verify an email address * using a verification code received by email. * * Email verification is required when the registering member is already listed as a contact. * * Typically, after a successful verification, you generate and use member tokens for the * registered member so that subsequent API calls are called as part of a member session. * @param code - The code to verify. * @public * @requiredField code * @requiredField options * @requiredField options.stateToken * @fqn wix.iam.verification.v1.VerificationService.VerifyDuringAuthentication */ declare function verifyDuringAuthentication(code: string, options: NonNullablePaths): Promise & { __applicationErrorsType?: VerifyDuringAuthenticationApplicationErrors; }>; interface VerifyDuringAuthenticationOptions { /** A state token representing the `REQUIRE_EMAIL_VERIFICATION` state. */ stateToken: string; } export { type Address, AddressTag, type AddressTagWithLiterals, type AddressWrapper, type AuthenticatorConnection, type Connection, type ConnectionTypeOneOf, type CustomField, type CustomValue, type CustomValueValueOneOf, type Email, EmailTag, type EmailTagWithLiterals, type Factor, FactorStatus, type FactorStatusWithLiterals, FactorType, type FactorTypeWithLiterals, type Identity, type IdentityProfile, type IdpConnection, type ListValue, type MapValue, type Metadata, type MfaChallengeData, MfaReason, type MfaReasonWithLiterals, type Phone, PhoneTag, type PhoneTagWithLiterals, PrivacyStatus, type PrivacyStatusWithLiterals, type PushChallengeData, Reason, type ReasonWithLiterals, type RequireFirstFactorData, type RequireMfaData, type SecondaryEmail, type StartOptions, type StartRequest, type StartResponse, type StateMachineResponse, type StateMachineResponseStateDataOneOf, StateType, type StateTypeWithLiterals, Status, StatusName, type StatusNameWithLiterals, type StatusV2, type StatusWithLiterals, Target, type TargetWithLiterals, type V1CustomValue, type V1CustomValueValueOneOf, type V1Factor, type V1ListValue, type V1MapValue, type VerificationChallenge, type VerificationChallengeFactorChallengeDataOneOf, type VerifyDuringAuthenticationApplicationErrors, type VerifyDuringAuthenticationOptions, type VerifyDuringAuthenticationRequest, type VerifyRequest, type VerifyResponse, type WebAuthnChallengeData, start, verifyDuringAuthentication };