{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/index.ts","/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/src/identity-invites-v1-site-invite-site-invites.universal.ts","/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/src/identity-invites-v1-site-invite-site-invites.http.ts","/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/src/identity-invites-v1-site-invite-site-invites.public.ts","/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/src/identity-invites-v1-site-invite-site-invites.context.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,aAAA,IAAA,aAAA,UAAA,IAAA,UAAA,WAAA,IAAA,YAAA,aAAA,IAAA,cAAA,aAAA,IAAA,gBAAA,OAAA,QAAA,aAAA,eCAA,IAAA,uBAAoD,QAAA,oCACpD,8BAGO,QAAA,2CCJP,iBAAqD,QAAA,8CACrD,uBAA+B,QAAA,oDAC/B,oBAA2B,QAAA,iCAI3B,SAAS,8CACP,GAmFA,SAAO,oBAAA,YAAW,OAAO,OAAO,EAAM,CAAE,iBAjFf,CACvB,oBAAqB,CACnB,CACE,QAAS,oBACT,SAAU,KAGd,wBAAyB,CACvB,CACE,QAAS,eACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,oBACT,SAAU,IAEZ,CACE,QAAS,WACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,oBACT,SAAU,KAGd,uBAAwB,CACtB,CACE,QAAS,oBACT,SAAU,KAGd,iBAAkB,CAChB,CACE,QAAS,oBACT,SAAU,KAGd,kBAAmB,CACjB,CACE,QAAS,wBACT,SAAU,iBAEZ,CACE,QAAS,2BACT,SAAU,oBAEZ,CACE,QAAS,WACT,SAAU,IAEZ,CACE,QAAS,uBACT,SAAU,gBAEZ,CACE,QAAS,0BACT,SAAU,oBAGd,oBAAqB,CACnB,CACE,QAAS,oBACT,SAAU,KAGd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MAFA,GAAa,UAAU,GAEjB,CACR,CACF,CE/eO,SAAS,YAAW,GACzB,MAAO,CACL,EACA,IAEA,YACE,EACA,EAEA,CAAE,cAER,CA6BO,SAAS,cAAa,GAC3B,MAAO,CAAC,EAAkB,IACxB,cACE,EACA,EAEA,CAAE,cAER,CA2BO,SAAS,cAAa,GAC3B,OAAQ,GACN,cACE,EAEA,CAAE,cAER,CC1FA,IAAA,qBAAiC,QAAA,iCAGpB,aAEK,EAAA,qBAAA,kBAAiB,aACtB,eAEK,EAAA,qBAAA,kBAAiB,eACtB,eAEK,EAAA,qBAAA,kBAAiB","file":"/npm/@wix/auto_sdk_user-management_site-invites@1.0.30/build/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@wix/auto_sdk_user-management_site-invites@1.0.30/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-invites-v1-site-invite-site-invites.context.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 ambassadorWixIdentityInvitesV1SiteInvite from './identity-invites-v1-site-invite-site-invites.http.js';\n\nexport interface SiteInvite {\n  /**\n   * Invite ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string;\n  /**\n   * Site ID the user is invited to as a collaborator.\n   * @format GUID\n   * @readonly\n   */\n  siteId?: string;\n  /**\n   * Email address where the invite was sent.\n   * @format EMAIL\n   */\n  email?: string;\n  /** Role IDs included in the invite. */\n  policyIds?: string[];\n  /**\n   * Deprecated. Use `inviterAccountId`.\n   * @readonly\n   * @deprecated\n   */\n  inviterId?: string;\n  /**\n   * Invite Status.\n   *\n   * Supported values:\n   * - **Pending:** The invite has been sent and is valid, waiting for the user's response.\n   * - **Used:** The invite has been accepted.\n   * - **Deleted:** The invite has been deleted or revoked.\n   * - **Declined:** The user declined the invite.\n   * - **Expired:** The invite has expired without being accepted.\n   */\n  status?: InviteStatusWithLiterals;\n  /** Link to accept the invite. */\n  acceptLink?: string;\n  /**\n   * Inviting account ID.\n   * @format GUID\n   * @readonly\n   */\n  inviterAccountId?: string;\n  /**\n   * Account ID that accepted the invite. Populated only once the invite is accepted.\n   * @format GUID\n   * @readonly\n   */\n  acceptedByAccountId?: string | null;\n  /** Date the invite was created. */\n  dateCreated?: Date | null;\n  /**\n   * User's Wix Bookings staff ID, if relevant.\n   * @format GUID\n   */\n  staffId?: string | null;\n  /** Invite expiration date */\n  expirationDate?: Date | null;\n  /**\n   * Location ids included in the invite\n   * @format GUID\n   * @readonly\n   * @maxSize 20\n   */\n  locationIds?: string[];\n  /**\n   * A set of capability keys representing the actions that the caller is allowed\n   * to perform on this specific contributor. This field is calculated based on the\n   * identity of the request sender and may differ between callers.\n   * @maxSize 20\n   * @maxLength 20\n   */\n  callerCapabilities?: string[];\n}\n\n/** Invite status stating whether the invite was accepted, waiting to be accepted, deleted etc.. */\nexport enum InviteStatus {\n  Pending = 'Pending',\n  Used = 'Used',\n  Deleted = 'Deleted',\n  Declined = 'Declined',\n  Expired = 'Expired',\n}\n\n/** @enumType */\nexport type InviteStatusWithLiterals =\n  | InviteStatus\n  | 'Pending'\n  | 'Used'\n  | 'Deleted'\n  | 'Declined'\n  | 'Expired';\n\nexport interface GetSiteInvitesRequest {}\n\nexport interface GetSiteInvitesResponse {\n  invites?: SiteInvite[];\n}\n\nexport interface QuerySiteInvitesRequest {\n  /**\n   * Supports only `filter` field with\n   * `\"filter\" : {\n   * \"acceptedByAccountId\":{\"$in\": [<id1>, <id2>, ...]}\n   * }`\n   */\n  query?: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n  /** Paging options to limit and offset the number of items. */\n  paging?: Paging;\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object.\n   *\n   * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object.\n   *\n   * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n   */\n  sort?: Sorting[];\n  /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */\n  fields?: string[];\n  /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */\n  fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n  /** Paging options to limit and offset the number of items. */\n  paging?: Paging;\n  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 512\n   */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\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 CursorPaging {\n  /**\n   * Maximum number of items to return in the results.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   * @maxLength 16000\n   */\n  cursor?: string | null;\n}\n\nexport interface QuerySiteInvitesResponse {\n  invites?: SiteInvite[];\n}\n\nexport interface GetSiteInviteRequest {\n  _id?: string;\n}\n\nexport interface GetSiteInviteResponse {\n  invite?: SiteInvite;\n}\n\nexport interface SiteInviteRequest {\n  /** The role ids to be assigned */\n  policyIds?: string[];\n  /**\n   * Invitee email\n   * @format EMAIL\n   */\n  email?: string;\n  /** The language of emails that will be used only for recipients that don't have a user, in case this parameter is unspecified, the sender's language will be used instead */\n  defaultEmailLanguage?: string | null;\n  /** Location restriction for the invite. */\n  locationRestriction?: LocationRestriction;\n}\n\nexport interface LocationRestriction {\n  /**\n   * @format GUID\n   * @maxSize 20\n   */\n  locationIds?: string[];\n}\n\nexport interface SiteInviteResponse {\n  /** Invites that were sent. */\n  invite?: SiteInvite;\n}\n\nexport interface BulkSiteInviteRequest {\n  /** Role IDs, referred to as policy IDs, to assign to the contributors. */\n  policyIds: string[];\n  /**\n   * Email addresses to which the invites should be sent.\n   * @minSize 1\n   * @maxSize 10\n   */\n  emails: string[];\n  /** Details explaining the purpose of the invite. */\n  invitePurpose?: string | null;\n  /** Language of emails to send. Relevant only for recipients that don't currently have a Wix user ID. Default: Site owner's language. */\n  defaultEmailLanguage?: string | null;\n  /** Location restriction for the invite. */\n  locationRestriction?: LocationRestriction;\n}\n\nexport interface BulkSiteInviteResponse {\n  /** Invites that were sent successfully. */\n  invites?: SiteInvite[];\n  /** Invites that failed. */\n  failedEmails?: string[];\n}\n\nexport interface ResendSiteInviteRequest {\n  /** Invite ID. */\n  inviteId: string;\n  /** Language of emails to send. Relevant only for recipients that don't currently have a Wix user ID. Default: Site owner's language. */\n  defaultEmailLanguage?: string | null;\n}\n\nexport interface AcceptSiteInviteRequest {\n  inviteToken?: string;\n}\n\nexport interface AcceptSiteInviteResponse {}\n\nexport interface RevokeSiteInviteRequest {\n  /** Invite ID. */\n  inviteId: string;\n}\n\nexport interface RevokeSiteInviteResponse {}\n\nexport interface UpdateSiteInviteRequest {\n  inviteId?: string;\n  policyIds?: string[];\n  /** @format GUID */\n  staffId?: string | null;\n  locationRestriction?: LocationRestriction;\n}\n\nexport interface UpdateSiteInviteResponse {}\n\nexport interface GetContributorLimitRequest {}\n\nexport interface GetContributorLimitResponse {\n  contributorLimitation?: ContributorLimitation;\n}\n\nexport interface ContributorLimitation {\n  contributorLimit?: number;\n  leftInvites?: number;\n}\n\nexport interface ParseSiteInviteTokenRequest {\n  inviteToken?: string;\n}\n\nexport interface ParseSiteInviteTokenResponse {\n  inviteId?: string;\n  siteId?: string;\n  status?: InviteStatusWithLiterals;\n}\n\n/**\n * Creates and sends emails inviting potential site contributors to become contributors in the requesting site.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n * @param policyIds - Role IDs, referred to as policy IDs, to assign to the contributors.\n * @public\n * @requiredField options.emails\n * @requiredField policyIds\n * @param options - Filter options. The `emails` field **must** be passed.\n * @permissionId site-users.send-invite\n * @applicableIdentity APP\n * @fqn com.wixpress.invites.api.SiteInvitesApi.BulkInvite\n */\nexport async function bulkInvite(\n  policyIds: string[],\n  options?: NonNullablePaths<BulkInviteOptions, `emails`, 2>\n): Promise<\n  NonNullablePaths<\n    BulkSiteInviteResponse,\n    | `invites`\n    | `invites.${number}._id`\n    | `invites.${number}.siteId`\n    | `invites.${number}.email`\n    | `invites.${number}.inviterId`\n    | `invites.${number}.status`\n    | `invites.${number}.acceptLink`\n    | `invites.${number}.inviterAccountId`\n    | `failedEmails`,\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    policyIds: policyIds,\n    emails: options?.emails,\n    invitePurpose: options?.invitePurpose,\n    defaultEmailLanguage: options?.defaultEmailLanguage,\n    locationRestriction: options?.locationRestriction,\n  });\n\n  const reqOpts = ambassadorWixIdentityInvitesV1SiteInvite.bulkInvite(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          policyIds: '$[0]',\n          emails: '$[1].emails',\n          invitePurpose: '$[1].invitePurpose',\n          defaultEmailLanguage: '$[1].defaultEmailLanguage',\n          locationRestriction: '$[1].locationRestriction',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['policyIds', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface BulkInviteOptions {\n  /**\n   * Email addresses to which the invites should be sent.\n   * @minSize 1\n   * @maxSize 10\n   */\n  emails: string[];\n  /** Details explaining the purpose of the invite. */\n  invitePurpose?: string | null;\n  /** Language of emails to send. Relevant only for recipients that don't currently have a Wix user ID. Default: Site owner's language. */\n  defaultEmailLanguage?: string | null;\n  /** Location restriction for the invite. */\n  locationRestriction?: LocationRestriction;\n}\n\n/**\n * Resends the email invitation to a potential site contributor.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n * @param inviteId - Invite ID.\n * @public\n * @requiredField inviteId\n * @param options - Filter options.\n * @permissionId site-users.send-invite\n * @applicableIdentity APP\n * @fqn com.wixpress.invites.api.SiteInvitesApi.ResendInvite\n */\nexport async function resendInvite(\n  inviteId: string,\n  options?: ResendInviteOptions\n): Promise<\n  NonNullablePaths<\n    SiteInviteResponse,\n    | `invite._id`\n    | `invite.siteId`\n    | `invite.email`\n    | `invite.policyIds`\n    | `invite.inviterId`\n    | `invite.status`\n    | `invite.acceptLink`\n    | `invite.inviterAccountId`\n    | `invite.locationIds`\n    | `invite.callerCapabilities`,\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    inviteId: inviteId,\n    defaultEmailLanguage: options?.defaultEmailLanguage,\n  });\n\n  const reqOpts =\n    ambassadorWixIdentityInvitesV1SiteInvite.resendInvite(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          inviteId: '$[0]',\n          defaultEmailLanguage: '$[1].defaultEmailLanguage',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['inviteId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ResendInviteOptions {\n  /** Language of emails to send. Relevant only for recipients that don't currently have a Wix user ID. Default: Site owner's language. */\n  defaultEmailLanguage?: string | null;\n}\n\n/**\n * Revokes a pending site contributor invite.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n * @param inviteId - Invite ID.\n * @public\n * @requiredField inviteId\n * @permissionId site-users.delete-invite\n * @applicableIdentity APP\n * @fqn com.wixpress.invites.api.SiteInvitesApi.RevokeInvite\n */\nexport async function revokeInvite(inviteId: string): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ inviteId: inviteId });\n\n  const reqOpts =\n    ambassadorWixIdentityInvitesV1SiteInvite.revokeInvite(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: { inviteId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['inviteId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { 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 resolveComWixpressInvitesApiSiteInvitesApiUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n    ],\n    'api._api_base_domain_': [\n      {\n        srcPath: '/invites-web',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n      {\n        srcPath: '/invites',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/invites/invites/site',\n        destPath: '/invites/site',\n      },\n      {\n        srcPath: '/invites/invites/account',\n        destPath: '/invites/account',\n      },\n      {\n        srcPath: '/invites',\n        destPath: '',\n      },\n      {\n        srcPath: '/invites/site-invite',\n        destPath: '/site-invite',\n      },\n      {\n        srcPath: '/invites/account-invite',\n        destPath: '/account-invite',\n      },\n    ],\n    'dev._base_domain_': [\n      {\n        srcPath: '/_api/invites-web',\n        destPath: '',\n      },\n    ],\n    'platform.rise.ai': [\n      {\n        srcPath: '/invites/site',\n        destPath: '/invites/site',\n      },\n      {\n        srcPath: '/site-invite',\n        destPath: '/site-invite',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_user-management_site-invites';\n\n/**\n * Creates and sends emails inviting potential site contributors to become contributors in the requesting site.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n */\nexport function bulkInvite(payload: object): RequestOptionsFactory<any> {\n  function __bulkInvite({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.invites.v1.site_invite',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.invites.api.SiteInvitesApi.BulkInvite',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressInvitesApiSiteInvitesApiUrl({\n        protoPath: '/site-invite/bulk',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'invites.dateCreated' },\n              { path: 'invites.expirationDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __bulkInvite;\n}\n\n/**\n * Resends the email invitation to a potential site contributor.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n */\nexport function resendInvite(payload: object): RequestOptionsFactory<any> {\n  function __resendInvite({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.invites.v1.site_invite',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.invites.api.SiteInvitesApi.ResendInvite',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressInvitesApiSiteInvitesApiUrl({\n        protoPath: '/site-invite/{inviteId}/resend',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'invite.dateCreated' },\n              { path: 'invite.expirationDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __resendInvite;\n}\n\n/**\n * Revokes a pending site contributor invite.\n * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n */\nexport function revokeInvite(payload: object): RequestOptionsFactory<any> {\n  function __revokeInvite({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.identity.invites.v1.site_invite',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.invites.api.SiteInvitesApi.RevokeInvite',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressInvitesApiSiteInvitesApiUrl({\n        protoPath: '/site-invite/{inviteId}/revoke',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __revokeInvite;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  BulkInviteOptions,\n  BulkSiteInviteResponse,\n  ResendInviteOptions,\n  SiteInviteResponse,\n  bulkInvite as universalBulkInvite,\n  resendInvite as universalResendInvite,\n  revokeInvite as universalRevokeInvite,\n} from './identity-invites-v1-site-invite-site-invites.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/user-management' };\n\nexport function bulkInvite(httpClient: HttpClient): BulkInviteSignature {\n  return (\n    policyIds: string[],\n    options?: NonNullablePaths<BulkInviteOptions, `emails`, 2>\n  ) =>\n    universalBulkInvite(\n      policyIds,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface BulkInviteSignature {\n  /**\n   * Creates and sends emails inviting potential site contributors to become contributors in the requesting site.\n   * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n   * @param - Role IDs, referred to as policy IDs, to assign to the contributors.\n   * @param - Filter options. The `emails` field **must** be passed.\n   */\n  (\n    policyIds: string[],\n    options?: NonNullablePaths<BulkInviteOptions, `emails`, 2>\n  ): Promise<\n    NonNullablePaths<\n      BulkSiteInviteResponse,\n      | `invites`\n      | `invites.${number}._id`\n      | `invites.${number}.siteId`\n      | `invites.${number}.email`\n      | `invites.${number}.inviterId`\n      | `invites.${number}.status`\n      | `invites.${number}.acceptLink`\n      | `invites.${number}.inviterAccountId`\n      | `failedEmails`,\n      4\n    >\n  >;\n}\n\nexport function resendInvite(httpClient: HttpClient): ResendInviteSignature {\n  return (inviteId: string, options?: ResendInviteOptions) =>\n    universalResendInvite(\n      inviteId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ResendInviteSignature {\n  /**\n   * Resends the email invitation to a potential site contributor.\n   * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n   * @param - Invite ID.\n   * @param - Filter options.\n   */\n  (inviteId: string, options?: ResendInviteOptions): Promise<\n    NonNullablePaths<\n      SiteInviteResponse,\n      | `invite._id`\n      | `invite.siteId`\n      | `invite.email`\n      | `invite.policyIds`\n      | `invite.inviterId`\n      | `invite.status`\n      | `invite.acceptLink`\n      | `invite.inviterAccountId`\n      | `invite.locationIds`\n      | `invite.callerCapabilities`,\n      3\n    >\n  >;\n}\n\nexport function revokeInvite(httpClient: HttpClient): RevokeInviteSignature {\n  return (inviteId: string) =>\n    universalRevokeInvite(\n      inviteId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface RevokeInviteSignature {\n  /**\n   * Revokes a pending site contributor invite.\n   * > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.\n   * @param - Invite ID.\n   */\n  (inviteId: string): Promise<void>;\n}\n\nexport {\n  AcceptSiteInviteRequest,\n  AcceptSiteInviteResponse,\n  BulkInviteOptions,\n  BulkSiteInviteRequest,\n  BulkSiteInviteResponse,\n  ContributorLimitation,\n  CursorPaging,\n  GetContributorLimitRequest,\n  GetContributorLimitResponse,\n  GetSiteInviteRequest,\n  GetSiteInviteResponse,\n  GetSiteInvitesRequest,\n  GetSiteInvitesResponse,\n  InviteStatus,\n  LocationRestriction,\n  Paging,\n  ParseSiteInviteTokenRequest,\n  ParseSiteInviteTokenResponse,\n  QuerySiteInvitesRequest,\n  QuerySiteInvitesResponse,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  ResendInviteOptions,\n  ResendSiteInviteRequest,\n  RevokeSiteInviteRequest,\n  RevokeSiteInviteResponse,\n  SiteInvite,\n  SiteInviteRequest,\n  SiteInviteResponse,\n  SortOrder,\n  Sorting,\n  UpdateSiteInviteRequest,\n  UpdateSiteInviteResponse,\n} from './identity-invites-v1-site-invite-site-invites.universal.js';\n","import {\n  bulkInvite as publicBulkInvite,\n  resendInvite as publicResendInvite,\n  revokeInvite as publicRevokeInvite,\n} from './identity-invites-v1-site-invite-site-invites.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const bulkInvite: MaybeContext<\n  BuildRESTFunction<typeof publicBulkInvite> & typeof publicBulkInvite\n> = /*#__PURE__*/ createRESTModule(publicBulkInvite);\nexport const resendInvite: MaybeContext<\n  BuildRESTFunction<typeof publicResendInvite> & typeof publicResendInvite\n> = /*#__PURE__*/ createRESTModule(publicResendInvite);\nexport const revokeInvite: MaybeContext<\n  BuildRESTFunction<typeof publicRevokeInvite> & typeof publicRevokeInvite\n> = /*#__PURE__*/ createRESTModule(publicRevokeInvite);\n\nexport {\n  InviteStatus,\n  SortOrder,\n} from './identity-invites-v1-site-invite-site-invites.universal.js';\nexport {\n  SiteInvite,\n  GetSiteInvitesRequest,\n  GetSiteInvitesResponse,\n  QuerySiteInvitesRequest,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  Sorting,\n  Paging,\n  CursorPaging,\n  QuerySiteInvitesResponse,\n  GetSiteInviteRequest,\n  GetSiteInviteResponse,\n  SiteInviteRequest,\n  LocationRestriction,\n  SiteInviteResponse,\n  BulkSiteInviteRequest,\n  BulkSiteInviteResponse,\n  ResendSiteInviteRequest,\n  AcceptSiteInviteRequest,\n  AcceptSiteInviteResponse,\n  RevokeSiteInviteRequest,\n  RevokeSiteInviteResponse,\n  UpdateSiteInviteRequest,\n  UpdateSiteInviteResponse,\n  GetContributorLimitRequest,\n  GetContributorLimitResponse,\n  ContributorLimitation,\n  ParseSiteInviteTokenRequest,\n  ParseSiteInviteTokenResponse,\n  BulkInviteOptions,\n  ResendInviteOptions,\n} from './identity-invites-v1-site-invite-site-invites.universal.js';\nexport {\n  InviteStatusWithLiterals,\n  SortOrderWithLiterals,\n} from './identity-invites-v1-site-invite-site-invites.universal.js';\n"]}