@wix/auto_sdk_embeds_custom-embeds 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.ts +402 -0
- package/build/cjs/index.d.ts +72 -0
- package/build/cjs/index.js +446 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.d.ts +190 -0
- package/build/cjs/meta.js +280 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.mts +402 -0
- package/build/es/index.d.mts +72 -0
- package/build/es/index.mjs +412 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/meta.d.mts +190 -0
- package/build/es/meta.mjs +249 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.ts +402 -0
- package/build/internal/cjs/index.d.ts +72 -0
- package/build/internal/cjs/index.js +446 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +190 -0
- package/build/internal/cjs/meta.js +280 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.d.mts +402 -0
- package/build/internal/es/index.d.mts +72 -0
- package/build/internal/es/index.mjs +412 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +190 -0
- package/build/internal/es/meta.mjs +249 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +53 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { f as CreateCustomEmbedRequest$1, g as CreateCustomEmbedResponse$1, G as GetCustomEmbedRequest$1, h as GetCustomEmbedResponse$1, i as UpdateCustomEmbedRequest$1, j as UpdateCustomEmbedResponse$1, D as DeleteCustomEmbedRequest$1, k as DeleteCustomEmbedResponse$1, l as ListCustomEmbedsRequest$1, a as ListCustomEmbedsResponse$1 } from './embeds-v1-custom-embed-custom-embeds.universal-mfBLr_Yo.mjs';
|
|
2
|
+
|
|
3
|
+
/** A custom embed is an entity that manages custom HTML and JavaScript code embedded in a site, along with its placement and properties. */
|
|
4
|
+
interface CustomEmbed {
|
|
5
|
+
/**
|
|
6
|
+
* Custom embed ID.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Revision number, which increments by 1 each time the custom embed is updated.
|
|
13
|
+
* To prevent conflicting changes, the current revision must be passed when updating a custom embed.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
revision?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Custom embed name, as displayed to Wix users.
|
|
19
|
+
* @minLength 1
|
|
20
|
+
* @maxLength 100
|
|
21
|
+
*/
|
|
22
|
+
name?: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the custom embed is enabled on the site.
|
|
25
|
+
* Default: `true`.
|
|
26
|
+
*/
|
|
27
|
+
enabled?: boolean | null;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to load the custom embed once during initial site rendering, rather than on each page navigation.
|
|
30
|
+
* This setting affects performance and should be chosen based on the embed's functionality.
|
|
31
|
+
* Default: `true`.
|
|
32
|
+
*/
|
|
33
|
+
loadOnce?: boolean | null;
|
|
34
|
+
/**
|
|
35
|
+
* Site domain that's connected to the site, if relevant.
|
|
36
|
+
* @format HOSTNAME
|
|
37
|
+
*/
|
|
38
|
+
domain?: string | null;
|
|
39
|
+
/** Position where the custom embed code is placed on the page. */
|
|
40
|
+
position?: PositionOnPageWithLiterals;
|
|
41
|
+
/** Custom embed data. */
|
|
42
|
+
embedData?: V1CustomEmbed;
|
|
43
|
+
}
|
|
44
|
+
declare enum PositionOnPage {
|
|
45
|
+
/** Illegal value, exception will be thrown if used */
|
|
46
|
+
UNKNOWN_POSITION = "UNKNOWN_POSITION",
|
|
47
|
+
/** HEAD position */
|
|
48
|
+
HEAD = "HEAD",
|
|
49
|
+
/** BODY_START position */
|
|
50
|
+
BODY_START = "BODY_START",
|
|
51
|
+
/** BODY_END position */
|
|
52
|
+
BODY_END = "BODY_END"
|
|
53
|
+
}
|
|
54
|
+
/** @enumType */
|
|
55
|
+
type PositionOnPageWithLiterals = PositionOnPage | 'UNKNOWN_POSITION' | 'HEAD' | 'BODY_START' | 'BODY_END';
|
|
56
|
+
interface V1CustomEmbed {
|
|
57
|
+
/** CustomEmbed's category */
|
|
58
|
+
category?: CategoryWithLiterals;
|
|
59
|
+
/**
|
|
60
|
+
* CustomEmbed's html
|
|
61
|
+
* @maxLength 15000
|
|
62
|
+
*/
|
|
63
|
+
html?: string;
|
|
64
|
+
}
|
|
65
|
+
declare enum Category {
|
|
66
|
+
/** Illegal type, exception will be thrown if used */
|
|
67
|
+
UNKNOWN_CATEGORY = "UNKNOWN_CATEGORY",
|
|
68
|
+
/** Essential category */
|
|
69
|
+
ESSENTIAL = "ESSENTIAL",
|
|
70
|
+
/** Functional category */
|
|
71
|
+
FUNCTIONAL = "FUNCTIONAL",
|
|
72
|
+
/** Analytics category */
|
|
73
|
+
ANALYTICS = "ANALYTICS",
|
|
74
|
+
/** Advertising category */
|
|
75
|
+
ADVERTISING = "ADVERTISING",
|
|
76
|
+
/** Data to third party category */
|
|
77
|
+
DATA_TO_THIRD_PARTY = "DATA_TO_THIRD_PARTY"
|
|
78
|
+
}
|
|
79
|
+
/** @enumType */
|
|
80
|
+
type CategoryWithLiterals = Category | 'UNKNOWN_CATEGORY' | 'ESSENTIAL' | 'FUNCTIONAL' | 'ANALYTICS' | 'ADVERTISING' | 'DATA_TO_THIRD_PARTY';
|
|
81
|
+
interface CreateCustomEmbedRequest {
|
|
82
|
+
/** Custom embed to create. */
|
|
83
|
+
customEmbed: CustomEmbed;
|
|
84
|
+
}
|
|
85
|
+
interface CreateCustomEmbedResponse {
|
|
86
|
+
/** Created custom embed. */
|
|
87
|
+
customEmbed?: CustomEmbed;
|
|
88
|
+
}
|
|
89
|
+
interface GetCustomEmbedRequest {
|
|
90
|
+
/**
|
|
91
|
+
* Custom embed ID.
|
|
92
|
+
* @format GUID
|
|
93
|
+
*/
|
|
94
|
+
customEmbedId: string;
|
|
95
|
+
}
|
|
96
|
+
interface GetCustomEmbedResponse {
|
|
97
|
+
/** Requested custom embed. */
|
|
98
|
+
customEmbed?: CustomEmbed;
|
|
99
|
+
}
|
|
100
|
+
interface UpdateCustomEmbedRequest {
|
|
101
|
+
/** Custom embed to update. */
|
|
102
|
+
customEmbed: CustomEmbed;
|
|
103
|
+
}
|
|
104
|
+
interface UpdateCustomEmbedResponse {
|
|
105
|
+
/** Updated custom embed. */
|
|
106
|
+
customEmbed?: CustomEmbed;
|
|
107
|
+
}
|
|
108
|
+
interface DeleteCustomEmbedRequest {
|
|
109
|
+
/**
|
|
110
|
+
* Custom embed ID to delete.
|
|
111
|
+
* @format GUID
|
|
112
|
+
*/
|
|
113
|
+
customEmbedId: string;
|
|
114
|
+
}
|
|
115
|
+
interface DeleteCustomEmbedResponse {
|
|
116
|
+
}
|
|
117
|
+
interface ListCustomEmbedsRequest {
|
|
118
|
+
/** Pagination options. */
|
|
119
|
+
paging?: CursorPaging;
|
|
120
|
+
}
|
|
121
|
+
interface CursorPaging {
|
|
122
|
+
/**
|
|
123
|
+
* Maximum number of items to return in the results.
|
|
124
|
+
* @max 100
|
|
125
|
+
*/
|
|
126
|
+
limit?: number | null;
|
|
127
|
+
/**
|
|
128
|
+
* Pointer to the next or previous page in the list of results.
|
|
129
|
+
*
|
|
130
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
131
|
+
* Not relevant for the first request.
|
|
132
|
+
* @maxLength 16000
|
|
133
|
+
*/
|
|
134
|
+
cursor?: string | null;
|
|
135
|
+
}
|
|
136
|
+
interface ListCustomEmbedsResponse {
|
|
137
|
+
/** List of custom embeds. */
|
|
138
|
+
customEmbeds?: CustomEmbed[];
|
|
139
|
+
/** Pagination metadata. */
|
|
140
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
141
|
+
}
|
|
142
|
+
interface CursorPagingMetadata {
|
|
143
|
+
/** Number of items returned in current page. */
|
|
144
|
+
count?: number | null;
|
|
145
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
146
|
+
cursors?: Cursors;
|
|
147
|
+
/**
|
|
148
|
+
* Whether there are more pages to retrieve following the current page.
|
|
149
|
+
*
|
|
150
|
+
* + `true`: Another page of results can be retrieved.
|
|
151
|
+
* + `false`: This is the last page.
|
|
152
|
+
*/
|
|
153
|
+
hasNext?: boolean | null;
|
|
154
|
+
}
|
|
155
|
+
interface Cursors {
|
|
156
|
+
/**
|
|
157
|
+
* Cursor string pointing to the next page in the list of results.
|
|
158
|
+
* @maxLength 16000
|
|
159
|
+
*/
|
|
160
|
+
next?: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Cursor pointing to the previous page in the list of results.
|
|
163
|
+
* @maxLength 16000
|
|
164
|
+
*/
|
|
165
|
+
prev?: string | null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
169
|
+
getUrl: (context: any) => string;
|
|
170
|
+
httpMethod: K;
|
|
171
|
+
path: string;
|
|
172
|
+
pathParams: M;
|
|
173
|
+
__requestType: T;
|
|
174
|
+
__originalRequestType: S;
|
|
175
|
+
__responseType: Q;
|
|
176
|
+
__originalResponseType: R;
|
|
177
|
+
};
|
|
178
|
+
declare function createCustomEmbed(): __PublicMethodMetaInfo<'POST', {}, CreateCustomEmbedRequest$1, CreateCustomEmbedRequest, CreateCustomEmbedResponse$1, CreateCustomEmbedResponse>;
|
|
179
|
+
declare function getCustomEmbed(): __PublicMethodMetaInfo<'GET', {
|
|
180
|
+
customEmbedId: string;
|
|
181
|
+
}, GetCustomEmbedRequest$1, GetCustomEmbedRequest, GetCustomEmbedResponse$1, GetCustomEmbedResponse>;
|
|
182
|
+
declare function updateCustomEmbed(): __PublicMethodMetaInfo<'PATCH', {
|
|
183
|
+
customEmbedId: string;
|
|
184
|
+
}, UpdateCustomEmbedRequest$1, UpdateCustomEmbedRequest, UpdateCustomEmbedResponse$1, UpdateCustomEmbedResponse>;
|
|
185
|
+
declare function deleteCustomEmbed(): __PublicMethodMetaInfo<'DELETE', {
|
|
186
|
+
customEmbedId: string;
|
|
187
|
+
}, DeleteCustomEmbedRequest$1, DeleteCustomEmbedRequest, DeleteCustomEmbedResponse$1, DeleteCustomEmbedResponse>;
|
|
188
|
+
declare function listCustomEmbeds(): __PublicMethodMetaInfo<'GET', {}, ListCustomEmbedsRequest$1, ListCustomEmbedsRequest, ListCustomEmbedsResponse$1, ListCustomEmbedsResponse>;
|
|
189
|
+
|
|
190
|
+
export { type __PublicMethodMetaInfo, createCustomEmbed, deleteCustomEmbed, getCustomEmbed, listCustomEmbeds, updateCustomEmbed };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// src/embeds-v1-custom-embed-custom-embeds.http.ts
|
|
2
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
3
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
4
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
5
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
6
|
+
function resolveWixEditorEmbedsV1CustomEmbedsServiceUrl(opts) {
|
|
7
|
+
const domainToMappings = {
|
|
8
|
+
"manage._base_domain_": [
|
|
9
|
+
{
|
|
10
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
11
|
+
destPath: ""
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"editor._base_domain_": [
|
|
15
|
+
{
|
|
16
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
17
|
+
destPath: ""
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"blocks._base_domain_": [
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
23
|
+
destPath: ""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"create.editorx": [
|
|
27
|
+
{
|
|
28
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
29
|
+
destPath: ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"*.dev.wix-code.com": [
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
35
|
+
destPath: ""
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
_: [
|
|
39
|
+
{
|
|
40
|
+
srcPath: "/_api/editor-custom-embeds",
|
|
41
|
+
destPath: ""
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"www.wixapis.com": [
|
|
45
|
+
{
|
|
46
|
+
srcPath: "/embeds/v1/custom-embeds",
|
|
47
|
+
destPath: "/v1/custom-embeds"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
52
|
+
}
|
|
53
|
+
var PACKAGE_NAME = "@wix/auto_sdk_embeds_custom-embeds";
|
|
54
|
+
function createCustomEmbed(payload) {
|
|
55
|
+
function __createCustomEmbed({ host }) {
|
|
56
|
+
const metadata = {
|
|
57
|
+
entityFqdn: "wix.embeds.v1.custom_embed",
|
|
58
|
+
method: "POST",
|
|
59
|
+
methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.CreateCustomEmbed",
|
|
60
|
+
packageName: PACKAGE_NAME,
|
|
61
|
+
url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
|
|
62
|
+
protoPath: "/v1/custom-embeds",
|
|
63
|
+
data: payload,
|
|
64
|
+
host
|
|
65
|
+
}),
|
|
66
|
+
data: payload
|
|
67
|
+
};
|
|
68
|
+
return metadata;
|
|
69
|
+
}
|
|
70
|
+
return __createCustomEmbed;
|
|
71
|
+
}
|
|
72
|
+
function getCustomEmbed(payload) {
|
|
73
|
+
function __getCustomEmbed({ host }) {
|
|
74
|
+
const metadata = {
|
|
75
|
+
entityFqdn: "wix.embeds.v1.custom_embed",
|
|
76
|
+
method: "GET",
|
|
77
|
+
methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.GetCustomEmbed",
|
|
78
|
+
packageName: PACKAGE_NAME,
|
|
79
|
+
url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
|
|
80
|
+
protoPath: "/v1/custom-embeds/{customEmbedId}",
|
|
81
|
+
data: payload,
|
|
82
|
+
host
|
|
83
|
+
}),
|
|
84
|
+
params: toURLSearchParams(payload)
|
|
85
|
+
};
|
|
86
|
+
return metadata;
|
|
87
|
+
}
|
|
88
|
+
return __getCustomEmbed;
|
|
89
|
+
}
|
|
90
|
+
function updateCustomEmbed(payload) {
|
|
91
|
+
function __updateCustomEmbed({ host }) {
|
|
92
|
+
const serializedData = transformPaths(payload, [
|
|
93
|
+
{
|
|
94
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
95
|
+
paths: [{ path: "fieldMask" }]
|
|
96
|
+
}
|
|
97
|
+
]);
|
|
98
|
+
const metadata = {
|
|
99
|
+
entityFqdn: "wix.embeds.v1.custom_embed",
|
|
100
|
+
method: "PATCH",
|
|
101
|
+
methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.UpdateCustomEmbed",
|
|
102
|
+
packageName: PACKAGE_NAME,
|
|
103
|
+
url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
|
|
104
|
+
protoPath: "/v1/custom-embeds/{customEmbed.id}",
|
|
105
|
+
data: serializedData,
|
|
106
|
+
host
|
|
107
|
+
}),
|
|
108
|
+
data: serializedData
|
|
109
|
+
};
|
|
110
|
+
return metadata;
|
|
111
|
+
}
|
|
112
|
+
return __updateCustomEmbed;
|
|
113
|
+
}
|
|
114
|
+
function deleteCustomEmbed(payload) {
|
|
115
|
+
function __deleteCustomEmbed({ host }) {
|
|
116
|
+
const metadata = {
|
|
117
|
+
entityFqdn: "wix.embeds.v1.custom_embed",
|
|
118
|
+
method: "DELETE",
|
|
119
|
+
methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.DeleteCustomEmbed",
|
|
120
|
+
packageName: PACKAGE_NAME,
|
|
121
|
+
url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
|
|
122
|
+
protoPath: "/v1/custom-embeds/{customEmbedId}",
|
|
123
|
+
data: payload,
|
|
124
|
+
host
|
|
125
|
+
}),
|
|
126
|
+
params: toURLSearchParams(payload)
|
|
127
|
+
};
|
|
128
|
+
return metadata;
|
|
129
|
+
}
|
|
130
|
+
return __deleteCustomEmbed;
|
|
131
|
+
}
|
|
132
|
+
function listCustomEmbeds(payload) {
|
|
133
|
+
function __listCustomEmbeds({ host }) {
|
|
134
|
+
const metadata = {
|
|
135
|
+
entityFqdn: "wix.embeds.v1.custom_embed",
|
|
136
|
+
method: "GET",
|
|
137
|
+
methodFqn: "wix.editor.embeds.v1.CustomEmbedsService.ListCustomEmbeds",
|
|
138
|
+
packageName: PACKAGE_NAME,
|
|
139
|
+
url: resolveWixEditorEmbedsV1CustomEmbedsServiceUrl({
|
|
140
|
+
protoPath: "/v1/custom-embeds",
|
|
141
|
+
data: payload,
|
|
142
|
+
host
|
|
143
|
+
}),
|
|
144
|
+
params: toURLSearchParams(payload)
|
|
145
|
+
};
|
|
146
|
+
return metadata;
|
|
147
|
+
}
|
|
148
|
+
return __listCustomEmbeds;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/embeds-v1-custom-embed-custom-embeds.meta.ts
|
|
152
|
+
function createCustomEmbed2() {
|
|
153
|
+
const payload = {};
|
|
154
|
+
const getRequestOptions = createCustomEmbed(payload);
|
|
155
|
+
const getUrl = (context) => {
|
|
156
|
+
const { url } = getRequestOptions(context);
|
|
157
|
+
return url;
|
|
158
|
+
};
|
|
159
|
+
return {
|
|
160
|
+
getUrl,
|
|
161
|
+
httpMethod: "POST",
|
|
162
|
+
path: "/v1/custom-embeds",
|
|
163
|
+
pathParams: {},
|
|
164
|
+
__requestType: null,
|
|
165
|
+
__originalRequestType: null,
|
|
166
|
+
__responseType: null,
|
|
167
|
+
__originalResponseType: null
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function getCustomEmbed2() {
|
|
171
|
+
const payload = { customEmbedId: ":customEmbedId" };
|
|
172
|
+
const getRequestOptions = getCustomEmbed(payload);
|
|
173
|
+
const getUrl = (context) => {
|
|
174
|
+
const { url } = getRequestOptions(context);
|
|
175
|
+
return url;
|
|
176
|
+
};
|
|
177
|
+
return {
|
|
178
|
+
getUrl,
|
|
179
|
+
httpMethod: "GET",
|
|
180
|
+
path: "/v1/custom-embeds/{customEmbedId}",
|
|
181
|
+
pathParams: { customEmbedId: "customEmbedId" },
|
|
182
|
+
__requestType: null,
|
|
183
|
+
__originalRequestType: null,
|
|
184
|
+
__responseType: null,
|
|
185
|
+
__originalResponseType: null
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function updateCustomEmbed2() {
|
|
189
|
+
const payload = { customEmbed: { id: ":customEmbedId" } };
|
|
190
|
+
const getRequestOptions = updateCustomEmbed(payload);
|
|
191
|
+
const getUrl = (context) => {
|
|
192
|
+
const { url } = getRequestOptions(context);
|
|
193
|
+
return url;
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
getUrl,
|
|
197
|
+
httpMethod: "PATCH",
|
|
198
|
+
path: "/v1/custom-embeds/{customEmbed.id}",
|
|
199
|
+
pathParams: { customEmbedId: "customEmbedId" },
|
|
200
|
+
__requestType: null,
|
|
201
|
+
__originalRequestType: null,
|
|
202
|
+
__responseType: null,
|
|
203
|
+
__originalResponseType: null
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function deleteCustomEmbed2() {
|
|
207
|
+
const payload = { customEmbedId: ":customEmbedId" };
|
|
208
|
+
const getRequestOptions = deleteCustomEmbed(payload);
|
|
209
|
+
const getUrl = (context) => {
|
|
210
|
+
const { url } = getRequestOptions(context);
|
|
211
|
+
return url;
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
getUrl,
|
|
215
|
+
httpMethod: "DELETE",
|
|
216
|
+
path: "/v1/custom-embeds/{customEmbedId}",
|
|
217
|
+
pathParams: { customEmbedId: "customEmbedId" },
|
|
218
|
+
__requestType: null,
|
|
219
|
+
__originalRequestType: null,
|
|
220
|
+
__responseType: null,
|
|
221
|
+
__originalResponseType: null
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function listCustomEmbeds2() {
|
|
225
|
+
const payload = {};
|
|
226
|
+
const getRequestOptions = listCustomEmbeds(payload);
|
|
227
|
+
const getUrl = (context) => {
|
|
228
|
+
const { url } = getRequestOptions(context);
|
|
229
|
+
return url;
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
getUrl,
|
|
233
|
+
httpMethod: "GET",
|
|
234
|
+
path: "/v1/custom-embeds",
|
|
235
|
+
pathParams: {},
|
|
236
|
+
__requestType: null,
|
|
237
|
+
__originalRequestType: null,
|
|
238
|
+
__responseType: null,
|
|
239
|
+
__originalResponseType: null
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export {
|
|
243
|
+
createCustomEmbed2 as createCustomEmbed,
|
|
244
|
+
deleteCustomEmbed2 as deleteCustomEmbed,
|
|
245
|
+
getCustomEmbed2 as getCustomEmbed,
|
|
246
|
+
listCustomEmbeds2 as listCustomEmbeds,
|
|
247
|
+
updateCustomEmbed2 as updateCustomEmbed
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/embeds-v1-custom-embed-custom-embeds.http.ts","../../src/embeds-v1-custom-embed-custom-embeds.meta.ts"],"sourcesContent":["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 * as ambassadorWixEmbedsV1CustomEmbed from './embeds-v1-custom-embed-custom-embeds.http.js';\nimport * as ambassadorWixEmbedsV1CustomEmbedTypes from './embeds-v1-custom-embed-custom-embeds.types.js';\nimport * as ambassadorWixEmbedsV1CustomEmbedUniversalTypes from './embeds-v1-custom-embed-custom-embeds.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function createCustomEmbed(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.CreateCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedTypes.CreateCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.CreateCustomEmbedResponse,\n ambassadorWixEmbedsV1CustomEmbedTypes.CreateCustomEmbedResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmbedsV1CustomEmbed.createCustomEmbed(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/custom-embeds',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getCustomEmbed(): __PublicMethodMetaInfo<\n 'GET',\n { customEmbedId: string },\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.GetCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedTypes.GetCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.GetCustomEmbedResponse,\n ambassadorWixEmbedsV1CustomEmbedTypes.GetCustomEmbedResponse\n> {\n const payload = { customEmbedId: ':customEmbedId' } as any;\n\n const getRequestOptions =\n ambassadorWixEmbedsV1CustomEmbed.getCustomEmbed(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/custom-embeds/{customEmbedId}',\n pathParams: { customEmbedId: 'customEmbedId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCustomEmbed(): __PublicMethodMetaInfo<\n 'PATCH',\n { customEmbedId: string },\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.UpdateCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedTypes.UpdateCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.UpdateCustomEmbedResponse,\n ambassadorWixEmbedsV1CustomEmbedTypes.UpdateCustomEmbedResponse\n> {\n const payload = { customEmbed: { id: ':customEmbedId' } } as any;\n\n const getRequestOptions =\n ambassadorWixEmbedsV1CustomEmbed.updateCustomEmbed(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v1/custom-embeds/{customEmbed.id}',\n pathParams: { customEmbedId: 'customEmbedId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function deleteCustomEmbed(): __PublicMethodMetaInfo<\n 'DELETE',\n { customEmbedId: string },\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.DeleteCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedTypes.DeleteCustomEmbedRequest,\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.DeleteCustomEmbedResponse,\n ambassadorWixEmbedsV1CustomEmbedTypes.DeleteCustomEmbedResponse\n> {\n const payload = { customEmbedId: ':customEmbedId' } as any;\n\n const getRequestOptions =\n ambassadorWixEmbedsV1CustomEmbed.deleteCustomEmbed(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'DELETE',\n path: '/v1/custom-embeds/{customEmbedId}',\n pathParams: { customEmbedId: 'customEmbedId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function listCustomEmbeds(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.ListCustomEmbedsRequest,\n ambassadorWixEmbedsV1CustomEmbedTypes.ListCustomEmbedsRequest,\n ambassadorWixEmbedsV1CustomEmbedUniversalTypes.ListCustomEmbedsResponse,\n ambassadorWixEmbedsV1CustomEmbedTypes.ListCustomEmbedsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmbedsV1CustomEmbed.listCustomEmbeds(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/custom-embeds',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,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