@wix/auto_sdk_blog_draft-posts 1.0.16 → 1.0.18

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