import { NonNullablePaths } from '@wix/sdk-types'; /** Recovery token proto is the saved data on the recovery token. */ interface RecoveryToken { /** * Recovery token ID * @format GUID * @readonly */ _id?: string | null; /** * Represents the time this SessionToken was created * @readonly */ _createdDate?: Date | null; /** * tenantId * @format GUID * @readonly */ tenantId?: string; /** * TenantType * @readonly */ tenantType?: TenantTypeWithLiterals; /** * identity id * @format GUID * @readonly */ identityId?: string; } declare enum TenantType { /** Unknown tenant type. This value isn't used. */ UNKNOWN_TENANT_TYPE = "UNKNOWN_TENANT_TYPE", /** The identity is a Wix user. */ ACCOUNT = "ACCOUNT", /** The identity is a member. */ SITE = "SITE" } /** @enumType */ type TenantTypeWithLiterals = TenantType | 'UNKNOWN_TENANT_TYPE' | 'ACCOUNT' | 'SITE'; interface SendRecoveryEmailRequest { /** * Email address associated with the account to recover. * @format EMAIL */ email: string; /** * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format of the email to be sent. * * If no language is specified, the language specified in the member's profile is used. * @format LANGUAGE */ language?: string | null; /** Where to redirect to after successfully resetting the password. */ redirect?: Redirect; } interface Redirect { /** * URL to redirect to after successfully resetting the password. * @maxLength 1000 */ url?: string; /** * Client ID of the [OAuth app](https://dev.wix.com/docs/go-headless/getting-started/setup/authentication/create-an-oauth-app-for-visitors-and-members) your Headless project is using. * @format GUID */ clientId?: string | null; } interface SendRecoveryEmailResponse { } interface SendActivationEmailRequest { /** * Id of the activating user * @format GUID */ identityId: string; /** Options for the activation email */ emailOptions?: EmailOptions; } interface EmailOptions { /** * language of the email - if not received will fallback to the identity language * @format LANGUAGE */ language?: string | null; /** Where to redirect after a successful activation process */ redirect?: Redirect; } interface SendActivationEmailResponse { } interface RecoverRequest { /** recovery token */ recoveryToken: string; /** new password to set for the identity */ password?: string | null; } interface StateMachineResponse extends StateMachineResponseStateDataOneOf { /** 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 { } 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" } /** @enumType */ type StateTypeWithLiterals = StateType | 'UNKNOWN_STATE' | 'SUCCESS' | 'REQUIRE_OWNER_APPROVAL' | 'REQUIRE_EMAIL_VERIFICATION' | 'STATUS_CHECK'; 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; /** * 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; } declare enum AddressTag { UNTAGGED = "UNTAGGED", HOME = "HOME", WORK = "WORK", BILLING = "BILLING", SHIPPING = "SHIPPING" } /** @enumType */ type AddressTagWithLiterals = AddressTag | 'UNTAGGED' | 'HOME' | 'WORK' | 'BILLING' | 'SHIPPING'; interface Metadata { } 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" } /** @enumType */ type ReasonWithLiterals = Reason | 'UNKNOWN_REASON' | 'PENDING_ADMIN_APPROVAL_REQUIRED' | 'PENDING_EMAIL_VERIFICATION_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 CreateRecoveryTokenRequest { /** @format EMAIL */ email?: string; } interface CreateRecoveryTokenResponse { /** @maxLength 1000 */ token?: string; } /** * Sends an email to a member with a unique link to a Wix-managed password reset page. * The member can use this page to reset their site password. * If the site owner uses this page, it resets their Wix account password instead. * * > **Note:** You must publish the Wix site connected to your Headless project. * > Wix uses the published site to display the password reset page. To do this, open your project dashboard, * > select **Design Site** from the left panel, and then select **Publish**. * @param email - Email address associated with the account to recover. * @public * @requiredField email * @fqn wix.iam.recovery.v1.RecoveryService.SendRecoveryEmail */ declare function sendRecoveryEmail(email: string, options?: SendRecoveryEmailOptions): Promise; interface SendRecoveryEmailOptions { /** * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format of the email to be sent. * * If no language is specified, the language specified in the member's profile is used. * @format LANGUAGE */ language?: string | null; /** Where to redirect to after successfully resetting the password. */ redirect?: Redirect; } /** * Sends an activation email with an activation token * making the transition from initial contact to a site member * @param identityId - Id of the activating user * @public * @documentationMaturity preview * @requiredField identityId * @permissionId IAM.SEND_ACTIVATION_EMAIL * @applicableIdentity APP * @fqn wix.iam.recovery.v1.RecoveryService.SendActivationEmail */ declare function sendActivationEmail(identityId: string, options?: SendActivationEmailOptions): Promise; interface SendActivationEmailOptions { /** Options for the activation email */ emailOptions?: EmailOptions; } /** @param recoveryToken - recovery token * @public * @documentationMaturity preview * @requiredField recoveryToken * @fqn wix.iam.recovery.v1.RecoveryService.Recover */ declare function recover(recoveryToken: string, options?: RecoverOptions): Promise>; interface RecoverOptions { /** new password to set for the identity */ password?: string | null; } export { type Address, AddressTag, type AddressTagWithLiterals, type AddressWrapper, type AuthenticatorConnection, type Connection, type ConnectionTypeOneOf, type CreateRecoveryTokenRequest, type CreateRecoveryTokenResponse, type CustomField, type CustomValue, type CustomValueValueOneOf, type Email, type EmailOptions, 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 RecoverOptions, type RecoverRequest, type RecoveryToken, type Redirect, type RequireMfaData, type SecondaryEmail, type SendActivationEmailOptions, type SendActivationEmailRequest, type SendActivationEmailResponse, type SendRecoveryEmailOptions, type SendRecoveryEmailRequest, type SendRecoveryEmailResponse, type StateMachineResponse, type StateMachineResponseStateDataOneOf, StateType, type StateTypeWithLiterals, Status, StatusName, type StatusNameWithLiterals, type StatusV2, type StatusWithLiterals, TenantType, type TenantTypeWithLiterals, type V1CustomValue, type V1CustomValueValueOneOf, type V1Factor, type V1ListValue, type V1MapValue, type VerificationChallenge, type VerificationChallengeFactorChallengeDataOneOf, type WebAuthnChallengeData, recover, sendActivationEmail, sendRecoveryEmail };