@wix/auto_sdk_crm_labels 1.0.45 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/contacts-v4-label-labels.public.ts","../../src/contacts-v4-label-labels.universal.ts","../../src/contacts-v4-label-labels.http.ts","../../src/contacts-v4-label-labels.context.ts"],"sourcesContent":["export * from './src/contacts-v4-label-labels.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 ContactLabel,\n ContactLabelQuery,\n FindOrCreateLabelApplicationErrors,\n FindOrCreateLabelOptions,\n FindOrCreateLabelResponse,\n GetLabelOptions,\n LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelUpdatedEnvelope,\n LabelsQueryBuilder,\n ListLabelsOptions,\n ListLabelsResponse,\n QueryLabelsApplicationErrors,\n QueryLabelsOptions,\n QueryLabelsResponse,\n RenameLabel,\n RenameLabelOptions,\n deleteLabel as universalDeleteLabel,\n findOrCreateLabel as universalFindOrCreateLabel,\n getLabel as universalGetLabel,\n listLabels as universalListLabels,\n queryLabels as universalQueryLabels,\n renameLabel as universalRenameLabel,\n typedQueryLabels as universalTypedQueryLabels,\n} from './contacts-v4-label-labels.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/crm' };\n\nexport function listLabels(httpClient: HttpClient): ListLabelsSignature {\n return (options?: ListLabelsOptions) =>\n universalListLabels(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListLabelsSignature {\n /**\n * Lists all contact labels for a site.\n * @returns List of labels.\n */\n (options?: ListLabelsOptions): Promise<\n NonNullablePaths<\n ListLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n >\n >;\n}\n\nexport function findOrCreateLabel(\n httpClient: HttpClient\n): FindOrCreateLabelSignature {\n return (displayName: string, options?: FindOrCreateLabelOptions) =>\n universalFindOrCreateLabel(\n displayName,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface FindOrCreateLabelSignature {\n /**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n * @param - Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @param - Language options.\n * @returns Label that was found or created.\n */\n (displayName: string, options?: FindOrCreateLabelOptions): Promise<\n NonNullablePaths<\n FindOrCreateLabelResponse,\n `label.key` | `label.displayName` | `label.labelType` | `newLabel`,\n 3\n > & {\n __applicationErrorsType?: FindOrCreateLabelApplicationErrors;\n }\n >;\n}\n\nexport function getLabel(httpClient: HttpClient): GetLabelSignature {\n return (key: string, options?: GetLabelOptions) =>\n universalGetLabel(\n key,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLabelSignature {\n /**\n * Retrieves a label by the specified label key.\n * @param - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @param - Language options.\n * @returns The specified label.\n */\n (key: string, options?: GetLabelOptions): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n >;\n}\n\nexport function renameLabel(httpClient: HttpClient): RenameLabelSignature {\n return (\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n ) =>\n universalRenameLabel(\n key,\n label,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RenameLabelSignature {\n /**\n * Renames a label.\n * @param - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @param - Language options.\n * @param - Label to rename.\n * @returns Renamed label.\n */\n (\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n ): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n >;\n}\n\nexport function deleteLabel(httpClient: HttpClient): DeleteLabelSignature {\n return (key: string) =>\n universalDeleteLabel(\n key,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteLabelSignature {\n /**\n * Deletes the specified label from a site and removes it from the contacts it applies to.\n * @param - Label key to delete.\n */\n (key: string): Promise<void>;\n}\n\nexport function queryLabels(httpClient: HttpClient): QueryLabelsSignature {\n return (options?: QueryLabelsOptions) =>\n universalQueryLabels(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryLabelsSignature {\n /**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n * @param - Language options.\n */\n (options?: QueryLabelsOptions): LabelsQueryBuilder;\n}\n\nexport function typedQueryLabels(\n httpClient: HttpClient\n): TypedQueryLabelsSignature {\n return (query: ContactLabelQuery, options?: QueryLabelsOptions) =>\n universalTypedQueryLabels(\n query,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryLabelsSignature {\n /** */\n (query: ContactLabelQuery, options?: QueryLabelsOptions): Promise<\n NonNullablePaths<\n QueryLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n > & {\n __applicationErrorsType?: QueryLabelsApplicationErrors;\n }\n >;\n}\n\nexport const onLabelCreated = EventDefinition(\n 'wix.contacts.v4.label_created',\n true,\n (event: LabelCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelCreatedEnvelope>();\nexport const onLabelDeleted = EventDefinition(\n 'wix.contacts.v4.label_deleted',\n true,\n (event: LabelDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelDeletedEnvelope>();\nexport const onLabelUpdated = EventDefinition(\n 'wix.contacts.v4.label_updated',\n true,\n (event: LabelUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n ActionEvent,\n BaseEventMetadata,\n ContactLabel,\n ContactLabelNamespace,\n ContactLabelQuerySpec,\n DeleteLabelRequest,\n DeleteLabelResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FindOrCreateLabelOptions,\n FindOrCreateLabelRequest,\n FindOrCreateLabelResponse,\n GdprListRequest,\n GdprListResponse,\n GetLabelByLegacyIdRequest,\n GetLabelByLegacyIdResponse,\n GetLabelOptions,\n GetLabelRequest,\n GetLabelResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelType,\n LabelUpdatedEnvelope,\n LabelsQueryBuilder,\n LabelsQueryResult,\n LabelsQuotaReached,\n ListLabelNamespacesRequest,\n ListLabelNamespacesResponse,\n ListLabelsOptions,\n ListLabelsRequest,\n ListLabelsResponse,\n MessageEnvelope,\n Paging,\n PagingMetadata,\n PurgeRequest,\n PurgeResponse,\n Query,\n QueryLabelsOptions,\n QueryLabelsRequest,\n QueryLabelsResponse,\n RenameLabel,\n RenameLabelOptions,\n RestoreInfo,\n SortOrder,\n Sorting,\n UpdateLabelRequest,\n UpdateLabelResponse,\n WebhookIdentityType,\n} from './contacts-v4-label-labels.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 ambassadorWixContactsV4Label from './contacts-v4-label-labels.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/** Label that was found or created. */\nexport interface ContactLabel {\n /**\n * Label namespace.\n *\n * Labels created by calling the Find Or Create Label method\n * are automatically assigned to the `custom` namespace.\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Display name for the namespace,\n * used to organize the list of labels in the site dashboard.\n * @readonly\n * @minLength 1\n * @maxLength 180\n */\n namespaceDisplayName?: string | null;\n /**\n * Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @readonly\n * @minLength 1\n * @maxLength 80\n */\n key?: string;\n /**\n * Label display name shown in the dashboard.\n * @minLength 1\n * @maxLength 180\n */\n displayName?: string;\n /**\n * Label type indicating how the label was created.\n * @readonly\n */\n labelType?: LabelTypeWithLiterals;\n /**\n * Date and time the label was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the label was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport enum LabelType {\n /** Default system label for the contact list. */\n SYSTEM = 'SYSTEM',\n /** Label created by calling the Find Or Create Label method. */\n USER_DEFINED = 'USER_DEFINED',\n /** Label created by an app built by Wix. */\n WIX_APP_DEFINED = 'WIX_APP_DEFINED',\n}\n\n/** @enumType */\nexport type LabelTypeWithLiterals =\n | LabelType\n | 'SYSTEM'\n | 'USER_DEFINED'\n | 'WIX_APP_DEFINED';\n\n/** Label filter options. */\nexport interface ListLabelsRequest {\n /** Filter for labels of the specified type. */\n labelType?: LabelTypeWithLiterals;\n /**\n * Filter for labels in the specified namespace.\n * @minLength 3\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Filter for labels where `displayName` starts with the specified case-sensitive string.\n * @minLength 1\n * @maxLength 180\n */\n startsWith?: string | null;\n /** Sorting options. */\n sort?: Sorting;\n /** Paging options. */\n paging?: Paging;\n /** @format LANGUAGE */\n language?: string | null;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 3000\n */\n fieldName?: string;\n /**\n * Sort order.\n *\n * Default: `ASC`.\n */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Sort by ascending order. */\n ASC = 'ASC',\n /** Sort by descending order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface Paging {\n /**\n * Number of items to return.\n *\n * Defaults to `1000`. <br>\n * Maximum: `2000`.\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\n/** List of labels. */\nexport interface ListLabelsResponse {\n /** List of labels. */\n labels?: ContactLabel[];\n /** Metadata for the page of results. */\n metadata?: PagingMetadata;\n}\n\nexport interface PagingMetadata {\n /** Number of items returned. */\n count?: number | null;\n /** Requested offset. */\n offset?: number | null;\n /** Number of items that matched the query. */\n total?: number | null;\n /**\n * Indicates if `total` calculation timed out before the response was sent.\n * Typically this happens if there is a large set of results.\n */\n tooManyToCount?: boolean | null;\n}\n\n/** Label to find or create. */\nexport interface FindOrCreateLabelRequest {\n /**\n * Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @minLength 1\n * @maxLength 180\n */\n displayName: string;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** Label that was found or created. */\nexport interface FindOrCreateLabelResponse {\n /** Label that was found or created. */\n label?: ContactLabel;\n /**\n * Indicates whether the label was just created or already existed.\n *\n * Returns `true` if the label was just created.\n */\n newLabel?: boolean;\n}\n\nexport interface LabelsQuotaReached {\n /** The maximum number of labels allowed for the site. */\n labelsQuota?: string | null;\n /** The current total number of labels on the site. */\n labelsCurrentTotal?: string | null;\n}\n\nexport interface ListLabelNamespacesRequest {\n /**\n * Language for localization\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface ListLabelNamespacesResponse {\n /** List of namespaces */\n namespaces?: ContactLabelNamespace[];\n}\n\nexport interface ContactLabelNamespace {\n /**\n * Namespace key\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n key?: string;\n /**\n * Namespace display name\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n displayName?: string | null;\n}\n\nexport interface GetLabelRequest {\n /**\n * Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @minLength 1\n * @maxLength 80\n */\n key: string;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** The specified label. */\nexport interface GetLabelResponse {\n /** The specified label. */\n label?: ContactLabel;\n}\n\nexport interface GetLabelByLegacyIdRequest {\n /**\n * Legacy id of the label\n * @format GUID\n */\n legacyId?: string;\n /**\n * Language for localization\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface GetLabelByLegacyIdResponse {\n /** Requested label */\n label?: ContactLabel;\n}\n\nexport interface UpdateLabelRequest {\n /** Label to rename. */\n label?: ContactLabel;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** Updated label. */\nexport interface UpdateLabelResponse {\n /** Renamed label. */\n label?: ContactLabel;\n}\n\nexport interface DeleteLabelRequest {\n /**\n * Label key to delete.\n * @minLength 1\n * @maxLength 80\n */\n key: string;\n}\n\nexport interface DeleteLabelResponse {}\n\nexport interface PurgeRequest {\n /**\n * Contacts Instance ID of the site.\n * @format GUID\n */\n instanceId?: string;\n /**\n * Labels to exclude from the purge.\n * @maxLength 80\n * @maxSize 80\n */\n exludingLabelKeys?: string[];\n}\n\nexport interface PurgeResponse {\n /** Number of deleted items */\n deletedItems?: number;\n}\n\nexport interface GdprListRequest {\n /**\n * Contacts Instance ID of the site.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface GdprListResponse {\n /** List of labels */\n labels?: ContactLabel[];\n}\n\nexport interface QueryLabelsRequest {\n /** Query options. */\n query?: Query;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface Query {\n /**\n * ilter object.\n *\n * Possible filters: `$eq`, `$gt`, `$gte`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.\n *\n * For a detailed list of supported filters, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n *\n * Example: `{ \"filter\": {\n * \"displayName\": {\n * \"$startsWith\": \"Referral\"\n * }\n * }\n * }`\n */\n filter?: Record<string, any> | null;\n /**\n * Sorting options. For a list of fields that can be sorted, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n *\n * Example: `{ \"sort\": [{\"fieldName\": \"displayName\", \"order\": \"DESC\"}] }`\n * @maxSize 100\n */\n sort?: Sorting[];\n /** Pagination options. */\n paging?: Paging;\n}\n\nexport interface QueryLabelsResponse {\n /** List of labels */\n labels?: ContactLabel[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadata;\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}\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 FindOrCreateLabelApplicationErrors = {\n code?: 'LABELS_QUOTA_REACHED';\n description?: string;\n data?: LabelsQuotaReached;\n};\n/** @docsIgnore */\nexport type QueryLabelsApplicationErrors =\n | {\n code?: 'INVALID_SORT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MALFORMED_FILTER';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_FIELD';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_OPERATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_VALUE';\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}\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}\n\nexport interface LabelCreatedEnvelope {\n entity: ContactLabel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_created\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug created\n */\nexport declare function onLabelCreated(\n handler: (event: LabelCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LabelDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is deleted.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_deleted\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug deleted\n */\nexport declare function onLabelDeleted(\n handler: (event: LabelDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LabelUpdatedEnvelope {\n entity: ContactLabel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_updated\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug updated\n */\nexport declare function onLabelUpdated(\n handler: (event: LabelUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Lists all contact labels for a site.\n * @public\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @returns List of labels.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.ListLabels\n */\nexport async function listLabels(\n options?: ListLabelsOptions\n): Promise<\n NonNullablePaths<\n ListLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\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 labelType: options?.labelType,\n namespace: options?.namespace,\n startsWith: options?.startsWith,\n sort: options?.sort,\n paging: options?.paging,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.listLabels(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 labelType: '$[0].labelType',\n namespace: '$[0].namespace',\n startsWith: '$[0].startsWith',\n sort: '$[0].sort',\n paging: '$[0].paging',\n language: '$[0].language',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListLabelsOptions {\n /** Filter for labels of the specified type. */\n labelType?: LabelTypeWithLiterals;\n /**\n * Filter for labels in the specified namespace.\n * @minLength 3\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Filter for labels where `displayName` starts with the specified case-sensitive string.\n * @minLength 1\n * @maxLength 180\n */\n startsWith?: string | null;\n /** Sorting options. */\n sort?: Sorting;\n /** Paging options. */\n paging?: Paging;\n /** @format LANGUAGE */\n language?: string | null;\n}\n\n/**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n * @param displayName - Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @public\n * @requiredField displayName\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @returns Label that was found or created.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.FindOrCreateLabel\n */\nexport async function findOrCreateLabel(\n displayName: string,\n options?: FindOrCreateLabelOptions\n): Promise<\n NonNullablePaths<\n FindOrCreateLabelResponse,\n `label.key` | `label.displayName` | `label.labelType` | `newLabel`,\n 3\n > & {\n __applicationErrorsType?: FindOrCreateLabelApplicationErrors;\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 displayName: displayName,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.findOrCreateLabel(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 displayName: '$[0]',\n language: '$[1].language',\n },\n singleArgumentUnchanged: false,\n },\n ['displayName', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface FindOrCreateLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Retrieves a label by the specified label key.\n * @param key - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @public\n * @requiredField key\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @returns The specified label.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.GetLabel\n */\nexport async function getLabel(\n key: string,\n options?: GetLabelOptions\n): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n key: key,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.getLabel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.label!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { key: '$[0]', language: '$[1].language' },\n singleArgumentUnchanged: false,\n },\n ['key', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Renames a label.\n * @param key - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @public\n * @requiredField key\n * @requiredField label\n * @requiredField label.displayName\n * @param options - Language options.\n * @param label - Label to rename.\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @returns Renamed label.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.UpdateLabel\n */\nexport async function renameLabel(\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n label: { ...label, key: key },\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.updateLabel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.label!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { label: '$[1]' },\n explicitPathsToArguments: {\n 'label.key': '$[0]',\n language: '$[2].language',\n },\n singleArgumentUnchanged: false,\n },\n ['key', 'label', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RenameLabel {\n /**\n * Label namespace.\n *\n * Labels created by calling the Find Or Create Label method\n * are automatically assigned to the `custom` namespace.\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Display name for the namespace,\n * used to organize the list of labels in the site dashboard.\n * @readonly\n * @minLength 1\n * @maxLength 180\n */\n namespaceDisplayName?: string | null;\n /**\n * Label display name shown in the dashboard.\n * @minLength 1\n * @maxLength 180\n */\n displayName?: string;\n /**\n * Label type indicating how the label was created.\n * @readonly\n */\n labelType?: LabelTypeWithLiterals;\n /**\n * Date and time the label was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the label was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface RenameLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Deletes the specified label from a site and removes it from the contacts it applies to.\n * @param key - Label key to delete.\n * @public\n * @requiredField key\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.DeleteLabel\n */\nexport async function deleteLabel(key: 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({ key: key });\n\n const reqOpts = ambassadorWixContactsV4Label.deleteLabel(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: { key: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['key']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n * @public\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels\n */\nexport function queryLabels(options?: QueryLabelsOptions): LabelsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n ContactLabel,\n 'OFFSET',\n QueryLabelsRequest,\n QueryLabelsResponse\n >({\n func: async (payload: QueryLabelsRequest) => {\n const reqOpts = ambassadorWixContactsV4Label.queryLabels({\n ...payload,\n ...(options ?? {}),\n });\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: QueryLabelsRequest['query']) => {\n const args = [query, options] as [\n QueryLabelsRequest['query'],\n QueryLabelsOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryLabelsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.labels,\n pagingMetadata: transformedData?.pagingMetadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\nexport interface QueryLabelsOptions {\n /**\n * Language for localization.\n *\n * 2-letter language code in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n * @format LANGUAGE\n */\n language?: string | null | undefined;\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface LabelsQueryResult extends QueryOffsetResult {\n items: ContactLabel[];\n query: LabelsQueryBuilder;\n next: () => Promise<LabelsQueryResult>;\n prev: () => Promise<LabelsQueryResult>;\n}\n\nexport interface LabelsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | 'namespace'\n | 'key'\n | 'displayName'\n | 'labelType'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | 'namespace'\n | 'key'\n | 'displayName'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: 'displayName',\n value: string\n ) => LabelsQueryBuilder;\n in: (propertyName: 'key' | 'displayName', value: any) => LabelsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>\n ) => LabelsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>\n ) => LabelsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => LabelsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => LabelsQueryBuilder;\n find: () => Promise<LabelsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels\n * @requiredField query\n */\nexport async function typedQueryLabels(\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n): Promise<\n NonNullablePaths<\n QueryLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n > & {\n __applicationErrorsType?: QueryLabelsApplicationErrors;\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 query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.queryLabels(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', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ContactLabelQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['key'];\n operators: ['$eq', '$in', '$ne'];\n sort: 'NONE';\n },\n {\n fields: ['displayName'];\n operators: ['$eq', '$in', '$ne', '$startsWith'];\n sort: 'BOTH';\n },\n {\n fields: ['_createdDate', '_updatedDate'];\n operators: ['$eq', '$gt', '$gte', '$lt', '$lte', '$ne'];\n sort: 'BOTH';\n },\n {\n fields: ['namespace'];\n operators: ['$eq', '$ne'];\n sort: 'NONE';\n },\n {\n fields: ['labelType'];\n operators: ['$eq'];\n sort: 'NONE';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n ContactLabel,\n ContactLabelQuerySpec\n>;\nexport type ContactLabelQuery = {\n /** \n ilter object.\n\n Possible filters: `$eq`, `$gt`, `$gte`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.\n\n For a detailed list of supported filters, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n\n Example: `{ \"filter\": {\n \"displayName\": {\n \"$startsWith\": \"Referral\"\n }\n }\n }` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For a list of fields that can be sorted, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n\n Example: `{ \"sort\": [{\"fieldName\": \"displayName\", \"order\": \"DESC\"}] }` \n @maxSize: 100 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 3000 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order.\n\n Default: `ASC`. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n /** \n Pagination options. \n */\n paging?: {\n /** \n Number of items to return.\n\n Defaults to `1000`. <br>\n Maximum: `2000`. \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n _: [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_labels';\n\n/** Lists all contact labels for a site. */\nexport function listLabels(payload: object): RequestOptionsFactory<any> {\n function __listLabels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.ListLabels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels',\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: 'labels.createdDate' },\n { path: 'labels.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listLabels;\n}\n\n/**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n */\nexport function findOrCreateLabel(payload: object): RequestOptionsFactory<any> {\n function __findOrCreateLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.FindOrCreateLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __findOrCreateLabel;\n}\n\n/** Retrieves a label by the specified label key. */\nexport function getLabel(payload: object): RequestOptionsFactory<any> {\n function __getLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.GetLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{key}',\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: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLabel;\n}\n\n/** Renames a label. */\nexport function updateLabel(payload: object): RequestOptionsFactory<any> {\n function __updateLabel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'label.createdDate' }, { path: 'label.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'PATCH' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.UpdateLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{label.key}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateLabel;\n}\n\n/** Deletes the specified label from a site and removes it from the contacts it applies to. */\nexport function deleteLabel(payload: object): RequestOptionsFactory<any> {\n function __deleteLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.DeleteLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{key}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLabel;\n}\n\n/**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n */\nexport function queryLabels(payload: object): RequestOptionsFactory<any> {\n function __queryLabels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/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: 'labels.createdDate' },\n { path: 'labels.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryLabels;\n}\n","import {\n listLabels as publicListLabels,\n findOrCreateLabel as publicFindOrCreateLabel,\n getLabel as publicGetLabel,\n renameLabel as publicRenameLabel,\n deleteLabel as publicDeleteLabel,\n queryLabels as publicQueryLabels,\n typedQueryLabels as publicTypedQueryLabels,\n} from './contacts-v4-label-labels.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 ContactLabelQuery,\n LabelsQueryBuilder,\n QueryLabelsOptions,\n typedQueryLabels as universalTypedQueryLabels,\n} from './contacts-v4-label-labels.universal.js';\nimport { onLabelCreated as publicOnLabelCreated } from './contacts-v4-label-labels.public.js';\nimport { onLabelDeleted as publicOnLabelDeleted } from './contacts-v4-label-labels.public.js';\nimport { onLabelUpdated as publicOnLabelUpdated } from './contacts-v4-label-labels.public.js';\n\nfunction customQueryLabels(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: (options?: QueryLabelsOptions) =>\n publicQueryLabels(httpClient)(options),\n typedQueryFunction: (\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n ) => publicTypedQueryLabels(httpClient)(query, options),\n hasOptionsParameter: true,\n });\n\n function overloadedQuery(\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n ): ReturnType<typeof universalTypedQueryLabels>;\n function overloadedQuery(options?: QueryLabelsOptions): LabelsQueryBuilder;\n function overloadedQuery(\n queryOrOptions?: ContactLabelQuery | QueryLabelsOptions,\n options?: QueryLabelsOptions\n ): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const listLabels: MaybeContext<\n BuildRESTFunction<typeof publicListLabels> & typeof publicListLabels\n> = /*#__PURE__*/ createRESTModule(publicListLabels);\nexport const findOrCreateLabel: MaybeContext<\n BuildRESTFunction<typeof publicFindOrCreateLabel> &\n typeof publicFindOrCreateLabel\n> = /*#__PURE__*/ createRESTModule(publicFindOrCreateLabel);\nexport const getLabel: MaybeContext<\n BuildRESTFunction<typeof publicGetLabel> & typeof publicGetLabel\n> = /*#__PURE__*/ createRESTModule(publicGetLabel);\nexport const renameLabel: MaybeContext<\n BuildRESTFunction<typeof publicRenameLabel> & typeof publicRenameLabel\n> = /*#__PURE__*/ createRESTModule(publicRenameLabel);\nexport const deleteLabel: MaybeContext<\n BuildRESTFunction<typeof publicDeleteLabel> & typeof publicDeleteLabel\n> = /*#__PURE__*/ createRESTModule(publicDeleteLabel);\nexport const queryLabels: MaybeContext<\n BuildRESTFunction<typeof customQueryLabels> & typeof customQueryLabels\n> = /*#__PURE__*/ createRESTModule(customQueryLabels);\n/**\n * Triggered when a label is created.\n */\nexport const onLabelCreated: BuildEventDefinition<typeof publicOnLabelCreated> &\n typeof publicOnLabelCreated = createEventModule(publicOnLabelCreated);\n/**\n * Triggered when a label is deleted.\n */\nexport const onLabelDeleted: BuildEventDefinition<typeof publicOnLabelDeleted> &\n typeof publicOnLabelDeleted = createEventModule(publicOnLabelDeleted);\n/**\n * Triggered when a label is updated.\n */\nexport const onLabelUpdated: BuildEventDefinition<typeof publicOnLabelUpdated> &\n typeof publicOnLabelUpdated = createEventModule(publicOnLabelUpdated);\n\nexport {\n LabelType,\n SortOrder,\n WebhookIdentityType,\n} from './contacts-v4-label-labels.universal.js';\nexport {\n ContactLabel,\n ListLabelsRequest,\n Sorting,\n Paging,\n ListLabelsResponse,\n PagingMetadata,\n FindOrCreateLabelRequest,\n FindOrCreateLabelResponse,\n LabelsQuotaReached,\n ListLabelNamespacesRequest,\n ListLabelNamespacesResponse,\n ContactLabelNamespace,\n GetLabelRequest,\n GetLabelResponse,\n GetLabelByLegacyIdRequest,\n GetLabelByLegacyIdResponse,\n UpdateLabelRequest,\n UpdateLabelResponse,\n DeleteLabelRequest,\n DeleteLabelResponse,\n PurgeRequest,\n PurgeResponse,\n GdprListRequest,\n GdprListResponse,\n QueryLabelsRequest,\n Query,\n QueryLabelsResponse,\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 LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelUpdatedEnvelope,\n ListLabelsOptions,\n FindOrCreateLabelOptions,\n GetLabelOptions,\n RenameLabel,\n RenameLabelOptions,\n QueryLabelsOptions,\n LabelsQueryResult,\n LabelsQueryBuilder,\n ContactLabelQuerySpec,\n} from './contacts-v4-label-labels.universal.js';\nexport {\n LabelTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n FindOrCreateLabelApplicationErrors,\n QueryLabelsApplicationErrors,\n CommonQueryWith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C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMN,eAEK,2DAAiB,iBAAiB;AAI7C,IAAMO,sBACmB,mDAAkB,cAAoB;AAI/D,IAAMC,sBACmB,mDAAkB,cAAoB;AAI/D,IAAMC,sBACmB,mDAAkB,cAAoB;","names":["deleteLabel","findOrCreateLabel","getLabel","listLabels","onLabelCreated","onLabelDeleted","onLabelUpdated","queryLabels","renameLabel","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","LabelType","SortOrder","WebhookIdentityType","listLabels","sdkTransformError","findOrCreateLabel","getLabel","deleteLabel","queryLabels","listLabels","findOrCreateLabel","getLabel","renameLabel","deleteLabel","queryLabels","typedQueryLabels","import_rest_modules","queryLabels","typedQueryLabels","listLabels","findOrCreateLabel","getLabel","renameLabel","deleteLabel","onLabelCreated","onLabelDeleted","onLabelUpdated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/contacts-v4-label-labels.public.ts","../../src/contacts-v4-label-labels.universal.ts","../../src/contacts-v4-label-labels.http.ts","../../src/contacts-v4-label-labels.context.ts"],"sourcesContent":["export * from './src/contacts-v4-label-labels.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 ContactLabel,\n ContactLabelQuery,\n FindOrCreateLabelApplicationErrors,\n FindOrCreateLabelOptions,\n FindOrCreateLabelResponse,\n GetLabelOptions,\n LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelUpdatedEnvelope,\n LabelsQueryBuilder,\n ListLabelsOptions,\n ListLabelsResponse,\n QueryLabelsApplicationErrors,\n QueryLabelsOptions,\n QueryLabelsResponse,\n RenameLabel,\n RenameLabelOptions,\n deleteLabel as universalDeleteLabel,\n findOrCreateLabel as universalFindOrCreateLabel,\n getLabel as universalGetLabel,\n listLabels as universalListLabels,\n queryLabels as universalQueryLabels,\n renameLabel as universalRenameLabel,\n typedQueryLabels as universalTypedQueryLabels,\n} from './contacts-v4-label-labels.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/crm' };\n\nexport function listLabels(httpClient: HttpClient): ListLabelsSignature {\n return (options?: ListLabelsOptions) =>\n universalListLabels(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListLabelsSignature {\n /**\n * Lists all contact labels for a site.\n * @returns List of labels.\n */\n (options?: ListLabelsOptions): Promise<\n NonNullablePaths<\n ListLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n >\n >;\n}\n\nexport function findOrCreateLabel(\n httpClient: HttpClient\n): FindOrCreateLabelSignature {\n return (displayName: string, options?: FindOrCreateLabelOptions) =>\n universalFindOrCreateLabel(\n displayName,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface FindOrCreateLabelSignature {\n /**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n * @param - Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @param - Language options.\n * @returns Label that was found or created.\n */\n (displayName: string, options?: FindOrCreateLabelOptions): Promise<\n NonNullablePaths<\n FindOrCreateLabelResponse,\n `label.key` | `label.displayName` | `label.labelType` | `newLabel`,\n 3\n > & {\n __applicationErrorsType?: FindOrCreateLabelApplicationErrors;\n }\n >;\n}\n\nexport function getLabel(httpClient: HttpClient): GetLabelSignature {\n return (key: string, options?: GetLabelOptions) =>\n universalGetLabel(\n key,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLabelSignature {\n /**\n * Retrieves a label by the specified label key.\n * @param - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @param - Language options.\n * @returns The specified label.\n */\n (key: string, options?: GetLabelOptions): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n >;\n}\n\nexport function renameLabel(httpClient: HttpClient): RenameLabelSignature {\n return (\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n ) =>\n universalRenameLabel(\n key,\n label,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RenameLabelSignature {\n /**\n * Renames a label.\n * @param - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @param - Language options.\n * @param - Label to rename.\n * @returns Renamed label.\n */\n (\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n ): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n >;\n}\n\nexport function deleteLabel(httpClient: HttpClient): DeleteLabelSignature {\n return (key: string) =>\n universalDeleteLabel(\n key,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteLabelSignature {\n /**\n * Deletes the specified label from a site and removes it from the contacts it applies to.\n * @param - Label key to delete.\n */\n (key: string): Promise<void>;\n}\n\nexport function queryLabels(httpClient: HttpClient): QueryLabelsSignature {\n return (options?: QueryLabelsOptions) =>\n universalQueryLabels(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryLabelsSignature {\n /**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n * @param - Language options.\n */\n (options?: QueryLabelsOptions): LabelsQueryBuilder;\n}\n\nexport function typedQueryLabels(\n httpClient: HttpClient\n): TypedQueryLabelsSignature {\n return (query: ContactLabelQuery, options?: QueryLabelsOptions) =>\n universalTypedQueryLabels(\n query,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryLabelsSignature {\n /** */\n (query: ContactLabelQuery, options?: QueryLabelsOptions): Promise<\n NonNullablePaths<\n QueryLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n > & {\n __applicationErrorsType?: QueryLabelsApplicationErrors;\n }\n >;\n}\n\nexport const onLabelCreated = EventDefinition(\n 'wix.contacts.v4.label_created',\n true,\n (event: LabelCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelCreatedEnvelope>();\nexport const onLabelDeleted = EventDefinition(\n 'wix.contacts.v4.label_deleted',\n true,\n (event: LabelDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelDeletedEnvelope>();\nexport const onLabelUpdated = EventDefinition(\n 'wix.contacts.v4.label_updated',\n true,\n (event: LabelUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LabelUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n ActionEvent,\n BaseEventMetadata,\n ContactLabel,\n ContactLabelNamespace,\n ContactLabelQuerySpec,\n DeleteLabelRequest,\n DeleteLabelResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FindOrCreateLabelOptions,\n FindOrCreateLabelRequest,\n FindOrCreateLabelResponse,\n GdprListRequest,\n GdprListResponse,\n GetLabelByLegacyIdRequest,\n GetLabelByLegacyIdResponse,\n GetLabelOptions,\n GetLabelRequest,\n GetLabelResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelType,\n LabelUpdatedEnvelope,\n LabelsQueryBuilder,\n LabelsQueryResult,\n LabelsQuotaReached,\n ListLabelNamespacesRequest,\n ListLabelNamespacesResponse,\n ListLabelsOptions,\n ListLabelsRequest,\n ListLabelsResponse,\n MessageEnvelope,\n Paging,\n PagingMetadata,\n PurgeRequest,\n PurgeResponse,\n Query,\n QueryLabelsOptions,\n QueryLabelsRequest,\n QueryLabelsResponse,\n RenameLabel,\n RenameLabelOptions,\n RestoreInfo,\n SortOrder,\n Sorting,\n UpdateLabelRequest,\n UpdateLabelResponse,\n WebhookIdentityType,\n} from './contacts-v4-label-labels.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 ambassadorWixContactsV4Label from './contacts-v4-label-labels.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/** Label that was found or created. */\nexport interface ContactLabel {\n /**\n * Label namespace.\n *\n * Labels created by calling the Find Or Create Label method\n * are automatically assigned to the `custom` namespace.\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Display name for the namespace,\n * used to organize the list of labels in the site dashboard.\n * @readonly\n * @minLength 1\n * @maxLength 180\n */\n namespaceDisplayName?: string | null;\n /**\n * Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @readonly\n * @minLength 1\n * @maxLength 80\n */\n key?: string;\n /**\n * Label display name shown in the dashboard.\n * @minLength 1\n * @maxLength 180\n */\n displayName?: string;\n /**\n * Label type indicating how the label was created.\n * @readonly\n */\n labelType?: LabelTypeWithLiterals;\n /**\n * Date and time the label was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the label was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport enum LabelType {\n /** Default system label for the contact list. */\n SYSTEM = 'SYSTEM',\n /** Label created by calling the Find Or Create Label method. */\n USER_DEFINED = 'USER_DEFINED',\n /** Label created by an app built by Wix. */\n WIX_APP_DEFINED = 'WIX_APP_DEFINED',\n}\n\n/** @enumType */\nexport type LabelTypeWithLiterals =\n | LabelType\n | 'SYSTEM'\n | 'USER_DEFINED'\n | 'WIX_APP_DEFINED';\n\n/** Label filter options. */\nexport interface ListLabelsRequest {\n /** Filter for labels of the specified type. */\n labelType?: LabelTypeWithLiterals;\n /**\n * Filter for labels in the specified namespace.\n * @minLength 3\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Filter for labels where `displayName` starts with the specified case-sensitive string.\n * @minLength 1\n * @maxLength 180\n */\n startsWith?: string | null;\n /** Sorting options. */\n sort?: Sorting;\n /** Paging options. */\n paging?: Paging;\n /** @format LANGUAGE */\n language?: string | null;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 3000\n */\n fieldName?: string;\n /**\n * Sort order.\n *\n * Default: `ASC`.\n */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Sort by ascending order. */\n ASC = 'ASC',\n /** Sort by descending order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface Paging {\n /**\n * Number of items to return.\n *\n * Defaults to `1000`. <br>\n * Maximum: `2000`.\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\n/** List of labels. */\nexport interface ListLabelsResponse {\n /** List of labels. */\n labels?: ContactLabel[];\n /** Metadata for the page of results. */\n metadata?: PagingMetadata;\n}\n\nexport interface PagingMetadata {\n /** Number of items returned. */\n count?: number | null;\n /** Requested offset. */\n offset?: number | null;\n /** Number of items that matched the query. */\n total?: number | null;\n /**\n * Indicates if `total` calculation timed out before the response was sent.\n * Typically this happens if there is a large set of results.\n */\n tooManyToCount?: boolean | null;\n}\n\n/** Label to find or create. */\nexport interface FindOrCreateLabelRequest {\n /**\n * Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @minLength 1\n * @maxLength 180\n */\n displayName: string;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** Label that was found or created. */\nexport interface FindOrCreateLabelResponse {\n /** Label that was found or created. */\n label?: ContactLabel;\n /**\n * Indicates whether the label was just created or already existed.\n *\n * Returns `true` if the label was just created.\n */\n newLabel?: boolean;\n}\n\nexport interface LabelsQuotaReached {\n /** The maximum number of labels allowed for the site. */\n labelsQuota?: string | null;\n /** The current total number of labels on the site. */\n labelsCurrentTotal?: string | null;\n}\n\nexport interface ListLabelNamespacesRequest {\n /**\n * Language for localization\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface ListLabelNamespacesResponse {\n /** List of namespaces */\n namespaces?: ContactLabelNamespace[];\n}\n\nexport interface ContactLabelNamespace {\n /**\n * Namespace key\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n key?: string;\n /**\n * Namespace display name\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n displayName?: string | null;\n}\n\nexport interface GetLabelRequest {\n /**\n * Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @minLength 1\n * @maxLength 80\n */\n key: string;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** The specified label. */\nexport interface GetLabelResponse {\n /** The specified label. */\n label?: ContactLabel;\n}\n\nexport interface GetLabelByLegacyIdRequest {\n /**\n * Legacy id of the label\n * @format GUID\n */\n legacyId?: string;\n /**\n * Language for localization\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface GetLabelByLegacyIdResponse {\n /** Requested label */\n label?: ContactLabel;\n}\n\nexport interface UpdateLabelRequest {\n /** Label to rename. */\n label?: ContactLabel;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/** Updated label. */\nexport interface UpdateLabelResponse {\n /** Renamed label. */\n label?: ContactLabel;\n}\n\nexport interface DeleteLabelRequest {\n /**\n * Label key to delete.\n * @minLength 1\n * @maxLength 80\n */\n key: string;\n}\n\nexport interface DeleteLabelResponse {}\n\nexport interface PurgeRequest {\n /**\n * Contacts Instance ID of the site.\n * @format GUID\n */\n instanceId?: string;\n /**\n * Labels to exclude from the purge.\n * @maxLength 80\n * @maxSize 80\n */\n exludingLabelKeys?: string[];\n}\n\nexport interface PurgeResponse {\n /** Number of deleted items */\n deletedItems?: number;\n}\n\nexport interface GdprListRequest {\n /**\n * Contacts Instance ID of the site.\n * @format GUID\n */\n instanceId?: string;\n}\n\nexport interface GdprListResponse {\n /** List of labels */\n labels?: ContactLabel[];\n}\n\nexport interface QueryLabelsRequest {\n /** Query options. */\n query?: Query;\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\nexport interface Query {\n /**\n * ilter object.\n *\n * Possible filters: `$eq`, `$gt`, `$gte`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.\n *\n * For a detailed list of supported filters, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n *\n * Example: `{ \"filter\": {\n * \"displayName\": {\n * \"$startsWith\": \"Referral\"\n * }\n * }\n * }`\n */\n filter?: Record<string, any> | null;\n /**\n * Sorting options. For a list of fields that can be sorted, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n *\n * Example: `{ \"sort\": [{\"fieldName\": \"displayName\", \"order\": \"DESC\"}] }`\n * @maxSize 100\n */\n sort?: Sorting[];\n /** Pagination options. */\n paging?: Paging;\n}\n\nexport interface QueryLabelsResponse {\n /** List of labels */\n labels?: ContactLabel[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadata;\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}\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 FindOrCreateLabelApplicationErrors = {\n code?: 'LABELS_QUOTA_REACHED';\n description?: string;\n data?: LabelsQuotaReached;\n};\n/** @docsIgnore */\nexport type QueryLabelsApplicationErrors =\n | {\n code?: 'INVALID_SORT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'MALFORMED_FILTER';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_FIELD';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_OPERATOR';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_VALUE';\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}\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\ninterface 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 LabelCreatedEnvelope {\n entity: ContactLabel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_created\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug created\n */\nexport declare function onLabelCreated(\n handler: (event: LabelCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LabelDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is deleted.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_deleted\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug deleted\n */\nexport declare function onLabelDeleted(\n handler: (event: LabelDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LabelUpdatedEnvelope {\n entity: ContactLabel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a label is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Bookings Services and Settings\n * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION\n * @permissionScope Manage Contact Labels\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-LABELS\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Challenges\n * @permissionScopeId SCOPE.CHALLENGES.MANAGE\n * @permissionScope Manage Portfolio\n * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionScope Access Verticals by Automations\n * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_LABELS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.label_updated\n * @serviceIdentifier com.wixpress.contacts.labels.v4.ContactLabelsServiceV4\n * @slug updated\n */\nexport declare function onLabelUpdated(\n handler: (event: LabelUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Lists all contact labels for a site.\n * @public\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @returns List of labels.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.ListLabels\n */\nexport async function listLabels(\n options?: ListLabelsOptions\n): Promise<\n NonNullablePaths<\n ListLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\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 labelType: options?.labelType,\n namespace: options?.namespace,\n startsWith: options?.startsWith,\n sort: options?.sort,\n paging: options?.paging,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.listLabels(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 labelType: '$[0].labelType',\n namespace: '$[0].namespace',\n startsWith: '$[0].startsWith',\n sort: '$[0].sort',\n paging: '$[0].paging',\n language: '$[0].language',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListLabelsOptions {\n /** Filter for labels of the specified type. */\n labelType?: LabelTypeWithLiterals;\n /**\n * Filter for labels in the specified namespace.\n * @minLength 3\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Filter for labels where `displayName` starts with the specified case-sensitive string.\n * @minLength 1\n * @maxLength 180\n */\n startsWith?: string | null;\n /** Sorting options. */\n sort?: Sorting;\n /** Paging options. */\n paging?: Paging;\n /** @format LANGUAGE */\n language?: string | null;\n}\n\n/**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n * @param displayName - Display name to retrieve or create.\n *\n * If an existing label is an exact match\n * for the specified display name,\n * the existing label is returned.\n * If not, a new label is created and returned.\n * @public\n * @requiredField displayName\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @returns Label that was found or created.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.FindOrCreateLabel\n */\nexport async function findOrCreateLabel(\n displayName: string,\n options?: FindOrCreateLabelOptions\n): Promise<\n NonNullablePaths<\n FindOrCreateLabelResponse,\n `label.key` | `label.displayName` | `label.labelType` | `newLabel`,\n 3\n > & {\n __applicationErrorsType?: FindOrCreateLabelApplicationErrors;\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 displayName: displayName,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.findOrCreateLabel(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 displayName: '$[0]',\n language: '$[1].language',\n },\n singleArgumentUnchanged: false,\n },\n ['displayName', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface FindOrCreateLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Retrieves a label by the specified label key.\n * @param key - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @public\n * @requiredField key\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @returns The specified label.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.GetLabel\n */\nexport async function getLabel(\n key: string,\n options?: GetLabelOptions\n): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n key: key,\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.getLabel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.label!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { key: '$[0]', language: '$[1].language' },\n singleArgumentUnchanged: false,\n },\n ['key', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Renames a label.\n * @param key - Label key.\n *\n * `key` is generated when the label is created.\n * It can't be modified, even if `displayName` is updated.\n * @public\n * @requiredField key\n * @requiredField label\n * @requiredField label.displayName\n * @param options - Language options.\n * @param label - Label to rename.\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @returns Renamed label.\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.UpdateLabel\n */\nexport async function renameLabel(\n key: string,\n label: NonNullablePaths<RenameLabel, `displayName`, 2>,\n options?: RenameLabelOptions\n): Promise<\n NonNullablePaths<ContactLabel, `key` | `displayName` | `labelType`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n label: { ...label, key: key },\n language: options?.language,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.updateLabel(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.label!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { label: '$[1]' },\n explicitPathsToArguments: {\n 'label.key': '$[0]',\n language: '$[2].language',\n },\n singleArgumentUnchanged: false,\n },\n ['key', 'label', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RenameLabel {\n /**\n * Label namespace.\n *\n * Labels created by calling the Find Or Create Label method\n * are automatically assigned to the `custom` namespace.\n * @readonly\n * @minLength 1\n * @maxLength 25\n */\n namespace?: string | null;\n /**\n * Display name for the namespace,\n * used to organize the list of labels in the site dashboard.\n * @readonly\n * @minLength 1\n * @maxLength 180\n */\n namespaceDisplayName?: string | null;\n /**\n * Label display name shown in the dashboard.\n * @minLength 1\n * @maxLength 180\n */\n displayName?: string;\n /**\n * Label type indicating how the label was created.\n * @readonly\n */\n labelType?: LabelTypeWithLiterals;\n /**\n * Date and time the label was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the label was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface RenameLabelOptions {\n /**\n * Language for localization.\n * 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format.\n * @format LANGUAGE\n */\n language?: string | null;\n}\n\n/**\n * Deletes the specified label from a site and removes it from the contacts it applies to.\n * @param key - Label key to delete.\n * @public\n * @requiredField key\n * @permissionId CONTACTS_LABELS.MODIFY\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.DeleteLabel\n */\nexport async function deleteLabel(key: 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({ key: key });\n\n const reqOpts = ambassadorWixContactsV4Label.deleteLabel(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: { key: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['key']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n * @public\n * @param options - Language options.\n * @permissionId CONTACTS_LABELS.VIEW\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels\n */\nexport function queryLabels(options?: QueryLabelsOptions): LabelsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n ContactLabel,\n 'OFFSET',\n QueryLabelsRequest,\n QueryLabelsResponse\n >({\n func: async (payload: QueryLabelsRequest) => {\n const reqOpts = ambassadorWixContactsV4Label.queryLabels({\n ...payload,\n ...(options ?? {}),\n });\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: QueryLabelsRequest['query']) => {\n const args = [query, options] as [\n QueryLabelsRequest['query'],\n QueryLabelsOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryLabelsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.labels,\n pagingMetadata: transformedData?.pagingMetadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\nexport interface QueryLabelsOptions {\n /**\n * Language for localization.\n *\n * 2-letter language code in\n * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.\n * @format LANGUAGE\n */\n language?: string | null | undefined;\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface LabelsQueryResult extends QueryOffsetResult {\n items: ContactLabel[];\n query: LabelsQueryBuilder;\n next: () => Promise<LabelsQueryResult>;\n prev: () => Promise<LabelsQueryResult>;\n}\n\nexport interface LabelsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | 'namespace'\n | 'key'\n | 'displayName'\n | 'labelType'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | 'namespace'\n | 'key'\n | 'displayName'\n | '_createdDate'\n | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LabelsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: 'displayName',\n value: string\n ) => LabelsQueryBuilder;\n in: (propertyName: 'key' | 'displayName', value: any) => LabelsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>\n ) => LabelsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>\n ) => LabelsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => LabelsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => LabelsQueryBuilder;\n find: () => Promise<LabelsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels\n * @requiredField query\n */\nexport async function typedQueryLabels(\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n): Promise<\n NonNullablePaths<\n QueryLabelsResponse,\n | `labels`\n | `labels.${number}.key`\n | `labels.${number}.displayName`\n | `labels.${number}.labelType`,\n 4\n > & {\n __applicationErrorsType?: QueryLabelsApplicationErrors;\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 query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixContactsV4Label.queryLabels(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', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ContactLabelQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['key'];\n operators: ['$eq', '$in', '$ne'];\n sort: 'NONE';\n },\n {\n fields: ['displayName'];\n operators: ['$eq', '$in', '$ne', '$startsWith'];\n sort: 'BOTH';\n },\n {\n fields: ['_createdDate', '_updatedDate'];\n operators: ['$eq', '$gt', '$gte', '$lt', '$lte', '$ne'];\n sort: 'BOTH';\n },\n {\n fields: ['namespace'];\n operators: ['$eq', '$ne'];\n sort: 'NONE';\n },\n {\n fields: ['labelType'];\n operators: ['$eq'];\n sort: 'NONE';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n ContactLabel,\n ContactLabelQuerySpec\n>;\nexport type ContactLabelQuery = {\n /** \n ilter object.\n\n Possible filters: `$eq`, `$gt`, `$gte`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.\n\n For a detailed list of supported filters, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n\n Example: `{ \"filter\": {\n \"displayName\": {\n \"$startsWith\": \"Referral\"\n }\n }\n }` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For a list of fields that can be sorted, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).\n\n Example: `{ \"sort\": [{\"fieldName\": \"displayName\", \"order\": \"DESC\"}] }` \n @maxSize: 100 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 3000 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order.\n\n Default: `ASC`. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n /** \n Pagination options. \n */\n paging?: {\n /** \n Number of items to return.\n\n Defaults to `1000`. <br>\n Maximum: `2000`. \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n _: [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/contacts/v4/labels',\n destPath: '/v4/labels',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_labels';\n\n/** Lists all contact labels for a site. */\nexport function listLabels(payload: object): RequestOptionsFactory<any> {\n function __listLabels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.ListLabels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels',\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: 'labels.createdDate' },\n { path: 'labels.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listLabels;\n}\n\n/**\n * Retrieves a label with a specified name, or creates one if it doesn't exist.\n *\n * Successful calls to this method always return a label,\n * which can be specified in subsequent calls.\n *\n * For example, in the Contacts API, Label Contact and Unlabel Contact\n * calls will fail if you include a non-existent label.\n * To ensure successful calls, you can call this method first,\n * and then use the response in the Label Contact and Unlabel Contact calls.\n *\n * To find an existing label without potentially creating a new one, call\n * Get Label or Query Labels.\n */\nexport function findOrCreateLabel(payload: object): RequestOptionsFactory<any> {\n function __findOrCreateLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.FindOrCreateLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __findOrCreateLabel;\n}\n\n/** Retrieves a label by the specified label key. */\nexport function getLabel(payload: object): RequestOptionsFactory<any> {\n function __getLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.GetLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{key}',\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: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLabel;\n}\n\n/** Renames a label. */\nexport function updateLabel(payload: object): RequestOptionsFactory<any> {\n function __updateLabel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'label.createdDate' }, { path: 'label.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'PATCH' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.UpdateLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{label.key}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'label.createdDate' },\n { path: 'label.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateLabel;\n}\n\n/** Deletes the specified label from a site and removes it from the contacts it applies to. */\nexport function deleteLabel(payload: object): RequestOptionsFactory<any> {\n function __deleteLabel({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.DeleteLabel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/{key}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLabel;\n}\n\n/**\n * Creates a query to retrieve a list of labels.\n *\n * The `queryLabels()` method builds a query to retrieve a list of labels and returns a `LabelsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to call the query using the `find()` method.\n *\n * You can refine the query by chaining `LabelsQueryBuilder` methods onto the query. `LabelsQueryBuilder` methods enable you to filter, sort, and control the response that `queryLabels()` returns.\n *\n * `queryLabels()` is called with the following `LabelsQueryBuilder` defaults, which you can override:\n * - `skip(0)`\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The following `LabelsQueryBuilder` methods are supported for `queryLabels()`. For a full description of the `Labels` object, see the object returned for the `items` field in `LabelsQueryResult`.\n *\n *\n */\nexport function queryLabels(payload: object): RequestOptionsFactory<any> {\n function __queryLabels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.contacts.v4.label',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.contacts.labels.v4.ContactLabelsServiceV4.QueryLabels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressContactsLabelsV4ContactLabelsServiceV4Url({\n protoPath: '/v4/labels/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: 'labels.createdDate' },\n { path: 'labels.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryLabels;\n}\n","import {\n listLabels as publicListLabels,\n findOrCreateLabel as publicFindOrCreateLabel,\n getLabel as publicGetLabel,\n renameLabel as publicRenameLabel,\n deleteLabel as publicDeleteLabel,\n queryLabels as publicQueryLabels,\n typedQueryLabels as publicTypedQueryLabels,\n} from './contacts-v4-label-labels.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 ContactLabelQuery,\n LabelsQueryBuilder,\n QueryLabelsOptions,\n typedQueryLabels as universalTypedQueryLabels,\n} from './contacts-v4-label-labels.universal.js';\nimport { onLabelCreated as publicOnLabelCreated } from './contacts-v4-label-labels.public.js';\nimport { onLabelDeleted as publicOnLabelDeleted } from './contacts-v4-label-labels.public.js';\nimport { onLabelUpdated as publicOnLabelUpdated } from './contacts-v4-label-labels.public.js';\n\nfunction customQueryLabels(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: (options?: QueryLabelsOptions) =>\n publicQueryLabels(httpClient)(options),\n typedQueryFunction: (\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n ) => publicTypedQueryLabels(httpClient)(query, options),\n hasOptionsParameter: true,\n });\n\n function overloadedQuery(\n query: ContactLabelQuery,\n options?: QueryLabelsOptions\n ): ReturnType<typeof universalTypedQueryLabels>;\n function overloadedQuery(options?: QueryLabelsOptions): LabelsQueryBuilder;\n function overloadedQuery(\n queryOrOptions?: ContactLabelQuery | QueryLabelsOptions,\n options?: QueryLabelsOptions\n ): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const listLabels: MaybeContext<\n BuildRESTFunction<typeof publicListLabels> & typeof publicListLabels\n> = /*#__PURE__*/ createRESTModule(publicListLabels);\nexport const findOrCreateLabel: MaybeContext<\n BuildRESTFunction<typeof publicFindOrCreateLabel> &\n typeof publicFindOrCreateLabel\n> = /*#__PURE__*/ createRESTModule(publicFindOrCreateLabel);\nexport const getLabel: MaybeContext<\n BuildRESTFunction<typeof publicGetLabel> & typeof publicGetLabel\n> = /*#__PURE__*/ createRESTModule(publicGetLabel);\nexport const renameLabel: MaybeContext<\n BuildRESTFunction<typeof publicRenameLabel> & typeof publicRenameLabel\n> = /*#__PURE__*/ createRESTModule(publicRenameLabel);\nexport const deleteLabel: MaybeContext<\n BuildRESTFunction<typeof publicDeleteLabel> & typeof publicDeleteLabel\n> = /*#__PURE__*/ createRESTModule(publicDeleteLabel);\nexport const queryLabels: MaybeContext<\n BuildRESTFunction<typeof customQueryLabels> & typeof customQueryLabels\n> = /*#__PURE__*/ createRESTModule(customQueryLabels);\n/**\n * Triggered when a label is created.\n */\nexport const onLabelCreated: BuildEventDefinition<typeof publicOnLabelCreated> &\n typeof publicOnLabelCreated = createEventModule(publicOnLabelCreated);\n/**\n * Triggered when a label is deleted.\n */\nexport const onLabelDeleted: BuildEventDefinition<typeof publicOnLabelDeleted> &\n typeof publicOnLabelDeleted = createEventModule(publicOnLabelDeleted);\n/**\n * Triggered when a label is updated.\n */\nexport const onLabelUpdated: BuildEventDefinition<typeof publicOnLabelUpdated> &\n typeof publicOnLabelUpdated = createEventModule(publicOnLabelUpdated);\n\nexport {\n LabelType,\n SortOrder,\n WebhookIdentityType,\n} from './contacts-v4-label-labels.universal.js';\nexport {\n ContactLabel,\n ListLabelsRequest,\n Sorting,\n Paging,\n ListLabelsResponse,\n PagingMetadata,\n FindOrCreateLabelRequest,\n FindOrCreateLabelResponse,\n LabelsQuotaReached,\n ListLabelNamespacesRequest,\n ListLabelNamespacesResponse,\n ContactLabelNamespace,\n GetLabelRequest,\n GetLabelResponse,\n GetLabelByLegacyIdRequest,\n GetLabelByLegacyIdResponse,\n UpdateLabelRequest,\n UpdateLabelResponse,\n DeleteLabelRequest,\n DeleteLabelResponse,\n PurgeRequest,\n PurgeResponse,\n GdprListRequest,\n GdprListResponse,\n QueryLabelsRequest,\n Query,\n QueryLabelsResponse,\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 LabelCreatedEnvelope,\n LabelDeletedEnvelope,\n LabelUpdatedEnvelope,\n ListLabelsOptions,\n FindOrCreateLabelOptions,\n GetLabelOptions,\n RenameLabel,\n RenameLabelOptions,\n QueryLabelsOptions,\n LabelsQueryResult,\n LabelsQueryBuilder,\n ContactLabelQuerySpec,\n} from './contacts-v4-label-labels.universal.js';\nexport {\n LabelTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n FindOrCreateLabelApplicationErrors,\n QueryLabelsApplicationErrors,\n CommonQueryWithEntityContext,\n ContactLabelQuery,\n} from './contacts-v4-label-labels.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,mBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACv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ACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAwB;;;AG3RxB,IAAAC,uBAAiC;AACjC,sCAAkC;AAOlC,iCAA0C;AAW1C,SAAS,kBAAkB,YAAwB;AACjD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,CAAC,YACrBC,aAAkB,UAAU,EAAE,OAAO;AAAA,IACvC,oBAAoB,CAClB,OACA,YACGC,kBAAuB,UAAU,EAAE,OAAO,OAAO;AAAA,IACtD,qBAAqB;AAAA,EACvB,CAAC;AAOD,WAAS,gBACP,gBACA,SACK;AACL,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,YAEK,2DAAiBA,SAAc;AAC1C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMN,eAEK,2DAAiB,iBAAiB;AAI7C,IAAMO,sBACmB,mDAAkB,cAAoB;AAI/D,IAAMC,sBACmB,mDAAkB,cAAoB;AAI/D,IAAMC,sBACmB,mDAAkB,cAAoB;","names":["deleteLabel","findOrCreateLabel","getLabel","listLabels","onLabelCreated","onLabelDeleted","onLabelUpdated","queryLabels","renameLabel","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","LabelType","SortOrder","WebhookIdentityType","listLabels","sdkTransformError","findOrCreateLabel","getLabel","deleteLabel","queryLabels","listLabels","findOrCreateLabel","getLabel","renameLabel","deleteLabel","queryLabels","typedQueryLabels","import_rest_modules","queryLabels","typedQueryLabels","listLabels","findOrCreateLabel","getLabel","renameLabel","deleteLabel","onLabelCreated","onLabelDeleted","onLabelUpdated"]}
@@ -560,6 +560,15 @@ interface EventMetadata extends BaseEventMetadata {
560
560
  * 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.
561
561
  */
562
562
  entityEventSequence?: string | null;
563
+ accountInfo?: AccountInfoMetadata;
564
+ }
565
+ interface AccountInfoMetadata {
566
+ /** ID of the Wix account associated with the event */
567
+ accountId: string;
568
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
569
+ siteId?: string;
570
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
571
+ parentAccountId?: string;
563
572
  }
564
573
  interface LabelCreatedEnvelope {
565
574
  entity: ContactLabel;