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