@wix/auto_sdk_embeds_custom-embeds 1.0.15 → 1.0.16
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.
- package/build/cjs/index.d.ts +4 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +22 -4
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +14 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +202 -0
- package/build/cjs/schemas.js +306 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.d.mts +4 -4
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +22 -4
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +14 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +202 -0
- package/build/es/schemas.mjs +260 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +4 -4
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +22 -4
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +14 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +202 -0
- package/build/internal/cjs/schemas.js +306 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.d.mts +4 -4
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +22 -4
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +14 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +202 -0
- package/build/internal/es/schemas.mjs +260 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +12 -5
- package/schemas/package.json +3 -0
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { CustomEmbed, CreateCustomEmbedApplicationErrors, GetCustomEmbedApplicationErrors, UpdateCustomEmbed, UpdateCustomEmbedApplicationErrors, DeleteCustomEmbedApplicationErrors, ListCustomEmbedsOptions, ListCustomEmbedsResponse, CustomEmbedCreatedEnvelope, CustomEmbedDeletedEnvelope, CustomEmbedUpdatedEnvelope } from './index.typings.js';
|
|
3
|
-
export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, Category, CategoryWithLiterals, CreateCustomEmbedRequest, CreateCustomEmbedResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteCustomEmbedRequest, DeleteCustomEmbedResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetCustomEmbedRequest, GetCustomEmbedResponse, IdentificationData, IdentificationDataIdOneOf, ListCustomEmbedsRequest, MessageEnvelope, PositionOnPage, PositionOnPageWithLiterals, RestoreInfo, UpdateCustomEmbedRequest, UpdateCustomEmbedResponse, V1CustomEmbed, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, Category, CategoryWithLiterals, CreateCustomEmbedRequest, CreateCustomEmbedResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteCustomEmbedRequest, DeleteCustomEmbedResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetCustomEmbedRequest, GetCustomEmbedResponse, IdentificationData, IdentificationDataIdOneOf, ListCustomEmbedsRequest, MessageEnvelope, PageFilter, PositionOnPage, PositionOnPageWithLiterals, RestoreInfo, UpdateCustomEmbedRequest, UpdateCustomEmbedResponse, V1CustomEmbed, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createCustomEmbed$1(httpClient: HttpClient): CreateCustomEmbedSignature;
|
|
6
6
|
interface CreateCustomEmbedSignature {
|
|
@@ -11,7 +11,7 @@ interface CreateCustomEmbedSignature {
|
|
|
11
11
|
* @param - Custom embed to create.
|
|
12
12
|
* @returns Created custom embed.
|
|
13
13
|
*/
|
|
14
|
-
(customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
14
|
+
(customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
15
15
|
__applicationErrorsType?: CreateCustomEmbedApplicationErrors;
|
|
16
16
|
}>;
|
|
17
17
|
}
|
|
@@ -22,7 +22,7 @@ interface GetCustomEmbedSignature {
|
|
|
22
22
|
* @param - Custom embed ID.
|
|
23
23
|
* @returns Requested custom embed.
|
|
24
24
|
*/
|
|
25
|
-
(customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
25
|
+
(customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
26
26
|
__applicationErrorsType?: GetCustomEmbedApplicationErrors;
|
|
27
27
|
}>;
|
|
28
28
|
}
|
|
@@ -34,7 +34,7 @@ interface UpdateCustomEmbedSignature {
|
|
|
34
34
|
* @param - Custom embed ID.
|
|
35
35
|
* @returns Updated custom embed.
|
|
36
36
|
*/
|
|
37
|
-
(_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
37
|
+
(_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
38
38
|
__applicationErrorsType?: UpdateCustomEmbedApplicationErrors;
|
|
39
39
|
}>;
|
|
40
40
|
}
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/embeds-v1-custom-embed-custom-embeds.public.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts","../../src/embeds-v1-custom-embed-custom-embeds.context.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.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 CreateCustomEmbedApplicationErrors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n ListCustomEmbedsOptions,\n ListCustomEmbedsResponse,\n UpdateCustomEmbed,\n UpdateCustomEmbedApplicationErrors,\n createCustomEmbed as universalCreateCustomEmbed,\n deleteCustomEmbed as universalDeleteCustomEmbed,\n getCustomEmbed as universalGetCustomEmbed,\n listCustomEmbeds as universalListCustomEmbeds,\n updateCustomEmbed as universalUpdateCustomEmbed,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/embeds' };\n\nexport function createCustomEmbed(\n httpClient: HttpClient\n): CreateCustomEmbedSignature {\n return (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ) =>\n universalCreateCustomEmbed(\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomEmbedSignature {\n /**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param - Custom embed to create.\n * @returns Created custom embed.\n */\n (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function getCustomEmbed(\n httpClient: HttpClient\n): GetCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalGetCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCustomEmbedSignature {\n /**\n * Retrieves a custom embed.\n * @param - Custom embed ID.\n * @returns Requested custom embed.\n */\n (customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function updateCustomEmbed(\n httpClient: HttpClient\n): UpdateCustomEmbedSignature {\n return (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ) =>\n universalUpdateCustomEmbed(\n _id,\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCustomEmbedSignature {\n /**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param - Custom embed ID.\n * @returns Updated custom embed.\n */\n (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function deleteCustomEmbed(\n httpClient: HttpClient\n): DeleteCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalDeleteCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteCustomEmbedSignature {\n /**\n * Permanently deletes a custom embed.\n * @param - Custom embed ID to delete.\n */\n (customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function listCustomEmbeds(\n httpClient: HttpClient\n): ListCustomEmbedsSignature {\n return (options?: ListCustomEmbedsOptions) =>\n universalListCustomEmbeds(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListCustomEmbedsSignature {\n /**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @param - Field options.\n */\n (options?: ListCustomEmbedsOptions): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n >;\n}\n\nexport const onCustomEmbedCreated = EventDefinition(\n 'wix.embeds.v1.custom_embed_created',\n true,\n (event: CustomEmbedCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedCreatedEnvelope>();\nexport const onCustomEmbedDeleted = EventDefinition(\n 'wix.embeds.v1.custom_embed_deleted',\n true,\n (event: CustomEmbedDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedDeletedEnvelope>();\nexport const onCustomEmbedUpdated = EventDefinition(\n 'wix.embeds.v1.custom_embed_updated',\n true,\n (event: CustomEmbedUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n Category,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListCustomEmbedsOptions,\n ListCustomEmbedsRequest,\n ListCustomEmbedsResponse,\n MessageEnvelope,\n PositionOnPage,\n RestoreInfo,\n UpdateCustomEmbed,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n V1CustomEmbed,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\nexport enum PositionOnPage {\n /** Illegal value, exception will be thrown if used */\n UNKNOWN_POSITION = 'UNKNOWN_POSITION',\n /** HEAD position */\n HEAD = 'HEAD',\n /** BODY_START position */\n BODY_START = 'BODY_START',\n /** BODY_END position */\n BODY_END = 'BODY_END',\n}\n\n/** @enumType */\nexport type PositionOnPageWithLiterals =\n | PositionOnPage\n | 'UNKNOWN_POSITION'\n | 'HEAD'\n | 'BODY_START'\n | 'BODY_END';\n\nexport interface V1CustomEmbed {\n /** CustomEmbed's category */\n category?: CategoryWithLiterals;\n /**\n * CustomEmbed's html\n * @maxLength 15000\n */\n html?: string;\n}\n\nexport enum Category {\n /** Illegal type, exception will be thrown if used */\n UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY',\n /** Essential category */\n ESSENTIAL = 'ESSENTIAL',\n /** Functional category */\n FUNCTIONAL = 'FUNCTIONAL',\n /** Analytics category */\n ANALYTICS = 'ANALYTICS',\n /** Advertising category */\n ADVERTISING = 'ADVERTISING',\n /** Data to third party category */\n DATA_TO_THIRD_PARTY = 'DATA_TO_THIRD_PARTY',\n}\n\n/** @enumType */\nexport type CategoryWithLiterals =\n | Category\n | 'UNKNOWN_CATEGORY'\n | 'ESSENTIAL'\n | 'FUNCTIONAL'\n | 'ANALYTICS'\n | 'ADVERTISING'\n | 'DATA_TO_THIRD_PARTY';\n\nexport interface CreateCustomEmbedRequest {\n /** Custom embed to create. */\n customEmbed: CustomEmbed;\n}\n\nexport interface CreateCustomEmbedResponse {\n /** Created custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface GetCustomEmbedRequest {\n /**\n * Custom embed ID.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface GetCustomEmbedResponse {\n /** Requested custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedRequest {\n /** Custom embed to update. */\n customEmbed: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedResponse {\n /** Updated custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface DeleteCustomEmbedRequest {\n /**\n * Custom embed ID to delete.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface DeleteCustomEmbedResponse {}\n\nexport interface ListCustomEmbedsRequest {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListCustomEmbedsResponse {\n /** List of custom embeds. */\n customEmbeds?: CustomEmbed[];\n /** Pagination metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\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 Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateCustomEmbedApplicationErrors = {\n code?: 'SITE_EMBEDS_LIMIT_EXCEEDED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type UpdateCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface CustomEmbedCreatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is created.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_created\n * @slug created\n */\nexport declare function onCustomEmbedCreated(\n handler: (event: CustomEmbedCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedDeletedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is deleted.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_deleted\n * @slug deleted\n */\nexport declare function onCustomEmbedDeleted(\n handler: (event: CustomEmbedDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedUpdatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is updated.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_updated\n * @slug updated\n */\nexport declare function onCustomEmbedUpdated(\n handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param customEmbed - Custom embed to create.\n * @public\n * @requiredField customEmbed\n * @requiredField customEmbed.embedData\n * @requiredField customEmbed.position\n * @permissionId EDITOR.CUSTOM_EMBED_CREATE\n * @applicableIdentity APP\n * @returns Created custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed\n */\nexport async function createCustomEmbed(\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\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 customEmbed: customEmbed,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.createCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbed: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a custom embed.\n * @param customEmbedId - Custom embed ID.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @returns Requested custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed\n */\nexport async function getCustomEmbed(customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.getCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param _id - Custom embed ID.\n * @public\n * @requiredField _id\n * @requiredField customEmbed\n * @requiredField customEmbed.revision\n * @permissionId EDITOR.CUSTOM_EMBED_UPDATE\n * @applicableIdentity APP\n * @returns Updated custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed\n */\nexport async function updateCustomEmbed(\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\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 customEmbed: { ...customEmbed, id: _id },\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.updateCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { customEmbed: '$[1]' },\n explicitPathsToArguments: { 'customEmbed.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\n/**\n * Permanently deletes a custom embed.\n * @param customEmbedId - Custom embed ID to delete.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_DELETE\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed\n */\nexport async function deleteCustomEmbed(customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.deleteCustomEmbed(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: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @public\n * @param options - Field options.\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds\n */\nexport async function listCustomEmbeds(\n options?: ListCustomEmbedsOptions\n): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.listCustomEmbeds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { paging: '$[0].paging' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCustomEmbedsOptions {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixEditorEmbedsV1CustomEmbedsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/embeds/v1/custom-embeds',\n destPath: '/v1/custom-embeds',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_embeds_custom-embeds';\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n */\nexport function createCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __createCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'POST' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n","import {\n createCustomEmbed as publicCreateCustomEmbed,\n getCustomEmbed as publicGetCustomEmbed,\n updateCustomEmbed as publicUpdateCustomEmbed,\n deleteCustomEmbed as publicDeleteCustomEmbed,\n listCustomEmbeds as publicListCustomEmbeds,\n} from './embeds-v1-custom-embed-custom-embeds.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 { onCustomEmbedCreated as publicOnCustomEmbedCreated } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedDeleted as publicOnCustomEmbedDeleted } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedUpdated as publicOnCustomEmbedUpdated } from './embeds-v1-custom-embed-custom-embeds.public.js';\n\nexport const createCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicCreateCustomEmbed> &\n typeof publicCreateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicCreateCustomEmbed);\nexport const getCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicGetCustomEmbed> & typeof publicGetCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicGetCustomEmbed);\nexport const updateCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCustomEmbed> &\n typeof publicUpdateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicUpdateCustomEmbed);\nexport const deleteCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicDeleteCustomEmbed> &\n typeof publicDeleteCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicDeleteCustomEmbed);\nexport const listCustomEmbeds: MaybeContext<\n BuildRESTFunction<typeof publicListCustomEmbeds> &\n typeof publicListCustomEmbeds\n> = /*#__PURE__*/ createRESTModule(publicListCustomEmbeds);\n/**\n * Triggered when a custom embed is created.\n */\nexport const onCustomEmbedCreated: BuildEventDefinition<\n typeof publicOnCustomEmbedCreated\n> &\n typeof publicOnCustomEmbedCreated = createEventModule(\n publicOnCustomEmbedCreated\n);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> &\n typeof publicOnCustomEmbedDeleted = createEventModule(\n publicOnCustomEmbedDeleted\n);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> &\n typeof publicOnCustomEmbedUpdated = createEventModule(\n publicOnCustomEmbedUpdated\n);\n\nexport {\n PositionOnPage,\n Category,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n CustomEmbed,\n V1CustomEmbed,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n ListCustomEmbedsRequest,\n CursorPaging,\n ListCustomEmbedsResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n UpdateCustomEmbed,\n ListCustomEmbedsOptions,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n PositionOnPageWithLiterals,\n CategoryWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n UpdateCustomEmbedApplicationErrors,\n DeleteCustomEmbedApplicationErrors,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACx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CAAC;AAAA,EACH;AACJ,EAA8B;AACvB,IAAM,2BAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA8B;;;AG7M9B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAIlD,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated","updateCustomEmbed","import_rename_all_nested_keys","import_transform_paths","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","import_rest_modules","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/embeds-v1-custom-embed-custom-embeds.public.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts","../../src/embeds-v1-custom-embed-custom-embeds.context.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.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 CreateCustomEmbedApplicationErrors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n ListCustomEmbedsOptions,\n ListCustomEmbedsResponse,\n UpdateCustomEmbed,\n UpdateCustomEmbedApplicationErrors,\n createCustomEmbed as universalCreateCustomEmbed,\n deleteCustomEmbed as universalDeleteCustomEmbed,\n getCustomEmbed as universalGetCustomEmbed,\n listCustomEmbeds as universalListCustomEmbeds,\n updateCustomEmbed as universalUpdateCustomEmbed,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/embeds' };\n\nexport function createCustomEmbed(\n httpClient: HttpClient\n): CreateCustomEmbedSignature {\n return (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ) =>\n universalCreateCustomEmbed(\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomEmbedSignature {\n /**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param - Custom embed to create.\n * @returns Created custom embed.\n */\n (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n | `position`\n | `embedData.category`\n | `embedData.html`\n | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function getCustomEmbed(\n httpClient: HttpClient\n): GetCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalGetCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCustomEmbedSignature {\n /**\n * Retrieves a custom embed.\n * @param - Custom embed ID.\n * @returns Requested custom embed.\n */\n (customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n | `position`\n | `embedData.category`\n | `embedData.html`\n | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function updateCustomEmbed(\n httpClient: HttpClient\n): UpdateCustomEmbedSignature {\n return (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ) =>\n universalUpdateCustomEmbed(\n _id,\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCustomEmbedSignature {\n /**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param - Custom embed ID.\n * @returns Updated custom embed.\n */\n (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n | `position`\n | `embedData.category`\n | `embedData.html`\n | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function deleteCustomEmbed(\n httpClient: HttpClient\n): DeleteCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalDeleteCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteCustomEmbedSignature {\n /**\n * Permanently deletes a custom embed.\n * @param - Custom embed ID to delete.\n */\n (customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function listCustomEmbeds(\n httpClient: HttpClient\n): ListCustomEmbedsSignature {\n return (options?: ListCustomEmbedsOptions) =>\n universalListCustomEmbeds(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListCustomEmbedsSignature {\n /**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @param - Field options.\n */\n (options?: ListCustomEmbedsOptions): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n >;\n}\n\nexport const onCustomEmbedCreated = EventDefinition(\n 'wix.embeds.v1.custom_embed_created',\n true,\n (event: CustomEmbedCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedCreatedEnvelope>();\nexport const onCustomEmbedDeleted = EventDefinition(\n 'wix.embeds.v1.custom_embed_deleted',\n true,\n (event: CustomEmbedDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedDeletedEnvelope>();\nexport const onCustomEmbedUpdated = EventDefinition(\n 'wix.embeds.v1.custom_embed_updated',\n true,\n (event: CustomEmbedUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n Category,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListCustomEmbedsOptions,\n ListCustomEmbedsRequest,\n ListCustomEmbedsResponse,\n MessageEnvelope,\n PageFilter,\n PositionOnPage,\n RestoreInfo,\n UpdateCustomEmbed,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n V1CustomEmbed,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n /**\n * Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.\n * @readonly\n */\n pageFilter?: PageFilter;\n}\n\nexport enum PositionOnPage {\n /** Illegal value, exception will be thrown if used */\n UNKNOWN_POSITION = 'UNKNOWN_POSITION',\n /** HEAD position */\n HEAD = 'HEAD',\n /** BODY_START position */\n BODY_START = 'BODY_START',\n /** BODY_END position */\n BODY_END = 'BODY_END',\n}\n\n/** @enumType */\nexport type PositionOnPageWithLiterals =\n | PositionOnPage\n | 'UNKNOWN_POSITION'\n | 'HEAD'\n | 'BODY_START'\n | 'BODY_END';\n\nexport interface V1CustomEmbed {\n /** CustomEmbed's category */\n category?: CategoryWithLiterals;\n /**\n * CustomEmbed's html\n * @maxLength 15000\n */\n html?: string;\n}\n\nexport enum Category {\n /** Illegal type, exception will be thrown if used */\n UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY',\n /** Essential category */\n ESSENTIAL = 'ESSENTIAL',\n /** Functional category */\n FUNCTIONAL = 'FUNCTIONAL',\n /** Analytics category */\n ANALYTICS = 'ANALYTICS',\n /** Advertising category */\n ADVERTISING = 'ADVERTISING',\n /** Data to third party category */\n DATA_TO_THIRD_PARTY = 'DATA_TO_THIRD_PARTY',\n}\n\n/** @enumType */\nexport type CategoryWithLiterals =\n | Category\n | 'UNKNOWN_CATEGORY'\n | 'ESSENTIAL'\n | 'FUNCTIONAL'\n | 'ANALYTICS'\n | 'ADVERTISING'\n | 'DATA_TO_THIRD_PARTY';\n\nexport interface PageFilter {\n /**\n * Pages where the site embed will be loaded.\n * @maxLength 50\n * @maxSize 100\n */\n pageIds?: string[];\n}\n\nexport interface CreateCustomEmbedRequest {\n /** Custom embed to create. */\n customEmbed: CustomEmbed;\n}\n\nexport interface CreateCustomEmbedResponse {\n /** Created custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface GetCustomEmbedRequest {\n /**\n * Custom embed ID.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface GetCustomEmbedResponse {\n /** Requested custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedRequest {\n /** Custom embed to update. */\n customEmbed: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedResponse {\n /** Updated custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface DeleteCustomEmbedRequest {\n /**\n * Custom embed ID to delete.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface DeleteCustomEmbedResponse {}\n\nexport interface ListCustomEmbedsRequest {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListCustomEmbedsResponse {\n /** List of custom embeds. */\n customEmbeds?: CustomEmbed[];\n /** Pagination metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\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 Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateCustomEmbedApplicationErrors = {\n code?: 'SITE_EMBEDS_LIMIT_EXCEEDED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type UpdateCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface CustomEmbedCreatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is created.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_created\n * @slug created\n */\nexport declare function onCustomEmbedCreated(\n handler: (event: CustomEmbedCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedDeletedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is deleted.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_deleted\n * @slug deleted\n */\nexport declare function onCustomEmbedDeleted(\n handler: (event: CustomEmbedDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedUpdatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is updated.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_updated\n * @slug updated\n */\nexport declare function onCustomEmbedUpdated(\n handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param customEmbed - Custom embed to create.\n * @public\n * @requiredField customEmbed\n * @requiredField customEmbed.embedData\n * @requiredField customEmbed.position\n * @permissionId EDITOR.CUSTOM_EMBED_CREATE\n * @applicableIdentity APP\n * @returns Created custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed\n */\nexport async function createCustomEmbed(\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\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 customEmbed: customEmbed,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.createCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbed: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a custom embed.\n * @param customEmbedId - Custom embed ID.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @returns Requested custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed\n */\nexport async function getCustomEmbed(customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.getCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param _id - Custom embed ID.\n * @public\n * @requiredField _id\n * @requiredField customEmbed\n * @requiredField customEmbed.revision\n * @permissionId EDITOR.CUSTOM_EMBED_UPDATE\n * @applicableIdentity APP\n * @returns Updated custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed\n */\nexport async function updateCustomEmbed(\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\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 customEmbed: { ...customEmbed, id: _id },\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.updateCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { customEmbed: '$[1]' },\n explicitPathsToArguments: { 'customEmbed.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n /**\n * Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.\n * @readonly\n */\n pageFilter?: PageFilter;\n}\n\n/**\n * Permanently deletes a custom embed.\n * @param customEmbedId - Custom embed ID to delete.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_DELETE\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed\n */\nexport async function deleteCustomEmbed(customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.deleteCustomEmbed(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: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @public\n * @param options - Field options.\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds\n */\nexport async function listCustomEmbeds(\n options?: ListCustomEmbedsOptions\n): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.listCustomEmbeds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { paging: '$[0].paging' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCustomEmbedsOptions {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixEditorEmbedsV1CustomEmbedsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/embeds/v1/custom-embeds',\n destPath: '/v1/custom-embeds',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_embeds_custom-embeds';\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n */\nexport function createCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __createCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'POST' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n","import {\n createCustomEmbed as publicCreateCustomEmbed,\n getCustomEmbed as publicGetCustomEmbed,\n updateCustomEmbed as publicUpdateCustomEmbed,\n deleteCustomEmbed as publicDeleteCustomEmbed,\n listCustomEmbeds as publicListCustomEmbeds,\n} from './embeds-v1-custom-embed-custom-embeds.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 { onCustomEmbedCreated as publicOnCustomEmbedCreated } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedDeleted as publicOnCustomEmbedDeleted } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedUpdated as publicOnCustomEmbedUpdated } from './embeds-v1-custom-embed-custom-embeds.public.js';\n\nexport const createCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicCreateCustomEmbed> &\n typeof publicCreateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicCreateCustomEmbed);\nexport const getCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicGetCustomEmbed> & typeof publicGetCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicGetCustomEmbed);\nexport const updateCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCustomEmbed> &\n typeof publicUpdateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicUpdateCustomEmbed);\nexport const deleteCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicDeleteCustomEmbed> &\n typeof publicDeleteCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicDeleteCustomEmbed);\nexport const listCustomEmbeds: MaybeContext<\n BuildRESTFunction<typeof publicListCustomEmbeds> &\n typeof publicListCustomEmbeds\n> = /*#__PURE__*/ createRESTModule(publicListCustomEmbeds);\n/**\n * Triggered when a custom embed is created.\n */\nexport const onCustomEmbedCreated: BuildEventDefinition<\n typeof publicOnCustomEmbedCreated\n> &\n typeof publicOnCustomEmbedCreated = createEventModule(\n publicOnCustomEmbedCreated\n);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> &\n typeof publicOnCustomEmbedDeleted = createEventModule(\n publicOnCustomEmbedDeleted\n);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> &\n typeof publicOnCustomEmbedUpdated = createEventModule(\n publicOnCustomEmbedUpdated\n);\n\nexport {\n PositionOnPage,\n Category,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n CustomEmbed,\n V1CustomEmbed,\n PageFilter,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n ListCustomEmbedsRequest,\n CursorPaging,\n ListCustomEmbedsResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n UpdateCustomEmbed,\n ListCustomEmbedsOptions,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n PositionOnPageWithLiterals,\n CategoryWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n UpdateCustomEmbedApplicationErrors,\n DeleteCustomEmbedApplicationErrors,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAAq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AA,EACH;AACJ,EAA8B;AACvB,IAAM,2BAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA8B;;;AGtN9B,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAIlD,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated","updateCustomEmbed","import_rename_all_nested_keys","import_transform_paths","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","import_rest_modules","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated"]}
|
|
@@ -40,6 +40,11 @@ interface CustomEmbed {
|
|
|
40
40
|
position?: PositionOnPageWithLiterals;
|
|
41
41
|
/** Custom embed data. */
|
|
42
42
|
embedData?: V1CustomEmbed;
|
|
43
|
+
/**
|
|
44
|
+
* Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.
|
|
45
|
+
* @readonly
|
|
46
|
+
*/
|
|
47
|
+
pageFilter?: PageFilter;
|
|
43
48
|
}
|
|
44
49
|
declare enum PositionOnPage {
|
|
45
50
|
/** Illegal value, exception will be thrown if used */
|
|
@@ -78,6 +83,14 @@ declare enum Category {
|
|
|
78
83
|
}
|
|
79
84
|
/** @enumType */
|
|
80
85
|
type CategoryWithLiterals = Category | 'UNKNOWN_CATEGORY' | 'ESSENTIAL' | 'FUNCTIONAL' | 'ANALYTICS' | 'ADVERTISING' | 'DATA_TO_THIRD_PARTY';
|
|
86
|
+
interface PageFilter {
|
|
87
|
+
/**
|
|
88
|
+
* Pages where the site embed will be loaded.
|
|
89
|
+
* @maxLength 50
|
|
90
|
+
* @maxSize 100
|
|
91
|
+
*/
|
|
92
|
+
pageIds?: string[];
|
|
93
|
+
}
|
|
81
94
|
interface CreateCustomEmbedRequest {
|
|
82
95
|
/** Custom embed to create. */
|
|
83
96
|
customEmbed: CustomEmbed;
|
|
@@ -460,7 +473,7 @@ declare function onCustomEmbedUpdated(handler: (event: CustomEmbedUpdatedEnvelop
|
|
|
460
473
|
* @returns Created custom embed.
|
|
461
474
|
* @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed
|
|
462
475
|
*/
|
|
463
|
-
declare function createCustomEmbed(customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
476
|
+
declare function createCustomEmbed(customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
464
477
|
__applicationErrorsType?: CreateCustomEmbedApplicationErrors;
|
|
465
478
|
}>;
|
|
466
479
|
/**
|
|
@@ -473,7 +486,7 @@ declare function createCustomEmbed(customEmbed: NonNullablePaths<CustomEmbed, `e
|
|
|
473
486
|
* @returns Requested custom embed.
|
|
474
487
|
* @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed
|
|
475
488
|
*/
|
|
476
|
-
declare function getCustomEmbed(customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
489
|
+
declare function getCustomEmbed(customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
477
490
|
__applicationErrorsType?: GetCustomEmbedApplicationErrors;
|
|
478
491
|
}>;
|
|
479
492
|
/**
|
|
@@ -489,7 +502,7 @@ declare function getCustomEmbed(customEmbedId: string): Promise<NonNullablePaths
|
|
|
489
502
|
* @returns Updated custom embed.
|
|
490
503
|
* @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed
|
|
491
504
|
*/
|
|
492
|
-
declare function updateCustomEmbed(_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
|
|
505
|
+
declare function updateCustomEmbed(_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`, 3> & {
|
|
493
506
|
__applicationErrorsType?: UpdateCustomEmbedApplicationErrors;
|
|
494
507
|
}>;
|
|
495
508
|
interface UpdateCustomEmbed {
|
|
@@ -531,6 +544,11 @@ interface UpdateCustomEmbed {
|
|
|
531
544
|
position?: PositionOnPageWithLiterals;
|
|
532
545
|
/** Custom embed data. */
|
|
533
546
|
embedData?: V1CustomEmbed;
|
|
547
|
+
/**
|
|
548
|
+
* Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.
|
|
549
|
+
* @readonly
|
|
550
|
+
*/
|
|
551
|
+
pageFilter?: PageFilter;
|
|
534
552
|
}
|
|
535
553
|
/**
|
|
536
554
|
* Permanently deletes a custom embed.
|
|
@@ -558,4 +576,4 @@ interface ListCustomEmbedsOptions {
|
|
|
558
576
|
paging?: CursorPaging;
|
|
559
577
|
}
|
|
560
578
|
|
|
561
|
-
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, Category, type CategoryWithLiterals, type CreateCustomEmbedApplicationErrors, type CreateCustomEmbedRequest, type CreateCustomEmbedResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomEmbed, type CustomEmbedCreatedEnvelope, type CustomEmbedDeletedEnvelope, type CustomEmbedUpdatedEnvelope, type DeleteCustomEmbedApplicationErrors, type DeleteCustomEmbedRequest, type DeleteCustomEmbedResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetCustomEmbedApplicationErrors, type GetCustomEmbedRequest, type GetCustomEmbedResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListCustomEmbedsOptions, type ListCustomEmbedsRequest, type ListCustomEmbedsResponse, type MessageEnvelope, PositionOnPage, type PositionOnPageWithLiterals, type RestoreInfo, type UpdateCustomEmbed, type UpdateCustomEmbedApplicationErrors, type UpdateCustomEmbedRequest, type UpdateCustomEmbedResponse, type V1CustomEmbed, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, onCustomEmbedCreated, onCustomEmbedDeleted, onCustomEmbedUpdated, updateCustomEmbed };
|
|
579
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, Category, type CategoryWithLiterals, type CreateCustomEmbedApplicationErrors, type CreateCustomEmbedRequest, type CreateCustomEmbedResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type CustomEmbed, type CustomEmbedCreatedEnvelope, type CustomEmbedDeletedEnvelope, type CustomEmbedUpdatedEnvelope, type DeleteCustomEmbedApplicationErrors, type DeleteCustomEmbedRequest, type DeleteCustomEmbedResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetCustomEmbedApplicationErrors, type GetCustomEmbedRequest, type GetCustomEmbedResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListCustomEmbedsOptions, type ListCustomEmbedsRequest, type ListCustomEmbedsResponse, type MessageEnvelope, type PageFilter, PositionOnPage, type PositionOnPageWithLiterals, type RestoreInfo, type UpdateCustomEmbed, type UpdateCustomEmbedApplicationErrors, type UpdateCustomEmbedRequest, type UpdateCustomEmbedResponse, type V1CustomEmbed, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, onCustomEmbedCreated, onCustomEmbedDeleted, onCustomEmbedUpdated, updateCustomEmbed };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\nexport enum PositionOnPage {\n /** Illegal value, exception will be thrown if used */\n UNKNOWN_POSITION = 'UNKNOWN_POSITION',\n /** HEAD position */\n HEAD = 'HEAD',\n /** BODY_START position */\n BODY_START = 'BODY_START',\n /** BODY_END position */\n BODY_END = 'BODY_END',\n}\n\n/** @enumType */\nexport type PositionOnPageWithLiterals =\n | PositionOnPage\n | 'UNKNOWN_POSITION'\n | 'HEAD'\n | 'BODY_START'\n | 'BODY_END';\n\nexport interface V1CustomEmbed {\n /** CustomEmbed's category */\n category?: CategoryWithLiterals;\n /**\n * CustomEmbed's html\n * @maxLength 15000\n */\n html?: string;\n}\n\nexport enum Category {\n /** Illegal type, exception will be thrown if used */\n UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY',\n /** Essential category */\n ESSENTIAL = 'ESSENTIAL',\n /** Functional category */\n FUNCTIONAL = 'FUNCTIONAL',\n /** Analytics category */\n ANALYTICS = 'ANALYTICS',\n /** Advertising category */\n ADVERTISING = 'ADVERTISING',\n /** Data to third party category */\n DATA_TO_THIRD_PARTY = 'DATA_TO_THIRD_PARTY',\n}\n\n/** @enumType */\nexport type CategoryWithLiterals =\n | Category\n | 'UNKNOWN_CATEGORY'\n | 'ESSENTIAL'\n | 'FUNCTIONAL'\n | 'ANALYTICS'\n | 'ADVERTISING'\n | 'DATA_TO_THIRD_PARTY';\n\nexport interface CreateCustomEmbedRequest {\n /** Custom embed to create. */\n customEmbed: CustomEmbed;\n}\n\nexport interface CreateCustomEmbedResponse {\n /** Created custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface GetCustomEmbedRequest {\n /**\n * Custom embed ID.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface GetCustomEmbedResponse {\n /** Requested custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedRequest {\n /** Custom embed to update. */\n customEmbed: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedResponse {\n /** Updated custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface DeleteCustomEmbedRequest {\n /**\n * Custom embed ID to delete.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface DeleteCustomEmbedResponse {}\n\nexport interface ListCustomEmbedsRequest {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListCustomEmbedsResponse {\n /** List of custom embeds. */\n customEmbeds?: CustomEmbed[];\n /** Pagination metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\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 Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateCustomEmbedApplicationErrors = {\n code?: 'SITE_EMBEDS_LIMIT_EXCEEDED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type UpdateCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface CustomEmbedCreatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is created.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_created\n * @slug created\n */\nexport declare function onCustomEmbedCreated(\n handler: (event: CustomEmbedCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedDeletedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is deleted.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_deleted\n * @slug deleted\n */\nexport declare function onCustomEmbedDeleted(\n handler: (event: CustomEmbedDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedUpdatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is updated.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_updated\n * @slug updated\n */\nexport declare function onCustomEmbedUpdated(\n handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param customEmbed - Custom embed to create.\n * @public\n * @requiredField customEmbed\n * @requiredField customEmbed.embedData\n * @requiredField customEmbed.position\n * @permissionId EDITOR.CUSTOM_EMBED_CREATE\n * @applicableIdentity APP\n * @returns Created custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed\n */\nexport async function createCustomEmbed(\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\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 customEmbed: customEmbed,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.createCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbed: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a custom embed.\n * @param customEmbedId - Custom embed ID.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @returns Requested custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed\n */\nexport async function getCustomEmbed(customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.getCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param _id - Custom embed ID.\n * @public\n * @requiredField _id\n * @requiredField customEmbed\n * @requiredField customEmbed.revision\n * @permissionId EDITOR.CUSTOM_EMBED_UPDATE\n * @applicableIdentity APP\n * @returns Updated custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed\n */\nexport async function updateCustomEmbed(\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\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 customEmbed: { ...customEmbed, id: _id },\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.updateCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { customEmbed: '$[1]' },\n explicitPathsToArguments: { 'customEmbed.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\n/**\n * Permanently deletes a custom embed.\n * @param customEmbedId - Custom embed ID to delete.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_DELETE\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed\n */\nexport async function deleteCustomEmbed(customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.deleteCustomEmbed(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: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @public\n * @param options - Field options.\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds\n */\nexport async function listCustomEmbeds(\n options?: ListCustomEmbedsOptions\n): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.listCustomEmbeds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { paging: '$[0].paging' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCustomEmbedsOptions {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixEditorEmbedsV1CustomEmbedsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/embeds/v1/custom-embeds',\n destPath: '/v1/custom-embeds',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_embeds_custom-embeds';\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n */\nexport function createCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __createCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'POST' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA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,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","updateCustomEmbed","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n /**\n * Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.\n * @readonly\n */\n pageFilter?: PageFilter;\n}\n\nexport enum PositionOnPage {\n /** Illegal value, exception will be thrown if used */\n UNKNOWN_POSITION = 'UNKNOWN_POSITION',\n /** HEAD position */\n HEAD = 'HEAD',\n /** BODY_START position */\n BODY_START = 'BODY_START',\n /** BODY_END position */\n BODY_END = 'BODY_END',\n}\n\n/** @enumType */\nexport type PositionOnPageWithLiterals =\n | PositionOnPage\n | 'UNKNOWN_POSITION'\n | 'HEAD'\n | 'BODY_START'\n | 'BODY_END';\n\nexport interface V1CustomEmbed {\n /** CustomEmbed's category */\n category?: CategoryWithLiterals;\n /**\n * CustomEmbed's html\n * @maxLength 15000\n */\n html?: string;\n}\n\nexport enum Category {\n /** Illegal type, exception will be thrown if used */\n UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY',\n /** Essential category */\n ESSENTIAL = 'ESSENTIAL',\n /** Functional category */\n FUNCTIONAL = 'FUNCTIONAL',\n /** Analytics category */\n ANALYTICS = 'ANALYTICS',\n /** Advertising category */\n ADVERTISING = 'ADVERTISING',\n /** Data to third party category */\n DATA_TO_THIRD_PARTY = 'DATA_TO_THIRD_PARTY',\n}\n\n/** @enumType */\nexport type CategoryWithLiterals =\n | Category\n | 'UNKNOWN_CATEGORY'\n | 'ESSENTIAL'\n | 'FUNCTIONAL'\n | 'ANALYTICS'\n | 'ADVERTISING'\n | 'DATA_TO_THIRD_PARTY';\n\nexport interface PageFilter {\n /**\n * Pages where the site embed will be loaded.\n * @maxLength 50\n * @maxSize 100\n */\n pageIds?: string[];\n}\n\nexport interface CreateCustomEmbedRequest {\n /** Custom embed to create. */\n customEmbed: CustomEmbed;\n}\n\nexport interface CreateCustomEmbedResponse {\n /** Created custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface GetCustomEmbedRequest {\n /**\n * Custom embed ID.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface GetCustomEmbedResponse {\n /** Requested custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedRequest {\n /** Custom embed to update. */\n customEmbed: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedResponse {\n /** Updated custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface DeleteCustomEmbedRequest {\n /**\n * Custom embed ID to delete.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface DeleteCustomEmbedResponse {}\n\nexport interface ListCustomEmbedsRequest {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListCustomEmbedsResponse {\n /** List of custom embeds. */\n customEmbeds?: CustomEmbed[];\n /** Pagination metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\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 Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateCustomEmbedApplicationErrors = {\n code?: 'SITE_EMBEDS_LIMIT_EXCEEDED';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type UpdateCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteCustomEmbedApplicationErrors = {\n code?: 'CUSTOM_EMBED_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface CustomEmbedCreatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is created.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_created\n * @slug created\n */\nexport declare function onCustomEmbedCreated(\n handler: (event: CustomEmbedCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedDeletedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is deleted.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_deleted\n * @slug deleted\n */\nexport declare function onCustomEmbedDeleted(\n handler: (event: CustomEmbedDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface CustomEmbedUpdatedEnvelope {\n entity: CustomEmbed;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a custom embed is updated.\n * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS\n * @permissionScope Manage Marketing Tags\n * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @webhook\n * @eventType wix.embeds.v1.custom_embed_updated\n * @slug updated\n */\nexport declare function onCustomEmbedUpdated(\n handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param customEmbed - Custom embed to create.\n * @public\n * @requiredField customEmbed\n * @requiredField customEmbed.embedData\n * @requiredField customEmbed.position\n * @permissionId EDITOR.CUSTOM_EMBED_CREATE\n * @applicableIdentity APP\n * @returns Created custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed\n */\nexport async function createCustomEmbed(\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\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 customEmbed: customEmbed,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.createCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbed: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a custom embed.\n * @param customEmbedId - Custom embed ID.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @returns Requested custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed\n */\nexport async function getCustomEmbed(customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.getCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param _id - Custom embed ID.\n * @public\n * @requiredField _id\n * @requiredField customEmbed\n * @requiredField customEmbed.revision\n * @permissionId EDITOR.CUSTOM_EMBED_UPDATE\n * @applicableIdentity APP\n * @returns Updated custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed\n */\nexport async function updateCustomEmbed(\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html` | `pageFilter.pageIds`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\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 customEmbed: { ...customEmbed, id: _id },\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.updateCustomEmbed(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.customEmbed!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { customEmbed: '$[1]' },\n explicitPathsToArguments: { 'customEmbed.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'customEmbed']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateCustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n /**\n * Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.\n * @readonly\n */\n pageFilter?: PageFilter;\n}\n\n/**\n * Permanently deletes a custom embed.\n * @param customEmbedId - Custom embed ID to delete.\n * @public\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_DELETE\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed\n */\nexport async function deleteCustomEmbed(customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\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 customEmbedId: customEmbedId,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.deleteCustomEmbed(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: { customEmbedId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['customEmbedId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @public\n * @param options - Field options.\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds\n */\nexport async function listCustomEmbeds(\n options?: ListCustomEmbedsOptions\n): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixEmbedsV1CustomEmbed.listCustomEmbeds(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { paging: '$[0].paging' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListCustomEmbedsOptions {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixEditorEmbedsV1CustomEmbedsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/editor-custom-embeds',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/embeds/v1/custom-embeds',\n destPath: '/v1/custom-embeds',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_embeds_custom-embeds';\n\n/**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n */\nexport function createCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __createCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'POST' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;A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AE1B,UAAM;AAAA,EACR;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","updateCustomEmbed","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -41,6 +41,11 @@ interface CustomEmbed {
|
|
|
41
41
|
position?: PositionOnPageWithLiterals;
|
|
42
42
|
/** Custom embed data. */
|
|
43
43
|
embedData?: V1CustomEmbed;
|
|
44
|
+
/**
|
|
45
|
+
* Page IDs where the custom embed should be loaded. By default, custom embeds are applied to all site pages.
|
|
46
|
+
* @readonly
|
|
47
|
+
*/
|
|
48
|
+
pageFilter?: PageFilter;
|
|
44
49
|
}
|
|
45
50
|
declare enum PositionOnPage {
|
|
46
51
|
/** Illegal value, exception will be thrown if used */
|
|
@@ -79,6 +84,14 @@ declare enum Category {
|
|
|
79
84
|
}
|
|
80
85
|
/** @enumType */
|
|
81
86
|
type CategoryWithLiterals = Category | 'UNKNOWN_CATEGORY' | 'ESSENTIAL' | 'FUNCTIONAL' | 'ANALYTICS' | 'ADVERTISING' | 'DATA_TO_THIRD_PARTY';
|
|
87
|
+
interface PageFilter {
|
|
88
|
+
/**
|
|
89
|
+
* Pages where the site embed will be loaded.
|
|
90
|
+
* @maxLength 50
|
|
91
|
+
* @maxSize 100
|
|
92
|
+
*/
|
|
93
|
+
pageIds?: string[];
|
|
94
|
+
}
|
|
82
95
|
interface CreateCustomEmbedRequest {
|
|
83
96
|
/** Custom embed to create. */
|
|
84
97
|
customEmbed: CustomEmbed;
|
|
@@ -369,4 +382,4 @@ declare function deleteCustomEmbed(): __PublicMethodMetaInfo<'DELETE', {
|
|
|
369
382
|
}, DeleteCustomEmbedRequest$1, DeleteCustomEmbedRequest, DeleteCustomEmbedResponse$1, DeleteCustomEmbedResponse>;
|
|
370
383
|
declare function listCustomEmbeds(): __PublicMethodMetaInfo<'GET', {}, ListCustomEmbedsRequest$1, ListCustomEmbedsRequest, ListCustomEmbedsResponse$1, ListCustomEmbedsResponse>;
|
|
371
384
|
|
|
372
|
-
export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, Category as CategoryOriginal, type CategoryWithLiterals as CategoryWithLiteralsOriginal, type CreateCustomEmbedApplicationErrors as CreateCustomEmbedApplicationErrorsOriginal, type CreateCustomEmbedRequest as CreateCustomEmbedRequestOriginal, type CreateCustomEmbedResponse as CreateCustomEmbedResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type Cursors as CursorsOriginal, type CustomEmbed as CustomEmbedOriginal, type DeleteCustomEmbedApplicationErrors as DeleteCustomEmbedApplicationErrorsOriginal, type DeleteCustomEmbedRequest as DeleteCustomEmbedRequestOriginal, type DeleteCustomEmbedResponse as DeleteCustomEmbedResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type Empty as EmptyOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type GetCustomEmbedApplicationErrors as GetCustomEmbedApplicationErrorsOriginal, type GetCustomEmbedRequest as GetCustomEmbedRequestOriginal, type GetCustomEmbedResponse as GetCustomEmbedResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type ListCustomEmbedsRequest as ListCustomEmbedsRequestOriginal, type ListCustomEmbedsResponse as ListCustomEmbedsResponseOriginal, type MessageEnvelope as MessageEnvelopeOriginal, PositionOnPage as PositionOnPageOriginal, type PositionOnPageWithLiterals as PositionOnPageWithLiteralsOriginal, type RestoreInfo as RestoreInfoOriginal, type UpdateCustomEmbedApplicationErrors as UpdateCustomEmbedApplicationErrorsOriginal, type UpdateCustomEmbedRequest as UpdateCustomEmbedRequestOriginal, type UpdateCustomEmbedResponse as UpdateCustomEmbedResponseOriginal, type V1CustomEmbed as V1CustomEmbedOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, updateCustomEmbed };
|
|
385
|
+
export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, Category as CategoryOriginal, type CategoryWithLiterals as CategoryWithLiteralsOriginal, type CreateCustomEmbedApplicationErrors as CreateCustomEmbedApplicationErrorsOriginal, type CreateCustomEmbedRequest as CreateCustomEmbedRequestOriginal, type CreateCustomEmbedResponse as CreateCustomEmbedResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type Cursors as CursorsOriginal, type CustomEmbed as CustomEmbedOriginal, type DeleteCustomEmbedApplicationErrors as DeleteCustomEmbedApplicationErrorsOriginal, type DeleteCustomEmbedRequest as DeleteCustomEmbedRequestOriginal, type DeleteCustomEmbedResponse as DeleteCustomEmbedResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type Empty as EmptyOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type GetCustomEmbedApplicationErrors as GetCustomEmbedApplicationErrorsOriginal, type GetCustomEmbedRequest as GetCustomEmbedRequestOriginal, type GetCustomEmbedResponse as GetCustomEmbedResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type ListCustomEmbedsRequest as ListCustomEmbedsRequestOriginal, type ListCustomEmbedsResponse as ListCustomEmbedsResponseOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type PageFilter as PageFilterOriginal, PositionOnPage as PositionOnPageOriginal, type PositionOnPageWithLiterals as PositionOnPageWithLiteralsOriginal, type RestoreInfo as RestoreInfoOriginal, type UpdateCustomEmbedApplicationErrors as UpdateCustomEmbedApplicationErrorsOriginal, type UpdateCustomEmbedRequest as UpdateCustomEmbedRequestOriginal, type UpdateCustomEmbedResponse as UpdateCustomEmbedResponseOriginal, type V1CustomEmbed as V1CustomEmbedOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, updateCustomEmbed };
|