@wix/blog 1.0.191 → 1.0.192

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 (51) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +2 -1
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +2 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/src/blog-v3-draft.http.d.ts +68 -0
  11. package/build/cjs/src/blog-v3-draft.http.js +905 -0
  12. package/build/cjs/src/blog-v3-draft.http.js.map +1 -0
  13. package/build/cjs/src/blog-v3-draft.meta.d.ts +38 -0
  14. package/build/cjs/src/blog-v3-draft.meta.js +252 -0
  15. package/build/cjs/src/blog-v3-draft.meta.js.map +1 -0
  16. package/build/cjs/src/blog-v3-draft.public.d.ts +1579 -0
  17. package/build/cjs/src/blog-v3-draft.public.js +116 -0
  18. package/build/cjs/src/blog-v3-draft.public.js.map +1 -0
  19. package/build/cjs/src/blog-v3-draft.types.d.ts +7869 -0
  20. package/build/cjs/src/blog-v3-draft.types.js +456 -0
  21. package/build/cjs/src/blog-v3-draft.types.js.map +1 -0
  22. package/build/cjs/src/blog-v3-draft.universal.d.ts +7608 -0
  23. package/build/cjs/src/blog-v3-draft.universal.js +1358 -0
  24. package/build/cjs/src/blog-v3-draft.universal.js.map +1 -0
  25. package/build/cjs/src/blog-v3-post.types.d.ts +4 -0
  26. package/build/es/index.d.ts +1 -0
  27. package/build/es/index.js +1 -0
  28. package/build/es/index.js.map +1 -1
  29. package/build/es/index.typings.d.ts +1 -0
  30. package/build/es/index.typings.js +1 -0
  31. package/build/es/index.typings.js.map +1 -1
  32. package/build/es/meta.d.ts +1 -0
  33. package/build/es/meta.js +1 -0
  34. package/build/es/meta.js.map +1 -1
  35. package/build/es/src/blog-v3-draft.http.d.ts +68 -0
  36. package/build/es/src/blog-v3-draft.http.js +890 -0
  37. package/build/es/src/blog-v3-draft.http.js.map +1 -0
  38. package/build/es/src/blog-v3-draft.meta.d.ts +38 -0
  39. package/build/es/src/blog-v3-draft.meta.js +218 -0
  40. package/build/es/src/blog-v3-draft.meta.js.map +1 -0
  41. package/build/es/src/blog-v3-draft.public.d.ts +1579 -0
  42. package/build/es/src/blog-v3-draft.public.js +64 -0
  43. package/build/es/src/blog-v3-draft.public.js.map +1 -0
  44. package/build/es/src/blog-v3-draft.types.d.ts +7869 -0
  45. package/build/es/src/blog-v3-draft.types.js +453 -0
  46. package/build/es/src/blog-v3-draft.types.js.map +1 -0
  47. package/build/es/src/blog-v3-draft.universal.d.ts +7608 -0
  48. package/build/es/src/blog-v3-draft.universal.js +1324 -0
  49. package/build/es/src/blog-v3-draft.universal.js.map +1 -0
  50. package/build/es/src/blog-v3-post.types.d.ts +4 -0
  51. package/package.json +2 -2
@@ -0,0 +1,1324 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
11
+ import * as ambassadorWixBlogV3Draft from './blog-v3-draft.http';
12
+ // @ts-ignore
13
+ import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
14
+ let __verbose = false;
15
+ function __log(...args) {
16
+ __verbose && console.log(...args);
17
+ }
18
+ function __inspect(obj) {
19
+ return obj;
20
+ }
21
+ export const __debug = {
22
+ verboseLogging: {
23
+ on: () => (__verbose = true),
24
+ off: () => (__verbose = false),
25
+ },
26
+ };
27
+ const _toVeloEntity = '$';
28
+ const _fromVeloEntity = '$';
29
+ export var Origin;
30
+ (function (Origin) {
31
+ Origin["UNKNOWN"] = "UNKNOWN";
32
+ /** Changed by admin */
33
+ Origin["ADMIN"] = "ADMIN";
34
+ /** Categories were changed */
35
+ Origin["ADD_CATEGORIES"] = "ADD_CATEGORIES";
36
+ /** Saved automatically */
37
+ Origin["AUTO_SAVE"] = "AUTO_SAVE";
38
+ /** Copied from template */
39
+ Origin["COPY_TEMPLATE"] = "COPY_TEMPLATE";
40
+ /** Imported */
41
+ Origin["IMPORT"] = "IMPORT";
42
+ /** Imported in bulk */
43
+ Origin["IMPORT_BULK"] = "IMPORT_BULK";
44
+ /** Imported with html import */
45
+ Origin["IMPORT_HTML"] = "IMPORT_HTML";
46
+ /** Patch import */
47
+ Origin["IMPORT_PATCH"] = "IMPORT_PATCH";
48
+ /** Changed language */
49
+ Origin["LANGUAGE_CHANGE"] = "LANGUAGE_CHANGE";
50
+ /** Saved manually */
51
+ Origin["MANUAL_SAVE"] = "MANUAL_SAVE";
52
+ /** Affected by migration */
53
+ Origin["MIGRATION"] = "MIGRATION";
54
+ /** Affected by moderation */
55
+ Origin["MODERATION"] = "MODERATION";
56
+ /** Moved to trash */
57
+ Origin["MOVE_TO_TRASH"] = "MOVE_TO_TRASH";
58
+ /** Pricing plans were changed */
59
+ Origin["PRICING_PLANS_CHANGE"] = "PRICING_PLANS_CHANGE";
60
+ /** Was provisioned */
61
+ Origin["PROVISION"] = "PROVISION";
62
+ /** Was published */
63
+ Origin["PUBLISH"] = "PUBLISH";
64
+ /** Owner was reassigned */
65
+ Origin["REASSIGN_OWNER"] = "REASSIGN_OWNER";
66
+ /** Was reblogged */
67
+ Origin["REBLOG"] = "REBLOG";
68
+ /** Was restored */
69
+ Origin["RESTORE"] = "RESTORE";
70
+ /** Reverted to draft */
71
+ Origin["REVERT_TO_DRAFT"] = "REVERT_TO_DRAFT";
72
+ /** Was translated */
73
+ Origin["TRANSLATION"] = "TRANSLATION";
74
+ /** Was unpublished */
75
+ Origin["UNPUBLISH"] = "UNPUBLISH";
76
+ /** Was unscheduled */
77
+ Origin["UNSCHEDULE"] = "UNSCHEDULE";
78
+ /** New edit session started which updated editing_session_id id */
79
+ Origin["NEW_EDIT_SESSION"] = "NEW_EDIT_SESSION";
80
+ /** Was scheduled by Later */
81
+ Origin["SCHEDULING_SERVICE_SCHEDULE"] = "SCHEDULING_SERVICE_SCHEDULE";
82
+ /** Was unscheduled by Later */
83
+ Origin["SCHEDULING_SERVICE_UNSCHEDULE"] = "SCHEDULING_SERVICE_UNSCHEDULE";
84
+ /** Was published by Later */
85
+ Origin["SCHEDULING_SERVICE_PUBLISH"] = "SCHEDULING_SERVICE_PUBLISH";
86
+ /** Was scheduled */
87
+ Origin["SCHEDULE"] = "SCHEDULE";
88
+ /** Was removed from moderation */
89
+ Origin["REMOVE_FROM_MODERATION"] = "REMOVE_FROM_MODERATION";
90
+ /** Was rejected from moderation */
91
+ Origin["REJECT_FROM_MODERATION"] = "REJECT_FROM_MODERATION";
92
+ /** Was approved in moderation */
93
+ Origin["APPROVE_IN_MODERATION"] = "APPROVE_IN_MODERATION";
94
+ /** Tag was deleted */
95
+ Origin["DELETE_TAG"] = "DELETE_TAG";
96
+ /** Post was pinned */
97
+ Origin["PIN"] = "PIN";
98
+ /** Post was unpinned */
99
+ Origin["UNPIN"] = "UNPIN";
100
+ })(Origin || (Origin = {}));
101
+ export var NodeType;
102
+ (function (NodeType) {
103
+ NodeType["PARAGRAPH"] = "PARAGRAPH";
104
+ NodeType["TEXT"] = "TEXT";
105
+ NodeType["HEADING"] = "HEADING";
106
+ NodeType["BULLETED_LIST"] = "BULLETED_LIST";
107
+ NodeType["ORDERED_LIST"] = "ORDERED_LIST";
108
+ NodeType["LIST_ITEM"] = "LIST_ITEM";
109
+ NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
110
+ NodeType["CODE_BLOCK"] = "CODE_BLOCK";
111
+ NodeType["VIDEO"] = "VIDEO";
112
+ NodeType["DIVIDER"] = "DIVIDER";
113
+ NodeType["FILE"] = "FILE";
114
+ NodeType["GALLERY"] = "GALLERY";
115
+ NodeType["GIF"] = "GIF";
116
+ NodeType["HTML"] = "HTML";
117
+ NodeType["IMAGE"] = "IMAGE";
118
+ NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
119
+ NodeType["MAP"] = "MAP";
120
+ NodeType["POLL"] = "POLL";
121
+ NodeType["APP_EMBED"] = "APP_EMBED";
122
+ NodeType["BUTTON"] = "BUTTON";
123
+ NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
124
+ NodeType["TABLE"] = "TABLE";
125
+ NodeType["EMBED"] = "EMBED";
126
+ NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
127
+ NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
128
+ NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
129
+ NodeType["TABLE_CELL"] = "TABLE_CELL";
130
+ NodeType["TABLE_ROW"] = "TABLE_ROW";
131
+ NodeType["EXTERNAL"] = "EXTERNAL";
132
+ NodeType["AUDIO"] = "AUDIO";
133
+ })(NodeType || (NodeType = {}));
134
+ export var WidthType;
135
+ (function (WidthType) {
136
+ /** Width matches the content width */
137
+ WidthType["CONTENT"] = "CONTENT";
138
+ /** Small Width */
139
+ WidthType["SMALL"] = "SMALL";
140
+ /** Width will match the original asset width */
141
+ WidthType["ORIGINAL"] = "ORIGINAL";
142
+ /** coast-to-coast display */
143
+ WidthType["FULL_WIDTH"] = "FULL_WIDTH";
144
+ })(WidthType || (WidthType = {}));
145
+ export var PluginContainerDataAlignment;
146
+ (function (PluginContainerDataAlignment) {
147
+ /** Center Alignment */
148
+ PluginContainerDataAlignment["CENTER"] = "CENTER";
149
+ /** Left Alignment */
150
+ PluginContainerDataAlignment["LEFT"] = "LEFT";
151
+ /** Right Alignment */
152
+ PluginContainerDataAlignment["RIGHT"] = "RIGHT";
153
+ })(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
154
+ export var ButtonDataType;
155
+ (function (ButtonDataType) {
156
+ /** Regular link button */
157
+ ButtonDataType["LINK"] = "LINK";
158
+ /** Triggers custom action that is defined in plugin configuration by the consumer */
159
+ ButtonDataType["ACTION"] = "ACTION";
160
+ })(ButtonDataType || (ButtonDataType = {}));
161
+ export var Target;
162
+ (function (Target) {
163
+ /** Opens the linked document in the same frame as it was clicked (this is default) */
164
+ Target["SELF"] = "SELF";
165
+ /** Opens the linked document in a new window or tab */
166
+ Target["BLANK"] = "BLANK";
167
+ /** Opens the linked document in the parent frame */
168
+ Target["PARENT"] = "PARENT";
169
+ /** Opens the linked document in the full body of the window */
170
+ Target["TOP"] = "TOP";
171
+ })(Target || (Target = {}));
172
+ export var TextAlignment;
173
+ (function (TextAlignment) {
174
+ /** browser default, eqivalent to `initial` */
175
+ TextAlignment["AUTO"] = "AUTO";
176
+ /** Left align */
177
+ TextAlignment["LEFT"] = "LEFT";
178
+ /** Right align */
179
+ TextAlignment["RIGHT"] = "RIGHT";
180
+ /** Center align */
181
+ TextAlignment["CENTER"] = "CENTER";
182
+ /** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line. */
183
+ TextAlignment["JUSTIFY"] = "JUSTIFY";
184
+ })(TextAlignment || (TextAlignment = {}));
185
+ export var LineStyle;
186
+ (function (LineStyle) {
187
+ /** Single Line */
188
+ LineStyle["SINGLE"] = "SINGLE";
189
+ /** Double Line */
190
+ LineStyle["DOUBLE"] = "DOUBLE";
191
+ /** Dashed Line */
192
+ LineStyle["DASHED"] = "DASHED";
193
+ /** Dotted Line */
194
+ LineStyle["DOTTED"] = "DOTTED";
195
+ })(LineStyle || (LineStyle = {}));
196
+ export var Width;
197
+ (function (Width) {
198
+ /** Large line */
199
+ Width["LARGE"] = "LARGE";
200
+ /** Medium line */
201
+ Width["MEDIUM"] = "MEDIUM";
202
+ /** Small line */
203
+ Width["SMALL"] = "SMALL";
204
+ })(Width || (Width = {}));
205
+ export var Alignment;
206
+ (function (Alignment) {
207
+ /** Center alignment */
208
+ Alignment["CENTER"] = "CENTER";
209
+ /** Left alignment */
210
+ Alignment["LEFT"] = "LEFT";
211
+ /** Right alignment */
212
+ Alignment["RIGHT"] = "RIGHT";
213
+ })(Alignment || (Alignment = {}));
214
+ export var ViewMode;
215
+ (function (ViewMode) {
216
+ /** No PDF view */
217
+ ViewMode["NONE"] = "NONE";
218
+ /** Full PDF view */
219
+ ViewMode["FULL"] = "FULL";
220
+ /** Mini PDF view */
221
+ ViewMode["MINI"] = "MINI";
222
+ })(ViewMode || (ViewMode = {}));
223
+ export var LayoutType;
224
+ (function (LayoutType) {
225
+ /** Collage type */
226
+ LayoutType["COLLAGE"] = "COLLAGE";
227
+ /** Masonry type */
228
+ LayoutType["MASONRY"] = "MASONRY";
229
+ /** Grid type */
230
+ LayoutType["GRID"] = "GRID";
231
+ /** Thumbnail type */
232
+ LayoutType["THUMBNAIL"] = "THUMBNAIL";
233
+ /** Slider type */
234
+ LayoutType["SLIDER"] = "SLIDER";
235
+ /** Slideshow type */
236
+ LayoutType["SLIDESHOW"] = "SLIDESHOW";
237
+ /** Panorama type */
238
+ LayoutType["PANORAMA"] = "PANORAMA";
239
+ /** Column type */
240
+ LayoutType["COLUMN"] = "COLUMN";
241
+ /** Magic type */
242
+ LayoutType["MAGIC"] = "MAGIC";
243
+ /** Fullsize images type */
244
+ LayoutType["FULLSIZE"] = "FULLSIZE";
245
+ })(LayoutType || (LayoutType = {}));
246
+ export var Orientation;
247
+ (function (Orientation) {
248
+ /** Rows Orientation */
249
+ Orientation["ROWS"] = "ROWS";
250
+ /** Columns Orientation */
251
+ Orientation["COLUMNS"] = "COLUMNS";
252
+ })(Orientation || (Orientation = {}));
253
+ export var Crop;
254
+ (function (Crop) {
255
+ /** Crop to fill */
256
+ Crop["FILL"] = "FILL";
257
+ /** Crop to fit */
258
+ Crop["FIT"] = "FIT";
259
+ })(Crop || (Crop = {}));
260
+ export var ThumbnailsAlignment;
261
+ (function (ThumbnailsAlignment) {
262
+ /** Top alignment */
263
+ ThumbnailsAlignment["TOP"] = "TOP";
264
+ /** Right alignment */
265
+ ThumbnailsAlignment["RIGHT"] = "RIGHT";
266
+ /** Bottom alignment */
267
+ ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
268
+ /** Left alignment */
269
+ ThumbnailsAlignment["LEFT"] = "LEFT";
270
+ /** No thumbnail */
271
+ ThumbnailsAlignment["NONE"] = "NONE";
272
+ })(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
273
+ export var Source;
274
+ (function (Source) {
275
+ Source["HTML"] = "HTML";
276
+ Source["ADSENSE"] = "ADSENSE";
277
+ })(Source || (Source = {}));
278
+ export var MapType;
279
+ (function (MapType) {
280
+ /** Roadmap map type */
281
+ MapType["ROADMAP"] = "ROADMAP";
282
+ /** Satellite map type */
283
+ MapType["SATELITE"] = "SATELITE";
284
+ /** Hybrid map type */
285
+ MapType["HYBRID"] = "HYBRID";
286
+ /** Terrain map type */
287
+ MapType["TERRAIN"] = "TERRAIN";
288
+ })(MapType || (MapType = {}));
289
+ export var ViewRole;
290
+ (function (ViewRole) {
291
+ /** Only Poll creator can view the results */
292
+ ViewRole["CREATOR"] = "CREATOR";
293
+ /** Anyone who voted can see the results */
294
+ ViewRole["VOTERS"] = "VOTERS";
295
+ /** Anyone can see the results, even if one didn't vote */
296
+ ViewRole["EVERYONE"] = "EVERYONE";
297
+ })(ViewRole || (ViewRole = {}));
298
+ export var VoteRole;
299
+ (function (VoteRole) {
300
+ /** Logged in member */
301
+ VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
302
+ /** Anyone */
303
+ VoteRole["ALL"] = "ALL";
304
+ })(VoteRole || (VoteRole = {}));
305
+ export var PollLayoutType;
306
+ (function (PollLayoutType) {
307
+ /** List */
308
+ PollLayoutType["LIST"] = "LIST";
309
+ /** Grid */
310
+ PollLayoutType["GRID"] = "GRID";
311
+ })(PollLayoutType || (PollLayoutType = {}));
312
+ export var PollLayoutDirection;
313
+ (function (PollLayoutDirection) {
314
+ /** Left-to-right */
315
+ PollLayoutDirection["LTR"] = "LTR";
316
+ /** Right-to-left */
317
+ PollLayoutDirection["RTL"] = "RTL";
318
+ })(PollLayoutDirection || (PollLayoutDirection = {}));
319
+ export var BackgroundType;
320
+ (function (BackgroundType) {
321
+ /** Color background type */
322
+ BackgroundType["COLOR"] = "COLOR";
323
+ /** Image background type */
324
+ BackgroundType["IMAGE"] = "IMAGE";
325
+ /** Gradiant background type */
326
+ BackgroundType["GRADIENT"] = "GRADIENT";
327
+ })(BackgroundType || (BackgroundType = {}));
328
+ export var DecorationType;
329
+ (function (DecorationType) {
330
+ DecorationType["BOLD"] = "BOLD";
331
+ DecorationType["ITALIC"] = "ITALIC";
332
+ DecorationType["UNDERLINE"] = "UNDERLINE";
333
+ DecorationType["SPOILER"] = "SPOILER";
334
+ DecorationType["ANCHOR"] = "ANCHOR";
335
+ DecorationType["MENTION"] = "MENTION";
336
+ DecorationType["LINK"] = "LINK";
337
+ DecorationType["COLOR"] = "COLOR";
338
+ DecorationType["FONT_SIZE"] = "FONT_SIZE";
339
+ DecorationType["EXTERNAL"] = "EXTERNAL";
340
+ })(DecorationType || (DecorationType = {}));
341
+ export var FontType;
342
+ (function (FontType) {
343
+ FontType["PX"] = "PX";
344
+ FontType["EM"] = "EM";
345
+ })(FontType || (FontType = {}));
346
+ export var AppType;
347
+ (function (AppType) {
348
+ AppType["PRODUCT"] = "PRODUCT";
349
+ AppType["EVENT"] = "EVENT";
350
+ AppType["BOOKING"] = "BOOKING";
351
+ })(AppType || (AppType = {}));
352
+ export var InitialExpandedItems;
353
+ (function (InitialExpandedItems) {
354
+ /** First item will be expended initally */
355
+ InitialExpandedItems["FIRST"] = "FIRST";
356
+ /** All items will expended initally */
357
+ InitialExpandedItems["ALL"] = "ALL";
358
+ /** All items collapsed initally */
359
+ InitialExpandedItems["NONE"] = "NONE";
360
+ })(InitialExpandedItems || (InitialExpandedItems = {}));
361
+ export var Direction;
362
+ (function (Direction) {
363
+ /** Left-to-right */
364
+ Direction["LTR"] = "LTR";
365
+ /** Right-to-left */
366
+ Direction["RTL"] = "RTL";
367
+ })(Direction || (Direction = {}));
368
+ export var VerticalAlignment;
369
+ (function (VerticalAlignment) {
370
+ /** Top alignment */
371
+ VerticalAlignment["TOP"] = "TOP";
372
+ /** Middle alignment */
373
+ VerticalAlignment["MIDDLE"] = "MIDDLE";
374
+ /** Bottom alignment */
375
+ VerticalAlignment["BOTTOM"] = "BOTTOM";
376
+ })(VerticalAlignment || (VerticalAlignment = {}));
377
+ /**
378
+ * `NullValue` is a singleton enumeration to represent the null value for the
379
+ * `Value` type union.
380
+ *
381
+ * The JSON representation for `NullValue` is JSON `null`.
382
+ */
383
+ export var NullValue;
384
+ (function (NullValue) {
385
+ /** Null value. */
386
+ NullValue["NULL_VALUE"] = "NULL_VALUE";
387
+ })(NullValue || (NullValue = {}));
388
+ export var Status;
389
+ (function (Status) {
390
+ Status["UNKNOWN"] = "UNKNOWN";
391
+ /** Status indicating the draft post is published. */
392
+ Status["PUBLISHED"] = "PUBLISHED";
393
+ /** Status indicating the draft post is unpublished. */
394
+ Status["UNPUBLISHED"] = "UNPUBLISHED";
395
+ /** Status indicating the draft post is scheduled for publication. */
396
+ Status["SCHEDULED"] = "SCHEDULED";
397
+ /** Status indicating the draft post is deleted. */
398
+ Status["DELETED"] = "DELETED";
399
+ /**
400
+ * Deprecated. Use `IN_REVIEW` instead. Status indicating the draft post is in review.
401
+ * Target removal date 2023-06-30
402
+ * Reserved for internal use.
403
+ */
404
+ Status["IN_MODERATION"] = "IN_MODERATION";
405
+ /** Status indicating the draft post is in review. */
406
+ Status["IN_REVIEW"] = "IN_REVIEW";
407
+ })(Status || (Status = {}));
408
+ export var ModerationStatusStatus;
409
+ (function (ModerationStatusStatus) {
410
+ ModerationStatusStatus["UNKNOWN"] = "UNKNOWN";
411
+ ModerationStatusStatus["APPROVED"] = "APPROVED";
412
+ ModerationStatusStatus["REJECTED"] = "REJECTED";
413
+ })(ModerationStatusStatus || (ModerationStatusStatus = {}));
414
+ export var Type;
415
+ (function (Type) {
416
+ Type["UNKNOWN"] = "UNKNOWN";
417
+ /** Manually saved. */
418
+ Type["MANUAL"] = "MANUAL";
419
+ /** Triggered by autosave. */
420
+ Type["AUTO_SAVE"] = "AUTO_SAVE";
421
+ /** Copied from template during provisioning flow. */
422
+ Type["PROVISIONING"] = "PROVISIONING";
423
+ /** Imported from another blog. */
424
+ Type["IMPORT"] = "IMPORT";
425
+ })(Type || (Type = {}));
426
+ export var Field;
427
+ (function (Field) {
428
+ Field["UNKNOWN"] = "UNKNOWN";
429
+ /** Includes draft post preview URL. */
430
+ Field["URL"] = "URL";
431
+ /**
432
+ * Includes internal id field.
433
+ * Reserved for internal use.
434
+ */
435
+ Field["INTERNAL_ID"] = "INTERNAL_ID";
436
+ /** Includes content field. */
437
+ Field["CONTENT"] = "CONTENT";
438
+ /** Includes rich content field. */
439
+ Field["RICH_CONTENT"] = "RICH_CONTENT";
440
+ /** Includes draft post translations when present. */
441
+ Field["TRANSLATIONS"] = "TRANSLATIONS";
442
+ /** If the user has not set excerpt, returns the one autogenerated from content. */
443
+ Field["GENERATED_EXCERPT"] = "GENERATED_EXCERPT";
444
+ })(Field || (Field = {}));
445
+ export var Action;
446
+ (function (Action) {
447
+ /** Update draft post properties. */
448
+ Action["UPDATE"] = "UPDATE";
449
+ /** Update and publish draft post. */
450
+ Action["UPDATE_PUBLISH"] = "UPDATE_PUBLISH";
451
+ /** Update and schedule draft post. */
452
+ Action["UPDATE_SCHEDULE"] = "UPDATE_SCHEDULE";
453
+ /** Update and revert to draft a published post. */
454
+ Action["UPDATE_REVERT_TO_DRAFT"] = "UPDATE_REVERT_TO_DRAFT";
455
+ /** Update draft and cancel post scheduling. */
456
+ Action["UPDATE_CANCEL_SCHEDULE"] = "UPDATE_CANCEL_SCHEDULE";
457
+ /** Update and reject draft post in moderation. */
458
+ Action["UPDATE_REJECT"] = "UPDATE_REJECT";
459
+ /** Update published draft post. */
460
+ Action["UPDATE_PUBLICATION"] = "UPDATE_PUBLICATION";
461
+ })(Action || (Action = {}));
462
+ export var GetDraftPostsSort;
463
+ (function (GetDraftPostsSort) {
464
+ /** Sorting by editing date descending. */
465
+ GetDraftPostsSort["EDITING_DATE_DESC"] = "EDITING_DATE_DESC";
466
+ /** Sorting by editing date ascending. */
467
+ GetDraftPostsSort["EDITING_DATE_ASC"] = "EDITING_DATE_ASC";
468
+ })(GetDraftPostsSort || (GetDraftPostsSort = {}));
469
+ export var SortOrder;
470
+ (function (SortOrder) {
471
+ SortOrder["ASC"] = "ASC";
472
+ SortOrder["DESC"] = "DESC";
473
+ })(SortOrder || (SortOrder = {}));
474
+ export var TotalDraftPostsGroupingField;
475
+ (function (TotalDraftPostsGroupingField) {
476
+ /** Groups results by status. */
477
+ TotalDraftPostsGroupingField["STATUS"] = "STATUS";
478
+ /** Groups results by language. */
479
+ TotalDraftPostsGroupingField["LANGUAGE"] = "LANGUAGE";
480
+ })(TotalDraftPostsGroupingField || (TotalDraftPostsGroupingField = {}));
481
+ const _bulkDraftPostResult = { item: '_draftPost' };
482
+ const _bulkUpdateDraftPostsRequest = { draftPosts: '_maskedDraftPosts' };
483
+ const _bulkUpdateDraftPostsResponse = { results: '_bulkDraftPostResult' };
484
+ const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
485
+ const _createDraftPostRequest = { draftPost: '_draftPost' };
486
+ const _createDraftPostResponse = { draftPost: '_draftPost' };
487
+ const _deleteDraftPostRequest = {};
488
+ const _deleteDraftPostResponse = {};
489
+ const _draftPost = {
490
+ heroImage: 'wix.common.Image',
491
+ url: 'wix.common.PageUrl',
492
+ coverMedia: '_coverMedia',
493
+ richContent: '_richContent',
494
+ media: '_media',
495
+ translations: '_draftPostTranslation',
496
+ };
497
+ const _draftPostTranslation = { url: 'wix.common.PageUrl' };
498
+ const _getDeletedDraftPostRequest = {};
499
+ const _getDeletedDraftPostResponse = { draftPost: '_draftPost' };
500
+ const _getDraftPostRequest = {};
501
+ const _getDraftPostResponse = { draftPost: '_draftPost' };
502
+ const _listDeletedDraftPostsRequest = {};
503
+ const _listDeletedDraftPostsResponse = { draftPosts: '_draftPost' };
504
+ const _listDraftPostsRequest = {};
505
+ const _listDraftPostsResponse = { draftPosts: '_draftPost' };
506
+ const _maskedDraftPosts = { draftPost: '_draftPost' };
507
+ const _media = { wixMedia: '_wixMedia' };
508
+ const _node = { nodes: '_node' };
509
+ const _publishDraftPostRequest = {};
510
+ const _publishDraftPostResponse = {};
511
+ const _queryDraftPostsRequest = {};
512
+ const _queryDraftPostsResponse = { draftPosts: '_draftPost' };
513
+ const _removeFromTrashBinRequest = {};
514
+ const _removeFromTrashBinResponse = {};
515
+ const _restoreFromTrashBinRequest = {};
516
+ const _restoreFromTrashBinResponse = { draftPost: '_draftPost' };
517
+ const _richContent = { nodes: '_node' };
518
+ const _updateDraftPostRequest = { draftPost: '_draftPost' };
519
+ const _updateDraftPostResponse = { draftPost: '_draftPost' };
520
+ const _wixMedia = { image: 'wix.common.Image', videoV2: 'wix.common.VideoV2' };
521
+ /**
522
+ * Creates a draft post.
523
+ *
524
+ * The draft post's [memberId](https://dev.wix.com/api/rest/members/members) is required for third-party apps.
525
+ * @param draftPost - Draft post to create.
526
+ * @public
527
+ * @documentationMaturity preview
528
+ * @requiredField draftPost
529
+ * @requiredField draftPost.title
530
+ * @permissionScope Manage Blog
531
+ * @applicableIdentity APP
532
+ * @returns Created draft post info.
533
+ */
534
+ export function createDraftPost(draftPost, options) {
535
+ var _a, _b, _c;
536
+ return __awaiter(this, arguments, void 0, function* () {
537
+ const requestTransformation = {
538
+ draftPost: '$[0]',
539
+ publish: '$[1].publish',
540
+ fieldsets: '$[1].fieldsets',
541
+ };
542
+ const responseTransformation = '$.draftPost';
543
+ // @ts-ignore
544
+ const { httpClient, sideEffects } = arguments[2];
545
+ const { toAmbassadorRequest } = serializer({
546
+ rootSchema: _createDraftPostRequest,
547
+ depSchemas: {
548
+ _coverMedia,
549
+ _draftPost,
550
+ _draftPostTranslation,
551
+ _media,
552
+ _node,
553
+ _richContent,
554
+ _wixMedia,
555
+ },
556
+ fqdnTransformation: {
557
+ paths: [...['draftPost']],
558
+ transformation: _fromVeloEntity,
559
+ },
560
+ customTransformation: requestTransformation,
561
+ });
562
+ const { fromJSON } = serializer({
563
+ rootSchema: _createDraftPostResponse,
564
+ depSchemas: {
565
+ _coverMedia,
566
+ _draftPost,
567
+ _draftPostTranslation,
568
+ _media,
569
+ _node,
570
+ _richContent,
571
+ _wixMedia,
572
+ },
573
+ fqdnTransformation: {
574
+ paths: [...['draftPost']],
575
+ transformation: _toVeloEntity,
576
+ },
577
+ customTransformation: responseTransformation,
578
+ });
579
+ const payload = toAmbassadorRequest([draftPost, options]);
580
+ const reqOpts = ambassadorWixBlogV3Draft.createDraftPost(payload);
581
+ __log(`"CreateDraftPost" sending request with: ${__inspect(reqOpts)}`);
582
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
583
+ try {
584
+ const result = yield httpClient.request(reqOpts);
585
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
586
+ return fromJSON(result.data);
587
+ }
588
+ catch (err) {
589
+ const transformedError = transformError(err, requestTransformation, [
590
+ 'draftPost',
591
+ 'options',
592
+ ]);
593
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
594
+ throw transformedError;
595
+ }
596
+ });
597
+ }
598
+ /**
599
+ * Updates multiple draft posts.
600
+ * @public
601
+ * @documentationMaturity preview
602
+ * @requiredField options.draftPosts.draftPost
603
+ * @requiredField options.draftPosts.draftPost._id
604
+ * @permissionScope Manage Blog
605
+ * @permissionScope Read Members
606
+ * @applicableIdentity APP
607
+ * @applicableIdentity MEMBER
608
+ * @applicableIdentity VISITOR
609
+ */
610
+ export function bulkUpdateDraftPosts(options) {
611
+ var _a, _b, _c;
612
+ return __awaiter(this, arguments, void 0, function* () {
613
+ const requestTransformation = {
614
+ draftPosts: '$[0].draftPosts',
615
+ action: '$[0].action',
616
+ scheduledPublishDate: '$[0].scheduledPublishDate',
617
+ returnFullEntity: '$[0].returnFullEntity',
618
+ fieldsets: '$[0].fieldsets',
619
+ };
620
+ const responseTransformation = '$';
621
+ // @ts-ignore
622
+ const { httpClient, sideEffects } = arguments[1];
623
+ const { toAmbassadorRequest } = serializer({
624
+ rootSchema: _bulkUpdateDraftPostsRequest,
625
+ depSchemas: {
626
+ _coverMedia,
627
+ _draftPost,
628
+ _draftPostTranslation,
629
+ _maskedDraftPosts,
630
+ _media,
631
+ _node,
632
+ _richContent,
633
+ _wixMedia,
634
+ },
635
+ fqdnTransformation: {
636
+ paths: [...['Array#draftPosts.draftPost']],
637
+ transformation: _fromVeloEntity,
638
+ },
639
+ customTransformation: requestTransformation,
640
+ });
641
+ const { fromJSON } = serializer({
642
+ rootSchema: _bulkUpdateDraftPostsResponse,
643
+ depSchemas: {
644
+ _bulkDraftPostResult,
645
+ _coverMedia,
646
+ _draftPost,
647
+ _draftPostTranslation,
648
+ _media,
649
+ _node,
650
+ _richContent,
651
+ _wixMedia,
652
+ },
653
+ fqdnTransformation: {
654
+ paths: [...['Array#results.item']],
655
+ transformation: _toVeloEntity,
656
+ },
657
+ customTransformation: responseTransformation,
658
+ });
659
+ const payload = toAmbassadorRequest([options]);
660
+ const reqOpts = ambassadorWixBlogV3Draft.bulkUpdateDraftPosts(payload);
661
+ __log(`"BulkUpdateDraftPosts" sending request with: ${__inspect(reqOpts)}`);
662
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
663
+ try {
664
+ const result = yield httpClient.request(reqOpts);
665
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
666
+ return fromJSON(result.data);
667
+ }
668
+ catch (err) {
669
+ const transformedError = transformError(err, requestTransformation, [
670
+ 'options',
671
+ ]);
672
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
673
+ throw transformedError;
674
+ }
675
+ });
676
+ }
677
+ /**
678
+ * Retrieves a list of up to 100 deleted draft posts.
679
+ *
680
+ * List Draft Posts runs with these defaults, which you can override:
681
+ * - `editedDate` is sorted in descending order. In this case,`editedDate` implies the date the post was deleted.
682
+ * - `paging.limit` is `50`.
683
+ * - `paging.offset` is `0`.
684
+ * @public
685
+ * @documentationMaturity preview
686
+ * @permissionScope Manage Blog
687
+ * @applicableIdentity APP
688
+ */
689
+ export function listDeletedDraftPosts(options) {
690
+ var _a, _b, _c;
691
+ return __awaiter(this, arguments, void 0, function* () {
692
+ const requestTransformation = {
693
+ language: '$[0].language',
694
+ sort: '$[0].sort',
695
+ paging: '$[0].paging',
696
+ fieldsets: '$[0].fieldsets',
697
+ draftPostIds: '$[0].draftPostIds',
698
+ };
699
+ const responseTransformation = '$';
700
+ // @ts-ignore
701
+ const { httpClient, sideEffects } = arguments[1];
702
+ const { toAmbassadorRequest } = serializer({
703
+ rootSchema: _listDeletedDraftPostsRequest,
704
+ depSchemas: {},
705
+ fqdnTransformation: {
706
+ paths: [],
707
+ transformation: _fromVeloEntity,
708
+ },
709
+ customTransformation: requestTransformation,
710
+ });
711
+ const { fromJSON } = serializer({
712
+ rootSchema: _listDeletedDraftPostsResponse,
713
+ depSchemas: {
714
+ _coverMedia,
715
+ _draftPost,
716
+ _draftPostTranslation,
717
+ _media,
718
+ _node,
719
+ _richContent,
720
+ _wixMedia,
721
+ },
722
+ fqdnTransformation: {
723
+ paths: [...['Array#draftPosts']],
724
+ transformation: _toVeloEntity,
725
+ },
726
+ customTransformation: responseTransformation,
727
+ });
728
+ const payload = toAmbassadorRequest([options]);
729
+ const reqOpts = ambassadorWixBlogV3Draft.listDeletedDraftPosts(payload);
730
+ __log(`"ListDeletedDraftPosts" sending request with: ${__inspect(reqOpts)}`);
731
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
732
+ try {
733
+ const result = yield httpClient.request(reqOpts);
734
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
735
+ return fromJSON(result.data);
736
+ }
737
+ catch (err) {
738
+ const transformedError = transformError(err, requestTransformation, [
739
+ 'options',
740
+ ]);
741
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
742
+ throw transformedError;
743
+ }
744
+ });
745
+ }
746
+ /**
747
+ * Gets a draft post by the provided ID.
748
+ * @param draftPostId - Draft post ID.
749
+ * @public
750
+ * @documentationMaturity preview
751
+ * @requiredField draftPostId
752
+ * @permissionScope Manage Blog
753
+ * @applicableIdentity APP
754
+ * @returns Draft post info.
755
+ */
756
+ export function getDraftPost(draftPostId, options) {
757
+ var _a, _b, _c;
758
+ return __awaiter(this, arguments, void 0, function* () {
759
+ const requestTransformation = {
760
+ draftPostId: '$[0]',
761
+ fieldsets: '$[1].fieldsets',
762
+ };
763
+ const responseTransformation = '$.draftPost';
764
+ // @ts-ignore
765
+ const { httpClient, sideEffects } = arguments[2];
766
+ const { toAmbassadorRequest } = serializer({
767
+ rootSchema: _getDraftPostRequest,
768
+ depSchemas: {},
769
+ fqdnTransformation: {
770
+ paths: [],
771
+ transformation: _fromVeloEntity,
772
+ },
773
+ customTransformation: requestTransformation,
774
+ });
775
+ const { fromJSON } = serializer({
776
+ rootSchema: _getDraftPostResponse,
777
+ depSchemas: {
778
+ _coverMedia,
779
+ _draftPost,
780
+ _draftPostTranslation,
781
+ _media,
782
+ _node,
783
+ _richContent,
784
+ _wixMedia,
785
+ },
786
+ fqdnTransformation: {
787
+ paths: [...['draftPost']],
788
+ transformation: _toVeloEntity,
789
+ },
790
+ customTransformation: responseTransformation,
791
+ });
792
+ const payload = toAmbassadorRequest([draftPostId, options]);
793
+ const reqOpts = ambassadorWixBlogV3Draft.getDraftPost(payload);
794
+ __log(`"GetDraftPost" sending request with: ${__inspect(reqOpts)}`);
795
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
796
+ try {
797
+ const result = yield httpClient.request(reqOpts);
798
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
799
+ return fromJSON(result.data);
800
+ }
801
+ catch (err) {
802
+ const transformedError = transformError(err, requestTransformation, [
803
+ 'draftPostId',
804
+ 'options',
805
+ ]);
806
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
807
+ throw transformedError;
808
+ }
809
+ });
810
+ }
811
+ /**
812
+ * Updates a specified draft post.
813
+ * @param _id - Draft post ID.
814
+ * @public
815
+ * @documentationMaturity preview
816
+ * @requiredField _id
817
+ * @requiredField draftPost
818
+ * @permissionScope Manage Blog
819
+ * @permissionScope Read Members
820
+ * @applicableIdentity APP
821
+ * @applicableIdentity MEMBER
822
+ * @applicableIdentity VISITOR
823
+ * @returns Updated draft post info.
824
+ */
825
+ export function updateDraftPost(_id, draftPost, options) {
826
+ var _a, _b, _c;
827
+ return __awaiter(this, arguments, void 0, function* () {
828
+ const requestTransformation = {
829
+ draftPost: { '*': '$[1]', id: '$[0]' },
830
+ action: '$[2].action',
831
+ scheduledPublishDate: '$[2].scheduledPublishDate',
832
+ fieldsets: '$[2].fieldsets',
833
+ };
834
+ const responseTransformation = '$.draftPost';
835
+ // @ts-ignore
836
+ const { httpClient, sideEffects } = arguments[3];
837
+ const { toAmbassadorRequest } = serializer({
838
+ rootSchema: _updateDraftPostRequest,
839
+ depSchemas: {
840
+ _coverMedia,
841
+ _draftPost,
842
+ _draftPostTranslation,
843
+ _media,
844
+ _node,
845
+ _richContent,
846
+ _wixMedia,
847
+ },
848
+ fqdnTransformation: {
849
+ paths: [...['draftPost']],
850
+ transformation: _fromVeloEntity,
851
+ },
852
+ customTransformation: requestTransformation,
853
+ });
854
+ const { fromJSON } = serializer({
855
+ rootSchema: _updateDraftPostResponse,
856
+ depSchemas: {
857
+ _coverMedia,
858
+ _draftPost,
859
+ _draftPostTranslation,
860
+ _media,
861
+ _node,
862
+ _richContent,
863
+ _wixMedia,
864
+ },
865
+ fqdnTransformation: {
866
+ paths: [...['draftPost']],
867
+ transformation: _toVeloEntity,
868
+ },
869
+ customTransformation: responseTransformation,
870
+ });
871
+ const payload = toAmbassadorRequest([_id, draftPost, options]);
872
+ const reqOpts = ambassadorWixBlogV3Draft.updateDraftPost(payload);
873
+ __log(`"UpdateDraftPost" sending request with: ${__inspect(reqOpts)}`);
874
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
875
+ try {
876
+ const result = yield httpClient.request(reqOpts);
877
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
878
+ return fromJSON(result.data);
879
+ }
880
+ catch (err) {
881
+ const transformedError = transformError(err, requestTransformation, [
882
+ '_id',
883
+ 'draftPost',
884
+ 'options',
885
+ ]);
886
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
887
+ throw transformedError;
888
+ }
889
+ });
890
+ }
891
+ /**
892
+ * Moves a draft post with the provided ID to the trash bin.
893
+ * A published posts can also be deleted by its provided [post `ID`](https://dev.wix.com/api/rest/wix-blog/blog/posts).
894
+ *
895
+ * The optional `permanent` field enables you to delete a post permanently, bypassing the trash bin. When a draft post is deleted this way, it can't be restored.
896
+ * @param draftPostId - Draft post ID.
897
+ * @public
898
+ * @documentationMaturity preview
899
+ * @requiredField draftPostId
900
+ * @permissionScope Manage Blog
901
+ * @applicableIdentity APP
902
+ */
903
+ export function deleteDraftPost(draftPostId, options) {
904
+ var _a, _b, _c;
905
+ return __awaiter(this, arguments, void 0, function* () {
906
+ const requestTransformation = {
907
+ draftPostId: '$[0]',
908
+ permanent: '$[1].permanent',
909
+ };
910
+ const responseTransformation = '$';
911
+ // @ts-ignore
912
+ const { httpClient, sideEffects } = arguments[2];
913
+ const { toAmbassadorRequest } = serializer({
914
+ rootSchema: _deleteDraftPostRequest,
915
+ depSchemas: {},
916
+ fqdnTransformation: {
917
+ paths: [],
918
+ transformation: _fromVeloEntity,
919
+ },
920
+ customTransformation: requestTransformation,
921
+ });
922
+ const { fromJSON } = serializer({
923
+ rootSchema: _deleteDraftPostResponse,
924
+ depSchemas: {},
925
+ fqdnTransformation: {
926
+ paths: [],
927
+ transformation: _toVeloEntity,
928
+ },
929
+ customTransformation: responseTransformation,
930
+ });
931
+ const payload = toAmbassadorRequest([draftPostId, options]);
932
+ const reqOpts = ambassadorWixBlogV3Draft.deleteDraftPost(payload);
933
+ __log(`"DeleteDraftPost" sending request with: ${__inspect(reqOpts)}`);
934
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
935
+ try {
936
+ const result = yield httpClient.request(reqOpts);
937
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
938
+ return fromJSON(result.data);
939
+ }
940
+ catch (err) {
941
+ const transformedError = transformError(err, requestTransformation, [
942
+ 'draftPostId',
943
+ 'options',
944
+ ]);
945
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
946
+ throw transformedError;
947
+ }
948
+ });
949
+ }
950
+ /**
951
+ * Permanently deletes a draft post by the provided ID from the trash bin.
952
+ * @param draftPostId - Draft post ID.
953
+ * @public
954
+ * @documentationMaturity preview
955
+ * @requiredField draftPostId
956
+ * @permissionScope Manage Blog
957
+ * @applicableIdentity APP
958
+ */
959
+ export function removeFromTrashBin(draftPostId) {
960
+ var _a, _b, _c;
961
+ return __awaiter(this, arguments, void 0, function* () {
962
+ const requestTransformation = { draftPostId: '$[0]' };
963
+ const responseTransformation = '$';
964
+ // @ts-ignore
965
+ const { httpClient, sideEffects } = arguments[1];
966
+ const { toAmbassadorRequest } = serializer({
967
+ rootSchema: _removeFromTrashBinRequest,
968
+ depSchemas: {},
969
+ fqdnTransformation: {
970
+ paths: [],
971
+ transformation: _fromVeloEntity,
972
+ },
973
+ customTransformation: requestTransformation,
974
+ });
975
+ const { fromJSON } = serializer({
976
+ rootSchema: _removeFromTrashBinResponse,
977
+ depSchemas: {},
978
+ fqdnTransformation: {
979
+ paths: [],
980
+ transformation: _toVeloEntity,
981
+ },
982
+ customTransformation: responseTransformation,
983
+ });
984
+ const payload = toAmbassadorRequest([draftPostId]);
985
+ const reqOpts = ambassadorWixBlogV3Draft.removeFromTrashBin(payload);
986
+ __log(`"RemoveFromTrashBin" sending request with: ${__inspect(reqOpts)}`);
987
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
988
+ try {
989
+ const result = yield httpClient.request(reqOpts);
990
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
991
+ return fromJSON(result.data);
992
+ }
993
+ catch (err) {
994
+ const transformedError = transformError(err, requestTransformation, [
995
+ 'draftPostId',
996
+ ]);
997
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
998
+ throw transformedError;
999
+ }
1000
+ });
1001
+ }
1002
+ /**
1003
+ * Retrieves a list of up to 100 draft posts per request.
1004
+ *
1005
+ * List Draft Posts runs with these defaults, which you can override:
1006
+ * - `editedDate` is sorted in descending order.
1007
+ * - `paging.limit` is `50`.
1008
+ * - `paging.offset` is `0`.
1009
+ * @public
1010
+ * @documentationMaturity preview
1011
+ * @permissionScope Manage Blog
1012
+ * @applicableIdentity APP
1013
+ */
1014
+ export function listDraftPosts(options) {
1015
+ var _a, _b, _c;
1016
+ return __awaiter(this, arguments, void 0, function* () {
1017
+ const requestTransformation = {
1018
+ status: '$[0].status',
1019
+ language: '$[0].language',
1020
+ sort: '$[0].sort',
1021
+ paging: '$[0].paging',
1022
+ fieldsets: '$[0].fieldsets',
1023
+ };
1024
+ const responseTransformation = '$';
1025
+ // @ts-ignore
1026
+ const { httpClient, sideEffects } = arguments[1];
1027
+ const { toAmbassadorRequest } = serializer({
1028
+ rootSchema: _listDraftPostsRequest,
1029
+ depSchemas: {},
1030
+ fqdnTransformation: {
1031
+ paths: [],
1032
+ transformation: _fromVeloEntity,
1033
+ },
1034
+ customTransformation: requestTransformation,
1035
+ });
1036
+ const { fromJSON } = serializer({
1037
+ rootSchema: _listDraftPostsResponse,
1038
+ depSchemas: {
1039
+ _coverMedia,
1040
+ _draftPost,
1041
+ _draftPostTranslation,
1042
+ _media,
1043
+ _node,
1044
+ _richContent,
1045
+ _wixMedia,
1046
+ },
1047
+ fqdnTransformation: {
1048
+ paths: [...['Array#draftPosts']],
1049
+ transformation: _toVeloEntity,
1050
+ },
1051
+ customTransformation: responseTransformation,
1052
+ });
1053
+ const payload = toAmbassadorRequest([options]);
1054
+ const reqOpts = ambassadorWixBlogV3Draft.listDraftPosts(payload);
1055
+ __log(`"ListDraftPosts" sending request with: ${__inspect(reqOpts)}`);
1056
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1057
+ try {
1058
+ const result = yield httpClient.request(reqOpts);
1059
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1060
+ return fromJSON(result.data);
1061
+ }
1062
+ catch (err) {
1063
+ const transformedError = transformError(err, requestTransformation, [
1064
+ 'options',
1065
+ ]);
1066
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1067
+ throw transformedError;
1068
+ }
1069
+ });
1070
+ }
1071
+ /**
1072
+ * Gets a deleted draft post from the trash bin by the provided ID.
1073
+ * @param draftPostId - Draft post ID.
1074
+ * @public
1075
+ * @documentationMaturity preview
1076
+ * @requiredField draftPostId
1077
+ * @permissionScope Manage Blog
1078
+ * @applicableIdentity APP
1079
+ */
1080
+ export function getDeletedDraftPost(draftPostId) {
1081
+ var _a, _b, _c;
1082
+ return __awaiter(this, arguments, void 0, function* () {
1083
+ const requestTransformation = { draftPostId: '$[0]' };
1084
+ const responseTransformation = '$';
1085
+ // @ts-ignore
1086
+ const { httpClient, sideEffects } = arguments[1];
1087
+ const { toAmbassadorRequest } = serializer({
1088
+ rootSchema: _getDeletedDraftPostRequest,
1089
+ depSchemas: {},
1090
+ fqdnTransformation: {
1091
+ paths: [],
1092
+ transformation: _fromVeloEntity,
1093
+ },
1094
+ customTransformation: requestTransformation,
1095
+ });
1096
+ const { fromJSON } = serializer({
1097
+ rootSchema: _getDeletedDraftPostResponse,
1098
+ depSchemas: {
1099
+ _coverMedia,
1100
+ _draftPost,
1101
+ _draftPostTranslation,
1102
+ _media,
1103
+ _node,
1104
+ _richContent,
1105
+ _wixMedia,
1106
+ },
1107
+ fqdnTransformation: {
1108
+ paths: [...['draftPost']],
1109
+ transformation: _toVeloEntity,
1110
+ },
1111
+ customTransformation: responseTransformation,
1112
+ });
1113
+ const payload = toAmbassadorRequest([draftPostId]);
1114
+ const reqOpts = ambassadorWixBlogV3Draft.getDeletedDraftPost(payload);
1115
+ __log(`"GetDeletedDraftPost" sending request with: ${__inspect(reqOpts)}`);
1116
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1117
+ try {
1118
+ const result = yield httpClient.request(reqOpts);
1119
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1120
+ return fromJSON(result.data);
1121
+ }
1122
+ catch (err) {
1123
+ const transformedError = transformError(err, requestTransformation, [
1124
+ 'draftPostId',
1125
+ ]);
1126
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1127
+ throw transformedError;
1128
+ }
1129
+ });
1130
+ }
1131
+ /**
1132
+ * Restores a deleted draft post from the trash-bin by the provided ID.
1133
+ * @param draftPostId - Draft post ID.
1134
+ * @public
1135
+ * @documentationMaturity preview
1136
+ * @requiredField draftPostId
1137
+ * @permissionScope Manage Blog
1138
+ * @applicableIdentity APP
1139
+ */
1140
+ export function restoreFromTrashBin(draftPostId) {
1141
+ var _a, _b, _c;
1142
+ return __awaiter(this, arguments, void 0, function* () {
1143
+ const requestTransformation = { draftPostId: '$[0]' };
1144
+ const responseTransformation = '$';
1145
+ // @ts-ignore
1146
+ const { httpClient, sideEffects } = arguments[1];
1147
+ const { toAmbassadorRequest } = serializer({
1148
+ rootSchema: _restoreFromTrashBinRequest,
1149
+ depSchemas: {},
1150
+ fqdnTransformation: {
1151
+ paths: [],
1152
+ transformation: _fromVeloEntity,
1153
+ },
1154
+ customTransformation: requestTransformation,
1155
+ });
1156
+ const { fromJSON } = serializer({
1157
+ rootSchema: _restoreFromTrashBinResponse,
1158
+ depSchemas: {
1159
+ _coverMedia,
1160
+ _draftPost,
1161
+ _draftPostTranslation,
1162
+ _media,
1163
+ _node,
1164
+ _richContent,
1165
+ _wixMedia,
1166
+ },
1167
+ fqdnTransformation: {
1168
+ paths: [...['draftPost']],
1169
+ transformation: _toVeloEntity,
1170
+ },
1171
+ customTransformation: responseTransformation,
1172
+ });
1173
+ const payload = toAmbassadorRequest([draftPostId]);
1174
+ const reqOpts = ambassadorWixBlogV3Draft.restoreFromTrashBin(payload);
1175
+ __log(`"RestoreFromTrashBin" sending request with: ${__inspect(reqOpts)}`);
1176
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1177
+ try {
1178
+ const result = yield httpClient.request(reqOpts);
1179
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1180
+ return fromJSON(result.data);
1181
+ }
1182
+ catch (err) {
1183
+ const transformedError = transformError(err, requestTransformation, [
1184
+ 'draftPostId',
1185
+ ]);
1186
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1187
+ throw transformedError;
1188
+ }
1189
+ });
1190
+ }
1191
+ /**
1192
+ * Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.
1193
+ *
1194
+ * Query Draft Posts runs with these defaults, which you can override:
1195
+ * - `editedDate` is sorted in `DESC` order.
1196
+ * - `paging.limit` is `50`.
1197
+ * - `paging.offset` is `0`.
1198
+ *
1199
+ * For field support for filters and sorting, see
1200
+ * [Field Support for Filtering and Sorting](https://dev.wix.com/api/rest/wix-blog/blog/draft-posts/supported-filters-and-sorting).
1201
+ *
1202
+ * To learn about working with _Query_ endpoints, see
1203
+ * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
1204
+ * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and
1205
+ * [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
1206
+ * @public
1207
+ * @documentationMaturity preview
1208
+ * @permissionScope Manage Blog
1209
+ * @applicableIdentity APP
1210
+ */
1211
+ export function queryDraftPosts(options) {
1212
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
1213
+ const responseTransformation = {
1214
+ items: '$.draftPosts',
1215
+ pagingMetadata: '$.pagingMetadata',
1216
+ };
1217
+ // @ts-ignore
1218
+ const { httpClient, sideEffects } = arguments[1];
1219
+ const { toAmbassadorRequest } = serializer({
1220
+ rootSchema: _queryDraftPostsRequest,
1221
+ depSchemas: {},
1222
+ fqdnTransformation: {
1223
+ paths: [],
1224
+ transformation: _fromVeloEntity,
1225
+ },
1226
+ customTransformation: requestTransformation,
1227
+ });
1228
+ const { fromJSON } = serializer({
1229
+ rootSchema: _queryDraftPostsResponse,
1230
+ depSchemas: {
1231
+ _coverMedia,
1232
+ _draftPost,
1233
+ _draftPostTranslation,
1234
+ _media,
1235
+ _node,
1236
+ _richContent,
1237
+ _wixMedia,
1238
+ },
1239
+ fqdnTransformation: {
1240
+ paths: [...['Array#draftPosts']],
1241
+ transformation: _toVeloEntity,
1242
+ },
1243
+ customTransformation: responseTransformation,
1244
+ });
1245
+ return wrapWithQueryBuilder({
1246
+ func: (payload) => __awaiter(this, void 0, void 0, function* () {
1247
+ var _a, _b, _c;
1248
+ const reqOpts = ambassadorWixBlogV3Draft.queryDraftPosts(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
1249
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1250
+ try {
1251
+ const result = yield httpClient.request(reqOpts);
1252
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1253
+ return result;
1254
+ }
1255
+ catch (err) {
1256
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1257
+ throw err;
1258
+ }
1259
+ }),
1260
+ requestTransformer: (...args) => toAmbassadorRequest(args),
1261
+ responseTransformer: ({ data }) => fromJSON(data),
1262
+ errorTransformer: (err) => {
1263
+ const transformedError = transformError(err, requestTransformation);
1264
+ throw transformedError;
1265
+ },
1266
+ pagingMethod: 'CURSOR',
1267
+ transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
1268
+ })({ cursorWithEmptyFilterAndSort: true });
1269
+ }
1270
+ /**
1271
+ * Publishes a specified draft post by ID. This creates a new [post](https://dev.wix.com/api/rest/wix-blog/blog/posts) entity with the data from the draft post.
1272
+ * If the specified draft post was already published, the published post will be updated with the latest values
1273
+ * from the draft post entity.
1274
+ * @param draftPostId - Draft post ID.
1275
+ * @public
1276
+ * @documentationMaturity preview
1277
+ * @requiredField draftPostId
1278
+ * @permissionScope Manage Blog
1279
+ * @applicableIdentity APP
1280
+ */
1281
+ export function publishDraftPost(draftPostId) {
1282
+ var _a, _b, _c;
1283
+ return __awaiter(this, arguments, void 0, function* () {
1284
+ const requestTransformation = { draftPostId: '$[0]' };
1285
+ const responseTransformation = '$';
1286
+ // @ts-ignore
1287
+ const { httpClient, sideEffects } = arguments[1];
1288
+ const { toAmbassadorRequest } = serializer({
1289
+ rootSchema: _publishDraftPostRequest,
1290
+ depSchemas: {},
1291
+ fqdnTransformation: {
1292
+ paths: [],
1293
+ transformation: _fromVeloEntity,
1294
+ },
1295
+ customTransformation: requestTransformation,
1296
+ });
1297
+ const { fromJSON } = serializer({
1298
+ rootSchema: _publishDraftPostResponse,
1299
+ depSchemas: {},
1300
+ fqdnTransformation: {
1301
+ paths: [],
1302
+ transformation: _toVeloEntity,
1303
+ },
1304
+ customTransformation: responseTransformation,
1305
+ });
1306
+ const payload = toAmbassadorRequest([draftPostId]);
1307
+ const reqOpts = ambassadorWixBlogV3Draft.publishDraftPost(payload);
1308
+ __log(`"PublishDraftPost" sending request with: ${__inspect(reqOpts)}`);
1309
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1310
+ try {
1311
+ const result = yield httpClient.request(reqOpts);
1312
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1313
+ return fromJSON(result.data);
1314
+ }
1315
+ catch (err) {
1316
+ const transformedError = transformError(err, requestTransformation, [
1317
+ 'draftPostId',
1318
+ ]);
1319
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1320
+ throw transformedError;
1321
+ }
1322
+ });
1323
+ }
1324
+ //# sourceMappingURL=blog-v3-draft.universal.js.map