{"version":3,"sources":["../../src/site-list-v2-site-sites.public.ts","../../src/site-list-v2-site-sites.universal.ts","../../src/site-list-v2-site-sites.http.ts","../../src/site-list-v2-site-sites.context.ts"],"sourcesContent":["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  CountSitesApplicationErrors,\n  CountSitesOptions,\n  CountSitesResponse,\n  QuerySitesApplicationErrors,\n  QuerySitesResponse,\n  SiteCreatedEnvelope,\n  SiteDeletedEnvelope,\n  SiteQuery,\n  SiteUpdatedEnvelope,\n  SitesQueryBuilder,\n  countSites as universalCountSites,\n  querySites as universalQuerySites,\n  typedQuerySites as universalTypedQuerySites,\n} from './site-list-v2-site-sites.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/sites' };\n\nexport function querySites(httpClient: HttpClient): QuerySitesSignature {\n  return () =>\n    universalQuerySites(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QuerySitesSignature {\n  /**\n   * Retrieves a list of up to 100 sites per request, given the provided paging, sorting and filtering.\n   *\n   * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n   */\n  (): SitesQueryBuilder;\n}\n\nexport function typedQuerySites(\n  httpClient: HttpClient\n): TypedQuerySitesSignature {\n  return (query: SiteQuery) =>\n    universalTypedQuerySites(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQuerySitesSignature {\n  /** */\n  (query: SiteQuery): Promise<\n    NonNullablePaths<\n      QuerySitesResponse,\n      | `sites`\n      | `sites.${number}._id`\n      | `sites.${number}.name`\n      | `sites.${number}.displayName`\n      | `sites.${number}.published`\n      | `sites.${number}.premium`\n      | `sites.${number}.viewUrl`\n      | `sites.${number}.editUrl`\n      | `sites.${number}.thumbnail`\n      | `sites.${number}.ownerAccountId`\n      | `sites.${number}.editorType`\n      | `sites.${number}.blocked`\n      | `sites.${number}.namespace`\n      | `sites.${number}.domainConnected`,\n      4\n    > & {\n      __applicationErrorsType?: QuerySitesApplicationErrors;\n    }\n  >;\n}\n\nexport function countSites(httpClient: HttpClient): CountSitesSignature {\n  return (options?: CountSitesOptions) =>\n    universalCountSites(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CountSitesSignature {\n  /**\n   * Retrieves the number of sites, given the provided filtering.\n   * See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\n   *\n   * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n   */\n  (options?: CountSitesOptions): Promise<\n    NonNullablePaths<CountSitesResponse, `count`, 2> & {\n      __applicationErrorsType?: CountSitesApplicationErrors;\n    }\n  >;\n}\n\nexport const onSiteCreated = EventDefinition(\n  'wix.site_list.v2.site_created',\n  true,\n  (event: SiteCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'entity.trashedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<SiteCreatedEnvelope>();\nexport const onSiteDeleted = EventDefinition(\n  'wix.site_list.v2.site_deleted',\n  true,\n  (event: SiteDeletedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'undefined.createdDate' },\n            { path: 'undefined.updatedDate' },\n            { path: 'undefined.trashedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<SiteDeletedEnvelope>();\nexport const onSiteUpdated = EventDefinition(\n  'wix.site_list.v2.site_updated',\n  true,\n  (event: SiteUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'entity.trashedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<SiteUpdatedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  BaseEventMetadata,\n  CountSitesOptions,\n  CountSitesRequest,\n  CountSitesResponse,\n  CursorPaging,\n  Cursors,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EditorType,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  MessageEnvelope,\n  Namespace,\n  PagingMetadataV2,\n  QuerySitesRequest,\n  QuerySitesResponse,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  RestoreInfo,\n  Site,\n  SiteCreatedEnvelope,\n  SiteDeletedEnvelope,\n  SiteQuerySpec,\n  SiteUpdatedEnvelope,\n  SitesQueryBuilder,\n  SitesQueryResult,\n  SortOrder,\n  Sorting,\n  WebhookIdentityType,\n  utils,\n} from './site-list-v2-site-sites.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n  HttpClient,\n  HttpResponse,\n  NonNullablePaths,\n  QuerySpec,\n  Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixSiteListV2Site from './site-list-v2-site-sites.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface Site {\n  /**\n   * Site ID.\n   * @format GUID\n   */\n  _id?: string;\n  /**\n   * HTML app ID for the site.\n   * @format GUID\n   */\n  htmlAppId?: string | null;\n  /** Site name. Used in the site's URL. */\n  name?: string;\n  /** Site display name. Used for display purposes, such as in the browser's tab name. */\n  displayName?: string;\n  /** Site creation date. */\n  _createdDate?: Date | null;\n  /** Site updated date. */\n  _updatedDate?: Date | null;\n  /** Site trashed date. */\n  trashedDate?: Date | null;\n  /** Whether the site is published. */\n  published?: boolean;\n  /** Whether the site has a Wix Premium (paid) plan. */\n  premium?: boolean;\n  /** Live site URL. */\n  viewUrl?: string;\n  /** Editor site URL. */\n  editUrl?: string;\n  /** Site thumbnail. */\n  thumbnail?: string;\n  /**\n   * Site owner's account ID.\n   * @format GUID\n   */\n  ownerAccountId?: string;\n  /**\n   * Site contributors' account IDs.\n   * @format GUID\n   * @minSize 1\n   * @maxSize 1000\n   */\n  contributorAccountIds?: string[];\n  /** Site's Wix editor type. */\n  editorType?: EditorTypeWithLiterals;\n  /** Whether Wix has blocked this site due to legal issues. */\n  blocked?: boolean;\n  /**\n   * Folder ID that contains this site. Empty if site is at root level.\n   * @format GUID\n   */\n  folderId?: string | null;\n  /** Namespace of the site, for internal use. */\n  namespace?: NamespaceWithLiterals;\n  /** Whether the site has a connected domain. */\n  domainConnected?: boolean;\n}\n\nexport enum EditorType {\n  UNKNOWN = 'UNKNOWN',\n  EDITOR = 'EDITOR',\n  ADI = 'ADI',\n  EDITORX = 'EDITORX',\n  STUDIO = 'STUDIO',\n  ODEDITOR = 'ODEDITOR',\n  PICASSO = 'PICASSO',\n  WIXEL = 'WIXEL',\n  STUDIO_TWO = 'STUDIO_TWO',\n  EDITORLESS = 'EDITORLESS',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n  | EditorType\n  | 'UNKNOWN'\n  | 'EDITOR'\n  | 'ADI'\n  | 'EDITORX'\n  | 'STUDIO'\n  | 'ODEDITOR'\n  | 'PICASSO'\n  | 'WIXEL'\n  | 'STUDIO_TWO'\n  | 'EDITORLESS';\n\nexport enum Namespace {\n  UNKNOWN_NAMESPACE = 'UNKNOWN_NAMESPACE',\n  /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */\n  WIX = 'WIX',\n  /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  SHOUT_OUT = 'SHOUT_OUT',\n  /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  ALBUMS = 'ALBUMS',\n  /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  WIX_STORES_TEST_DRIVE = 'WIX_STORES_TEST_DRIVE',\n  /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  HOTELS = 'HOTELS',\n  /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  CLUBS = 'CLUBS',\n  /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  ONBOARDING_DRAFT = 'ONBOARDING_DRAFT',\n  /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  DEV_SITE = 'DEV_SITE',\n  /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  LOGOS = 'LOGOS',\n  /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  VIDEO_MAKER = 'VIDEO_MAKER',\n  /** MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  PARTNER_DASHBOARD = 'PARTNER_DASHBOARD',\n  /** MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  DEV_CENTER_COMPANY = 'DEV_CENTER_COMPANY',\n  /**\n   * A draft created by HTML editor on open. Upon \"first save\" it will be moved to be of WIX domain.\n   *\n   * Meta site with this namespace will *not* be shown in a user's site list by default.\n   */\n  HTML_DRAFT = 'HTML_DRAFT',\n  /**\n   * the user-journey for Fitness users who want to start from managing their business instead of designing their website.\n   * Will be accessible from Site List and will not have a website app.\n   * Once the user attaches a site, the site will become a regular wixsite.\n   */\n  SITELESS_BUSINESS = 'SITELESS_BUSINESS',\n  /** Belongs to \"strategic products\" company. Supports new product in the creator's economy space. */\n  CREATOR_ECONOMY = 'CREATOR_ECONOMY',\n  /** It is to be used in the Business First efforts. */\n  DASHBOARD_FIRST = 'DASHBOARD_FIRST',\n  /** Bookings business flow with no site. */\n  ANYWHERE = 'ANYWHERE',\n  /** Namespace for Headless Backoffice with no editor */\n  HEADLESS = 'HEADLESS',\n  /**\n   * Namespace for master site that will exist in parent account that will be referenced by subaccounts\n   * The site will be used for account level CSM feature for enterprise\n   */\n  ACCOUNT_MASTER_CMS = 'ACCOUNT_MASTER_CMS',\n  /** Rise.ai Siteless account management for Gift Cards and Store Credit. */\n  RISE = 'RISE',\n  /**\n   * As part of the branded app new funnel, users now can create a meta site that will be branded app first.\n   * There's a blank site behind the scene but it's blank).\n   * The Mobile company will be the owner of this namespace.\n   */\n  BRANDED_FIRST = 'BRANDED_FIRST',\n  /** Nownia.com Siteless account management for Ai Scheduling Assistant. */\n  NOWNIA = 'NOWNIA',\n  /**\n   * UGC Templates are templates that are created by users for personal use and to sale to other users.\n   * The Partners company owns this namespace.\n   */\n  UGC_TEMPLATE = 'UGC_TEMPLATE',\n  /** Codux Headless Sites */\n  CODUX = 'CODUX',\n  /** Bobb - AI Design Creator. */\n  MEDIA_DESIGN_CREATOR = 'MEDIA_DESIGN_CREATOR',\n  /**\n   * Shared Blog Site is a unique single site across Enterprise account,\n   * This site will hold all Blog posts related to the Marketing product.\n   */\n  SHARED_BLOG_ENTERPRISE = 'SHARED_BLOG_ENTERPRISE',\n  /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  STANDALONE_FORMS = 'STANDALONE_FORMS',\n  /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */\n  STANDALONE_EVENTS = 'STANDALONE_EVENTS',\n  /** MIMIR - Siteless account for MIMIR Ai Job runner. */\n  MIMIR = 'MIMIR',\n  /** Wix Twins platform. */\n  TWINS = 'TWINS',\n  /** Wix Nano. */\n  NANO = 'NANO',\n  /** Base44 headless sites. */\n  BASE44 = 'BASE44',\n  /** Wix Channels Sites */\n  CHANNELS = 'CHANNELS',\n}\n\n/** @enumType */\nexport type NamespaceWithLiterals =\n  | Namespace\n  | 'UNKNOWN_NAMESPACE'\n  | 'WIX'\n  | 'SHOUT_OUT'\n  | 'ALBUMS'\n  | 'WIX_STORES_TEST_DRIVE'\n  | 'HOTELS'\n  | 'CLUBS'\n  | 'ONBOARDING_DRAFT'\n  | 'DEV_SITE'\n  | 'LOGOS'\n  | 'VIDEO_MAKER'\n  | 'PARTNER_DASHBOARD'\n  | 'DEV_CENTER_COMPANY'\n  | 'HTML_DRAFT'\n  | 'SITELESS_BUSINESS'\n  | 'CREATOR_ECONOMY'\n  | 'DASHBOARD_FIRST'\n  | 'ANYWHERE'\n  | 'HEADLESS'\n  | 'ACCOUNT_MASTER_CMS'\n  | 'RISE'\n  | 'BRANDED_FIRST'\n  | 'NOWNIA'\n  | 'UGC_TEMPLATE'\n  | 'CODUX'\n  | 'MEDIA_DESIGN_CREATOR'\n  | 'SHARED_BLOG_ENTERPRISE'\n  | 'STANDALONE_FORMS'\n  | 'STANDALONE_EVENTS'\n  | 'MIMIR'\n  | 'TWINS'\n  | 'NANO'\n  | 'BASE44'\n  | 'CHANNELS';\n\nexport interface QuerySitesRequest {\n  /**\n   * Filter and sorting with the following format:\n   * `\"filter\" : { \"displayName\": \"my-site\" }`\n   */\n  query?: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n  /**\n   * Paging options to limit and offset the number of items.\n   * wix.common.Paging paging = 3;\n   * Cursor token pointing to a page of results. Used in all calls following the first request.\n   */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object with the following format:\n   * `\"filter\" : {\n   * \"displayName\": \"my-site\",\n   * \"namespace\":{\"$in\":[\"value1\", \"value2\"]},\n   * \"folderId\": {\"$exists\": false}\n   * }`\n   * Example of operators: `$in`, `$hasSome`, `$hasAll`, `$exists`\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object with the following format:\n   * `[{\"fieldName\":\"displayName\",\"order\":\"ASC\"},{\"fieldName\":\"createdDate\",\"order\":\"DESC\"}]`\n   * @maxSize 4\n   */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n  /**\n   * Paging options to limit and offset the number of items.\n   * wix.common.Paging paging = 3;\n   * Cursor token pointing to a page of results. Used in all calls following the first request.\n   */\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 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 QuerySitesResponse {\n  /** List of retrieved sites. */\n  sites?: Site[];\n  /**\n   * Paging information.\n   * @deprecated\n   */\n  cursorPaging?: CursorPaging;\n  /** Meta data about the returned sites */\n  metadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Cursors to navigate through the result pages. Returned if cursor paging is used. */\n  cursors?: Cursors;\n}\n\nexport interface Cursors {\n  /** Cursor pointing to next page in the list of results. */\n  next?: string | null;\n}\n\nexport interface CountSitesRequest {\n  /**\n   * Filter object. See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\n   * Note: the `premium` and `appIds` filters are not supported in this endpoint.\n   */\n  filter?: Record<string, any> | null;\n}\n\nexport interface CountSitesResponse {\n  /**\n   * Number of sites retrieved basd on the filter.\n   * Free Wix accounts are limited to max 1,000 sites.\n   * Premium accounts can have an unlimited number of sites.\n   */\n  count?: number;\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?: AccountInfo;\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 AccountInfo {\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\n/** @docsIgnore */\nexport type QuerySitesApplicationErrors = {\n  code?: 'unauthenticated_user';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type CountSitesApplicationErrors = {\n  code?: 'unauthenticated_user';\n  description?: string;\n  data?: Record<string, any>;\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?: AccountInfo;\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 SiteCreatedEnvelope {\n  entity: Site;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a site is created.\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.ACC-DC-OS.READ-SITE\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.CX-OS.VIEW-SITES\n * @permissionId SITE_LIST.READ\n * @webhook\n * @eventType wix.site_list.v2.site_created\n * @serviceIdentifier com.wixpress.sitelist.api.SiteListServiceV2\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onSiteCreated(\n  handler: (event: SiteCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface SiteDeletedEnvelope {\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a site is deleted.\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.ACC-DC-OS.READ-SITE\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.CX-OS.VIEW-SITES\n * @permissionId SITE_LIST.READ\n * @webhook\n * @eventType wix.site_list.v2.site_deleted\n * @serviceIdentifier com.wixpress.sitelist.api.SiteListServiceV2\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onSiteDeleted(\n  handler: (event: SiteDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface SiteUpdatedEnvelope {\n  entity: Site;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when a site is updated.\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.ACC-DC-OS.READ-SITE\n * @permissionScope Read Site Data\n * @permissionScopeId SCOPE.CX-OS.VIEW-SITES\n * @permissionId SITE_LIST.READ\n * @webhook\n * @eventType wix.site_list.v2.site_updated\n * @serviceIdentifier com.wixpress.sitelist.api.SiteListServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onSiteUpdated(\n  handler: (event: SiteUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves a list of up to 100 sites per request, given the provided paging, sorting and filtering.\n *\n * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n * @public\n * @permissionId SITE_LIST.READ\n * @applicableIdentity APP\n * @fqn com.wixpress.sitelist.api.SiteListServiceV2.QuerySites\n */\nexport function querySites(): SitesQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<Site, 'CURSOR', QuerySitesRequest, QuerySitesResponse>({\n    func: async (payload: QuerySitesRequest) => {\n      const reqOpts = ambassadorWixSiteListV2Site.querySites(payload);\n\n      sideEffects?.onSiteCall?.();\n      try {\n        const result = await httpClient.request(reqOpts);\n        sideEffects?.onSuccess?.(result);\n        return result;\n      } catch (err) {\n        sideEffects?.onError?.(err);\n        throw err;\n      }\n    },\n    requestTransformer: (query: QuerySitesRequest['query']) => {\n      const args = [query, {}] as [QuerySitesRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({ data }: HttpResponse<QuerySitesResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.sites,\n        pagingMetadata: transformedData?.metadata,\n      };\n    },\n    errorTransformer: (err: unknown) => {\n      const transformedError = sdkTransformError(err, {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      });\n\n      throw transformedError;\n    },\n    pagingMethod: 'CURSOR',\n    transformationPaths: {},\n  });\n}\n\ninterface QueryCursorResult {\n  cursors: Cursors;\n  hasNext: () => boolean;\n  hasPrev: () => boolean;\n  length: number;\n  pageSize: number;\n}\n\nexport interface SitesQueryResult extends QueryCursorResult {\n  items: Site[];\n  query: SitesQueryBuilder;\n  next: () => Promise<SitesQueryResult>;\n  prev: () => Promise<SitesQueryResult>;\n}\n\nexport interface SitesQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  eq: (\n    propertyName:\n      | '_id'\n      | 'name'\n      | 'published'\n      | 'premium'\n      | 'editorType'\n      | 'folderId'\n      | 'namespace'\n      | 'domainConnected',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ne: (\n    propertyName:\n      | '_id'\n      | 'name'\n      | 'published'\n      | 'premium'\n      | 'editorType'\n      | 'folderId'\n      | 'namespace'\n      | 'domainConnected',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  ge: (\n    propertyName: '_id' | 'name' | 'folderId',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  gt: (\n    propertyName: '_id' | 'name' | 'folderId',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  le: (\n    propertyName: '_id' | 'name' | 'folderId',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   */\n  lt: (\n    propertyName: '_id' | 'name' | 'folderId',\n    value: any\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `string`.\n   * @param string - String to compare against. Case-insensitive.\n   */\n  startsWith: (\n    propertyName: '_id' | 'name' | 'folderId',\n    value: string\n  ) => SitesQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `values`.\n   * @param values - List of values to compare against.\n   */\n  hasSome: (\n    propertyName:\n      | '_id'\n      | 'name'\n      | 'published'\n      | 'premium'\n      | 'editorType'\n      | 'folderId'\n      | 'namespace'\n      | 'domainConnected',\n    value: any[]\n  ) => SitesQueryBuilder;\n  in: (\n    propertyName:\n      | '_id'\n      | 'name'\n      | 'published'\n      | 'premium'\n      | 'editorType'\n      | 'folderId'\n      | 'namespace'\n      | 'domainConnected',\n    value: any\n  ) => SitesQueryBuilder;\n  exists: (\n    propertyName:\n      | '_id'\n      | 'name'\n      | 'published'\n      | 'premium'\n      | 'editorType'\n      | 'folderId'\n      | 'namespace'\n      | 'domainConnected',\n    value: boolean\n  ) => SitesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  ascending: (\n    ...propertyNames: Array<\n      'displayName' | '_createdDate' | '_updatedDate' | 'trashedDate'\n    >\n  ) => SitesQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n  descending: (\n    ...propertyNames: Array<\n      'displayName' | '_createdDate' | '_updatedDate' | 'trashedDate'\n    >\n  ) => SitesQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n  limit: (limit: number) => SitesQueryBuilder;\n  /** @param cursor - A pointer to specific record */\n  skipTo: (cursor: string) => SitesQueryBuilder;\n  find: () => Promise<SitesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn com.wixpress.sitelist.api.SiteListServiceV2.QuerySites\n * @requiredField query\n */\nexport async function typedQuerySites(query: SiteQuery): Promise<\n  NonNullablePaths<\n    QuerySitesResponse,\n    | `sites`\n    | `sites.${number}._id`\n    | `sites.${number}.name`\n    | `sites.${number}.displayName`\n    | `sites.${number}.published`\n    | `sites.${number}.premium`\n    | `sites.${number}.viewUrl`\n    | `sites.${number}.editUrl`\n    | `sites.${number}.thumbnail`\n    | `sites.${number}.ownerAccountId`\n    | `sites.${number}.editorType`\n    | `sites.${number}.blocked`\n    | `sites.${number}.namespace`\n    | `sites.${number}.domainConnected`,\n    4\n  > & {\n    __applicationErrorsType?: QuerySitesApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n  const reqOpts = ambassadorWixSiteListV2Site.querySites(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: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['query']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface SiteQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: [\n        '_id',\n        'domainConnected',\n        'editorType',\n        'folderId',\n        'name',\n        'namespace',\n        'premium',\n        'published'\n      ];\n      operators: '*';\n      sort: 'NONE';\n    },\n    {\n      fields: ['_createdDate', '_updatedDate', 'displayName', 'trashedDate'];\n      operators: [];\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Site, SiteQuerySpec>;\nexport type SiteQuery = {\n  /** \n  Paging options to limit and offset the number of items.\n  wix.common.Paging paging = 3;\n  Cursor token pointing to a page of results. Used in all calls following the first request.  \n  */\n  cursorPaging?: {\n    /** \n  Maximum number of items to return in the results. \n  @max: 100 \n  */\n    limit?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n      | 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?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n      | null;\n  };\n  /** \n  Filter object with the following format:\n  `\"filter\" : {\n  \"displayName\": \"my-site\",\n  \"namespace\":{\"$in\":[\"value1\", \"value2\"]},\n  \"folderId\": {\"$exists\": false}\n  }`\n  Example of operators: `$in`, `$hasSome`, `$hasAll`, `$exists`  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object with the following format:\n  `[{\"fieldName\":\"displayName\",\"order\":\"ASC\"},{\"fieldName\":\"createdDate\",\"order\":\"DESC\"}]` \n  @maxSize: 4 \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 512 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order.  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n  }[];\n};\n\nexport const utils = {\n  query: {\n    ...createQueryUtils<Site, SiteQuerySpec, SiteQuery>(),\n  },\n};\n\n/**\n * Retrieves the number of sites, given the provided filtering.\n * See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\n *\n * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n * @public\n * @permissionId SITE_LIST.READ\n * @applicableIdentity APP\n * @fqn com.wixpress.sitelist.api.SiteListServiceV2.CountSites\n */\nexport async function countSites(options?: CountSitesOptions): Promise<\n  NonNullablePaths<CountSitesResponse, `count`, 2> & {\n    __applicationErrorsType?: CountSitesApplicationErrors;\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    filter: options?.filter,\n  });\n\n  const reqOpts = ambassadorWixSiteListV2Site.countSites(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: { filter: '$[0].filter' },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface CountSitesOptions {\n  /**\n   * Filter object. See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\n   * Note: the `premium` and `appIds` filters are not supported in this endpoint.\n   */\n  filter?: Record<string, any> | null;\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 resolveComWixpressSitelistApiSiteListServiceV2Url(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/sites-list',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'feedback._base_domain_': [\n      {\n        srcPath: '/_api/sites-list',\n        destPath: '/api',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/sites-list',\n        destPath: '/api',\n      },\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n      {\n        srcPath: '/_api/sites-list-data',\n        destPath: '/api/sites-list-data',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/site-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'api._api_base_domain_': [\n      {\n        srcPath: '/sites-list',\n        destPath: '',\n      },\n    ],\n    'bo._base_domain_': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'dev._base_domain_': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'online.codux.com': [\n      {\n        srcPath: '/_api/sites-list',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/sites-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/site-list/v2/sites',\n        destPath: '/v2/sites',\n      },\n    ],\n    'vibe._base_domain_': [\n      {\n        srcPath: '/_api/sites-list',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_sites_sites';\n\n/**\n * Retrieves a list of up to 100 sites per request, given the provided paging, sorting and filtering.\n *\n * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n */\nexport function querySites(payload: object): RequestOptionsFactory<any> {\n  function __querySites({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.site_list.v2.site',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.sitelist.api.SiteListServiceV2.QuerySites',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressSitelistApiSiteListServiceV2Url({\n        protoPath: '/v2/sites/query',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'sites.createdDate' },\n              { path: 'sites.updatedDate' },\n              { path: 'sites.trashedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __querySites;\n}\n\n/**\n * Retrieves the number of sites, given the provided filtering.\n * See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\n *\n * > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key.\n */\nexport function countSites(payload: object): RequestOptionsFactory<any> {\n  function __countSites({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.site_list.v2.site',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.sitelist.api.SiteListServiceV2.CountSites',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressSitelistApiSiteListServiceV2Url({\n        protoPath: '/v2/sites/count',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __countSites;\n}\n","import {\n  querySites as publicQuerySites,\n  typedQuerySites as publicTypedQuerySites,\n  countSites as publicCountSites,\n} from './site-list-v2-site-sites.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 { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n  SiteQuery,\n  SitesQueryBuilder,\n  typedQuerySites as universalTypedQuerySites,\n} from './site-list-v2-site-sites.universal.js';\nimport { onSiteCreated as publicOnSiteCreated } from './site-list-v2-site-sites.public.js';\nimport { onSiteDeleted as publicOnSiteDeleted } from './site-list-v2-site-sites.public.js';\nimport { onSiteUpdated as publicOnSiteUpdated } from './site-list-v2-site-sites.public.js';\n\nfunction customQuerySites(httpClient: HttpClient) {\n  const router = createQueryOverloadRouter({\n    builderQueryFunction: () => publicQuerySites(httpClient)(),\n    typedQueryFunction: (query: SiteQuery) =>\n      publicTypedQuerySites(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): SitesQueryBuilder;\n  function overloadedQuery(\n    query: SiteQuery\n  ): ReturnType<typeof universalTypedQuerySites>;\n  function overloadedQuery(query?: SiteQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const countSites: MaybeContext<\n  BuildRESTFunction<typeof publicCountSites> & typeof publicCountSites\n> = /*#__PURE__*/ createRESTModule(publicCountSites);\nexport const querySites: MaybeContext<\n  BuildRESTFunction<typeof customQuerySites> & typeof customQuerySites\n> = /*#__PURE__*/ createRESTModule(customQuerySites);\n/**\n * Triggered when a site is created.\n */\nexport const onSiteCreated: BuildEventDefinition<typeof publicOnSiteCreated> &\n  typeof publicOnSiteCreated = createEventModule(publicOnSiteCreated);\n/**\n * Triggered when a site is deleted.\n */\nexport const onSiteDeleted: BuildEventDefinition<typeof publicOnSiteDeleted> &\n  typeof publicOnSiteDeleted = createEventModule(publicOnSiteDeleted);\n/**\n * Triggered when a site is updated.\n */\nexport const onSiteUpdated: BuildEventDefinition<typeof publicOnSiteUpdated> &\n  typeof publicOnSiteUpdated = createEventModule(publicOnSiteUpdated);\n\nexport {\n  EditorType,\n  Namespace,\n  SortOrder,\n  WebhookIdentityType,\n} from './site-list-v2-site-sites.universal.js';\nexport {\n  Site,\n  QuerySitesRequest,\n  QueryV2,\n  QueryV2PagingMethodOneOf,\n  Sorting,\n  CursorPaging,\n  QuerySitesResponse,\n  PagingMetadataV2,\n  Cursors,\n  CountSitesRequest,\n  CountSitesResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  SiteCreatedEnvelope,\n  SiteDeletedEnvelope,\n  SiteUpdatedEnvelope,\n  SitesQueryResult,\n  SitesQueryBuilder,\n  SiteQuerySpec,\n  CountSitesOptions,\n} from './site-list-v2-site-sites.universal.js';\nexport { utils } from './site-list-v2-site-sites.universal.js';\nexport {\n  EditorTypeWithLiterals,\n  NamespaceWithLiterals,\n  SortOrderWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  QuerySitesApplicationErrors,\n  CountSitesApplicationErrors,\n  CommonQueryWithEntityContext,\n  SiteQuery,\n} from './site-list-v2-site-sites.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,kDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,q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AAA,EAC3B;AAAA,EACA;AAAA,EACA,CAAC,UACCF;AAAA,IACEC,gBAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAaC;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAuB;;;AGnJvB,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAOlC,SAAS,iCAAiC;AAU1C,SAAS,iBAAiB,YAAwB;AAChD,QAAM,SAAS,0BAA0B;AAAA,IACvC,sBAAsB,MAAMC,YAAiB,UAAU,EAAE;AAAA,IACzD,oBAAoB,CAAC,UACnBC,iBAAsB,UAAU,EAAE,KAAK;AAAA,IACzC,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAAwB;AAC/C,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,cAEK,iCAAiBA,WAAgB;AAC5C,IAAMF,cAEK,iCAAiB,gBAAgB;AAI5C,IAAMG,iBACkB,kBAAkB,aAAmB;AAI7D,IAAMC,iBACkB,kBAAkB,aAAmB;AAI7D,IAAMC,iBACkB,kBAAkB,aAAmB;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","transformPaths","EditorType","Namespace","SortOrder","WebhookIdentityType","querySites","countSites","querySites","typedQuerySites","countSites","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","querySites","typedQuerySites","countSites","onSiteCreated","onSiteDeleted","onSiteUpdated"]}