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