@wix/auto_sdk_embeds_custom-embeds 1.0.4 → 1.0.5

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.
@@ -104,6 +104,9 @@ function createCustomEmbed(payload) {
104
104
  method: "POST",
105
105
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed",
106
106
  packageName: PACKAGE_NAME,
107
+ migrationOptions: {
108
+ optInTransformResponse: true
109
+ },
107
110
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
108
111
  protoPath: "/v1/custom-embeds",
109
112
  data: payload,
@@ -122,6 +125,9 @@ function getCustomEmbed(payload) {
122
125
  method: "GET",
123
126
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed",
124
127
  packageName: PACKAGE_NAME,
128
+ migrationOptions: {
129
+ optInTransformResponse: true
130
+ },
125
131
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
126
132
  protoPath: "/v1/custom-embeds/{customEmbedId}",
127
133
  data: payload,
@@ -146,6 +152,9 @@ function updateCustomEmbed(payload) {
146
152
  method: "PATCH",
147
153
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed",
148
154
  packageName: PACKAGE_NAME,
155
+ migrationOptions: {
156
+ optInTransformResponse: true
157
+ },
149
158
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
150
159
  protoPath: "/v1/custom-embeds/{customEmbed.id}",
151
160
  data: serializedData,
@@ -164,6 +173,9 @@ function deleteCustomEmbed(payload) {
164
173
  method: "DELETE",
165
174
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed",
166
175
  packageName: PACKAGE_NAME,
176
+ migrationOptions: {
177
+ optInTransformResponse: true
178
+ },
167
179
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
168
180
  protoPath: "/v1/custom-embeds/{customEmbedId}",
169
181
  data: payload,
@@ -182,6 +194,9 @@ function listCustomEmbeds(payload) {
182
194
  method: "GET",
183
195
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds",
184
196
  packageName: PACKAGE_NAME,
197
+ migrationOptions: {
198
+ optInTransformResponse: true
199
+ },
185
200
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
186
201
  protoPath: "/v1/custom-embeds",
187
202
  data: payload,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/embeds-v1-custom-embed-custom-embeds.public.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts","../../src/embeds-v1-custom-embed-custom-embeds.context.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateCustomEmbedApplicationErrors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n ListCustomEmbedsOptions,\n ListCustomEmbedsResponse,\n UpdateCustomEmbed,\n UpdateCustomEmbedApplicationErrors,\n createCustomEmbed as universalCreateCustomEmbed,\n deleteCustomEmbed as universalDeleteCustomEmbed,\n getCustomEmbed as universalGetCustomEmbed,\n listCustomEmbeds as universalListCustomEmbeds,\n updateCustomEmbed as universalUpdateCustomEmbed,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/embeds' };\n\nexport function createCustomEmbed(\n httpClient: HttpClient\n): CreateCustomEmbedSignature {\n return (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ) =>\n universalCreateCustomEmbed(\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomEmbedSignature {\n /**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param - Custom embed to create.\n * @returns Created custom embed.\n */\n (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: CreateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function getCustomEmbed(\n httpClient: HttpClient\n): GetCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalGetCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCustomEmbedSignature {\n /**\n * Retrieves a custom embed.\n * @param - Custom embed ID.\n * @returns Requested custom embed.\n */\n (customEmbedId: string): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: GetCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function updateCustomEmbed(\n httpClient: HttpClient\n): UpdateCustomEmbedSignature {\n return (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ) =>\n universalUpdateCustomEmbed(\n _id,\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCustomEmbedSignature {\n /**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n * @param - Custom embed ID.\n * @returns Updated custom embed.\n */\n (\n _id: string,\n customEmbed: NonNullablePaths<UpdateCustomEmbed, `revision`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `embedData.category` | `embedData.html`,\n 3\n > & {\n __applicationErrorsType?: UpdateCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function deleteCustomEmbed(\n httpClient: HttpClient\n): DeleteCustomEmbedSignature {\n return (customEmbedId: string) =>\n universalDeleteCustomEmbed(\n customEmbedId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteCustomEmbedSignature {\n /**\n * Permanently deletes a custom embed.\n * @param - Custom embed ID to delete.\n */\n (customEmbedId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteCustomEmbedApplicationErrors;\n }\n >;\n}\n\nexport function listCustomEmbeds(\n httpClient: HttpClient\n): ListCustomEmbedsSignature {\n return (options?: ListCustomEmbedsOptions) =>\n universalListCustomEmbeds(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListCustomEmbedsSignature {\n /**\n * Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`).\n * @param - Field options.\n */\n (options?: ListCustomEmbedsOptions): Promise<\n NonNullablePaths<\n ListCustomEmbedsResponse,\n | `customEmbeds`\n | `customEmbeds.${number}.position`\n | `customEmbeds.${number}.embedData.category`\n | `customEmbeds.${number}.embedData.html`,\n 5\n >\n >;\n}\n\nexport const onCustomEmbedCreated = EventDefinition(\n 'wix.embeds.v1.custom_embed_created',\n true,\n (event: CustomEmbedCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedCreatedEnvelope>();\nexport const onCustomEmbedDeleted = EventDefinition(\n 'wix.embeds.v1.custom_embed_deleted',\n true,\n (event: CustomEmbedDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedDeletedEnvelope>();\nexport const onCustomEmbedUpdated = EventDefinition(\n 'wix.embeds.v1.custom_embed_updated',\n true,\n (event: CustomEmbedUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<CustomEmbedUpdatedEnvelope>();\n\nexport {\n 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> &\n typeof publicOnCustomEmbedCreated = createEventModule(\n publicOnCustomEmbedCreated\n);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> &\n typeof publicOnCustomEmbedDeleted = createEventModule(\n publicOnCustomEmbedDeleted\n);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> &\n typeof publicOnCustomEmbedUpdated = createEventModule(\n publicOnCustomEmbedUpdated\n);\n\nexport {\n PositionOnPage,\n Category,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n CustomEmbed,\n V1CustomEmbed,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n ListCustomEmbedsRequest,\n CursorPaging,\n ListCustomEmbedsResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n 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,QACT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AAA,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,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated","updateCustomEmbed","import_rename_all_nested_keys","import_transform_paths","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","import_rest_modules","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/embeds-v1-custom-embed-custom-embeds.public.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts","../../src/embeds-v1-custom-embed-custom-embeds.context.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateCustomEmbedApplicationErrors,\n CustomEmbed,\n CustomEmbedCreatedEnvelope,\n CustomEmbedDeletedEnvelope,\n CustomEmbedUpdatedEnvelope,\n DeleteCustomEmbedApplicationErrors,\n GetCustomEmbedApplicationErrors,\n ListCustomEmbedsOptions,\n ListCustomEmbedsResponse,\n UpdateCustomEmbed,\n UpdateCustomEmbedApplicationErrors,\n createCustomEmbed as universalCreateCustomEmbed,\n deleteCustomEmbed as universalDeleteCustomEmbed,\n getCustomEmbed as universalGetCustomEmbed,\n listCustomEmbeds as universalListCustomEmbeds,\n updateCustomEmbed as universalUpdateCustomEmbed,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/embeds' };\n\nexport function createCustomEmbed(\n httpClient: HttpClient\n): CreateCustomEmbedSignature {\n return (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ) =>\n universalCreateCustomEmbed(\n customEmbed,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomEmbedSignature {\n /**\n * Creates a custom embed within the specified position (`HEAD`, `BODY_START` or `BODY_END`).\n *\n * Required fields: `name`, `position`, `embedData` (including `category` and `html`).\n * @param - Custom embed to create.\n * @returns Created custom embed.\n */\n (\n customEmbed: NonNullablePaths<CustomEmbed, `embedData` | `position`, 2>\n ): Promise<\n NonNullablePaths<\n CustomEmbed,\n `position` | `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 migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n","import {\n createCustomEmbed as publicCreateCustomEmbed,\n getCustomEmbed as publicGetCustomEmbed,\n updateCustomEmbed as publicUpdateCustomEmbed,\n deleteCustomEmbed as publicDeleteCustomEmbed,\n listCustomEmbeds as publicListCustomEmbeds,\n} from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onCustomEmbedCreated as publicOnCustomEmbedCreated } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedDeleted as publicOnCustomEmbedDeleted } from './embeds-v1-custom-embed-custom-embeds.public.js';\nimport { onCustomEmbedUpdated as publicOnCustomEmbedUpdated } from './embeds-v1-custom-embed-custom-embeds.public.js';\n\nexport const createCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicCreateCustomEmbed> &\n typeof publicCreateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicCreateCustomEmbed);\nexport const getCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicGetCustomEmbed> & typeof publicGetCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicGetCustomEmbed);\nexport const updateCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCustomEmbed> &\n typeof publicUpdateCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicUpdateCustomEmbed);\nexport const deleteCustomEmbed: MaybeContext<\n BuildRESTFunction<typeof publicDeleteCustomEmbed> &\n typeof publicDeleteCustomEmbed\n> = /*#__PURE__*/ createRESTModule(publicDeleteCustomEmbed);\nexport const listCustomEmbeds: MaybeContext<\n BuildRESTFunction<typeof publicListCustomEmbeds> &\n typeof publicListCustomEmbeds\n> = /*#__PURE__*/ createRESTModule(publicListCustomEmbeds);\n/**\n * Triggered when a custom embed is created.\n */\nexport const onCustomEmbedCreated: BuildEventDefinition<\n typeof publicOnCustomEmbedCreated\n> &\n typeof publicOnCustomEmbedCreated = createEventModule(\n publicOnCustomEmbedCreated\n);\n/**\n * Triggered when a custom embed is deleted.\n */\nexport const onCustomEmbedDeleted: BuildEventDefinition<\n typeof publicOnCustomEmbedDeleted\n> &\n typeof publicOnCustomEmbedDeleted = createEventModule(\n publicOnCustomEmbedDeleted\n);\n/**\n * Triggered when a custom embed is updated.\n */\nexport const onCustomEmbedUpdated: BuildEventDefinition<\n typeof publicOnCustomEmbedUpdated\n> &\n typeof publicOnCustomEmbedUpdated = createEventModule(\n publicOnCustomEmbedUpdated\n);\n\nexport {\n PositionOnPage,\n Category,\n WebhookIdentityType,\n} from './embeds-v1-custom-embed-custom-embeds.universal.js';\nexport {\n CustomEmbed,\n V1CustomEmbed,\n CreateCustomEmbedRequest,\n CreateCustomEmbedResponse,\n GetCustomEmbedRequest,\n GetCustomEmbedResponse,\n UpdateCustomEmbedRequest,\n UpdateCustomEmbedResponse,\n DeleteCustomEmbedRequest,\n DeleteCustomEmbedResponse,\n ListCustomEmbedsRequest,\n CursorPaging,\n ListCustomEmbedsResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n 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,s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;AACF;AAIO,IAAMC,4BAGyB;AAAA,EACpC;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated","updateCustomEmbed","import_rename_all_nested_keys","import_transform_paths","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","import_rest_modules","createCustomEmbed","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds","onCustomEmbedCreated","onCustomEmbedDeleted","onCustomEmbedUpdated"]}
@@ -95,6 +95,9 @@ function createCustomEmbed(payload) {
95
95
  method: "POST",
96
96
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed",
97
97
  packageName: PACKAGE_NAME,
98
+ migrationOptions: {
99
+ optInTransformResponse: true
100
+ },
98
101
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
99
102
  protoPath: "/v1/custom-embeds",
100
103
  data: payload,
@@ -113,6 +116,9 @@ function getCustomEmbed(payload) {
113
116
  method: "GET",
114
117
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed",
115
118
  packageName: PACKAGE_NAME,
119
+ migrationOptions: {
120
+ optInTransformResponse: true
121
+ },
116
122
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
117
123
  protoPath: "/v1/custom-embeds/{customEmbedId}",
118
124
  data: payload,
@@ -137,6 +143,9 @@ function updateCustomEmbed(payload) {
137
143
  method: "PATCH",
138
144
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed",
139
145
  packageName: PACKAGE_NAME,
146
+ migrationOptions: {
147
+ optInTransformResponse: true
148
+ },
140
149
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
141
150
  protoPath: "/v1/custom-embeds/{customEmbed.id}",
142
151
  data: serializedData,
@@ -155,6 +164,9 @@ function deleteCustomEmbed(payload) {
155
164
  method: "DELETE",
156
165
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed",
157
166
  packageName: PACKAGE_NAME,
167
+ migrationOptions: {
168
+ optInTransformResponse: true
169
+ },
158
170
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
159
171
  protoPath: "/v1/custom-embeds/{customEmbedId}",
160
172
  data: payload,
@@ -173,6 +185,9 @@ function listCustomEmbeds(payload) {
173
185
  method: "GET",
174
186
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds",
175
187
  packageName: PACKAGE_NAME,
188
+ migrationOptions: {
189
+ optInTransformResponse: true
190
+ },
176
191
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
177
192
  protoPath: "/v1/custom-embeds",
178
193
  data: payload,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\nexport enum PositionOnPage {\n /** Illegal value, exception will be thrown if used */\n UNKNOWN_POSITION = 'UNKNOWN_POSITION',\n /** HEAD position */\n HEAD = 'HEAD',\n /** BODY_START position */\n BODY_START = 'BODY_START',\n /** BODY_END position */\n BODY_END = 'BODY_END',\n}\n\n/** @enumType */\nexport type PositionOnPageWithLiterals =\n | PositionOnPage\n | 'UNKNOWN_POSITION'\n | 'HEAD'\n | 'BODY_START'\n | 'BODY_END';\n\nexport interface V1CustomEmbed {\n /** CustomEmbed's category */\n category?: CategoryWithLiterals;\n /**\n * CustomEmbed's html\n * @maxLength 15000\n */\n html?: string;\n}\n\nexport enum Category {\n /** Illegal type, exception will be thrown if used */\n UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY',\n /** Essential category */\n ESSENTIAL = 'ESSENTIAL',\n /** Functional category */\n FUNCTIONAL = 'FUNCTIONAL',\n /** Analytics category */\n ANALYTICS = 'ANALYTICS',\n /** Advertising category */\n ADVERTISING = 'ADVERTISING',\n /** Data to third party category */\n DATA_TO_THIRD_PARTY = 'DATA_TO_THIRD_PARTY',\n}\n\n/** @enumType */\nexport type CategoryWithLiterals =\n | Category\n | 'UNKNOWN_CATEGORY'\n | 'ESSENTIAL'\n | 'FUNCTIONAL'\n | 'ANALYTICS'\n | 'ADVERTISING'\n | 'DATA_TO_THIRD_PARTY';\n\nexport interface CreateCustomEmbedRequest {\n /** Custom embed to create. */\n customEmbed: CustomEmbed;\n}\n\nexport interface CreateCustomEmbedResponse {\n /** Created custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface GetCustomEmbedRequest {\n /**\n * Custom embed ID.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface GetCustomEmbedResponse {\n /** Requested custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedRequest {\n /** Custom embed to update. */\n customEmbed: CustomEmbed;\n}\n\nexport interface UpdateCustomEmbedResponse {\n /** Updated custom embed. */\n customEmbed?: CustomEmbed;\n}\n\nexport interface DeleteCustomEmbedRequest {\n /**\n * Custom embed ID to delete.\n * @format GUID\n */\n customEmbedId: string;\n}\n\nexport interface DeleteCustomEmbedResponse {}\n\nexport interface ListCustomEmbedsRequest {\n /** Pagination options. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListCustomEmbedsResponse {\n /** List of custom embeds. */\n customEmbeds?: CustomEmbed[];\n /** Pagination metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;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,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;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SAAS;AAAA,EACnB,CAAC;AAED,QAAM,UAA2C,iBAAiB,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAJ;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,QAAQ,cAAc;AAAA,QAClD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","updateCustomEmbed","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/embeds-v1-custom-embed-custom-embeds.universal.ts","../../src/embeds-v1-custom-embed-custom-embeds.http.ts"],"sourcesContent":["export * from './src/embeds-v1-custom-embed-custom-embeds.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\n\n/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */\nexport interface CustomEmbed {\n /**\n * Custom embed ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the custom embed is updated.\n * To prevent conflicting changes, the current revision must be passed when updating a custom embed.\n * @readonly\n */\n revision?: string | null;\n /**\n * Custom embed name, as displayed to Wix users.\n * @minLength 1\n * @maxLength 100\n */\n name?: string | null;\n /**\n * Whether the custom embed is enabled on the site.\n * Default: `true`.\n */\n enabled?: boolean | null;\n /**\n * Whether to load the custom embed once during initial site rendering, rather than on each page navigation.\n * This setting affects performance and should be chosen based on the embed's functionality.\n * Default: `true`.\n */\n loadOnce?: boolean | null;\n /**\n * Site domain that's connected to the site, if relevant.\n * @format HOSTNAME\n */\n domain?: string | null;\n /** Position where the custom embed code is placed on the page. */\n position?: PositionOnPageWithLiterals;\n /** Custom embed data. */\n embedData?: V1CustomEmbed;\n}\n\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 migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createCustomEmbed;\n}\n\n/** Retrieves a custom embed. */\nexport function getCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __getCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCustomEmbed;\n}\n\n/**\n * Updates a custom embed.\n * To prevent conflicting changes, you must pass the current revision number.\n */\nexport function updateCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __updateCustomEmbed({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'PATCH' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbed.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateCustomEmbed;\n}\n\n/** Permanently deletes a custom embed. */\nexport function deleteCustomEmbed(payload: object): RequestOptionsFactory<any> {\n function __deleteCustomEmbed({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'DELETE' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds/{customEmbedId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteCustomEmbed;\n}\n\n/** Retrieves a list of up to 100 custom embeds, sorted by position (`HEAD`, `BODY_START` or `BODY_END`). */\nexport function listCustomEmbeds(payload: object): RequestOptionsFactory<any> {\n function __listCustomEmbeds({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.embeds.v1.custom_embed',\n method: 'GET' as any,\n methodFqn: 'wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({\n protoPath: '/v1/custom-embeds',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listCustomEmbeds;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;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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Q,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAH;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,eAAe,OAAO;AAAA,QAClD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,eAAe;AAAA,IAClB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAUA,eAAsBI,kBACpB,SAUA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,QAAQ,SAAS;AAAA,EACnB,CAAC;AAED,QAAM,UAA2C,iBAAiB,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAJ;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,QAAQ,cAAc;AAAA,QAClD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["createCustomEmbed","deleteCustomEmbed","getCustomEmbed","listCustomEmbeds","updateCustomEmbed","import_rest_modules","PositionOnPage","Category","WebhookIdentityType","createCustomEmbed","sdkTransformError","getCustomEmbed","updateCustomEmbed","deleteCustomEmbed","listCustomEmbeds"]}
package/build/cjs/meta.js CHANGED
@@ -88,6 +88,9 @@ function createCustomEmbed(payload) {
88
88
  method: "POST",
89
89
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed",
90
90
  packageName: PACKAGE_NAME,
91
+ migrationOptions: {
92
+ optInTransformResponse: true
93
+ },
91
94
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
92
95
  protoPath: "/v1/custom-embeds",
93
96
  data: payload,
@@ -106,6 +109,9 @@ function getCustomEmbed(payload) {
106
109
  method: "GET",
107
110
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed",
108
111
  packageName: PACKAGE_NAME,
112
+ migrationOptions: {
113
+ optInTransformResponse: true
114
+ },
109
115
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
110
116
  protoPath: "/v1/custom-embeds/{customEmbedId}",
111
117
  data: payload,
@@ -130,6 +136,9 @@ function updateCustomEmbed(payload) {
130
136
  method: "PATCH",
131
137
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed",
132
138
  packageName: PACKAGE_NAME,
139
+ migrationOptions: {
140
+ optInTransformResponse: true
141
+ },
133
142
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
134
143
  protoPath: "/v1/custom-embeds/{customEmbed.id}",
135
144
  data: serializedData,
@@ -148,6 +157,9 @@ function deleteCustomEmbed(payload) {
148
157
  method: "DELETE",
149
158
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed",
150
159
  packageName: PACKAGE_NAME,
160
+ migrationOptions: {
161
+ optInTransformResponse: true
162
+ },
151
163
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
152
164
  protoPath: "/v1/custom-embeds/{customEmbedId}",
153
165
  data: payload,
@@ -166,6 +178,9 @@ function listCustomEmbeds(payload) {
166
178
  method: "GET",
167
179
  methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds",
168
180
  packageName: PACKAGE_NAME,
181
+ migrationOptions: {
182
+ optInTransformResponse: true
183
+ },
169
184
  url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
170
185
  protoPath: "/v1/custom-embeds",
171
186
  data: payload,