{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_user-management_accounts@1.0.41/index.ts","/npm/@wix/auto_sdk_user-management_accounts@1.0.41/src/identity-account-v2-account-accounts.public.ts","/npm/@wix/auto_sdk_user-management_accounts@1.0.41/src/identity-account-v2-account-accounts.universal.ts","/npm/@wix/auto_sdk_user-management_accounts@1.0.41/src/identity-account-v2-account-accounts.http.ts","/npm/@wix/auto_sdk_user-management_accounts@1.0.41/src/identity-account-v2-account-accounts.context.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,cAAA,IAAA,cAAA,WAAA,IAAA,WAAA,oBAAA,IAAA,oBAAA,cAAA,IAAA,eAAA,4BAAA,IAAA,6BAAA,uBAAA,IAAA,wBAAA,WAAA,IAAA,YAAA,kBAAA,IAAA,mBAAA,iBAAA,IAAA,oBAAA,OAAA,QAAA,aAAA,eCAA,IAAA,+BAAwD,QAAA,2CACxD,kBAAqD,QAAA,8CACrD,wBAA+B,QAAA,oDAC/B,iBAA8D,QAAA,kBCH9D,uBAAoD,QAAA,oCACpD,8BAGO,QAAA,2CCJP,oBAAkC,QAAA,iCAClC,iBAAqD,QAAA,8CACrD,uBAA+B,QAAA,oDAC/B,qBAA2B,QAAA,iCAI3B,SAAS,8CACP,GAqGA,SAAO,qBAAA,YAAW,OAAO,OAAO,EAAM,CAAE,iBAnGf,CACvB,wBAAyB,CACvB,CACE,QAAS,kBACT,SAAU,KAGd,oBAAqB,CACnB,CACE,QAAS,uBACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,uBACT,SAAU,IAEZ,CACE,QAAS,kBACT,SAAU,KAGd,wBAAyB,CACvB,CACE,QAAS,uBACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,uBACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,uBACT,SAAU,KAGd,iBAAkB,CAChB,CACE,QAAS,uBACT,SAAU,KAGd,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,yBAGK,EAAA,qBAAA,kBAAiB,yBACtB,oBAGK,EAAA,qBAAA,kBAAiB,oBACtB,8BAGK,EAAA,qBAAA,kBAAiB,8BAItB,qBAGqB,gCAAA,mBAAkB","file":"/npm/@wix/auto_sdk_user-management_accounts@1.0.41/build/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@wix/auto_sdk_user-management_accounts@1.0.41/build/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export * from './src/identity-account-v2-account-accounts.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  AccountCreatedEnvelope,\n  AccountResponse,\n  CreateAccountAsCollaboratorOptions,\n  CreateAccountAsCollaboratorResponse,\n  CreateAccountForMyUserOptions,\n  CreateAccountOptions,\n  CreateAccountResponse,\n  ListChildAccountsOptions,\n  ListChildAccountsResponse,\n  User,\n  createAccount as universalCreateAccount,\n  createAccountAsCollaborator as universalCreateAccountAsCollaborator,\n  createAccountForMyUser as universalCreateAccountForMyUser,\n  getAccount as universalGetAccount,\n  listChildAccounts as universalListChildAccounts,\n} from './identity-account-v2-account-accounts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/user-management' };\n\nexport function getAccount(httpClient: HttpClient): GetAccountSignature {\n  return (accountId: string) =>\n    universalGetAccount(\n      accountId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetAccountSignature {\n  /**\n   * Retrieves an account.\n   * @param - Account ID to retrieve.\n   */\n  (accountId: string): Promise<\n    NonNullablePaths<\n      AccountResponse,\n      | `account.accountId`\n      | `account.slug`\n      | `account.status`\n      | `account.accountOwner`\n      | `account.accountProperties.isTeam`\n      | `account.accountProperties.coBranding`\n      | `account.accountProperties.dataLocality`,\n      4\n    >\n  >;\n}\n\nexport function createAccount(httpClient: HttpClient): CreateAccountSignature {\n  return (user: User, options?: CreateAccountOptions) =>\n    universalCreateAccount(\n      user,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateAccountSignature {\n  /**\n   * Creates a new Wix account, and creates a new Wix user as the account owner.\n   * The newly created account is a child account of the account used to create it, making that account its parent.\n   *\n   * > **Important**: This call requires an account level API key.\n   * @param - The user to create under the new account, with the roles defined in `roles`.\n   * @param - Filter options.\n   */\n  (user: User, options?: CreateAccountOptions): Promise<\n    NonNullablePaths<\n      CreateAccountResponse,\n      `account.accountId` | `user.userId`,\n      3\n    >\n  >;\n}\n\n/** @internal */\nexport function createAccountForMyUser(\n  httpClient: HttpClient\n): CreateAccountForMyUserSignature {\n  return (options?: CreateAccountForMyUserOptions) =>\n    universalCreateAccountForMyUser(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateAccountForMyUserSignature {\n  /**\n   * creates account for the logged in user\n   */\n  (options?: CreateAccountForMyUserOptions): Promise<\n    NonNullablePaths<\n      AccountResponse,\n      | `account.accountId`\n      | `account.slug`\n      | `account.status`\n      | `account.accountOwner`\n      | `account.accountProperties.isTeam`\n      | `account.accountProperties.coBranding`\n      | `account.accountProperties.dataLocality`,\n      4\n    >\n  >;\n}\n\nexport function listChildAccounts(\n  httpClient: HttpClient\n): ListChildAccountsSignature {\n  return (options?: ListChildAccountsOptions) =>\n    universalListChildAccounts(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ListChildAccountsSignature {\n  /**\n   * Retrieves a list of child account IDs for the requesting account.\n   * If no child accounts exist, an empty list will be returned.\n   *\n   * > **Important**: This call requires an account level API key.\n   * @param - Filter options.\n   */\n  (options?: ListChildAccountsOptions): Promise<\n    NonNullablePaths<\n      ListChildAccountsResponse,\n      `childAccounts` | `childAccounts.${number}.accountId`,\n      4\n    >\n  >;\n}\n\nexport function createAccountAsCollaborator(\n  httpClient: HttpClient\n): CreateAccountAsCollaboratorSignature {\n  return (\n    user: User,\n    options?: NonNullablePaths<\n      CreateAccountAsCollaboratorOptions,\n      `collaboratorRoles` | `siteId`,\n      2\n    >\n  ) =>\n    universalCreateAccountAsCollaborator(\n      user,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateAccountAsCollaboratorSignature {\n  /**\n   * Creates a new Wix account with a user as the account owner and immediately assigns the account as a collaborator on a specified site with defined roles.\n   *\n   * This method combines account creation, user registration, and site collaboration assignment in a single operation. The newly created account becomes a child account of the requesting account, establishing a parent-child relationship that allows for centralized management and inherited configurations like custom branding.\n   *\n   * > **Important**: This call requires an account level API key.\n   * @param - User details for creating the new account. When parent_as_owner is omitted, this user is the account owner.\n   * When parent_as_owner is set, the parent account's owner is the account owner and this user is added as a team member.\n   * The created account is then assigned as a collaborator on the specified site.\n   */\n  (\n    user: User,\n    options?: NonNullablePaths<\n      CreateAccountAsCollaboratorOptions,\n      `collaboratorRoles` | `siteId`,\n      2\n    >\n  ): Promise<\n    NonNullablePaths<\n      CreateAccountAsCollaboratorResponse,\n      | `account.accountId`\n      | `assignedCollaboratorRoles`\n      | `assignedCollaboratorRoles.${number}.assignmentId`\n      | `assignedCollaboratorRoles.${number}.roleId`,\n      4\n    >\n  >;\n}\n\nexport const onAccountCreated = EventDefinition(\n  'wix.identity.account.v2.account_created',\n  true,\n  (event: AccountCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [{ path: 'metadata.eventTime' }],\n        },\n      ])\n    )\n)<AccountCreatedEnvelope>();\n\nexport {\n  Account,\n  AccountCreatedEnvelope,\n  AccountInfo,\n  AccountInfoMetadata,\n  AccountProperties,\n  AccountResponse,\n  AccountStatus,\n  AccountV2,\n  AccountsResponse,\n  ActionEvent,\n  BaseEventMetadata,\n  CoBranding,\n  CreateAccountAndAssignUserRequest,\n  CreateAccountAsCollaboratorOptions,\n  CreateAccountAsCollaboratorRequest,\n  CreateAccountAsCollaboratorResponse,\n  CreateAccountForMyUserOptions,\n  CreateAccountForMyUserRequest,\n  CreateAccountOptions,\n  CreateAccountRequest,\n  CreateAccountResponse,\n  CreateAccountTenantRequest,\n  CreateAccountTenantResponse,\n  DeleteAccountRequest,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Email,\n  EmptyResponse,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  GetAccountRequest,\n  GetAccountsRequest,\n  GetMyAccountRequest,\n  GetMyUserAccountsRequest,\n  GetParentAccountInfoRequest,\n  GetParentAccountInfoResponse,\n  GetSubAccountsRequest,\n  GetSubAccountsResponse,\n  GetUserAccountRequest,\n  GetUserAccountsRequest,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  IsTeamRequest,\n  IsTeamResponse,\n  ListChildAccountsOptions,\n  ListChildAccountsRequest,\n  ListChildAccountsResponse,\n  MarkAccountFlagRequest,\n  MarkAccountFlagRequestFlagOneOf,\n  MessageEnvelope,\n  Paging,\n  PagingMetadata,\n  ParentAsOwnerWithRoles,\n  RemoveParent,\n  RestoreInfo,\n  SetIsReadOnlyAccountRequest,\n  SiteRoleAssignment,\n  SsoIdentity,\n  SubAccountInfo,\n  UpdateAccountRequest,\n  UpdateParentAccountRequest,\n  UpdateParentAccountRequestUpdateOneOf,\n  UpdateParentAccountResponse,\n  UpdateSlugRequest,\n  User,\n  UserDetails,\n  UserV2,\n  WebhookIdentityType,\n  WebhooksAccountInfo,\n} from './identity-account-v2-account-accounts.universal.js';\n","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 ambassadorWixIdentityAccountV2Account from './identity-account-v2-account-accounts.http.js';\n\nexport interface AccountV2 {\n  /**\n   * Account ID.\n   * @format GUID\n   */\n  accountId?: string;\n}\n\nexport interface GetUserAccountRequest {\n  /**\n   * the user id that his account we query\n   * @format GUID\n   */\n  userId?: string;\n}\n\nexport interface Account {\n  /**\n   * Account ID.\n   * @format GUID\n   */\n  accountId?: string;\n  /** Slug used in the prefix of a free site's URL. */\n  slug?: string;\n  /** Account name for display. */\n  accountName?: string | null;\n  /**\n   * Deprecated. Use `accountProperties. accountImg` instead.\n   * @deprecated\n   */\n  accountImg?: string | null;\n  /** Account status. */\n  status?: AccountStatusWithLiterals;\n  /** Account owner's user ID. */\n  accountOwner?: string;\n  /** Additional account properties. */\n  accountProperties?: AccountProperties;\n  /** Date and time the account was created. */\n  dateCreated?: Date | null;\n  /** Date and time the account was last updated. */\n  dateUpdated?: Date | null;\n}\n\n/** enum with all available statuses of account */\nexport enum AccountStatus {\n  ACTIVE = 'ACTIVE',\n  BLOCKED = 'BLOCKED',\n  DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type AccountStatusWithLiterals =\n  | AccountStatus\n  | 'ACTIVE'\n  | 'BLOCKED'\n  | 'DELETED';\n\n/** All relevant account properties */\nexport interface AccountProperties {\n  /** Whether this account is a team account. */\n  isTeam?: boolean;\n  /** Account image for display. Relevant primarily for accounts with [custom branding](https://support.wix.com/en/article/wix-studio-setting-up-custom-branding). */\n  accountImg?: string | null;\n  /** Account banner for display. Relevant primarily for accounts with [custom branding](https://support.wix.com/en/article/wix-studio-setting-up-custom-branding). */\n  accountBanner?: string | null;\n  /** Account logo, displayed on customer sites that inherit the custom branding. */\n  accountLogo?: string | null;\n  /** Account [custom branding](https://support.wix.com/en/article/wix-studio-setting-up-custom-branding) status. */\n  coBranding?: CoBrandingWithLiterals;\n  /** Account website URL. This URL is displayed on customer sites that inherit the custom branding. */\n  websiteUrl?: string | null;\n  /** ID of parent account to this account, if relevant. */\n  parentAccountId?: string | null;\n  /** Whether the account's data should be stored locally. */\n  dataLocality?: boolean;\n}\n\n/** co branding flag options for account */\nexport enum CoBranding {\n  /** The account does not have custom branding. */\n  None = 'None',\n  /** The account has custom branding. */\n  CoBranded = 'CoBranded',\n  /** The account is a contributor of an account with custom branding and was created because of the contributor invite. */\n  CoBranded_Customer_New = 'CoBranded_Customer_New',\n  /** The account is a contributor of an account with custom branding and existed before receiving the contributor invite. */\n  CoBranded_Customer_Existing = 'CoBranded_Customer_Existing',\n}\n\n/** @enumType */\nexport type CoBrandingWithLiterals =\n  | CoBranding\n  | 'None'\n  | 'CoBranded'\n  | 'CoBranded_Customer_New'\n  | 'CoBranded_Customer_Existing';\n\nexport interface GetUserAccountsRequest {\n  /**\n   * the user id that his accounts we query\n   * @format GUID\n   */\n  userId?: string;\n  /** Limited to max 20 at a single request */\n  paging?: Paging;\n}\n\nexport interface Paging {\n  /** Number of items to load. */\n  limit?: number | null;\n  /** Number of items to skip in the current sort order. */\n  offset?: number | null;\n}\n\nexport interface AccountsResponse {\n  accounts?: Account[];\n}\n\nexport interface GetMyUserAccountsRequest {\n  /** Limited to max 20 at a single request */\n  paging?: Paging;\n}\n\nexport interface GetAccountRequest {\n  /**\n   * Account ID to retrieve.\n   * @format GUID\n   */\n  accountId: string;\n}\n\nexport interface AccountResponse {\n  account?: Account;\n}\n\nexport interface GetMyAccountRequest {}\n\nexport interface GetAccountsRequest {\n  /**\n   * Account ID to retrieve.\n   * @format GUID\n   */\n  accountIds?: string[];\n}\n\nexport interface CreateAccountRequest {\n  /** The user to create under the new account, with the roles defined in `roles`. */\n  user: User;\n  /**\n   * Roles to be assigned to the user in the new account. To retrieve all available roles, call Get Roles Info in the Users API.\n   * Default: OWNER.\n   */\n  roles?: string[] | null;\n}\n\n/** A User to be created under an implicitly provided accountId: must have a unique email. */\nexport interface User {\n  /** User's unique email address details. Required. */\n  email?: Email;\n  /** User's single sign on identity, when the user is identified via SSO authentication response token params, as specified by [OpenID Connect](https://openid.net/developers/how-connect-works/) (aka. OIDC) protocol. */\n  ssoIdentities?: SsoIdentity[];\n  /** Additional user details. */\n  userDetails?: UserDetails;\n}\n\n/** User's email address. */\nexport interface Email {\n  /**\n   * User's email address.\n   * @format EMAIL\n   */\n  emailAddress?: string;\n  /** Whether the caller has verified the user's email address. */\n  isVerified?: boolean;\n}\n\n/** Single Sign On (aka. SSO) identity; user is identified via SSO authentication response token params, as specified by OpenID Connect (aka. OIDC) protocol */\nexport interface SsoIdentity {\n  /** An SSO setting (URLs, clientId, secret, etc. as required by OIDC protocol) for a specific Identity-Provider (aka. IdP) for a specific Wix account. */\n  ssoId?: string;\n  /**\n   * User ID as stored in IdP. For example a \"sub\" claim of OIDC protocol,\n   * or any other alternative, specified by IdP (Identity Provider).\n   */\n  userId?: string;\n}\n\n/** additional user details */\nexport interface UserDetails {\n  /**\n   * User's first name.\n   * @maxLength 64\n   */\n  firstName?: string | null;\n  /**\n   * User's last name.\n   * @maxLength 64\n   */\n  lastName?: string | null;\n  /**\n   * URL to location of user's profile picture.\n   * @format WEB_URL\n   */\n  profilePictureUrl?: string | null;\n  /**\n   * User's preferred language in [ISO 639-1:2002](https://en.wikipedia.org/wiki/ISO_639-1) format. For example, \"en\", \"es\".\n   * @maxLength 2\n   */\n  language?: string | null;\n  /**\n   * Original Client IP from which a request was made.\n   * This is useful in case where a createUser API is called by some server call, which, in turn, has been called by some client from another IP.\n   * Wix checks this IP against the [OFAC sanctioned countries](https://ofac.treasury.gov/sanctions-programs-and-country-information).\n   */\n  clientIp?: string | null;\n  /**\n   * if defined then emails to the user will be sent to this email instead of the user's primary email\n   * @format EMAIL\n   */\n  contactEmail?: string | null;\n}\n\nexport interface CreateAccountResponse {\n  /** The created account. */\n  account?: AccountV2;\n  /** The created user */\n  user?: UserV2;\n}\n\nexport interface UserV2 {\n  /**\n   * User ID\n   * @format GUID\n   */\n  userId?: string;\n}\n\nexport interface CreateAccountForMyUserRequest {\n  /** the account name */\n  accountName?: string | null;\n  /**\n   * account image url\n   * @format WEB_URL\n   */\n  accountImg?: string | null;\n  /** whether to mark the account as `studio` */\n  studio?: boolean;\n}\n\nexport interface CreateAccountTenantRequest {\n  slug?: string | null;\n}\n\nexport interface CreateAccountTenantResponse {\n  account?: AccountV2;\n}\n\nexport interface CreateAccountAndAssignUserRequest {\n  /**\n   * the user id for which we are creating the account\n   * @format GUID\n   */\n  userId?: string;\n  /** the user name of the user for which the account is created */\n  userName?: string;\n  /**\n   * the parent account of the created account\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /** whether to mark the account as `studio` */\n  studio?: boolean;\n}\n\nexport interface UpdateAccountRequest {\n  /**\n   * the account id to update\n   * @format GUID\n   */\n  accountId?: string;\n  /**\n   * DEPRECATED field of image\n   * @deprecated\n   */\n  accountImg?: string | null;\n  /** optional - new account name */\n  accountName?: string | null;\n  /**\n   * the new properties for the account.\n   * can be passed partially - and only relevant fields will be updated\n   */\n  accountProperties?: AccountProperties;\n}\n\nexport interface UpdateParentAccountRequest\n  extends UpdateParentAccountRequestUpdateOneOf {\n  /** Removes the parent account */\n  remove?: RemoveParent;\n}\n\n/** @oneof */\nexport interface UpdateParentAccountRequestUpdateOneOf {\n  /** Removes the parent account */\n  remove?: RemoveParent;\n}\n\nexport interface RemoveParent {}\n\nexport interface UpdateParentAccountResponse {\n  newParentAccountId?: string | null;\n}\n\nexport interface DeleteAccountRequest {\n  /**\n   * the account id to delete\n   * @format GUID\n   */\n  accountId?: string;\n  /** will throw exception if trying to delete the account of the last user when the value is true */\n  shouldNotDeleteLastAccount?: boolean;\n}\n\nexport interface EmptyResponse {}\n\nexport interface UpdateSlugRequest {\n  /**\n   * account id\n   * @format GUID\n   */\n  accountId?: string;\n  /** new slug */\n  newSlugName?: string;\n}\n\nexport interface IsTeamRequest {\n  /**\n   * the account id to check if it's a team account\n   * @format GUID\n   */\n  accountId?: string;\n}\n\nexport interface IsTeamResponse {\n  /** true if the account is marked as a team account, false if not */\n  isTeamAccount?: boolean;\n}\n\nexport interface MarkAccountFlagRequest\n  extends MarkAccountFlagRequestFlagOneOf {\n  /**\n   * account co branding flag (if exists)\n   * an enum for CoBranding flag contains 4 possible options:\n   * None - the account is not CoBranded\n   * CoBranded - the account has a CoBranding flag\n   * CoBranded_Customer_New - the account is a contributor of a CoBranded account. This account was created because of the contributor invite\n   * CoBranded_Customer_Existing - the account is a contributor of a CoBranded account. This account was created before the invite of the contributor invite\n   */\n  coBranding?: CoBrandingWithLiterals;\n  /**\n   * the account id to mark\n   * @format GUID\n   */\n  accountId?: string;\n  /** the inviting account id in case the flag is given by an invite */\n  invitedByAccountId?: string | null;\n}\n\n/** @oneof */\nexport interface MarkAccountFlagRequestFlagOneOf {\n  /**\n   * account co branding flag (if exists)\n   * an enum for CoBranding flag contains 4 possible options:\n   * None - the account is not CoBranded\n   * CoBranded - the account has a CoBranding flag\n   * CoBranded_Customer_New - the account is a contributor of a CoBranded account. This account was created because of the contributor invite\n   * CoBranded_Customer_Existing - the account is a contributor of a CoBranded account. This account was created before the invite of the contributor invite\n   */\n  coBranding?: CoBrandingWithLiterals;\n}\n\nexport interface GetParentAccountInfoRequest {}\n\nexport interface GetParentAccountInfoResponse {\n  /** The info of the parent account, if the account has a parent */\n  parentAccountInfo?: AccountInfo;\n}\n\nexport interface AccountInfo {\n  /** The name of the account */\n  name?: string | null;\n  /** The url of the image of the account */\n  image?: string | null;\n}\n\nexport interface GetSubAccountsRequest {\n  /** Offset-based pagination for the response. Default page size is 20, max page size is 50 */\n  paging?: Paging;\n}\n\nexport interface GetSubAccountsResponse {\n  /** The sub accounts of the target account */\n  subAccounts?: SubAccountInfo[];\n  /** Metadata of the response pagination */\n  pagingMetadata?: PagingMetadata;\n}\n\nexport interface SubAccountInfo {\n  /** The id of the sub account */\n  accountId?: string;\n}\n\nexport interface PagingMetadata {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  offset?: number | null;\n  /** Total number of items that match the query. */\n  total?: number | null;\n  /** Flag that indicates the server failed to calculate the `total` field. */\n  tooManyToCount?: boolean | null;\n}\n\nexport interface ListChildAccountsRequest {\n  /**\n   * Paging options to limit and offset the number of items.\n   * Default: 20. Max: 50.\n   */\n  paging?: Paging;\n}\n\nexport interface ListChildAccountsResponse {\n  /** The requested child accounts. */\n  childAccounts?: AccountV2[];\n  /** Metadata of the response pagination. */\n  pagingMetadata?: PagingMetadata;\n}\n\nexport interface SetIsReadOnlyAccountRequest {\n  /** @format GUID */\n  accountId?: string;\n  isReadOnly?: boolean;\n}\n\nexport interface CreateAccountAsCollaboratorRequest {\n  /**\n   * User details for creating the new account. When parent_as_owner is omitted, this user is the account owner.\n   * When parent_as_owner is set, the parent account's owner is the account owner and this user is added as a team member.\n   * The created account is then assigned as a collaborator on the specified site.\n   */\n  user: User;\n  /**\n   * Site ID where the created account will be assigned as a collaborator.\n   * The site must exist and the requesting account must have permission to add collaborators to this site.\n   * @format GUID\n   */\n  siteId: string;\n  /**\n   * Role IDs to assign to the account for the specified site.\n   * These roles define the collaborator's permissions and access level on the site.\n   * To retrieve available roles, call [Get Roles Info](https://dev.wix.com/docs/api-reference/account-level/user-management/accounts/users/get-roles-info).\n   * Minimum: 1 role, Maximum: 5 roles.\n   * @minSize 1\n   * @maxSize 5\n   * @maxLength 100\n   */\n  collaboratorRoles: string[];\n  /** Whether to assign the existing child account as the collaborator, if one already exists for the specified email address. */\n  useExistingAccount?: boolean;\n  /** When omitted: user in request is account owner. When set: parent account's owner is account owner; user in request is team member with user_roles. */\n  parentAsOwner?: ParentAsOwnerWithRoles;\n}\n\nexport interface ParentAsOwnerWithRoles {\n  /**\n   * Role IDs for the user (team member) on the created account. At least one required when using parent-as-owner flow.\n   * @minSize 1\n   * @maxSize 5\n   * @maxLength 100\n   */\n  userRoles?: string[];\n}\n\nexport interface CreateAccountAsCollaboratorResponse {\n  /**\n   * Created account. When parent_as_owner was omitted, the user from the request is the account owner.\n   * When parent_as_owner was set, the parent account's owner is the account owner and the user was added as a team member.\n   * This account is a child of the requesting account and inherits applicable configurations.\n   */\n  account?: AccountV2;\n  /** Site role assignments for each requested collaborator role. */\n  assignedCollaboratorRoles?: SiteRoleAssignment[];\n}\n\nexport interface SiteRoleAssignment {\n  /**\n   * Unique identifier mapping the role to the contributor on the site.\n   * @maxLength 100\n   */\n  assignmentId?: string;\n  /**\n   * Role ID that was successfully assigned to the account for the site.\n   * @maxLength 100\n   */\n  roleId?: string;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: WebhooksAccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface WebhooksAccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: WebhooksAccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface AccountCreatedEnvelope {\n  entity: AccountV2;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a new account is created.\n * @permissionId Account.GetAccountProperties\n * @webhook\n * @eventType wix.identity.account.v2.account_created\n * @serviceIdentifier com.wixpress.account.api.AccountService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onAccountCreated(\n  handler: (event: AccountCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves an account.\n * @param accountId - Account ID to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField accountId\n * @permissionId Account.GetAccountProperties\n * @fqn com.wixpress.account.api.AccountService.getAccount\n */\nexport async function getAccount(\n  accountId: string\n): Promise<\n  NonNullablePaths<\n    AccountResponse,\n    | `account.accountId`\n    | `account.slug`\n    | `account.status`\n    | `account.accountOwner`\n    | `account.accountProperties.isTeam`\n    | `account.accountProperties.coBranding`\n    | `account.accountProperties.dataLocality`,\n    4\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    accountId: accountId,\n  });\n\n  const reqOpts = ambassadorWixIdentityAccountV2Account.getAccount(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { accountId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['accountId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Creates a new Wix account, and creates a new Wix user as the account owner.\n * The newly created account is a child account of the account used to create it, making that account its parent.\n *\n * > **Important**: This call requires an account level API key.\n * @param user - The user to create under the new account, with the roles defined in `roles`.\n * @public\n * @requiredField user\n * @param options - Filter options.\n * @permissionId ACCOUNT.CREATE_ACCOUNT\n * @fqn com.wixpress.account.api.AccountService.createAccount\n */\nexport async function createAccount(\n  user: User,\n  options?: CreateAccountOptions\n): Promise<\n  NonNullablePaths<\n    CreateAccountResponse,\n    `account.accountId` | `user.userId`,\n    3\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    user: user,\n    roles: options?.roles,\n  });\n\n  const reqOpts = ambassadorWixIdentityAccountV2Account.createAccount(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { user: '$[0]', roles: '$[1].roles' },\n        singleArgumentUnchanged: false,\n      },\n      ['user', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CreateAccountOptions {\n  /**\n   * Roles to be assigned to the user in the new account. To retrieve all available roles, call Get Roles Info in the Users API.\n   * Default: OWNER.\n   */\n  roles?: string[] | null;\n}\n\n/**\n * creates account for the logged in user\n * @internal\n * @documentationMaturity preview\n * @fqn com.wixpress.account.api.AccountService.createAccountForMyUser\n */\nexport async function createAccountForMyUser(\n  options?: CreateAccountForMyUserOptions\n): Promise<\n  NonNullablePaths<\n    AccountResponse,\n    | `account.accountId`\n    | `account.slug`\n    | `account.status`\n    | `account.accountOwner`\n    | `account.accountProperties.isTeam`\n    | `account.accountProperties.coBranding`\n    | `account.accountProperties.dataLocality`,\n    4\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    accountName: options?.accountName,\n    accountImg: options?.accountImg,\n    studio: options?.studio,\n  });\n\n  const reqOpts =\n    ambassadorWixIdentityAccountV2Account.createAccountForMyUser(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          accountName: '$[0].accountName',\n          accountImg: '$[0].accountImg',\n          studio: '$[0].studio',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CreateAccountForMyUserOptions {\n  /** the account name */\n  accountName?: string | null;\n  /**\n   * account image url\n   * @format WEB_URL\n   */\n  accountImg?: string | null;\n  /** whether to mark the account as `studio` */\n  studio?: boolean;\n}\n\n/**\n * Retrieves a list of child account IDs for the requesting account.\n * If no child accounts exist, an empty list will be returned.\n *\n * > **Important**: This call requires an account level API key.\n * @public\n * @param options - Filter options.\n * @permissionId ACCOUNT.CHILD_ACCOUNTS_LIST\n * @fqn com.wixpress.account.api.AccountService.listChildAccounts\n */\nexport async function listChildAccounts(\n  options?: ListChildAccountsOptions\n): Promise<\n  NonNullablePaths<\n    ListChildAccountsResponse,\n    `childAccounts` | `childAccounts.${number}.accountId`,\n    4\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    paging: options?.paging,\n  });\n\n  const reqOpts =\n    ambassadorWixIdentityAccountV2Account.listChildAccounts(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { paging: '$[0].paging' },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ListChildAccountsOptions {\n  /**\n   * Paging options to limit and offset the number of items.\n   * Default: 20. Max: 50.\n   */\n  paging?: Paging;\n}\n\n/**\n * Creates a new Wix account with a user as the account owner and immediately assigns the account as a collaborator on a specified site with defined roles.\n *\n * This method combines account creation, user registration, and site collaboration assignment in a single operation. The newly created account becomes a child account of the requesting account, establishing a parent-child relationship that allows for centralized management and inherited configurations like custom branding.\n *\n * > **Important**: This call requires an account level API key.\n * @param user - User details for creating the new account. When parent_as_owner is omitted, this user is the account owner.\n * When parent_as_owner is set, the parent account's owner is the account owner and this user is added as a team member.\n * The created account is then assigned as a collaborator on the specified site.\n * @public\n * @documentationMaturity preview\n * @requiredField options.collaboratorRoles\n * @requiredField options.siteId\n * @requiredField user\n * @permissionId ACCOUNT.ACCOUNT_CREATE_AS_COLLABORATOR\n * @fqn com.wixpress.account.api.AccountService.CreateAccountAsCollaborator\n */\nexport async function createAccountAsCollaborator(\n  user: User,\n  options?: NonNullablePaths<\n    CreateAccountAsCollaboratorOptions,\n    `collaboratorRoles` | `siteId`,\n    2\n  >\n): Promise<\n  NonNullablePaths<\n    CreateAccountAsCollaboratorResponse,\n    | `account.accountId`\n    | `assignedCollaboratorRoles`\n    | `assignedCollaboratorRoles.${number}.assignmentId`\n    | `assignedCollaboratorRoles.${number}.roleId`,\n    4\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    user: user,\n    siteId: options?.siteId,\n    collaboratorRoles: options?.collaboratorRoles,\n    useExistingAccount: options?.useExistingAccount,\n    parentAsOwner: options?.parentAsOwner,\n  });\n\n  const reqOpts =\n    ambassadorWixIdentityAccountV2Account.createAccountAsCollaborator(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          user: '$[0]',\n          siteId: '$[1].siteId',\n          collaboratorRoles: '$[1].collaboratorRoles',\n          useExistingAccount: '$[1].useExistingAccount',\n          parentAsOwner: '$[1].parentAsOwner',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['user', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CreateAccountAsCollaboratorOptions {\n  /**\n   * Site ID where the created account will be assigned as a collaborator.\n   * The site must exist and the requesting account must have permission to add collaborators to this site.\n   * @format GUID\n   */\n  siteId: string;\n  /**\n   * Role IDs to assign to the account for the specified site.\n   * These roles define the collaborator's permissions and access level on the site.\n   * To retrieve available roles, call [Get Roles Info](https://dev.wix.com/docs/api-reference/account-level/user-management/accounts/users/get-roles-info).\n   * Minimum: 1 role, Maximum: 5 roles.\n   * @minSize 1\n   * @maxSize 5\n   * @maxLength 100\n   */\n  collaboratorRoles: string[];\n  /** Whether to assign the existing child account as the collaborator, if one already exists for the specified email address. */\n  useExistingAccount?: boolean;\n  /** When omitted: user in request is account owner. When set: parent account's owner is account owner; user in request is team member with user_roles. */\n  parentAsOwner?: ParentAsOwnerWithRoles;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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 resolveComWixpressAccountApiAccountServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/account-server',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n      {\n        srcPath: '/account-server',\n        destPath: '',\n      },\n    ],\n    'premium._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'bo._base_domain_': [\n      {\n        srcPath: '/account-server',\n        destPath: '',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/account-server',\n        destPath: '',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/account-server',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/accounts',\n        destPath: '',\n      },\n      {\n        srcPath: '/accounts/v1/accounts',\n        destPath: '/v1/accounts',\n      },\n      {\n        srcPath: '/accounts/v1/account',\n        destPath: '/v1/account',\n      },\n    ],\n    'users._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n    'twins._base_domain_': [\n      {\n        srcPath: '/_api/account-server',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_user-management_accounts';\n\n/** Retrieves an account. */\nexport function getAccount(payload: object): RequestOptionsFactory<any> {\n  function __getAccount({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.account.v2.account',\n      method: 'GET' as any,\n      methodFqn: 'com.wixpress.account.api.AccountService.getAccount',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressAccountApiAccountServiceUrl({\n        protoPath: '/v1/accounts/{accountId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'account.dateCreated' },\n              { path: 'account.dateUpdated' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getAccount;\n}\n\n/**\n * Creates a new Wix account, and creates a new Wix user as the account owner.\n * The newly created account is a child account of the account used to create it, making that account its parent.\n *\n * > **Important**: This call requires an account level API key.\n */\nexport function createAccount(payload: object): RequestOptionsFactory<any> {\n  function __createAccount({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.account.v2.account',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.account.api.AccountService.createAccount',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressAccountApiAccountServiceUrl({\n        protoPath: '/v1/accounts/create',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __createAccount;\n}\n\n/** creates account for the logged in user */\nexport function createAccountForMyUser(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __createAccountForMyUser({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.account.v2.account',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wixpress.account.api.AccountService.createAccountForMyUser',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressAccountApiAccountServiceUrl({\n        protoPath: '/v1/accounts',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'account.dateCreated' },\n              { path: 'account.dateUpdated' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __createAccountForMyUser;\n}\n\n/**\n * Retrieves a list of child account IDs for the requesting account.\n * If no child accounts exist, an empty list will be returned.\n *\n * > **Important**: This call requires an account level API key.\n */\nexport function listChildAccounts(payload: object): RequestOptionsFactory<any> {\n  function __listChildAccounts({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.account.v2.account',\n      method: 'GET' as any,\n      methodFqn: 'com.wixpress.account.api.AccountService.listChildAccounts',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressAccountApiAccountServiceUrl({\n        protoPath: '/v1/account/child-accounts',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __listChildAccounts;\n}\n\n/**\n * Creates a new Wix account with a user as the account owner and immediately assigns the account as a collaborator on a specified site with defined roles.\n *\n * This method combines account creation, user registration, and site collaboration assignment in a single operation. The newly created account becomes a child account of the requesting account, establishing a parent-child relationship that allows for centralized management and inherited configurations like custom branding.\n *\n * > **Important**: This call requires an account level API key.\n */\nexport function createAccountAsCollaborator(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __createAccountAsCollaborator({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.account.v2.account',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wixpress.account.api.AccountService.CreateAccountAsCollaborator',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressAccountApiAccountServiceUrl({\n        protoPath: '/v1/accounts/create-as-collaborator',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __createAccountAsCollaborator;\n}\n","import {\n  getAccount as publicGetAccount,\n  createAccount as publicCreateAccount,\n  createAccountForMyUser as publicCreateAccountForMyUser,\n  listChildAccounts as publicListChildAccounts,\n  createAccountAsCollaborator as publicCreateAccountAsCollaborator,\n} from './identity-account-v2-account-accounts.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n  BuildRESTFunction,\n  MaybeContext,\n  BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onAccountCreated as publicOnAccountCreated } from './identity-account-v2-account-accounts.public.js';\n\nexport const getAccount: MaybeContext<\n  BuildRESTFunction<typeof publicGetAccount> & typeof publicGetAccount\n> = /*#__PURE__*/ createRESTModule(publicGetAccount);\nexport const createAccount: MaybeContext<\n  BuildRESTFunction<typeof publicCreateAccount> & typeof publicCreateAccount\n> = /*#__PURE__*/ createRESTModule(publicCreateAccount);\n/** @internal */\nexport const createAccountForMyUser: MaybeContext<\n  BuildRESTFunction<typeof publicCreateAccountForMyUser> &\n    typeof publicCreateAccountForMyUser\n> = /*#__PURE__*/ createRESTModule(publicCreateAccountForMyUser);\nexport const listChildAccounts: MaybeContext<\n  BuildRESTFunction<typeof publicListChildAccounts> &\n    typeof publicListChildAccounts\n> = /*#__PURE__*/ createRESTModule(publicListChildAccounts);\nexport const createAccountAsCollaborator: MaybeContext<\n  BuildRESTFunction<typeof publicCreateAccountAsCollaborator> &\n    typeof publicCreateAccountAsCollaborator\n> = /*#__PURE__*/ createRESTModule(publicCreateAccountAsCollaborator);\n/**\n * Triggered when a new account is created.\n */\nexport const onAccountCreated: BuildEventDefinition<\n  typeof publicOnAccountCreated\n> &\n  typeof publicOnAccountCreated = createEventModule(publicOnAccountCreated);\n\nexport {\n  AccountStatus,\n  CoBranding,\n  WebhookIdentityType,\n} from './identity-account-v2-account-accounts.universal.js';\nexport {\n  AccountV2,\n  GetUserAccountRequest,\n  Account,\n  AccountProperties,\n  GetUserAccountsRequest,\n  Paging,\n  AccountsResponse,\n  GetMyUserAccountsRequest,\n  GetAccountRequest,\n  AccountResponse,\n  GetMyAccountRequest,\n  GetAccountsRequest,\n  CreateAccountRequest,\n  User,\n  Email,\n  SsoIdentity,\n  UserDetails,\n  CreateAccountResponse,\n  UserV2,\n  CreateAccountForMyUserRequest,\n  CreateAccountTenantRequest,\n  CreateAccountTenantResponse,\n  CreateAccountAndAssignUserRequest,\n  UpdateAccountRequest,\n  UpdateParentAccountRequest,\n  UpdateParentAccountRequestUpdateOneOf,\n  RemoveParent,\n  UpdateParentAccountResponse,\n  DeleteAccountRequest,\n  EmptyResponse,\n  UpdateSlugRequest,\n  IsTeamRequest,\n  IsTeamResponse,\n  MarkAccountFlagRequest,\n  MarkAccountFlagRequestFlagOneOf,\n  GetParentAccountInfoRequest,\n  GetParentAccountInfoResponse,\n  AccountInfo,\n  GetSubAccountsRequest,\n  GetSubAccountsResponse,\n  SubAccountInfo,\n  PagingMetadata,\n  ListChildAccountsRequest,\n  ListChildAccountsResponse,\n  SetIsReadOnlyAccountRequest,\n  CreateAccountAsCollaboratorRequest,\n  ParentAsOwnerWithRoles,\n  CreateAccountAsCollaboratorResponse,\n  SiteRoleAssignment,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  WebhooksAccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  AccountCreatedEnvelope,\n  CreateAccountOptions,\n  CreateAccountForMyUserOptions,\n  ListChildAccountsOptions,\n  CreateAccountAsCollaboratorOptions,\n} from './identity-account-v2-account-accounts.universal.js';\nexport {\n  AccountStatusWithLiterals,\n  CoBrandingWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n} from './identity-account-v2-account-accounts.universal.js';\n"]}