{"version":3,"sources":["../../src/iam-recovery-v1-recovery-recovery.universal.ts","../../src/iam-recovery-v1-recovery-recovery.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIamRecoveryV1Recovery from './iam-recovery-v1-recovery-recovery.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/** Recovery token proto is the saved data on the recovery token. */\nexport interface RecoveryToken {\n  /**\n   * Recovery token ID\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * Represents the time this SessionToken was created\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * tenantId\n   * @format GUID\n   * @readonly\n   */\n  tenantId?: string;\n  /**\n   * TenantType\n   * @readonly\n   */\n  tenantType?: TenantTypeWithLiterals;\n  /**\n   * identity id\n   * @format GUID\n   * @readonly\n   */\n  identityId?: string;\n}\n\nexport enum TenantType {\n  /** Unknown tenant type. This value isn't used. */\n  UNKNOWN_TENANT_TYPE = 'UNKNOWN_TENANT_TYPE',\n  /** The identity is a Wix user. */\n  ACCOUNT = 'ACCOUNT',\n  /** The identity is a member. */\n  SITE = 'SITE',\n}\n\n/** @enumType */\nexport type TenantTypeWithLiterals =\n  | TenantType\n  | 'UNKNOWN_TENANT_TYPE'\n  | 'ACCOUNT'\n  | 'SITE';\n\nexport interface SendRecoveryEmailRequest {\n  /**\n   * Email address associated with the account to recover.\n   * @format EMAIL\n   */\n  email: string;\n  /**\n   * 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.\n   *\n   * If no language is specified, the language specified in the member's profile is used.\n   * @format LANGUAGE\n   */\n  language?: string | null;\n  /** Where to redirect to after successfully resetting the password. */\n  redirect?: Redirect;\n}\n\nexport interface Redirect {\n  /**\n   * URL to redirect to after successfully resetting the password.\n   * @maxLength 1000\n   */\n  url?: string;\n  /**\n   * 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.\n   * @format GUID\n   */\n  clientId?: string | null;\n}\n\nexport interface SendRecoveryEmailResponse {}\n\nexport interface SendActivationEmailRequest {\n  /**\n   * Id of the activating user\n   * @format GUID\n   */\n  identityId: string;\n  /** Options for the activation email */\n  emailOptions?: EmailOptions;\n}\n\nexport interface EmailOptions {\n  /**\n   * language of the email - if not received will fallback to the identity language\n   * @format LANGUAGE\n   */\n  language?: string | null;\n  /** Where to redirect after a successful activation process */\n  redirect?: Redirect;\n}\n\nexport interface SendActivationEmailResponse {}\n\nexport interface RecoverRequest {\n  /** recovery token */\n  recoveryToken: string;\n  /** new password to set for the identity */\n  password?: string | null;\n}\n\nexport interface StateMachineResponse\n  extends StateMachineResponseStateDataOneOf {\n  /** Current state of the login or registration process. */\n  state?: StateTypeWithLiterals;\n  /** Session token. If `state` is not `SUCCESS`, this field is undefined. */\n  sessionToken?: string | null;\n  /** Token that represents the current state of the login or registration process. */\n  stateToken?: string | null;\n  /** Identity of the current member. */\n  identity?: Identity;\n  /** Additional data relevant to the login or registration process. */\n  additionalData?: Record<string, CustomValue>;\n}\n\n/** @oneof */\nexport interface StateMachineResponseStateDataOneOf {}\n\nexport enum StateType {\n  /** Initial unknown state. */\n  UNKNOWN_STATE = 'UNKNOWN_STATE',\n  /** Login completed successfully. */\n  SUCCESS = 'SUCCESS',\n  /** Member needs the owner to approve their registration. */\n  REQUIRE_OWNER_APPROVAL = 'REQUIRE_OWNER_APPROVAL',\n  /** Member needs to verify their email. */\n  REQUIRE_EMAIL_VERIFICATION = 'REQUIRE_EMAIL_VERIFICATION',\n  /** The `status` is not one that prevents the member logging in, meaning it's not `OFFLINE`, `BLOCKED`, or `DELETED`. */\n  STATUS_CHECK = 'STATUS_CHECK',\n}\n\n/** @enumType */\nexport type StateTypeWithLiterals =\n  | StateType\n  | 'UNKNOWN_STATE'\n  | 'SUCCESS'\n  | 'REQUIRE_OWNER_APPROVAL'\n  | 'REQUIRE_EMAIL_VERIFICATION'\n  | 'STATUS_CHECK';\n\nexport interface Identity {\n  /**\n   * Identity ID.\n   * @format GUID\n   */\n  _id?: string | null;\n  /**\n   * Revision number, which increments by 1 each time the identity is updated.\n   * To prevent conflicting changes,\n   * the current revision must be passed when updating the identity.\n   *\n   * Ignored when creating an identity.\n   */\n  revision?: string | null;\n  /**\n   * Date and time the identity was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the identity was updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /** The identity configured connections to authenticate with. */\n  connections?: Connection[];\n  /** Identity profile. */\n  identityProfile?: IdentityProfile;\n  /**\n   * Additional information about the identity that can impact user access.\n   * This data cannot be set.\n   */\n  metadata?: Metadata;\n  /** Identity email address. */\n  email?: Email;\n  /** Identity's current status. */\n  status?: StatusV2;\n  /**\n   * Identity verification factors.\n   * @maxSize 10\n   * @readonly\n   */\n  factors?: Factor[];\n}\n\nexport interface Connection extends ConnectionTypeOneOf {\n  /** IDP connection. */\n  idpConnection?: IdpConnection;\n  /** Authenticator connection. */\n  authenticatorConnection?: AuthenticatorConnection;\n}\n\n/** @oneof */\nexport interface ConnectionTypeOneOf {\n  /** IDP connection. */\n  idpConnection?: IdpConnection;\n  /** Authenticator connection. */\n  authenticatorConnection?: AuthenticatorConnection;\n}\n\nexport interface IdpConnection {\n  /**\n   * IDP connection ID.\n   * @format GUID\n   */\n  idpConnectionId?: string;\n  /** IDP user ID. */\n  idpUserId?: string;\n}\n\nexport interface AuthenticatorConnection {\n  /**\n   * Authenticator connection ID.\n   * @format GUID\n   */\n  authenticatorConnectionId?: string;\n  /** Whether re-enrollment is required. */\n  reEnrollmentRequired?: boolean;\n}\n\nexport interface IdentityProfile {\n  /** Member's first name. */\n  firstName?: string | null;\n  /** Member's last name. */\n  lastName?: string | null;\n  /** Member's display nickname. */\n  nickname?: string | null;\n  /** URL to member's profile picture. */\n  picture?: string | null;\n  /**\n   * Deprecated. Use `secondaryEmails` instead.\n   * @deprecated Deprecated. Use `secondaryEmails` instead.\n   * @replacedBy secondary_emails\n   * @targetRemovalDate 2023-11-01\n   */\n  emails?: string[];\n  /**\n   * Deprecated. Use `phonesV2` instead.\n   * @deprecated Deprecated. Use `phonesV2` instead.\n   * @replacedBy phones_v2\n   * @targetRemovalDate 2023-11-01\n   */\n  phones?: string[];\n  /**\n   * Labels associated with the member.\n   * @maxSize 2000\n   */\n  labels?: string[];\n  /**\n   * Member's preferred language code.\n   * @format LANGUAGE\n   */\n  language?: string | null;\n  /** Member's profile visibility setting. */\n  privacyStatus?: PrivacyStatusWithLiterals;\n  /**\n   * Any number of custom fields. [Custom fields](https://support.wix.com/en/article/adding-custom-fields-to-contacts)\n   * are used to store additional information about your site or app's contacts.\n   */\n  customFields?: CustomField[];\n  /** Additional email addresses for the member. */\n  secondaryEmails?: SecondaryEmail[];\n  /** Phone numbers associated with the member. */\n  phonesV2?: Phone[];\n  /** Physical addresses for the member. */\n  addresses?: AddressWrapper[];\n  /**\n   * Company name.\n   * @maxLength 1000\n   */\n  company?: string | null;\n  /**\n   * Position within company.\n   * @maxLength 1000\n   */\n  position?: string | null;\n  /**\n   * Member's birth date in `YYYY-MM-DD` format.\n   * @format LOCAL_DATE\n   */\n  birthdate?: string | null;\n  /**\n   * URL-friendly slug for the member's profile.\n   * @maxLength 255\n   */\n  slug?: string | null;\n  /** Whether the member consents to receive marketing communications. */\n  subscription?: boolean | null;\n  /**\n   * Tax ID or VAT number for personal or corporate use.\n   * @maxLength 1000\n   */\n  vatId?: string | null;\n}\n\nexport enum PrivacyStatus {\n  /** No privacy status defined. */\n  UNDEFINED = 'UNDEFINED',\n  /** Profile details are visible to other members. */\n  PUBLIC = 'PUBLIC',\n  /** Profile details are hidden from other members. */\n  PRIVATE = 'PRIVATE',\n}\n\n/** @enumType */\nexport type PrivacyStatusWithLiterals =\n  | PrivacyStatus\n  | 'UNDEFINED'\n  | 'PUBLIC'\n  | 'PRIVATE';\n\nexport interface CustomField {\n  /**\n   * Custom field name matching an extended field key (without `custom.` prefix).\n   *\n   * Must match a key from [`List Extended Fields`](https://dev.wix.com/docs/rest/api-reference/contacts/extended-fields/list-extended-fields).\n   */\n  name?: string;\n  /** Value for the custom field. */\n  value?: V1CustomValue;\n}\n\nexport interface V1CustomValue extends V1CustomValueValueOneOf {\n  /** Text value. */\n  strValue?: string;\n  /** Numeric value. */\n  numValue?: number;\n  /** Date/time value. */\n  dateValue?: Date | null;\n  /** List of values. */\n  listValue?: V1ListValue;\n  /** Key-value pairs. */\n  mapValue?: V1MapValue;\n  /** Bool value */\n  boolValue?: boolean;\n}\n\n/** @oneof */\nexport interface V1CustomValueValueOneOf {\n  /** Text value. */\n  strValue?: string;\n  /** Numeric value. */\n  numValue?: number;\n  /** Date/time value. */\n  dateValue?: Date | null;\n  /** List of values. */\n  listValue?: V1ListValue;\n  /** Key-value pairs. */\n  mapValue?: V1MapValue;\n  /** Bool value */\n  boolValue?: boolean;\n}\n\nexport interface V1ListValue {\n  /** List of custom values. */\n  value?: V1CustomValue[];\n}\n\nexport interface V1MapValue {\n  /** Map of custom field values. */\n  value?: Record<string, V1CustomValue>;\n}\n\nexport interface SecondaryEmail {\n  /**\n   * Secondary email address.\n   * @format EMAIL\n   */\n  email?: string;\n  /** Email tag. */\n  tag?: EmailTagWithLiterals;\n}\n\nexport enum EmailTag {\n  UNTAGGED = 'UNTAGGED',\n  MAIN = 'MAIN',\n  HOME = 'HOME',\n  WORK = 'WORK',\n}\n\n/** @enumType */\nexport type EmailTagWithLiterals =\n  | EmailTag\n  | 'UNTAGGED'\n  | 'MAIN'\n  | 'HOME'\n  | 'WORK';\n\nexport interface Phone {\n  /**\n   * Country code for the phone number.\n   * @format COUNTRY\n   */\n  countryCode?: string | null;\n  /**\n   * Phone number without country code.\n   * @format PHONE\n   */\n  phone?: string;\n  /** Phone tag. */\n  tag?: PhoneTagWithLiterals;\n}\n\nexport enum PhoneTag {\n  UNTAGGED = 'UNTAGGED',\n  MAIN = 'MAIN',\n  HOME = 'HOME',\n  MOBILE = 'MOBILE',\n  WORK = 'WORK',\n  FAX = 'FAX',\n}\n\n/** @enumType */\nexport type PhoneTagWithLiterals =\n  | PhoneTag\n  | 'UNTAGGED'\n  | 'MAIN'\n  | 'HOME'\n  | 'MOBILE'\n  | 'WORK'\n  | 'FAX';\n\nexport interface AddressWrapper {\n  /** Physical address details. */\n  address?: Address;\n  /** Address tag. */\n  tag?: AddressTagWithLiterals;\n}\n\n/** Physical address */\nexport interface Address {\n  /**\n   * Country code.\n   * @format COUNTRY\n   */\n  country?: string | null;\n  /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */\n  subdivision?: string | null;\n  /** City name. */\n  city?: string | null;\n  /** Zip/postal code. */\n  postalCode?: string | null;\n  /** Main address line, usually street and number as free text. */\n  addressLine1?: string | null;\n  /** Free text providing more detailed address info. Usually contains apartment, suite, and floor. */\n  addressLine2?: string | null;\n}\n\nexport enum AddressTag {\n  UNTAGGED = 'UNTAGGED',\n  HOME = 'HOME',\n  WORK = 'WORK',\n  BILLING = 'BILLING',\n  SHIPPING = 'SHIPPING',\n}\n\n/** @enumType */\nexport type AddressTagWithLiterals =\n  | AddressTag\n  | 'UNTAGGED'\n  | 'HOME'\n  | 'WORK'\n  | 'BILLING'\n  | 'SHIPPING';\n\nexport interface Metadata {}\n\nexport interface Email {\n  /**\n   * Email address.\n   * @format EMAIL\n   */\n  address?: string;\n  /** Whether the email address is verified. */\n  isVerified?: boolean;\n}\n\nexport interface StatusV2 {\n  /** Descriptive name of the identity status. */\n  name?: StatusNameWithLiterals;\n  /** Reasons for the current identity status. */\n  reasons?: ReasonWithLiterals[];\n}\n\nexport enum StatusName {\n  /** Unknown status. This value isn't used. */\n  UNKNOWN_STATUS = 'UNKNOWN_STATUS',\n  /** Identity is pending verification, owner approval, or both. */\n  PENDING = 'PENDING',\n  /** Identity is active and can log in. */\n  ACTIVE = 'ACTIVE',\n  /** Identity is deleted. This identity can't log in. */\n  DELETED = 'DELETED',\n  /** Identity is blocked. This identity can't log in. */\n  BLOCKED = 'BLOCKED',\n  /** Identity is offline. This identity can't log in. */\n  OFFLINE = 'OFFLINE',\n}\n\n/** @enumType */\nexport type StatusNameWithLiterals =\n  | StatusName\n  | 'UNKNOWN_STATUS'\n  | 'PENDING'\n  | 'ACTIVE'\n  | 'DELETED'\n  | 'BLOCKED'\n  | 'OFFLINE';\n\nexport enum Reason {\n  /** Unknown reason. This value isn't used. */\n  UNKNOWN_REASON = 'UNKNOWN_REASON',\n  /** The identity is waiting for admin approval. After the approval, the identity has an `ACTIVE` status. */\n  PENDING_ADMIN_APPROVAL_REQUIRED = 'PENDING_ADMIN_APPROVAL_REQUIRED',\n  /** The identity has to verify the email. After the verification, the identity has an `ACTIVE` status. */\n  PENDING_EMAIL_VERIFICATION_REQUIRED = 'PENDING_EMAIL_VERIFICATION_REQUIRED',\n}\n\n/** @enumType */\nexport type ReasonWithLiterals =\n  | Reason\n  | 'UNKNOWN_REASON'\n  | 'PENDING_ADMIN_APPROVAL_REQUIRED'\n  | 'PENDING_EMAIL_VERIFICATION_REQUIRED';\n\nexport interface Factor {\n  /**\n   * Factor ID.\n   * @format GUID\n   */\n  factorId?: string;\n  /** Factor type. */\n  type?: FactorTypeWithLiterals;\n  /** Factor status. */\n  status?: StatusWithLiterals;\n}\n\nexport enum FactorType {\n  /** Requires a password. */\n  PASSWORD = 'PASSWORD',\n  /** Requires a code sent via SMS. */\n  SMS = 'SMS',\n  /** Requires a code sent by phone call. */\n  CALL = 'CALL',\n  /** Requires a code sent by email. */\n  EMAIL = 'EMAIL',\n  /** Requires authentication via an authenticator app. */\n  TOTP = 'TOTP',\n  /** Requires authentication via a push notification. */\n  PUSH = 'PUSH',\n  /** Requires authentication via WebAuthn/passkey. */\n  WEBAUTHN = 'WEBAUTHN',\n  /** Requires a recovery code. */\n  RECOVERY_CODE = 'RECOVERY_CODE',\n}\n\n/** @enumType */\nexport type FactorTypeWithLiterals =\n  | FactorType\n  | 'PASSWORD'\n  | 'SMS'\n  | 'CALL'\n  | 'EMAIL'\n  | 'TOTP'\n  | 'PUSH'\n  | 'WEBAUTHN'\n  | 'RECOVERY_CODE';\n\nexport enum Status {\n  /** Factor requires activation. */\n  INACTIVE = 'INACTIVE',\n  /** Factor is active and can be used for authentication. */\n  ACTIVE = 'ACTIVE',\n  /** Factor is blocked and cannot be used for authentication. The user should reenroll the factor. */\n  REQUIRE_REENROLL = 'REQUIRE_REENROLL',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n  | Status\n  | 'INACTIVE'\n  | 'ACTIVE'\n  | 'REQUIRE_REENROLL';\n\nexport interface CustomValue extends CustomValueValueOneOf {\n  /** String value. */\n  strValue?: string;\n  /** Number value. */\n  numValue?: number;\n  /** Date value. */\n  dateValue?: Date | null;\n  /** List value. */\n  listValue?: ListValue;\n  /** Map value. */\n  mapValue?: MapValue;\n}\n\n/** @oneof */\nexport interface CustomValueValueOneOf {\n  /** String value. */\n  strValue?: string;\n  /** Number value. */\n  numValue?: number;\n  /** Date value. */\n  dateValue?: Date | null;\n  /** List value. */\n  listValue?: ListValue;\n  /** Map value. */\n  mapValue?: MapValue;\n}\n\nexport interface ListValue {\n  /** Custom value. */\n  value?: CustomValue[];\n}\n\nexport interface MapValue {\n  /** Mapped custom value. */\n  value?: Record<string, CustomValue>;\n}\n\nexport interface RequireMfaData {\n  /**\n   * The factors available for the user to perform the required MFA.\n   * @maxSize 100\n   */\n  availableFactors?: V1Factor[];\n  /** The reason the user is required to perform MFA. */\n  reason?: MfaReasonWithLiterals;\n}\n\nexport interface V1Factor {\n  /** Type of verification factor. */\n  factorType?: FactorTypeWithLiterals;\n  /** Availability status for second factor */\n  factorStatus?: FactorStatusWithLiterals;\n}\n\nexport enum FactorStatus {\n  ENABLED = 'ENABLED',\n  REQUIRE_ACTIVATION = 'REQUIRE_ACTIVATION',\n  REQUIRE_REENROLL = 'REQUIRE_REENROLL',\n  ENABLED_BY_RULE = 'ENABLED_BY_RULE',\n  DISABLED_BY_RULE = 'DISABLED_BY_RULE',\n}\n\n/** @enumType */\nexport type FactorStatusWithLiterals =\n  | FactorStatus\n  | 'ENABLED'\n  | 'REQUIRE_ACTIVATION'\n  | 'REQUIRE_REENROLL'\n  | 'ENABLED_BY_RULE'\n  | 'DISABLED_BY_RULE';\n\nexport enum MfaReason {\n  /** Mfa is required due to user settings */\n  USER_SETTINGS = 'USER_SETTINGS',\n  /** Mfa is required due to high risk login */\n  HIGH_RISK_LOGIN = 'HIGH_RISK_LOGIN',\n}\n\n/** @enumType */\nexport type MfaReasonWithLiterals =\n  | MfaReason\n  | 'USER_SETTINGS'\n  | 'HIGH_RISK_LOGIN';\n\nexport interface MfaChallengeData {\n  /** Type of verifation factor. */\n  factorType?: FactorTypeWithLiterals;\n  verificationChallengeData?: VerificationChallenge;\n  /**\n   * Factors types the user can choose from to verify themselves.\n   * @maxSize 100\n   */\n  availableFactors?: V1Factor[];\n  /** The reason the user is required for verification. */\n  reason?: MfaReasonWithLiterals;\n}\n\nexport interface VerificationChallenge\n  extends VerificationChallengeFactorChallengeDataOneOf {\n  pushData?: PushChallengeData;\n  webauthnData?: WebAuthnChallengeData;\n  /** @maxLength 200 */\n  hint?: string | null;\n}\n\n/** @oneof */\nexport interface VerificationChallengeFactorChallengeDataOneOf {\n  pushData?: PushChallengeData;\n  webauthnData?: WebAuthnChallengeData;\n}\n\nexport interface PushChallengeData {\n  /**\n   * This should be tied to a specific push notification.\n   * It will be sent in subsequent requests to verify the factor.\n   * @maxLength 36\n   */\n  transactionId?: string;\n}\n\nexport interface WebAuthnChallengeData {\n  /**\n   * A unique identifier for this challenge that will be used to correlate\n   * the authentication response with this challenge.\n   * This should be a cryptographically random GUID to prevent guessing attacks.\n   * @format GUID\n   */\n  challengeId?: string;\n  /**\n   * A PublicKeyCredentialRequestOptions JSON as defined in the WebAuthn spec (https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialrequestoptions).\n   * @maxLength 40000\n   */\n  publicKeyCredentialRequestOptionsJson?: string;\n}\n\nexport interface CreateRecoveryTokenRequest {\n  /** @format EMAIL */\n  email?: string;\n}\n\nexport interface CreateRecoveryTokenResponse {\n  /** @maxLength 1000 */\n  token?: string;\n}\n\n/**\n * Sends an email to a member with a unique link to a Wix-managed password reset page.\n * The member can use this page to reset their site password.\n * If the site owner uses this page, it resets their Wix account password instead.\n *\n * > **Note:** You must publish the Wix site connected to your Headless project.\n * > Wix uses the published site to display the password reset page. To do this, open your project dashboard,\n * > select **Design Site** from the left panel, and then select **Publish**.\n * @param email - Email address associated with the account to recover.\n * @public\n * @requiredField email\n * @fqn wix.iam.recovery.v1.RecoveryService.SendRecoveryEmail\n */\nexport async function sendRecoveryEmail(\n  email: string,\n  options?: SendRecoveryEmailOptions\n): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    email: email,\n    language: options?.language,\n    redirect: options?.redirect,\n  });\n\n  const reqOpts = ambassadorWixIamRecoveryV1Recovery.sendRecoveryEmail(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          email: '$[0]',\n          language: '$[1].language',\n          redirect: '$[1].redirect',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['email', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface SendRecoveryEmailOptions {\n  /**\n   * 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.\n   *\n   * If no language is specified, the language specified in the member's profile is used.\n   * @format LANGUAGE\n   */\n  language?: string | null;\n  /** Where to redirect to after successfully resetting the password. */\n  redirect?: Redirect;\n}\n\n/**\n * Sends an activation email with an activation token\n * making the transition from initial contact to a site member\n * @param identityId - Id of the activating user\n * @public\n * @documentationMaturity preview\n * @requiredField identityId\n * @permissionId IAM.SEND_ACTIVATION_EMAIL\n * @applicableIdentity APP\n * @fqn wix.iam.recovery.v1.RecoveryService.SendActivationEmail\n */\nexport async function sendActivationEmail(\n  identityId: string,\n  options?: SendActivationEmailOptions\n): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    identityId: identityId,\n    emailOptions: options?.emailOptions,\n  });\n\n  const reqOpts =\n    ambassadorWixIamRecoveryV1Recovery.sendActivationEmail(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          identityId: '$[0]',\n          emailOptions: '$[1].emailOptions',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['identityId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface SendActivationEmailOptions {\n  /** Options for the activation email */\n  emailOptions?: EmailOptions;\n}\n\n/** @param recoveryToken - recovery token\n * @public\n * @documentationMaturity preview\n * @requiredField recoveryToken\n * @fqn wix.iam.recovery.v1.RecoveryService.Recover\n */\nexport async function recover(\n  recoveryToken: string,\n  options?: RecoverOptions\n): Promise<\n  NonNullablePaths<\n    StateMachineResponse,\n    | `state`\n    | `identity.connections`\n    | `identity.connections.${number}.idpConnection.idpConnectionId`\n    | `identity.connections.${number}.idpConnection.idpUserId`\n    | `identity.connections.${number}.authenticatorConnection.authenticatorConnectionId`\n    | `identity.connections.${number}.authenticatorConnection.reEnrollmentRequired`\n    | `identity.identityProfile.emails`\n    | `identity.identityProfile.phones`\n    | `identity.identityProfile.labels`\n    | `identity.identityProfile.privacyStatus`\n    | `identity.identityProfile.customFields`\n    | `identity.identityProfile.customFields.${number}.name`\n    | `identity.identityProfile.customFields.${number}.value.strValue`\n    | `identity.identityProfile.customFields.${number}.value.numValue`\n    | `identity.identityProfile.customFields.${number}.value.boolValue`\n    | `identity.identityProfile.secondaryEmails`\n    | `identity.identityProfile.secondaryEmails.${number}.email`\n    | `identity.identityProfile.secondaryEmails.${number}.tag`\n    | `identity.identityProfile.phonesV2`\n    | `identity.identityProfile.phonesV2.${number}.phone`\n    | `identity.identityProfile.phonesV2.${number}.tag`\n    | `identity.identityProfile.addresses`\n    | `identity.identityProfile.addresses.${number}.tag`\n    | `identity.email.address`\n    | `identity.email.isVerified`\n    | `identity.status.name`\n    | `identity.status.reasons`\n    | `identity.factors`\n    | `identity.factors.${number}.factorId`\n    | `identity.factors.${number}.type`\n    | `identity.factors.${number}.status`,\n    7\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    recoveryToken: recoveryToken,\n    password: options?.password,\n  });\n\n  const reqOpts = ambassadorWixIamRecoveryV1Recovery.recover(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(result.data, [\n        {\n          transformFn: transformRESTAddressToSDKAddress,\n          paths: [{ path: 'identity.identityProfile.addresses.address' }],\n        },\n      ])\n    )!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          recoveryToken: '$[0]',\n          password: '$[1].password',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['recoveryToken', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface RecoverOptions {\n  /** new password to set for the identity */\n  password?: string | null;\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIamRecoveryV1RecoveryServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    _: [\n      {\n        srcPath: '/_iam/recovery',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/iam/recovery',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/_api/iam/recovery',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/iam/recovery/v1/recover',\n        destPath: '/v1/recover',\n      },\n      {\n        srcPath: '/iam/recovery/v1/send-email',\n        destPath: '/v1/send-email',\n      },\n      {\n        srcPath: '/iam/recovery/v1/activation-email',\n        destPath: '/v1/activation-email',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_identity_recovery';\n\n/**\n * Sends an email to a member with a unique link to a Wix-managed password reset page.\n * The member can use this page to reset their site password.\n * If the site owner uses this page, it resets their Wix account password instead.\n *\n * > **Note:** You must publish the Wix site connected to your Headless project.\n * > Wix uses the published site to display the password reset page. To do this, open your project dashboard,\n * > select **Design Site** from the left panel, and then select **Publish**.\n */\nexport function sendRecoveryEmail(payload: object): RequestOptionsFactory<any> {\n  function __sendRecoveryEmail({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.iam.recovery.v1.recovery',\n      method: 'POST' as any,\n      methodFqn: 'wix.iam.recovery.v1.RecoveryService.SendRecoveryEmail',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixIamRecoveryV1RecoveryServiceUrl({\n        protoPath: '/v1/send-email',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __sendRecoveryEmail;\n}\n\n/**\n * Sends an activation email with an activation token\n * making the transition from initial contact to a site member\n */\nexport function sendActivationEmail(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __sendActivationEmail({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.iam.recovery.v1.recovery',\n      method: 'POST' as any,\n      methodFqn: 'wix.iam.recovery.v1.RecoveryService.SendActivationEmail',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixIamRecoveryV1RecoveryServiceUrl({\n        protoPath: '/v1/activation-email',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __sendActivationEmail;\n}\n\nexport function recover(payload: object): RequestOptionsFactory<any> {\n  function __recover({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.iam.recovery.v1.recovery',\n      method: 'POST' as any,\n      methodFqn: 'wix.iam.recovery.v1.RecoveryService.Recover',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixIamRecoveryV1RecoveryServiceUrl({\n        protoPath: '/v1/recover',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'identity.createdDate' },\n              { path: 'identity.updatedDate' },\n              { path: 'identity.identityProfile.customFields.value.dateValue' },\n              { path: 'additionalData.*.dateValue' },\n            ],\n          },\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [\n              { path: 'identity.identityProfile.customFields.value.numValue' },\n              { path: 'additionalData.*.numValue' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __recover;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,0CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAWd,SAAS,kBAAkB,SAA6C;AAC7E,WAAS,oBAAoB,EAAE,KAAK,GAAQ;AAC1C,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,0CA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AAAA,QAC1B;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,6CAA6C,CAAC;AAAA,QAChE;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,eAAe;AAAA,UACf,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,iBAAiB,SAAS;AAAA,IAC7B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","TenantType","StateType","PrivacyStatus","EmailTag","PhoneTag","AddressTag","StatusName","Reason","FactorType","Status","FactorStatus","MfaReason","sendRecoveryEmail","sendActivationEmail","recover"]}