@wix/auto_sdk_embeds_custom-embeds 1.0.2 → 1.0.3

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.
Files changed (29) hide show
  1. package/build/cjs/index.d.ts +17 -9
  2. package/build/cjs/index.js +1 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.ts → index.typings.d.ts} +130 -1
  5. package/build/cjs/index.typings.js +349 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +17 -9
  9. package/build/es/index.mjs +1 -0
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.mts → index.typings.d.mts} +130 -1
  12. package/build/es/index.typings.mjs +318 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +17 -9
  16. package/build/internal/cjs/index.js +1 -0
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.ts → index.typings.d.ts} +130 -1
  19. package/build/internal/cjs/index.typings.js +349 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +17 -9
  23. package/build/internal/es/index.mjs +1 -0
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.mts → index.typings.d.mts} +130 -1
  26. package/build/internal/es/index.typings.mjs +318 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +5 -4
@@ -1,6 +1,6 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { C as CustomEmbed, U as UpdateCustomEmbed, L as ListCustomEmbedsOptions, a as ListCustomEmbedsResponse, b as CustomEmbedCreatedEnvelope, c as CustomEmbedDeletedEnvelope, d as CustomEmbedUpdatedEnvelope } from './embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.js';
3
- export { A as ActionEvent, B as BaseEventMetadata, e as Category, f as CreateCustomEmbedRequest, g as CreateCustomEmbedResponse, m as CursorPaging, n as CursorPagingMetadata, o as Cursors, D as DeleteCustomEmbedRequest, k as DeleteCustomEmbedResponse, p as DomainEvent, q as DomainEventBodyOneOf, t as Empty, E as EntityCreatedEvent, s as EntityDeletedEvent, r as EntityUpdatedEvent, v as EventMetadata, G as GetCustomEmbedRequest, h as GetCustomEmbedResponse, I as IdentificationData, u as IdentificationDataIdOneOf, l as ListCustomEmbedsRequest, M as MessageEnvelope, P as PositionOnPage, R as RestoreInfo, i as UpdateCustomEmbedRequest, j as UpdateCustomEmbedResponse, V as V1CustomEmbed, W as WebhookIdentityType } from './embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.js';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { CustomEmbed, CreateCustomEmbedApplicationErrors, GetCustomEmbedApplicationErrors, UpdateCustomEmbed, UpdateCustomEmbedApplicationErrors, DeleteCustomEmbedApplicationErrors, ListCustomEmbedsOptions, ListCustomEmbedsResponse, CustomEmbedCreatedEnvelope, CustomEmbedDeletedEnvelope, CustomEmbedUpdatedEnvelope } from './index.typings.js';
3
+ export { 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';
4
4
 
5
5
  declare function createCustomEmbed$1(httpClient: HttpClient): CreateCustomEmbedSignature;
6
6
  interface CreateCustomEmbedSignature {
@@ -11,7 +11,9 @@ interface CreateCustomEmbedSignature {
11
11
  * @param - Custom embed to create.
12
12
  * @returns Created custom embed.
13
13
  */
14
- (customEmbed: CustomEmbed): Promise<CustomEmbed>;
14
+ (customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
15
+ __applicationErrorsType?: CreateCustomEmbedApplicationErrors;
16
+ }>;
15
17
  }
16
18
  declare function getCustomEmbed$1(httpClient: HttpClient): GetCustomEmbedSignature;
17
19
  interface GetCustomEmbedSignature {
@@ -20,7 +22,9 @@ interface GetCustomEmbedSignature {
20
22
  * @param - Custom embed ID.
21
23
  * @returns Requested custom embed.
22
24
  */
23
- (customEmbedId: string): Promise<CustomEmbed>;
25
+ (customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
26
+ __applicationErrorsType?: GetCustomEmbedApplicationErrors;
27
+ }>;
24
28
  }
25
29
  declare function updateCustomEmbed$1(httpClient: HttpClient): UpdateCustomEmbedSignature;
26
30
  interface UpdateCustomEmbedSignature {
@@ -30,7 +34,9 @@ interface UpdateCustomEmbedSignature {
30
34
  * @param - Custom embed ID.
31
35
  * @returns Updated custom embed.
32
36
  */
33
- (_id: string, customEmbed: UpdateCustomEmbed): Promise<CustomEmbed>;
37
+ (_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
38
+ __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;
39
+ }>;
34
40
  }
35
41
  declare function deleteCustomEmbed$1(httpClient: HttpClient): DeleteCustomEmbedSignature;
36
42
  interface DeleteCustomEmbedSignature {
@@ -38,7 +44,9 @@ interface DeleteCustomEmbedSignature {
38
44
  * Permanently deletes a custom embed.
39
45
  * @param - Custom embed ID to delete.
40
46
  */
41
- (customEmbedId: string): Promise<void>;
47
+ (customEmbedId: string): Promise<void & {
48
+ __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;
49
+ }>;
42
50
  }
43
51
  declare function listCustomEmbeds$1(httpClient: HttpClient): ListCustomEmbedsSignature;
44
52
  interface ListCustomEmbedsSignature {
@@ -46,7 +54,7 @@ interface ListCustomEmbedsSignature {
46
54
  * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).
47
55
  * @param - Field options.
48
56
  */
49
- (options?: ListCustomEmbedsOptions | undefined): Promise<ListCustomEmbedsResponse>;
57
+ (options?: ListCustomEmbedsOptions): Promise<NonNullablePaths<ListCustomEmbedsResponse, `customEmbeds` | `customEmbeds.${number}.position` | `customEmbeds.${number}.embedData.category` | `customEmbeds.${number}.embedData.html`, 5>>;
50
58
  }
51
59
  declare const onCustomEmbedCreated$1: EventDefinition<CustomEmbedCreatedEnvelope, "wix.embeds.v1.custom_embed_created">;
52
60
  declare const onCustomEmbedDeleted$1: EventDefinition<CustomEmbedDeletedEnvelope, "wix.embeds.v1.custom_embed_deleted">;
@@ -70,4 +78,4 @@ declare const onCustomEmbedDeleted: BuildEventDefinition<typeof onCustomEmbedDel
70
78
  */
71
79
  declare const onCustomEmbedUpdated: BuildEventDefinition<typeof onCustomEmbedUpdated$1>;
72
80
 
73
- export { CustomEmbed, CustomEmbedCreatedEnvelope, CustomEmbedDeletedEnvelope, CustomEmbedUpdatedEnvelope, ListCustomEmbedsOptions, ListCustomEmbedsResponse, UpdateCustomEmbed, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, onCustomEmbedCreated, onCustomEmbedDeleted, onCustomEmbedUpdated, updateCustomEmbed };
81
+ export { CreateCustomEmbedApplicationErrors, CustomEmbed, CustomEmbedCreatedEnvelope, CustomEmbedDeletedEnvelope, CustomEmbedUpdatedEnvelope, DeleteCustomEmbedApplicationErrors, GetCustomEmbedApplicationErrors, ListCustomEmbedsOptions, ListCustomEmbedsResponse, UpdateCustomEmbed, UpdateCustomEmbedApplicationErrors, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, onCustomEmbedCreated, onCustomEmbedDeleted, onCustomEmbedUpdated, updateCustomEmbed };
@@ -304,6 +304,7 @@ async function deleteCustomEmbed2(customEmbedId) {
304
304
  try {
305
305
  const result = await httpClient.request(reqOpts);
306
306
  sideEffects?.onSuccess?.(result);
307
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
307
308
  } catch (err) {
308
309
  const transformedError = (0, import_transform_error.transformError)(
309
310
  err,
@@ -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 CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n ListCustomEmbedsOptions,\n ListCustomEmbedsResponse,\n UpdateCustomEmbed,\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`>\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 (customEmbed: CustomEmbed): Promise<CustomEmbed>;\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<CustomEmbed>;\n}\n\nexport function updateCustomEmbed(\n httpClient: HttpClient\n): UpdateCustomEmbedSignature {\n return (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`>\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 (_id: string, customEmbed: UpdateCustomEmbed): Promise<CustomEmbed>;\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<void>;\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 (\n options?: ListCustomEmbedsOptions | undefined\n ): Promise<ListCustomEmbedsResponse>;\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 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}\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 BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\n */\nexport declare function onCustomEmbedUpdated(\n handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>\n): void;\n\ntype CustomEmbedNonNullablePaths =\n | `position`\n | `embedData.category`\n | `embedData.html`;\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 * @documentationMaturity preview\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`>\n): Promise<NonNullablePaths<CustomEmbed, CustomEmbedNonNullablePaths>> {\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 * @documentationMaturity preview\n * @requiredField customEmbedId\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns Requested custom embed.\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed\n */\nexport async function getCustomEmbed(\n customEmbedId: string\n): Promise<NonNullablePaths<CustomEmbed, CustomEmbedNonNullablePaths>> {\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 * @documentationMaturity preview\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`>\n): Promise<NonNullablePaths<CustomEmbed, CustomEmbedNonNullablePaths>> {\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 * @documentationMaturity preview\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<void> {\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 } 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 * @documentationMaturity preview\n * @param options - Field options.\n * @permissionId EDITOR.CUSTOM_EMBED_READ\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds\n */\nexport async function listCustomEmbeds(\n options?: ListCustomEmbedsOptions\n): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n {\n [P in CustomEmbedNonNullablePaths]: `customEmbeds.${number}.${P}`;\n }[CustomEmbedNonNullablePaths]\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 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 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 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 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 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> = createEventModule(publicOnCustomEmbedCreated);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> = createEventModule(publicOnCustomEmbedDeleted);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> = createEventModule(publicOnCustomEmbedUpdated);\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 BaseEventMetadata,\n EventMetadata,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n UpdateCustomEmbed,\n ListCustomEmbedsOptions,\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,uBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,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;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AA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,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,kBACd,YAC2B;AAC3B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,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;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;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;;;AGjK9B,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,4BAET,mDAAkB,oBAA0B;AAIzC,IAAMC,4BAET,mDAAkB,oBAA0B;AAIzC,IAAMC,4BAET,mDAAkB,oBAA0B;","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` | `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 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}\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/** @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}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 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 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 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 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 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> = createEventModule(publicOnCustomEmbedCreated);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> = createEventModule(publicOnCustomEmbedDeleted);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> = createEventModule(publicOnCustomEmbedUpdated);\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 BaseEventMetadata,\n EventMetadata,\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,uBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,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;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QAC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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;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;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,4BAET,mDAAkB,oBAA0B;AAIzC,IAAMC,4BAET,mDAAkB,oBAA0B;AAIzC,IAAMC,4BAET,mDAAkB,oBAA0B;","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,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */
2
4
  interface CustomEmbed {
3
5
  /**
@@ -298,6 +300,30 @@ declare enum WebhookIdentityType {
298
300
  }
299
301
  /** @enumType */
300
302
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
303
+ /** @docsIgnore */
304
+ type CreateCustomEmbedApplicationErrors = {
305
+ code?: 'SITE_EMBEDS_LIMIT_EXCEEDED';
306
+ description?: string;
307
+ data?: Record<string, any>;
308
+ };
309
+ /** @docsIgnore */
310
+ type GetCustomEmbedApplicationErrors = {
311
+ code?: 'CUSTOM_EMBED_NOT_FOUND';
312
+ description?: string;
313
+ data?: Record<string, any>;
314
+ };
315
+ /** @docsIgnore */
316
+ type UpdateCustomEmbedApplicationErrors = {
317
+ code?: 'CUSTOM_EMBED_NOT_FOUND';
318
+ description?: string;
319
+ data?: Record<string, any>;
320
+ };
321
+ /** @docsIgnore */
322
+ type DeleteCustomEmbedApplicationErrors = {
323
+ code?: 'CUSTOM_EMBED_NOT_FOUND';
324
+ description?: string;
325
+ data?: Record<string, any>;
326
+ };
301
327
  interface BaseEventMetadata {
302
328
  /**
303
329
  * App instance ID.
@@ -346,14 +372,96 @@ interface CustomEmbedCreatedEnvelope {
346
372
  entity: CustomEmbed;
347
373
  metadata: EventMetadata;
348
374
  }
375
+ /**
376
+ * Triggered when a custom embed is created.
377
+ * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
378
+ * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
379
+ * @permissionScope Manage Marketing Tags
380
+ * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS
381
+ * @permissionId EDITOR.CUSTOM_EMBED_READ
382
+ * @webhook
383
+ * @eventType wix.embeds.v1.custom_embed_created
384
+ * @slug created
385
+ */
386
+ declare function onCustomEmbedCreated(handler: (event: CustomEmbedCreatedEnvelope) => void | Promise<void>): void;
349
387
  interface CustomEmbedDeletedEnvelope {
350
388
  entity: CustomEmbed;
351
389
  metadata: EventMetadata;
352
390
  }
391
+ /**
392
+ * Triggered when a custom embed is deleted.
393
+ * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
394
+ * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
395
+ * @permissionScope Manage Marketing Tags
396
+ * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS
397
+ * @permissionId EDITOR.CUSTOM_EMBED_READ
398
+ * @webhook
399
+ * @eventType wix.embeds.v1.custom_embed_deleted
400
+ * @slug deleted
401
+ */
402
+ declare function onCustomEmbedDeleted(handler: (event: CustomEmbedDeletedEnvelope) => void | Promise<void>): void;
353
403
  interface CustomEmbedUpdatedEnvelope {
354
404
  entity: CustomEmbed;
355
405
  metadata: EventMetadata;
356
406
  }
407
+ /**
408
+ * Triggered when a custom embed is updated.
409
+ * @permissionScope SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
410
+ * @permissionScopeId SCOPE.EDITOR.MANAGE_CUSTOM_EMBEDS
411
+ * @permissionScope Manage Marketing Tags
412
+ * @permissionScopeId SCOPE.DC-MARKETING.MANAGE-TAGS
413
+ * @permissionId EDITOR.CUSTOM_EMBED_READ
414
+ * @webhook
415
+ * @eventType wix.embeds.v1.custom_embed_updated
416
+ * @slug updated
417
+ */
418
+ declare function onCustomEmbedUpdated(handler: (event: CustomEmbedUpdatedEnvelope) => void | Promise<void>): void;
419
+ /**
420
+ * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).
421
+ *
422
+ * Required fields: `name`, `position`, `embedData` (including `category` and `html`).
423
+ * @param customEmbed - Custom embed to create.
424
+ * @public
425
+ * @requiredField customEmbed
426
+ * @requiredField customEmbed.embedData
427
+ * @requiredField customEmbed.position
428
+ * @permissionId EDITOR.CUSTOM_EMBED_CREATE
429
+ * @applicableIdentity APP
430
+ * @returns Created custom embed.
431
+ * @fqn wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed
432
+ */
433
+ declare function createCustomEmbed(customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
434
+ __applicationErrorsType?: CreateCustomEmbedApplicationErrors;
435
+ }>;
436
+ /**
437
+ * Retrieves a custom embed.
438
+ * @param customEmbedId - Custom embed ID.
439
+ * @public
440
+ * @requiredField customEmbedId
441
+ * @permissionId EDITOR.CUSTOM_EMBED_READ
442
+ * @applicableIdentity APP
443
+ * @returns Requested custom embed.
444
+ * @fqn wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed
445
+ */
446
+ declare function getCustomEmbed(customEmbedId: string): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
447
+ __applicationErrorsType?: GetCustomEmbedApplicationErrors;
448
+ }>;
449
+ /**
450
+ * Updates a custom embed.
451
+ * To prevent conflicting changes, you must pass the current revision number.
452
+ * @param _id - Custom embed ID.
453
+ * @public
454
+ * @requiredField _id
455
+ * @requiredField customEmbed
456
+ * @requiredField customEmbed.revision
457
+ * @permissionId EDITOR.CUSTOM_EMBED_UPDATE
458
+ * @applicableIdentity APP
459
+ * @returns Updated custom embed.
460
+ * @fqn wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed
461
+ */
462
+ declare function updateCustomEmbed(_id: string, customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>): Promise<NonNullablePaths<CustomEmbed, `position` | `embedData.category` | `embedData.html`, 3> & {
463
+ __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;
464
+ }>;
357
465
  interface UpdateCustomEmbed {
358
466
  /**
359
467
  * Custom embed ID.
@@ -394,9 +502,30 @@ interface UpdateCustomEmbed {
394
502
  /** Custom embed data. */
395
503
  embedData?: V1CustomEmbed;
396
504
  }
505
+ /**
506
+ * Permanently deletes a custom embed.
507
+ * @param customEmbedId - Custom embed ID to delete.
508
+ * @public
509
+ * @requiredField customEmbedId
510
+ * @permissionId EDITOR.CUSTOM_EMBED_DELETE
511
+ * @applicableIdentity APP
512
+ * @fqn wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed
513
+ */
514
+ declare function deleteCustomEmbed(customEmbedId: string): Promise<void & {
515
+ __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;
516
+ }>;
517
+ /**
518
+ * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).
519
+ * @public
520
+ * @param options - Field options.
521
+ * @permissionId EDITOR.CUSTOM_EMBED_READ
522
+ * @applicableIdentity APP
523
+ * @fqn wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds
524
+ */
525
+ declare function listCustomEmbeds(options?: ListCustomEmbedsOptions): Promise<NonNullablePaths<ListCustomEmbedsResponse, `customEmbeds` | `customEmbeds.${number}.position` | `customEmbeds.${number}.embedData.category` | `customEmbeds.${number}.embedData.html`, 5>>;
397
526
  interface ListCustomEmbedsOptions {
398
527
  /** Pagination options. */
399
528
  paging?: CursorPaging;
400
529
  }
401
530
 
402
- export { type ActionEvent as A, type BaseEventMetadata as B, type CustomEmbed as C, type DeleteCustomEmbedRequest as D, type EntityCreatedEvent as E, type GetCustomEmbedRequest as G, type IdentificationData as I, type ListCustomEmbedsOptions as L, type MessageEnvelope as M, PositionOnPage as P, type RestoreInfo as R, type UpdateCustomEmbed as U, type V1CustomEmbed as V, WebhookIdentityType as W, type ListCustomEmbedsResponse as a, type CustomEmbedCreatedEnvelope as b, type CustomEmbedDeletedEnvelope as c, type CustomEmbedUpdatedEnvelope as d, Category as e, type CreateCustomEmbedRequest as f, type CreateCustomEmbedResponse as g, type GetCustomEmbedResponse as h, type UpdateCustomEmbedRequest as i, type UpdateCustomEmbedResponse as j, type DeleteCustomEmbedResponse as k, type ListCustomEmbedsRequest as l, type CursorPaging as m, type CursorPagingMetadata as n, type Cursors as o, type DomainEvent as p, type DomainEventBodyOneOf as q, type EntityUpdatedEvent as r, type EntityDeletedEvent as s, type Empty as t, type IdentificationDataIdOneOf as u, type EventMetadata as v };
531
+ export { 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 };