@wix/auto_sdk_rich-content_ricos-documents 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/index.d.ts +35 -0
- package/build/cjs/index.js +669 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1781 -0
- package/build/cjs/index.typings.js +638 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1679 -0
- package/build/cjs/meta.js +267 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +35 -0
- package/build/es/index.mjs +611 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +1781 -0
- package/build/es/index.typings.mjs +580 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1679 -0
- package/build/es/meta.mjs +238 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +35 -0
- package/build/internal/cjs/index.js +669 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1781 -0
- package/build/internal/cjs/index.typings.js +638 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1679 -0
- package/build/internal/cjs/meta.js +267 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +35 -0
- package/build/internal/es/index.mjs +611 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +1781 -0
- package/build/internal/es/index.typings.mjs +580 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1679 -0
- package/build/internal/es/meta.mjs +238 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +53 -0
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
// src/ricos-v1-document-ricos-documents.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/ricos-v1-document-ricos-documents.http.ts
|
|
9
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
10
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
11
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
12
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
13
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
14
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
15
|
+
function resolveWixRicosV1RicosDocumentUrl(opts) {
|
|
16
|
+
const domainToMappings = {
|
|
17
|
+
"www.wixapis.com": [
|
|
18
|
+
{
|
|
19
|
+
srcPath: "/ricos/v1/ricos-document",
|
|
20
|
+
destPath: "/v1/ricos-document"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
25
|
+
}
|
|
26
|
+
var PACKAGE_NAME = "@wix/auto_sdk_rich-content_ricos-documents";
|
|
27
|
+
function validateDocument(payload) {
|
|
28
|
+
function __validateDocument({ host }) {
|
|
29
|
+
const metadata = {
|
|
30
|
+
entityFqdn: "wix.ricos.v1.document",
|
|
31
|
+
method: "POST",
|
|
32
|
+
methodFqn: "wix.ricos.v1.RicosDocument.ValidateDocument",
|
|
33
|
+
packageName: PACKAGE_NAME,
|
|
34
|
+
url: resolveWixRicosV1RicosDocumentUrl({
|
|
35
|
+
protoPath: "/v1/ricos-document/validate",
|
|
36
|
+
data: payload,
|
|
37
|
+
host
|
|
38
|
+
}),
|
|
39
|
+
data: payload,
|
|
40
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
41
|
+
{
|
|
42
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
43
|
+
paths: [
|
|
44
|
+
{
|
|
45
|
+
path: "validDocument.nodes.galleryData.items.image.media.duration"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: "validDocument.nodes.galleryData.items.video.media.duration"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: "validDocument.nodes.galleryData.items.video.thumbnail.duration"
|
|
52
|
+
},
|
|
53
|
+
{ path: "validDocument.nodes.galleryData.options.item.ratio" },
|
|
54
|
+
{ path: "validDocument.nodes.imageData.image.duration" },
|
|
55
|
+
{ path: "validDocument.nodes.mapData.mapSettings.lat" },
|
|
56
|
+
{ path: "validDocument.nodes.mapData.mapSettings.lng" },
|
|
57
|
+
{ path: "validDocument.nodes.pollData.poll.image.duration" },
|
|
58
|
+
{
|
|
59
|
+
path: "validDocument.nodes.pollData.poll.options.image.duration"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
path: "validDocument.nodes.pollData.design.poll.background.image.duration"
|
|
63
|
+
},
|
|
64
|
+
{ path: "validDocument.nodes.appEmbedData.image.duration" },
|
|
65
|
+
{ path: "validDocument.nodes.videoData.video.duration" },
|
|
66
|
+
{ path: "validDocument.nodes.videoData.thumbnail.duration" },
|
|
67
|
+
{ path: "validDocument.nodes.audioData.audio.duration" },
|
|
68
|
+
{ path: "validDocument.nodes.audioData.coverImage.duration" }
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
73
|
+
paths: [
|
|
74
|
+
{ path: "validDocument.metadata.createdTimestamp" },
|
|
75
|
+
{ path: "validDocument.metadata.updatedTimestamp" }
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
])
|
|
79
|
+
};
|
|
80
|
+
return metadata;
|
|
81
|
+
}
|
|
82
|
+
return __validateDocument;
|
|
83
|
+
}
|
|
84
|
+
function convertToRicosDocument(payload) {
|
|
85
|
+
function __convertToRicosDocument({ host }) {
|
|
86
|
+
const metadata = {
|
|
87
|
+
entityFqdn: "wix.ricos.v1.document",
|
|
88
|
+
method: "POST",
|
|
89
|
+
methodFqn: "wix.ricos.v1.RicosDocument.ConvertToRicosDocument",
|
|
90
|
+
packageName: PACKAGE_NAME,
|
|
91
|
+
url: resolveWixRicosV1RicosDocumentUrl({
|
|
92
|
+
protoPath: "/v1/ricos-document/convert/to-ricos",
|
|
93
|
+
data: payload,
|
|
94
|
+
host
|
|
95
|
+
}),
|
|
96
|
+
data: payload,
|
|
97
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
98
|
+
{
|
|
99
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
100
|
+
paths: [
|
|
101
|
+
{ path: "document.nodes.galleryData.items.image.media.duration" },
|
|
102
|
+
{ path: "document.nodes.galleryData.items.video.media.duration" },
|
|
103
|
+
{
|
|
104
|
+
path: "document.nodes.galleryData.items.video.thumbnail.duration"
|
|
105
|
+
},
|
|
106
|
+
{ path: "document.nodes.galleryData.options.item.ratio" },
|
|
107
|
+
{ path: "document.nodes.imageData.image.duration" },
|
|
108
|
+
{ path: "document.nodes.mapData.mapSettings.lat" },
|
|
109
|
+
{ path: "document.nodes.mapData.mapSettings.lng" },
|
|
110
|
+
{ path: "document.nodes.pollData.poll.image.duration" },
|
|
111
|
+
{ path: "document.nodes.pollData.poll.options.image.duration" },
|
|
112
|
+
{
|
|
113
|
+
path: "document.nodes.pollData.design.poll.background.image.duration"
|
|
114
|
+
},
|
|
115
|
+
{ path: "document.nodes.appEmbedData.image.duration" },
|
|
116
|
+
{ path: "document.nodes.videoData.video.duration" },
|
|
117
|
+
{ path: "document.nodes.videoData.thumbnail.duration" },
|
|
118
|
+
{ path: "document.nodes.audioData.audio.duration" },
|
|
119
|
+
{ path: "document.nodes.audioData.coverImage.duration" }
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
124
|
+
paths: [
|
|
125
|
+
{ path: "document.metadata.createdTimestamp" },
|
|
126
|
+
{ path: "document.metadata.updatedTimestamp" }
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
])
|
|
130
|
+
};
|
|
131
|
+
return metadata;
|
|
132
|
+
}
|
|
133
|
+
return __convertToRicosDocument;
|
|
134
|
+
}
|
|
135
|
+
function convertFromRicosDocument(payload) {
|
|
136
|
+
function __convertFromRicosDocument({ host }) {
|
|
137
|
+
const serializedData = transformPaths(payload, [
|
|
138
|
+
{
|
|
139
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
140
|
+
paths: [
|
|
141
|
+
{ path: "document.nodes.galleryData.items.image.media.duration" },
|
|
142
|
+
{ path: "document.nodes.galleryData.items.video.media.duration" },
|
|
143
|
+
{ path: "document.nodes.galleryData.items.video.thumbnail.duration" },
|
|
144
|
+
{ path: "document.nodes.galleryData.options.item.ratio" },
|
|
145
|
+
{ path: "document.nodes.imageData.image.duration" },
|
|
146
|
+
{ path: "document.nodes.mapData.mapSettings.lat" },
|
|
147
|
+
{ path: "document.nodes.mapData.mapSettings.lng" },
|
|
148
|
+
{ path: "document.nodes.pollData.poll.image.duration" },
|
|
149
|
+
{ path: "document.nodes.pollData.poll.options.image.duration" },
|
|
150
|
+
{
|
|
151
|
+
path: "document.nodes.pollData.design.poll.background.image.duration"
|
|
152
|
+
},
|
|
153
|
+
{ path: "document.nodes.appEmbedData.image.duration" },
|
|
154
|
+
{ path: "document.nodes.videoData.video.duration" },
|
|
155
|
+
{ path: "document.nodes.videoData.thumbnail.duration" },
|
|
156
|
+
{ path: "document.nodes.audioData.audio.duration" },
|
|
157
|
+
{ path: "document.nodes.audioData.coverImage.duration" }
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
162
|
+
paths: [
|
|
163
|
+
{ path: "document.metadata.createdTimestamp" },
|
|
164
|
+
{ path: "document.metadata.updatedTimestamp" }
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]);
|
|
168
|
+
const metadata = {
|
|
169
|
+
entityFqdn: "wix.ricos.v1.document",
|
|
170
|
+
method: "POST",
|
|
171
|
+
methodFqn: "wix.ricos.v1.RicosDocument.ConvertFromRicosDocument",
|
|
172
|
+
packageName: PACKAGE_NAME,
|
|
173
|
+
url: resolveWixRicosV1RicosDocumentUrl({
|
|
174
|
+
protoPath: "/v1/ricos-document/convert/from-ricos",
|
|
175
|
+
data: serializedData,
|
|
176
|
+
host
|
|
177
|
+
}),
|
|
178
|
+
data: serializedData
|
|
179
|
+
};
|
|
180
|
+
return metadata;
|
|
181
|
+
}
|
|
182
|
+
return __convertFromRicosDocument;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// src/ricos-v1-document-ricos-documents.universal.ts
|
|
186
|
+
var Plugin = /* @__PURE__ */ ((Plugin2) => {
|
|
187
|
+
Plugin2["UNKNOWN_PLUGIN"] = "UNKNOWN_PLUGIN";
|
|
188
|
+
Plugin2["ACTION_BUTTON"] = "ACTION_BUTTON";
|
|
189
|
+
Plugin2["AUDIO"] = "AUDIO";
|
|
190
|
+
Plugin2["CODE_BLOCK"] = "CODE_BLOCK";
|
|
191
|
+
Plugin2["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
|
|
192
|
+
Plugin2["DIVIDER"] = "DIVIDER";
|
|
193
|
+
Plugin2["EMOJI"] = "EMOJI";
|
|
194
|
+
Plugin2["FILE"] = "FILE";
|
|
195
|
+
Plugin2["GALLERY"] = "GALLERY";
|
|
196
|
+
Plugin2["GIPHY"] = "GIPHY";
|
|
197
|
+
Plugin2["HASHTAG"] = "HASHTAG";
|
|
198
|
+
Plugin2["HEADING"] = "HEADING";
|
|
199
|
+
Plugin2["HTML"] = "HTML";
|
|
200
|
+
Plugin2["IMAGE"] = "IMAGE";
|
|
201
|
+
Plugin2["INDENT"] = "INDENT";
|
|
202
|
+
Plugin2["LAYOUT"] = "LAYOUT";
|
|
203
|
+
Plugin2["LINE_SPACING"] = "LINE_SPACING";
|
|
204
|
+
Plugin2["LINK"] = "LINK";
|
|
205
|
+
Plugin2["LINK_BUTTON"] = "LINK_BUTTON";
|
|
206
|
+
Plugin2["LINK_PREVIEW"] = "LINK_PREVIEW";
|
|
207
|
+
Plugin2["MENTIONS"] = "MENTIONS";
|
|
208
|
+
Plugin2["POLL"] = "POLL";
|
|
209
|
+
Plugin2["SPOILER"] = "SPOILER";
|
|
210
|
+
Plugin2["TABLE"] = "TABLE";
|
|
211
|
+
Plugin2["TEXT_COLOR"] = "TEXT_COLOR";
|
|
212
|
+
Plugin2["TEXT_HIGHLIGHT"] = "TEXT_HIGHLIGHT";
|
|
213
|
+
Plugin2["VERTICAL_EMBED"] = "VERTICAL_EMBED";
|
|
214
|
+
Plugin2["VIDEO"] = "VIDEO";
|
|
215
|
+
return Plugin2;
|
|
216
|
+
})(Plugin || {});
|
|
217
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
218
|
+
NodeType2["PARAGRAPH"] = "PARAGRAPH";
|
|
219
|
+
NodeType2["TEXT"] = "TEXT";
|
|
220
|
+
NodeType2["HEADING"] = "HEADING";
|
|
221
|
+
NodeType2["BULLETED_LIST"] = "BULLETED_LIST";
|
|
222
|
+
NodeType2["ORDERED_LIST"] = "ORDERED_LIST";
|
|
223
|
+
NodeType2["LIST_ITEM"] = "LIST_ITEM";
|
|
224
|
+
NodeType2["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
225
|
+
NodeType2["CODE_BLOCK"] = "CODE_BLOCK";
|
|
226
|
+
NodeType2["VIDEO"] = "VIDEO";
|
|
227
|
+
NodeType2["DIVIDER"] = "DIVIDER";
|
|
228
|
+
NodeType2["FILE"] = "FILE";
|
|
229
|
+
NodeType2["GALLERY"] = "GALLERY";
|
|
230
|
+
NodeType2["GIF"] = "GIF";
|
|
231
|
+
NodeType2["HTML"] = "HTML";
|
|
232
|
+
NodeType2["IMAGE"] = "IMAGE";
|
|
233
|
+
NodeType2["LINK_PREVIEW"] = "LINK_PREVIEW";
|
|
234
|
+
NodeType2["MAP"] = "MAP";
|
|
235
|
+
NodeType2["POLL"] = "POLL";
|
|
236
|
+
NodeType2["APP_EMBED"] = "APP_EMBED";
|
|
237
|
+
NodeType2["BUTTON"] = "BUTTON";
|
|
238
|
+
NodeType2["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
|
|
239
|
+
NodeType2["TABLE"] = "TABLE";
|
|
240
|
+
NodeType2["EMBED"] = "EMBED";
|
|
241
|
+
NodeType2["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
|
|
242
|
+
NodeType2["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
|
|
243
|
+
NodeType2["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
|
|
244
|
+
NodeType2["TABLE_CELL"] = "TABLE_CELL";
|
|
245
|
+
NodeType2["TABLE_ROW"] = "TABLE_ROW";
|
|
246
|
+
NodeType2["EXTERNAL"] = "EXTERNAL";
|
|
247
|
+
NodeType2["AUDIO"] = "AUDIO";
|
|
248
|
+
NodeType2["CAPTION"] = "CAPTION";
|
|
249
|
+
NodeType2["LAYOUT"] = "LAYOUT";
|
|
250
|
+
NodeType2["LAYOUT_CELL"] = "LAYOUT_CELL";
|
|
251
|
+
return NodeType2;
|
|
252
|
+
})(NodeType || {});
|
|
253
|
+
var WidthType = /* @__PURE__ */ ((WidthType2) => {
|
|
254
|
+
WidthType2["CONTENT"] = "CONTENT";
|
|
255
|
+
WidthType2["SMALL"] = "SMALL";
|
|
256
|
+
WidthType2["ORIGINAL"] = "ORIGINAL";
|
|
257
|
+
WidthType2["FULL_WIDTH"] = "FULL_WIDTH";
|
|
258
|
+
return WidthType2;
|
|
259
|
+
})(WidthType || {});
|
|
260
|
+
var PluginContainerDataAlignment = /* @__PURE__ */ ((PluginContainerDataAlignment2) => {
|
|
261
|
+
PluginContainerDataAlignment2["CENTER"] = "CENTER";
|
|
262
|
+
PluginContainerDataAlignment2["LEFT"] = "LEFT";
|
|
263
|
+
PluginContainerDataAlignment2["RIGHT"] = "RIGHT";
|
|
264
|
+
return PluginContainerDataAlignment2;
|
|
265
|
+
})(PluginContainerDataAlignment || {});
|
|
266
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
267
|
+
Type2["LINK"] = "LINK";
|
|
268
|
+
Type2["ACTION"] = "ACTION";
|
|
269
|
+
return Type2;
|
|
270
|
+
})(Type || {});
|
|
271
|
+
var Target = /* @__PURE__ */ ((Target2) => {
|
|
272
|
+
Target2["SELF"] = "SELF";
|
|
273
|
+
Target2["BLANK"] = "BLANK";
|
|
274
|
+
Target2["PARENT"] = "PARENT";
|
|
275
|
+
Target2["TOP"] = "TOP";
|
|
276
|
+
return Target2;
|
|
277
|
+
})(Target || {});
|
|
278
|
+
var TextAlignment = /* @__PURE__ */ ((TextAlignment2) => {
|
|
279
|
+
TextAlignment2["AUTO"] = "AUTO";
|
|
280
|
+
TextAlignment2["LEFT"] = "LEFT";
|
|
281
|
+
TextAlignment2["RIGHT"] = "RIGHT";
|
|
282
|
+
TextAlignment2["CENTER"] = "CENTER";
|
|
283
|
+
TextAlignment2["JUSTIFY"] = "JUSTIFY";
|
|
284
|
+
return TextAlignment2;
|
|
285
|
+
})(TextAlignment || {});
|
|
286
|
+
var LineStyle = /* @__PURE__ */ ((LineStyle2) => {
|
|
287
|
+
LineStyle2["SINGLE"] = "SINGLE";
|
|
288
|
+
LineStyle2["DOUBLE"] = "DOUBLE";
|
|
289
|
+
LineStyle2["DASHED"] = "DASHED";
|
|
290
|
+
LineStyle2["DOTTED"] = "DOTTED";
|
|
291
|
+
return LineStyle2;
|
|
292
|
+
})(LineStyle || {});
|
|
293
|
+
var Width = /* @__PURE__ */ ((Width2) => {
|
|
294
|
+
Width2["LARGE"] = "LARGE";
|
|
295
|
+
Width2["MEDIUM"] = "MEDIUM";
|
|
296
|
+
Width2["SMALL"] = "SMALL";
|
|
297
|
+
return Width2;
|
|
298
|
+
})(Width || {});
|
|
299
|
+
var Alignment = /* @__PURE__ */ ((Alignment2) => {
|
|
300
|
+
Alignment2["CENTER"] = "CENTER";
|
|
301
|
+
Alignment2["LEFT"] = "LEFT";
|
|
302
|
+
Alignment2["RIGHT"] = "RIGHT";
|
|
303
|
+
return Alignment2;
|
|
304
|
+
})(Alignment || {});
|
|
305
|
+
var ViewMode = /* @__PURE__ */ ((ViewMode2) => {
|
|
306
|
+
ViewMode2["NONE"] = "NONE";
|
|
307
|
+
ViewMode2["FULL"] = "FULL";
|
|
308
|
+
ViewMode2["MINI"] = "MINI";
|
|
309
|
+
return ViewMode2;
|
|
310
|
+
})(ViewMode || {});
|
|
311
|
+
var LayoutType = /* @__PURE__ */ ((LayoutType2) => {
|
|
312
|
+
LayoutType2["COLLAGE"] = "COLLAGE";
|
|
313
|
+
LayoutType2["MASONRY"] = "MASONRY";
|
|
314
|
+
LayoutType2["GRID"] = "GRID";
|
|
315
|
+
LayoutType2["THUMBNAIL"] = "THUMBNAIL";
|
|
316
|
+
LayoutType2["SLIDER"] = "SLIDER";
|
|
317
|
+
LayoutType2["SLIDESHOW"] = "SLIDESHOW";
|
|
318
|
+
LayoutType2["PANORAMA"] = "PANORAMA";
|
|
319
|
+
LayoutType2["COLUMN"] = "COLUMN";
|
|
320
|
+
LayoutType2["MAGIC"] = "MAGIC";
|
|
321
|
+
LayoutType2["FULLSIZE"] = "FULLSIZE";
|
|
322
|
+
return LayoutType2;
|
|
323
|
+
})(LayoutType || {});
|
|
324
|
+
var Orientation = /* @__PURE__ */ ((Orientation2) => {
|
|
325
|
+
Orientation2["ROWS"] = "ROWS";
|
|
326
|
+
Orientation2["COLUMNS"] = "COLUMNS";
|
|
327
|
+
return Orientation2;
|
|
328
|
+
})(Orientation || {});
|
|
329
|
+
var Crop = /* @__PURE__ */ ((Crop2) => {
|
|
330
|
+
Crop2["FILL"] = "FILL";
|
|
331
|
+
Crop2["FIT"] = "FIT";
|
|
332
|
+
return Crop2;
|
|
333
|
+
})(Crop || {});
|
|
334
|
+
var ThumbnailsAlignment = /* @__PURE__ */ ((ThumbnailsAlignment2) => {
|
|
335
|
+
ThumbnailsAlignment2["TOP"] = "TOP";
|
|
336
|
+
ThumbnailsAlignment2["RIGHT"] = "RIGHT";
|
|
337
|
+
ThumbnailsAlignment2["BOTTOM"] = "BOTTOM";
|
|
338
|
+
ThumbnailsAlignment2["LEFT"] = "LEFT";
|
|
339
|
+
ThumbnailsAlignment2["NONE"] = "NONE";
|
|
340
|
+
return ThumbnailsAlignment2;
|
|
341
|
+
})(ThumbnailsAlignment || {});
|
|
342
|
+
var GIFType = /* @__PURE__ */ ((GIFType2) => {
|
|
343
|
+
GIFType2["NORMAL"] = "NORMAL";
|
|
344
|
+
GIFType2["STICKER"] = "STICKER";
|
|
345
|
+
return GIFType2;
|
|
346
|
+
})(GIFType || {});
|
|
347
|
+
var Source = /* @__PURE__ */ ((Source2) => {
|
|
348
|
+
Source2["HTML"] = "HTML";
|
|
349
|
+
Source2["ADSENSE"] = "ADSENSE";
|
|
350
|
+
return Source2;
|
|
351
|
+
})(Source || {});
|
|
352
|
+
var Position = /* @__PURE__ */ ((Position2) => {
|
|
353
|
+
Position2["START"] = "START";
|
|
354
|
+
Position2["END"] = "END";
|
|
355
|
+
Position2["TOP"] = "TOP";
|
|
356
|
+
Position2["HIDDEN"] = "HIDDEN";
|
|
357
|
+
return Position2;
|
|
358
|
+
})(Position || {});
|
|
359
|
+
var MapType = /* @__PURE__ */ ((MapType2) => {
|
|
360
|
+
MapType2["ROADMAP"] = "ROADMAP";
|
|
361
|
+
MapType2["SATELITE"] = "SATELITE";
|
|
362
|
+
MapType2["HYBRID"] = "HYBRID";
|
|
363
|
+
MapType2["TERRAIN"] = "TERRAIN";
|
|
364
|
+
return MapType2;
|
|
365
|
+
})(MapType || {});
|
|
366
|
+
var ViewRole = /* @__PURE__ */ ((ViewRole2) => {
|
|
367
|
+
ViewRole2["CREATOR"] = "CREATOR";
|
|
368
|
+
ViewRole2["VOTERS"] = "VOTERS";
|
|
369
|
+
ViewRole2["EVERYONE"] = "EVERYONE";
|
|
370
|
+
return ViewRole2;
|
|
371
|
+
})(ViewRole || {});
|
|
372
|
+
var VoteRole = /* @__PURE__ */ ((VoteRole2) => {
|
|
373
|
+
VoteRole2["SITE_MEMBERS"] = "SITE_MEMBERS";
|
|
374
|
+
VoteRole2["ALL"] = "ALL";
|
|
375
|
+
return VoteRole2;
|
|
376
|
+
})(VoteRole || {});
|
|
377
|
+
var PollLayoutType = /* @__PURE__ */ ((PollLayoutType2) => {
|
|
378
|
+
PollLayoutType2["LIST"] = "LIST";
|
|
379
|
+
PollLayoutType2["GRID"] = "GRID";
|
|
380
|
+
return PollLayoutType2;
|
|
381
|
+
})(PollLayoutType || {});
|
|
382
|
+
var PollLayoutDirection = /* @__PURE__ */ ((PollLayoutDirection2) => {
|
|
383
|
+
PollLayoutDirection2["LTR"] = "LTR";
|
|
384
|
+
PollLayoutDirection2["RTL"] = "RTL";
|
|
385
|
+
return PollLayoutDirection2;
|
|
386
|
+
})(PollLayoutDirection || {});
|
|
387
|
+
var BackgroundType = /* @__PURE__ */ ((BackgroundType2) => {
|
|
388
|
+
BackgroundType2["COLOR"] = "COLOR";
|
|
389
|
+
BackgroundType2["IMAGE"] = "IMAGE";
|
|
390
|
+
BackgroundType2["GRADIENT"] = "GRADIENT";
|
|
391
|
+
return BackgroundType2;
|
|
392
|
+
})(BackgroundType || {});
|
|
393
|
+
var DecorationType = /* @__PURE__ */ ((DecorationType2) => {
|
|
394
|
+
DecorationType2["BOLD"] = "BOLD";
|
|
395
|
+
DecorationType2["ITALIC"] = "ITALIC";
|
|
396
|
+
DecorationType2["UNDERLINE"] = "UNDERLINE";
|
|
397
|
+
DecorationType2["SPOILER"] = "SPOILER";
|
|
398
|
+
DecorationType2["ANCHOR"] = "ANCHOR";
|
|
399
|
+
DecorationType2["MENTION"] = "MENTION";
|
|
400
|
+
DecorationType2["LINK"] = "LINK";
|
|
401
|
+
DecorationType2["COLOR"] = "COLOR";
|
|
402
|
+
DecorationType2["FONT_SIZE"] = "FONT_SIZE";
|
|
403
|
+
DecorationType2["EXTERNAL"] = "EXTERNAL";
|
|
404
|
+
DecorationType2["STRIKETHROUGH"] = "STRIKETHROUGH";
|
|
405
|
+
DecorationType2["SUPERSCRIPT"] = "SUPERSCRIPT";
|
|
406
|
+
DecorationType2["SUBSCRIPT"] = "SUBSCRIPT";
|
|
407
|
+
return DecorationType2;
|
|
408
|
+
})(DecorationType || {});
|
|
409
|
+
var FontType = /* @__PURE__ */ ((FontType2) => {
|
|
410
|
+
FontType2["PX"] = "PX";
|
|
411
|
+
FontType2["EM"] = "EM";
|
|
412
|
+
return FontType2;
|
|
413
|
+
})(FontType || {});
|
|
414
|
+
var AppType = /* @__PURE__ */ ((AppType2) => {
|
|
415
|
+
AppType2["PRODUCT"] = "PRODUCT";
|
|
416
|
+
AppType2["EVENT"] = "EVENT";
|
|
417
|
+
AppType2["BOOKING"] = "BOOKING";
|
|
418
|
+
return AppType2;
|
|
419
|
+
})(AppType || {});
|
|
420
|
+
var InitialExpandedItems = /* @__PURE__ */ ((InitialExpandedItems2) => {
|
|
421
|
+
InitialExpandedItems2["FIRST"] = "FIRST";
|
|
422
|
+
InitialExpandedItems2["ALL"] = "ALL";
|
|
423
|
+
InitialExpandedItems2["NONE"] = "NONE";
|
|
424
|
+
return InitialExpandedItems2;
|
|
425
|
+
})(InitialExpandedItems || {});
|
|
426
|
+
var Direction = /* @__PURE__ */ ((Direction2) => {
|
|
427
|
+
Direction2["LTR"] = "LTR";
|
|
428
|
+
Direction2["RTL"] = "RTL";
|
|
429
|
+
return Direction2;
|
|
430
|
+
})(Direction || {});
|
|
431
|
+
var VerticalAlignment = /* @__PURE__ */ ((VerticalAlignment2) => {
|
|
432
|
+
VerticalAlignment2["TOP"] = "TOP";
|
|
433
|
+
VerticalAlignment2["MIDDLE"] = "MIDDLE";
|
|
434
|
+
VerticalAlignment2["BOTTOM"] = "BOTTOM";
|
|
435
|
+
return VerticalAlignment2;
|
|
436
|
+
})(VerticalAlignment || {});
|
|
437
|
+
var NullValue = /* @__PURE__ */ ((NullValue2) => {
|
|
438
|
+
NullValue2["NULL_VALUE"] = "NULL_VALUE";
|
|
439
|
+
return NullValue2;
|
|
440
|
+
})(NullValue || {});
|
|
441
|
+
var TargetFormat = /* @__PURE__ */ ((TargetFormat2) => {
|
|
442
|
+
TargetFormat2["UNKNOWN_TARGET_FORMAT"] = "UNKNOWN_TARGET_FORMAT";
|
|
443
|
+
TargetFormat2["MARKDOWN"] = "MARKDOWN";
|
|
444
|
+
TargetFormat2["HTML"] = "HTML";
|
|
445
|
+
TargetFormat2["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
446
|
+
return TargetFormat2;
|
|
447
|
+
})(TargetFormat || {});
|
|
448
|
+
async function validateDocument2(document, options) {
|
|
449
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
450
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
451
|
+
document,
|
|
452
|
+
plugins: options?.plugins,
|
|
453
|
+
fixDocument: options?.fixDocument
|
|
454
|
+
});
|
|
455
|
+
const reqOpts = validateDocument(payload);
|
|
456
|
+
sideEffects?.onSiteCall?.();
|
|
457
|
+
try {
|
|
458
|
+
const result = await httpClient.request(reqOpts);
|
|
459
|
+
sideEffects?.onSuccess?.(result);
|
|
460
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
461
|
+
} catch (err) {
|
|
462
|
+
const transformedError = sdkTransformError(
|
|
463
|
+
err,
|
|
464
|
+
{
|
|
465
|
+
spreadPathsToArguments: {},
|
|
466
|
+
explicitPathsToArguments: {
|
|
467
|
+
document: "$[0]",
|
|
468
|
+
plugins: "$[1].plugins",
|
|
469
|
+
fixDocument: "$[1].fixDocument"
|
|
470
|
+
},
|
|
471
|
+
singleArgumentUnchanged: false
|
|
472
|
+
},
|
|
473
|
+
["document", "options"]
|
|
474
|
+
);
|
|
475
|
+
sideEffects?.onError?.(err);
|
|
476
|
+
throw transformedError;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
async function convertToRicosDocument2(options) {
|
|
480
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
481
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
482
|
+
markdown: options?.markdown,
|
|
483
|
+
html: options?.html,
|
|
484
|
+
plainText: options?.plainText,
|
|
485
|
+
options: options?.options
|
|
486
|
+
});
|
|
487
|
+
const reqOpts = convertToRicosDocument(payload);
|
|
488
|
+
sideEffects?.onSiteCall?.();
|
|
489
|
+
try {
|
|
490
|
+
const result = await httpClient.request(reqOpts);
|
|
491
|
+
sideEffects?.onSuccess?.(result);
|
|
492
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
493
|
+
} catch (err) {
|
|
494
|
+
const transformedError = sdkTransformError(
|
|
495
|
+
err,
|
|
496
|
+
{
|
|
497
|
+
spreadPathsToArguments: {},
|
|
498
|
+
explicitPathsToArguments: {
|
|
499
|
+
markdown: "$[0].markdown",
|
|
500
|
+
html: "$[0].html",
|
|
501
|
+
plainText: "$[0].plainText",
|
|
502
|
+
options: "$[0].options"
|
|
503
|
+
},
|
|
504
|
+
singleArgumentUnchanged: false
|
|
505
|
+
},
|
|
506
|
+
["options"]
|
|
507
|
+
);
|
|
508
|
+
sideEffects?.onError?.(err);
|
|
509
|
+
throw transformedError;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
async function convertFromRicosDocument2(document, options) {
|
|
513
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
514
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
515
|
+
document,
|
|
516
|
+
targetFormat: options?.targetFormat,
|
|
517
|
+
plainTextOptions: options?.plainTextOptions
|
|
518
|
+
});
|
|
519
|
+
const reqOpts = convertFromRicosDocument(payload);
|
|
520
|
+
sideEffects?.onSiteCall?.();
|
|
521
|
+
try {
|
|
522
|
+
const result = await httpClient.request(reqOpts);
|
|
523
|
+
sideEffects?.onSuccess?.(result);
|
|
524
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
525
|
+
} catch (err) {
|
|
526
|
+
const transformedError = sdkTransformError(
|
|
527
|
+
err,
|
|
528
|
+
{
|
|
529
|
+
spreadPathsToArguments: {},
|
|
530
|
+
explicitPathsToArguments: {
|
|
531
|
+
document: "$[0]",
|
|
532
|
+
targetFormat: "$[1].targetFormat",
|
|
533
|
+
plainTextOptions: "$[1].plainTextOptions"
|
|
534
|
+
},
|
|
535
|
+
singleArgumentUnchanged: false
|
|
536
|
+
},
|
|
537
|
+
["document", "options"]
|
|
538
|
+
);
|
|
539
|
+
sideEffects?.onError?.(err);
|
|
540
|
+
throw transformedError;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// src/ricos-v1-document-ricos-documents.public.ts
|
|
545
|
+
function validateDocument3(httpClient) {
|
|
546
|
+
return (document, options) => validateDocument2(
|
|
547
|
+
document,
|
|
548
|
+
options,
|
|
549
|
+
// @ts-ignore
|
|
550
|
+
{ httpClient }
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
function convertToRicosDocument3(httpClient) {
|
|
554
|
+
return (options) => convertToRicosDocument2(
|
|
555
|
+
options,
|
|
556
|
+
// @ts-ignore
|
|
557
|
+
{ httpClient }
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
function convertFromRicosDocument3(httpClient) {
|
|
561
|
+
return (document, options) => convertFromRicosDocument2(
|
|
562
|
+
document,
|
|
563
|
+
options,
|
|
564
|
+
// @ts-ignore
|
|
565
|
+
{ httpClient }
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// src/ricos-v1-document-ricos-documents.context.ts
|
|
570
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
571
|
+
var validateDocument4 = /* @__PURE__ */ createRESTModule(validateDocument3);
|
|
572
|
+
var convertToRicosDocument4 = /* @__PURE__ */ createRESTModule(convertToRicosDocument3);
|
|
573
|
+
var convertFromRicosDocument4 = /* @__PURE__ */ createRESTModule(convertFromRicosDocument3);
|
|
574
|
+
export {
|
|
575
|
+
Alignment,
|
|
576
|
+
AppType,
|
|
577
|
+
BackgroundType,
|
|
578
|
+
Crop,
|
|
579
|
+
DecorationType,
|
|
580
|
+
Direction,
|
|
581
|
+
FontType,
|
|
582
|
+
GIFType,
|
|
583
|
+
InitialExpandedItems,
|
|
584
|
+
LayoutType,
|
|
585
|
+
LineStyle,
|
|
586
|
+
MapType,
|
|
587
|
+
NodeType,
|
|
588
|
+
NullValue,
|
|
589
|
+
Orientation,
|
|
590
|
+
Plugin,
|
|
591
|
+
PluginContainerDataAlignment,
|
|
592
|
+
PollLayoutDirection,
|
|
593
|
+
PollLayoutType,
|
|
594
|
+
Position,
|
|
595
|
+
Source,
|
|
596
|
+
Target,
|
|
597
|
+
TargetFormat,
|
|
598
|
+
TextAlignment,
|
|
599
|
+
ThumbnailsAlignment,
|
|
600
|
+
Type,
|
|
601
|
+
VerticalAlignment,
|
|
602
|
+
ViewMode,
|
|
603
|
+
ViewRole,
|
|
604
|
+
VoteRole,
|
|
605
|
+
Width,
|
|
606
|
+
WidthType,
|
|
607
|
+
convertFromRicosDocument4 as convertFromRicosDocument,
|
|
608
|
+
convertToRicosDocument4 as convertToRicosDocument,
|
|
609
|
+
validateDocument4 as validateDocument
|
|
610
|
+
};
|
|
611
|
+
//# sourceMappingURL=index.mjs.map
|