@wix/auto_sdk_blog_draft-posts 1.0.24 → 1.0.26

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 (119) hide show
  1. package/build/{internal/cjs/src/blog-v3-draft-draft-posts.universal.d.ts → cjs/blog-v3-draft-draft-posts.universal-yk8zFFHT.d.ts} +311 -644
  2. package/build/cjs/index.d.ts +195 -1
  3. package/build/cjs/index.js +3441 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +2359 -1
  6. package/build/cjs/meta.js +2054 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/{internal/es/src/blog-v3-draft-draft-posts.universal.d.ts → es/blog-v3-draft-draft-posts.universal-yk8zFFHT.d.mts} +311 -644
  9. package/build/es/index.d.mts +195 -0
  10. package/build/es/index.mjs +3364 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/es/{src/blog-v3-draft-draft-posts.types.d.ts → meta.d.mts} +263 -1025
  13. package/build/es/meta.mjs +2017 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/{cjs/src/blog-v3-draft-draft-posts.universal.d.ts → internal/cjs/blog-v3-draft-draft-posts.universal-yk8zFFHT.d.ts} +311 -644
  16. package/build/internal/cjs/index.d.ts +195 -1
  17. package/build/internal/cjs/index.js +3441 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +2359 -1
  20. package/build/internal/cjs/meta.js +2054 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/{es/src/blog-v3-draft-draft-posts.universal.d.ts → internal/es/blog-v3-draft-draft-posts.universal-yk8zFFHT.d.mts} +311 -644
  23. package/build/internal/es/index.d.mts +195 -0
  24. package/build/internal/es/index.mjs +3364 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/{cjs/src/blog-v3-draft-draft-posts.types.d.ts → internal/es/meta.d.mts} +263 -1025
  27. package/build/internal/es/meta.mjs +2017 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +9 -8
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  34. package/build/cjs/src/blog-v3-draft-draft-posts.context.js +0 -78
  35. package/build/cjs/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  36. package/build/cjs/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  37. package/build/cjs/src/blog-v3-draft-draft-posts.http.js +0 -1803
  38. package/build/cjs/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  39. package/build/cjs/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  40. package/build/cjs/src/blog-v3-draft-draft-posts.meta.js +0 -294
  41. package/build/cjs/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  42. package/build/cjs/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  43. package/build/cjs/src/blog-v3-draft-draft-posts.public.js +0 -339
  44. package/build/cjs/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  45. package/build/cjs/src/blog-v3-draft-draft-posts.types.js +0 -477
  46. package/build/cjs/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  47. package/build/cjs/src/blog-v3-draft-draft-posts.universal.js +0 -1506
  48. package/build/cjs/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  49. package/build/es/index.d.ts +0 -1
  50. package/build/es/index.js +0 -2
  51. package/build/es/index.js.map +0 -1
  52. package/build/es/index.typings.d.ts +0 -1
  53. package/build/es/index.typings.js +0 -2
  54. package/build/es/index.typings.js.map +0 -1
  55. package/build/es/meta.d.ts +0 -1
  56. package/build/es/meta.js +0 -2
  57. package/build/es/meta.js.map +0 -1
  58. package/build/es/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  59. package/build/es/src/blog-v3-draft-draft-posts.context.js +0 -34
  60. package/build/es/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  61. package/build/es/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  62. package/build/es/src/blog-v3-draft-draft-posts.http.js +0 -1786
  63. package/build/es/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  64. package/build/es/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  65. package/build/es/src/blog-v3-draft-draft-posts.meta.js +0 -254
  66. package/build/es/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  67. package/build/es/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  68. package/build/es/src/blog-v3-draft-draft-posts.public.js +0 -281
  69. package/build/es/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  70. package/build/es/src/blog-v3-draft-draft-posts.types.js +0 -474
  71. package/build/es/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  72. package/build/es/src/blog-v3-draft-draft-posts.universal.js +0 -1465
  73. package/build/es/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  74. package/build/internal/cjs/index.typings.d.ts +0 -1
  75. package/build/internal/cjs/index.typings.js +0 -18
  76. package/build/internal/cjs/index.typings.js.map +0 -1
  77. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  78. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.js +0 -78
  79. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  80. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  81. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.js +0 -1803
  82. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  83. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  84. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.js +0 -294
  85. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  86. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  87. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.js +0 -339
  88. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  89. package/build/internal/cjs/src/blog-v3-draft-draft-posts.types.d.ts +0 -3121
  90. package/build/internal/cjs/src/blog-v3-draft-draft-posts.types.js +0 -477
  91. package/build/internal/cjs/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  92. package/build/internal/cjs/src/blog-v3-draft-draft-posts.universal.js +0 -1506
  93. package/build/internal/cjs/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  94. package/build/internal/es/index.d.ts +0 -1
  95. package/build/internal/es/index.js +0 -2
  96. package/build/internal/es/index.js.map +0 -1
  97. package/build/internal/es/index.typings.d.ts +0 -1
  98. package/build/internal/es/index.typings.js +0 -2
  99. package/build/internal/es/index.typings.js.map +0 -1
  100. package/build/internal/es/meta.d.ts +0 -1
  101. package/build/internal/es/meta.js +0 -2
  102. package/build/internal/es/meta.js.map +0 -1
  103. package/build/internal/es/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  104. package/build/internal/es/src/blog-v3-draft-draft-posts.context.js +0 -34
  105. package/build/internal/es/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  106. package/build/internal/es/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  107. package/build/internal/es/src/blog-v3-draft-draft-posts.http.js +0 -1786
  108. package/build/internal/es/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  109. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  110. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.js +0 -254
  111. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  112. package/build/internal/es/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  113. package/build/internal/es/src/blog-v3-draft-draft-posts.public.js +0 -281
  114. package/build/internal/es/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  115. package/build/internal/es/src/blog-v3-draft-draft-posts.types.d.ts +0 -3121
  116. package/build/internal/es/src/blog-v3-draft-draft-posts.types.js +0 -474
  117. package/build/internal/es/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  118. package/build/internal/es/src/blog-v3-draft-draft-posts.universal.js +0 -1465
  119. package/build/internal/es/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
@@ -1,1465 +0,0 @@
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
- * @permissionScope Manage Blog
507
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
508
- * @applicableIdentity APP
509
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.CreateDraftPost
510
- */
511
- export async function createDraftPost(draftPost, options) {
512
- // @ts-ignore
513
- const { httpClient, sideEffects } = arguments[2];
514
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
515
- draftPost: draftPost,
516
- publish: options?.publish,
517
- fieldsets: options?.fieldsets,
518
- }, ['draftPost.richContent']), [
519
- {
520
- transformFn: transformSDKImageToRESTImage,
521
- paths: [
522
- { path: 'draftPost.heroImage' },
523
- { path: 'draftPost.coverMedia.image' },
524
- { path: 'draftPost.media.wixMedia.image' },
525
- ],
526
- },
527
- {
528
- transformFn: transformSDKPageURLToRESTPageURL,
529
- paths: [
530
- { path: 'draftPost.url' },
531
- { path: 'draftPost.translations.url' },
532
- ],
533
- },
534
- {
535
- transformFn: transformSDKVideoToRESTVideo,
536
- paths: [{ path: 'draftPost.coverMedia.video' }],
537
- },
538
- {
539
- transformFn: transformSDKVideoV2ToRESTVideoV2,
540
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
541
- },
542
- ]);
543
- const reqOpts = ambassadorWixBlogV3Draft.createDraftPost(payload);
544
- sideEffects?.onSiteCall?.();
545
- try {
546
- const result = await httpClient.request(reqOpts);
547
- sideEffects?.onSuccess?.(result);
548
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
549
- {
550
- transformFn: transformRESTImageToSDKImage,
551
- paths: [
552
- { path: 'draftPost.heroImage' },
553
- { path: 'draftPost.coverMedia.image' },
554
- { path: 'draftPost.media.wixMedia.image' },
555
- ],
556
- },
557
- {
558
- transformFn: transformRESTPageURLToSDKPageURL,
559
- paths: [
560
- { path: 'draftPost.url' },
561
- { path: 'draftPost.translations.url' },
562
- ],
563
- },
564
- {
565
- transformFn: transformRESTVideoToSDKVideo,
566
- paths: [{ path: 'draftPost.coverMedia.video' }],
567
- },
568
- {
569
- transformFn: transformRESTVideoV2ToSDKVideoV2,
570
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
571
- },
572
- ]), ['draftPost.richContent']);
573
- }
574
- catch (err) {
575
- const transformedError = sdkTransformError(err, {
576
- spreadPathsToArguments: {},
577
- explicitPathsToArguments: {
578
- draftPost: '$[0]',
579
- publish: '$[1].publish',
580
- fieldsets: '$[1].fieldsets',
581
- },
582
- singleArgumentUnchanged: false,
583
- }, ['draftPost', 'options']);
584
- sideEffects?.onError?.(err);
585
- throw transformedError;
586
- }
587
- }
588
- /**
589
- * Creates multiple draft posts.
590
- * @param draftPosts - Draft posts to create.
591
- * @public
592
- * @requiredField draftPosts
593
- * @requiredField draftPosts.title
594
- * @param options - Options for creating multiple draft posts.
595
- * @permissionId BLOG.CREATE-DRAFT
596
- * @permissionScope Manage Blog
597
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
598
- * @permissionScope Manage Blog
599
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
600
- * @applicableIdentity APP
601
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkCreateDraftPosts
602
- */
603
- export async function bulkCreateDraftPosts(draftPosts, options) {
604
- // @ts-ignore
605
- const { httpClient, sideEffects } = arguments[2];
606
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
607
- draftPosts: draftPosts,
608
- publish: options?.publish,
609
- returnFullEntity: options?.returnFullEntity,
610
- fieldsets: options?.fieldsets,
611
- }, ['draftPosts.richContent']), [
612
- {
613
- transformFn: transformSDKImageToRESTImage,
614
- paths: [
615
- { path: 'draftPosts.heroImage' },
616
- { path: 'draftPosts.coverMedia.image' },
617
- { path: 'draftPosts.media.wixMedia.image' },
618
- ],
619
- },
620
- {
621
- transformFn: transformSDKPageURLToRESTPageURL,
622
- paths: [
623
- { path: 'draftPosts.url' },
624
- { path: 'draftPosts.translations.url' },
625
- ],
626
- },
627
- {
628
- transformFn: transformSDKVideoToRESTVideo,
629
- paths: [{ path: 'draftPosts.coverMedia.video' }],
630
- },
631
- {
632
- transformFn: transformSDKVideoV2ToRESTVideoV2,
633
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
634
- },
635
- ]);
636
- const reqOpts = ambassadorWixBlogV3Draft.bulkCreateDraftPosts(payload);
637
- sideEffects?.onSiteCall?.();
638
- try {
639
- const result = await httpClient.request(reqOpts);
640
- sideEffects?.onSuccess?.(result);
641
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
642
- {
643
- transformFn: transformRESTImageToSDKImage,
644
- paths: [
645
- { path: 'results.item.heroImage' },
646
- { path: 'results.item.coverMedia.image' },
647
- { path: 'results.item.media.wixMedia.image' },
648
- ],
649
- },
650
- {
651
- transformFn: transformRESTPageURLToSDKPageURL,
652
- paths: [
653
- { path: 'results.item.url' },
654
- { path: 'results.item.translations.url' },
655
- ],
656
- },
657
- {
658
- transformFn: transformRESTVideoToSDKVideo,
659
- paths: [{ path: 'results.item.coverMedia.video' }],
660
- },
661
- {
662
- transformFn: transformRESTVideoV2ToSDKVideoV2,
663
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
664
- },
665
- ]), ['results.item.richContent']);
666
- }
667
- catch (err) {
668
- const transformedError = sdkTransformError(err, {
669
- spreadPathsToArguments: {},
670
- explicitPathsToArguments: {
671
- draftPosts: '$[0]',
672
- publish: '$[1].publish',
673
- returnFullEntity: '$[1].returnFullEntity',
674
- fieldsets: '$[1].fieldsets',
675
- },
676
- singleArgumentUnchanged: false,
677
- }, ['draftPosts', 'options']);
678
- sideEffects?.onError?.(err);
679
- throw transformedError;
680
- }
681
- }
682
- /**
683
- * Updates multiple draft posts.
684
- * @public
685
- * @requiredField options.draftPosts.draftPost
686
- * @requiredField options.draftPosts.draftPost._id
687
- * @param options - Options for updating multiple draft posts.
688
- * @permissionId BLOG.EDIT-DRAFT
689
- * @permissionScope Manage Blog
690
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
691
- * @permissionScope Manage Blog
692
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
693
- * @applicableIdentity APP
694
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkUpdateDraftPosts
695
- */
696
- export async function bulkUpdateDraftPosts(options) {
697
- // @ts-ignore
698
- const { httpClient, sideEffects } = arguments[1];
699
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
700
- draftPosts: options?.draftPosts,
701
- action: options?.action,
702
- scheduledPublishDate: options?.scheduledPublishDate,
703
- returnFullEntity: options?.returnFullEntity,
704
- fieldsets: options?.fieldsets,
705
- }, ['draftPosts.draftPost.richContent']), [
706
- {
707
- transformFn: transformSDKImageToRESTImage,
708
- paths: [
709
- { path: 'draftPosts.draftPost.heroImage' },
710
- { path: 'draftPosts.draftPost.coverMedia.image' },
711
- { path: 'draftPosts.draftPost.media.wixMedia.image' },
712
- ],
713
- },
714
- {
715
- transformFn: transformSDKPageURLToRESTPageURL,
716
- paths: [
717
- { path: 'draftPosts.draftPost.url' },
718
- { path: 'draftPosts.draftPost.translations.url' },
719
- ],
720
- },
721
- {
722
- transformFn: transformSDKVideoToRESTVideo,
723
- paths: [{ path: 'draftPosts.draftPost.coverMedia.video' }],
724
- },
725
- {
726
- transformFn: transformSDKVideoV2ToRESTVideoV2,
727
- paths: [{ path: 'draftPosts.draftPost.media.wixMedia.videoV2' }],
728
- },
729
- ]);
730
- const reqOpts = ambassadorWixBlogV3Draft.bulkUpdateDraftPosts(payload);
731
- sideEffects?.onSiteCall?.();
732
- try {
733
- const result = await httpClient.request(reqOpts);
734
- sideEffects?.onSuccess?.(result);
735
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
736
- {
737
- transformFn: transformRESTImageToSDKImage,
738
- paths: [
739
- { path: 'results.item.heroImage' },
740
- { path: 'results.item.coverMedia.image' },
741
- { path: 'results.item.media.wixMedia.image' },
742
- ],
743
- },
744
- {
745
- transformFn: transformRESTPageURLToSDKPageURL,
746
- paths: [
747
- { path: 'results.item.url' },
748
- { path: 'results.item.translations.url' },
749
- ],
750
- },
751
- {
752
- transformFn: transformRESTVideoToSDKVideo,
753
- paths: [{ path: 'results.item.coverMedia.video' }],
754
- },
755
- {
756
- transformFn: transformRESTVideoV2ToSDKVideoV2,
757
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
758
- },
759
- ]), ['results.item.richContent']);
760
- }
761
- catch (err) {
762
- const transformedError = sdkTransformError(err, {
763
- spreadPathsToArguments: {},
764
- explicitPathsToArguments: {
765
- draftPosts: '$[0].draftPosts',
766
- action: '$[0].action',
767
- scheduledPublishDate: '$[0].scheduledPublishDate',
768
- returnFullEntity: '$[0].returnFullEntity',
769
- fieldsets: '$[0].fieldsets',
770
- },
771
- singleArgumentUnchanged: false,
772
- }, ['options']);
773
- sideEffects?.onError?.(err);
774
- throw transformedError;
775
- }
776
- }
777
- /**
778
- * Retrieves a list of up to 100 deleted draft posts.
779
- *
780
- * List Draft Posts runs with these defaults, which you can override:
781
- * - `editedDate` is sorted in descending order. In this case,`editedDate` implies the date the post was deleted.
782
- * - `paging.limit` is `50`.
783
- * - `paging.offset` is `0`.
784
- * @public
785
- * @param options - Options for listing deleted draft posts.
786
- * @permissionId BLOG.READ_DRAFT
787
- * @permissionScope Manage Blog
788
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
789
- * @permissionScope Manage Blog
790
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
791
- * @applicableIdentity APP
792
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.ListDeletedDraftPosts
793
- */
794
- export async function listDeletedDraftPosts(options) {
795
- // @ts-ignore
796
- const { httpClient, sideEffects } = arguments[1];
797
- const payload = renameKeysFromSDKRequestToRESTRequest({
798
- language: options?.language,
799
- sort: options?.sort,
800
- paging: options?.paging,
801
- fieldsets: options?.fieldsets,
802
- draftPostIds: options?.draftPostIds,
803
- }, []);
804
- const reqOpts = ambassadorWixBlogV3Draft.listDeletedDraftPosts(payload);
805
- sideEffects?.onSiteCall?.();
806
- try {
807
- const result = await httpClient.request(reqOpts);
808
- sideEffects?.onSuccess?.(result);
809
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
810
- {
811
- transformFn: transformRESTImageToSDKImage,
812
- paths: [
813
- { path: 'draftPosts.heroImage' },
814
- { path: 'draftPosts.coverMedia.image' },
815
- { path: 'draftPosts.media.wixMedia.image' },
816
- ],
817
- },
818
- {
819
- transformFn: transformRESTPageURLToSDKPageURL,
820
- paths: [
821
- { path: 'draftPosts.url' },
822
- { path: 'draftPosts.translations.url' },
823
- ],
824
- },
825
- {
826
- transformFn: transformRESTVideoToSDKVideo,
827
- paths: [{ path: 'draftPosts.coverMedia.video' }],
828
- },
829
- {
830
- transformFn: transformRESTVideoV2ToSDKVideoV2,
831
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
832
- },
833
- ]), ['draftPosts.richContent']);
834
- }
835
- catch (err) {
836
- const transformedError = sdkTransformError(err, {
837
- spreadPathsToArguments: {},
838
- explicitPathsToArguments: {
839
- language: '$[0].language',
840
- sort: '$[0].sort',
841
- paging: '$[0].paging',
842
- fieldsets: '$[0].fieldsets',
843
- draftPostIds: '$[0].draftPostIds',
844
- },
845
- singleArgumentUnchanged: false,
846
- }, ['options']);
847
- sideEffects?.onError?.(err);
848
- throw transformedError;
849
- }
850
- }
851
- /**
852
- * Retrieves a draft post by the provided ID.
853
- * @param draftPostId - Draft post ID.
854
- * @public
855
- * @requiredField draftPostId
856
- * @param options - Options for getting a draft post.
857
- * @permissionId BLOG.READ_DRAFT
858
- * @permissionScope Manage Blog
859
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
860
- * @permissionScope Manage Blog
861
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
862
- * @applicableIdentity APP
863
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.GetDraftPost
864
- */
865
- export async function getDraftPost(draftPostId, options) {
866
- // @ts-ignore
867
- const { httpClient, sideEffects } = arguments[2];
868
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId, fieldsets: options?.fieldsets }, []);
869
- const reqOpts = ambassadorWixBlogV3Draft.getDraftPost(payload);
870
- sideEffects?.onSiteCall?.();
871
- try {
872
- const result = await httpClient.request(reqOpts);
873
- sideEffects?.onSuccess?.(result);
874
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
875
- {
876
- transformFn: transformRESTImageToSDKImage,
877
- paths: [
878
- { path: 'draftPost.heroImage' },
879
- { path: 'draftPost.coverMedia.image' },
880
- { path: 'draftPost.media.wixMedia.image' },
881
- ],
882
- },
883
- {
884
- transformFn: transformRESTPageURLToSDKPageURL,
885
- paths: [
886
- { path: 'draftPost.url' },
887
- { path: 'draftPost.translations.url' },
888
- ],
889
- },
890
- {
891
- transformFn: transformRESTVideoToSDKVideo,
892
- paths: [{ path: 'draftPost.coverMedia.video' }],
893
- },
894
- {
895
- transformFn: transformRESTVideoV2ToSDKVideoV2,
896
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
897
- },
898
- ]), ['draftPost.richContent']);
899
- }
900
- catch (err) {
901
- const transformedError = sdkTransformError(err, {
902
- spreadPathsToArguments: {},
903
- explicitPathsToArguments: {
904
- draftPostId: '$[0]',
905
- fieldsets: '$[1].fieldsets',
906
- },
907
- singleArgumentUnchanged: false,
908
- }, ['draftPostId', 'options']);
909
- sideEffects?.onError?.(err);
910
- throw transformedError;
911
- }
912
- }
913
- /**
914
- * Updates a draft post.
915
- * @param _id - Draft post ID.
916
- * @public
917
- * @requiredField _id
918
- * @requiredField draftPost
919
- * @param options - Options for updating a draft post.
920
- * @param draftPost - Draft Post info.
921
- * @permissionId BLOG.EDIT-DRAFT
922
- * @permissionScope Manage Blog
923
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
924
- * @permissionScope Manage Blog
925
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
926
- * @applicableIdentity APP
927
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.UpdateDraftPost
928
- */
929
- export async function updateDraftPost(_id, draftPost, options) {
930
- // @ts-ignore
931
- const { httpClient, sideEffects } = arguments[3];
932
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
933
- draftPost: { ...draftPost, id: _id },
934
- action: options?.action,
935
- scheduledPublishDate: options?.scheduledPublishDate,
936
- fieldsets: options?.fieldsets,
937
- }, ['draftPost.richContent']), [
938
- {
939
- transformFn: transformSDKImageToRESTImage,
940
- paths: [
941
- { path: 'draftPost.heroImage' },
942
- { path: 'draftPost.coverMedia.image' },
943
- { path: 'draftPost.media.wixMedia.image' },
944
- ],
945
- },
946
- {
947
- transformFn: transformSDKPageURLToRESTPageURL,
948
- paths: [
949
- { path: 'draftPost.url' },
950
- { path: 'draftPost.translations.url' },
951
- ],
952
- },
953
- {
954
- transformFn: transformSDKVideoToRESTVideo,
955
- paths: [{ path: 'draftPost.coverMedia.video' }],
956
- },
957
- {
958
- transformFn: transformSDKVideoV2ToRESTVideoV2,
959
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
960
- },
961
- ]);
962
- const reqOpts = ambassadorWixBlogV3Draft.updateDraftPost(payload);
963
- sideEffects?.onSiteCall?.();
964
- try {
965
- const result = await httpClient.request(reqOpts);
966
- sideEffects?.onSuccess?.(result);
967
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
968
- {
969
- transformFn: transformRESTImageToSDKImage,
970
- paths: [
971
- { path: 'draftPost.heroImage' },
972
- { path: 'draftPost.coverMedia.image' },
973
- { path: 'draftPost.media.wixMedia.image' },
974
- ],
975
- },
976
- {
977
- transformFn: transformRESTPageURLToSDKPageURL,
978
- paths: [
979
- { path: 'draftPost.url' },
980
- { path: 'draftPost.translations.url' },
981
- ],
982
- },
983
- {
984
- transformFn: transformRESTVideoToSDKVideo,
985
- paths: [{ path: 'draftPost.coverMedia.video' }],
986
- },
987
- {
988
- transformFn: transformRESTVideoV2ToSDKVideoV2,
989
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
990
- },
991
- ]), ['draftPost.richContent']);
992
- }
993
- catch (err) {
994
- const transformedError = sdkTransformError(err, {
995
- spreadPathsToArguments: { draftPost: '$[1]' },
996
- explicitPathsToArguments: {
997
- 'draftPost.id': '$[0]',
998
- action: '$[2].action',
999
- scheduledPublishDate: '$[2].scheduledPublishDate',
1000
- fieldsets: '$[2].fieldsets',
1001
- },
1002
- singleArgumentUnchanged: false,
1003
- }, ['_id', 'draftPost', 'options']);
1004
- sideEffects?.onError?.(err);
1005
- throw transformedError;
1006
- }
1007
- }
1008
- /**
1009
- * Moves a draft post to the trash bin.
1010
- * 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.
1011
- *
1012
- * To permanently delete a post bypassing the trash bin, set the `permanent` field value to `true`. The post can't be restored after this.
1013
- * @param draftPostId - Draft post ID.
1014
- * @public
1015
- * @requiredField draftPostId
1016
- * @param options - Options for deleting a draft post.
1017
- * @permissionId BLOG.DELETE-DRAFT
1018
- * @permissionScope Manage Blog
1019
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1020
- * @permissionScope Manage Blog
1021
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1022
- * @applicableIdentity APP
1023
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.DeleteDraftPost
1024
- */
1025
- export async function deleteDraftPost(draftPostId, options) {
1026
- // @ts-ignore
1027
- const { httpClient, sideEffects } = arguments[2];
1028
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId, permanent: options?.permanent }, []);
1029
- const reqOpts = ambassadorWixBlogV3Draft.deleteDraftPost(payload);
1030
- sideEffects?.onSiteCall?.();
1031
- try {
1032
- const result = await httpClient.request(reqOpts);
1033
- sideEffects?.onSuccess?.(result);
1034
- }
1035
- catch (err) {
1036
- const transformedError = sdkTransformError(err, {
1037
- spreadPathsToArguments: {},
1038
- explicitPathsToArguments: {
1039
- draftPostId: '$[0]',
1040
- permanent: '$[1].permanent',
1041
- },
1042
- singleArgumentUnchanged: false,
1043
- }, ['draftPostId', 'options']);
1044
- sideEffects?.onError?.(err);
1045
- throw transformedError;
1046
- }
1047
- }
1048
- /**
1049
- * Permanently deletes a draft post that is currently in the trash bin.
1050
- *
1051
- * This action is permanent and can't be reversed.
1052
- * @param draftPostId - Draft post ID.
1053
- * @public
1054
- * @requiredField draftPostId
1055
- * @permissionId BLOG.DELETE-DRAFT
1056
- * @permissionScope Manage Blog
1057
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1058
- * @permissionScope Manage Blog
1059
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1060
- * @applicableIdentity APP
1061
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.RemoveFromTrashBin
1062
- */
1063
- export async function removeFromTrashBin(draftPostId) {
1064
- // @ts-ignore
1065
- const { httpClient, sideEffects } = arguments[1];
1066
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId }, []);
1067
- const reqOpts = ambassadorWixBlogV3Draft.removeFromTrashBin(payload);
1068
- sideEffects?.onSiteCall?.();
1069
- try {
1070
- const result = await httpClient.request(reqOpts);
1071
- sideEffects?.onSuccess?.(result);
1072
- }
1073
- catch (err) {
1074
- const transformedError = sdkTransformError(err, {
1075
- spreadPathsToArguments: {},
1076
- explicitPathsToArguments: { draftPostId: '$[0]' },
1077
- singleArgumentUnchanged: false,
1078
- }, ['draftPostId']);
1079
- sideEffects?.onError?.(err);
1080
- throw transformedError;
1081
- }
1082
- }
1083
- /**
1084
- * Deletes multiple draft posts.
1085
- * @param postIds - Post IDs.
1086
- * @public
1087
- * @requiredField postIds
1088
- * @param options - Options for deleting multiple draft posts.
1089
- * @permissionId BLOG.DELETE-DRAFT
1090
- * @permissionScope Manage Blog
1091
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1092
- * @permissionScope Manage Blog
1093
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1094
- * @applicableIdentity APP
1095
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkDeleteDraftPosts
1096
- */
1097
- export async function bulkDeleteDraftPosts(postIds, options) {
1098
- // @ts-ignore
1099
- const { httpClient, sideEffects } = arguments[2];
1100
- const payload = renameKeysFromSDKRequestToRESTRequest({ postIds: postIds, permanent: options?.permanent }, []);
1101
- const reqOpts = ambassadorWixBlogV3Draft.bulkDeleteDraftPosts(payload);
1102
- sideEffects?.onSiteCall?.();
1103
- try {
1104
- const result = await httpClient.request(reqOpts);
1105
- sideEffects?.onSuccess?.(result);
1106
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1107
- {
1108
- transformFn: transformRESTImageToSDKImage,
1109
- paths: [
1110
- { path: 'results.item.heroImage' },
1111
- { path: 'results.item.coverMedia.image' },
1112
- { path: 'results.item.media.wixMedia.image' },
1113
- ],
1114
- },
1115
- {
1116
- transformFn: transformRESTPageURLToSDKPageURL,
1117
- paths: [
1118
- { path: 'results.item.url' },
1119
- { path: 'results.item.translations.url' },
1120
- ],
1121
- },
1122
- {
1123
- transformFn: transformRESTVideoToSDKVideo,
1124
- paths: [{ path: 'results.item.coverMedia.video' }],
1125
- },
1126
- {
1127
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1128
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
1129
- },
1130
- ]), ['results.item.richContent']);
1131
- }
1132
- catch (err) {
1133
- const transformedError = sdkTransformError(err, {
1134
- spreadPathsToArguments: {},
1135
- explicitPathsToArguments: {
1136
- postIds: '$[0]',
1137
- permanent: '$[1].permanent',
1138
- },
1139
- singleArgumentUnchanged: false,
1140
- }, ['postIds', 'options']);
1141
- sideEffects?.onError?.(err);
1142
- throw transformedError;
1143
- }
1144
- }
1145
- /**
1146
- * Retrieves a list of up to 100 draft posts per request.
1147
- *
1148
- * List Draft Posts runs with these defaults, which you can override:
1149
- * - `editedDate` is sorted in descending order.
1150
- * - `paging.limit` is `50`.
1151
- * - `paging.offset` is `0`.
1152
- * @public
1153
- * @param options - Options for listing multiple draft posts.
1154
- * @permissionId BLOG.READ_DRAFT
1155
- * @permissionScope Manage Blog
1156
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1157
- * @permissionScope Manage Blog
1158
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1159
- * @applicableIdentity APP
1160
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.ListDraftPosts
1161
- */
1162
- export async function listDraftPosts(options) {
1163
- // @ts-ignore
1164
- const { httpClient, sideEffects } = arguments[1];
1165
- const payload = renameKeysFromSDKRequestToRESTRequest({
1166
- status: options?.status,
1167
- language: options?.language,
1168
- sort: options?.sort,
1169
- paging: options?.paging,
1170
- fieldsets: options?.fieldsets,
1171
- }, []);
1172
- const reqOpts = ambassadorWixBlogV3Draft.listDraftPosts(payload);
1173
- sideEffects?.onSiteCall?.();
1174
- try {
1175
- const result = await httpClient.request(reqOpts);
1176
- sideEffects?.onSuccess?.(result);
1177
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1178
- {
1179
- transformFn: transformRESTImageToSDKImage,
1180
- paths: [
1181
- { path: 'draftPosts.heroImage' },
1182
- { path: 'draftPosts.coverMedia.image' },
1183
- { path: 'draftPosts.media.wixMedia.image' },
1184
- ],
1185
- },
1186
- {
1187
- transformFn: transformRESTPageURLToSDKPageURL,
1188
- paths: [
1189
- { path: 'draftPosts.url' },
1190
- { path: 'draftPosts.translations.url' },
1191
- ],
1192
- },
1193
- {
1194
- transformFn: transformRESTVideoToSDKVideo,
1195
- paths: [{ path: 'draftPosts.coverMedia.video' }],
1196
- },
1197
- {
1198
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1199
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
1200
- },
1201
- ]), ['draftPosts.richContent']);
1202
- }
1203
- catch (err) {
1204
- const transformedError = sdkTransformError(err, {
1205
- spreadPathsToArguments: {},
1206
- explicitPathsToArguments: {
1207
- status: '$[0].status',
1208
- language: '$[0].language',
1209
- sort: '$[0].sort',
1210
- paging: '$[0].paging',
1211
- fieldsets: '$[0].fieldsets',
1212
- },
1213
- singleArgumentUnchanged: false,
1214
- }, ['options']);
1215
- sideEffects?.onError?.(err);
1216
- throw transformedError;
1217
- }
1218
- }
1219
- /**
1220
- * Retrieves a deleted draft post from the trash bin by the provided ID.
1221
- * @param draftPostId - Draft post ID.
1222
- * @public
1223
- * @requiredField draftPostId
1224
- * @permissionId BLOG.READ_DRAFT
1225
- * @permissionScope Manage Blog
1226
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1227
- * @permissionScope Manage Blog
1228
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1229
- * @applicableIdentity APP
1230
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.GetDeletedDraftPost
1231
- */
1232
- export async function getDeletedDraftPost(draftPostId) {
1233
- // @ts-ignore
1234
- const { httpClient, sideEffects } = arguments[1];
1235
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId }, []);
1236
- const reqOpts = ambassadorWixBlogV3Draft.getDeletedDraftPost(payload);
1237
- sideEffects?.onSiteCall?.();
1238
- try {
1239
- const result = await httpClient.request(reqOpts);
1240
- sideEffects?.onSuccess?.(result);
1241
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1242
- {
1243
- transformFn: transformRESTImageToSDKImage,
1244
- paths: [
1245
- { path: 'draftPost.heroImage' },
1246
- { path: 'draftPost.coverMedia.image' },
1247
- { path: 'draftPost.media.wixMedia.image' },
1248
- ],
1249
- },
1250
- {
1251
- transformFn: transformRESTPageURLToSDKPageURL,
1252
- paths: [
1253
- { path: 'draftPost.url' },
1254
- { path: 'draftPost.translations.url' },
1255
- ],
1256
- },
1257
- {
1258
- transformFn: transformRESTVideoToSDKVideo,
1259
- paths: [{ path: 'draftPost.coverMedia.video' }],
1260
- },
1261
- {
1262
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1263
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
1264
- },
1265
- ]), ['draftPost.richContent']);
1266
- }
1267
- catch (err) {
1268
- const transformedError = sdkTransformError(err, {
1269
- spreadPathsToArguments: {},
1270
- explicitPathsToArguments: { draftPostId: '$[0]' },
1271
- singleArgumentUnchanged: false,
1272
- }, ['draftPostId']);
1273
- sideEffects?.onError?.(err);
1274
- throw transformedError;
1275
- }
1276
- }
1277
- /**
1278
- * Restores a deleted draft post from the trash bin by the provided ID.
1279
- * @param draftPostId - Draft post ID.
1280
- * @public
1281
- * @requiredField draftPostId
1282
- * @permissionId BLOG.EDIT-DRAFT
1283
- * @permissionScope Manage Blog
1284
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1285
- * @permissionScope Manage Blog
1286
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1287
- * @applicableIdentity APP
1288
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.RestoreFromTrashBin
1289
- */
1290
- export async function restoreFromTrashBin(draftPostId) {
1291
- // @ts-ignore
1292
- const { httpClient, sideEffects } = arguments[1];
1293
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId }, []);
1294
- const reqOpts = ambassadorWixBlogV3Draft.restoreFromTrashBin(payload);
1295
- sideEffects?.onSiteCall?.();
1296
- try {
1297
- const result = await httpClient.request(reqOpts);
1298
- sideEffects?.onSuccess?.(result);
1299
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1300
- {
1301
- transformFn: transformRESTImageToSDKImage,
1302
- paths: [
1303
- { path: 'draftPost.heroImage' },
1304
- { path: 'draftPost.coverMedia.image' },
1305
- { path: 'draftPost.media.wixMedia.image' },
1306
- ],
1307
- },
1308
- {
1309
- transformFn: transformRESTPageURLToSDKPageURL,
1310
- paths: [
1311
- { path: 'draftPost.url' },
1312
- { path: 'draftPost.translations.url' },
1313
- ],
1314
- },
1315
- {
1316
- transformFn: transformRESTVideoToSDKVideo,
1317
- paths: [{ path: 'draftPost.coverMedia.video' }],
1318
- },
1319
- {
1320
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1321
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
1322
- },
1323
- ]), ['draftPost.richContent']);
1324
- }
1325
- catch (err) {
1326
- const transformedError = sdkTransformError(err, {
1327
- spreadPathsToArguments: {},
1328
- explicitPathsToArguments: { draftPostId: '$[0]' },
1329
- singleArgumentUnchanged: false,
1330
- }, ['draftPostId']);
1331
- sideEffects?.onError?.(err);
1332
- throw transformedError;
1333
- }
1334
- }
1335
- /**
1336
- * Creates a query to retrieve a list of up to 100 draft posts.
1337
- *
1338
- *
1339
- * The `queryDraftPosts()` function builds a query to retrieve a list of up to 100 draft posts, and returns a `DraftPostsQueryBuilder` object.
1340
- *
1341
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
1342
- *
1343
- * 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.
1344
- *
1345
- * `queryDraftPosts()` runs with these `DraftPostsQueryBuilder` defaults that can be overridden:
1346
- * - `limit(50)`
1347
- * - `ascending('_id')`
1348
- *
1349
- * 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`.
1350
- * @public
1351
- * @param options - Options for querying draft posts.
1352
- * @permissionScope Manage Blog
1353
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1354
- * @permissionScope Manage Blog
1355
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1356
- * @permissionId BLOG.READ_DRAFT
1357
- * @applicableIdentity APP
1358
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.QueryDraftPosts
1359
- */
1360
- export function queryDraftPosts(options) {
1361
- // @ts-ignore
1362
- const { httpClient, sideEffects } = arguments[1];
1363
- return queryBuilder({
1364
- func: async (payload) => {
1365
- const reqOpts = ambassadorWixBlogV3Draft.queryDraftPosts({
1366
- ...payload,
1367
- ...(options ?? {}),
1368
- });
1369
- sideEffects?.onSiteCall?.();
1370
- try {
1371
- const result = await httpClient.request(reqOpts);
1372
- sideEffects?.onSuccess?.(result);
1373
- return result;
1374
- }
1375
- catch (err) {
1376
- sideEffects?.onError?.(err);
1377
- throw err;
1378
- }
1379
- },
1380
- requestTransformer: (query) => {
1381
- const args = [query, options];
1382
- return renameKeysFromSDKRequestToRESTRequest({ ...args?.[1], query: args?.[0] }, []);
1383
- },
1384
- responseTransformer: ({ data }) => {
1385
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
1386
- {
1387
- transformFn: transformRESTImageToSDKImage,
1388
- paths: [
1389
- { path: 'draftPosts.heroImage' },
1390
- { path: 'draftPosts.coverMedia.image' },
1391
- { path: 'draftPosts.media.wixMedia.image' },
1392
- ],
1393
- },
1394
- {
1395
- transformFn: transformRESTPageURLToSDKPageURL,
1396
- paths: [
1397
- { path: 'draftPosts.url' },
1398
- { path: 'draftPosts.translations.url' },
1399
- ],
1400
- },
1401
- {
1402
- transformFn: transformRESTVideoToSDKVideo,
1403
- paths: [{ path: 'draftPosts.coverMedia.video' }],
1404
- },
1405
- {
1406
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1407
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
1408
- },
1409
- ]), ['draftPosts.richContent']);
1410
- return {
1411
- items: transformedData?.draftPosts,
1412
- pagingMetadata: transformedData?.pagingMetadata,
1413
- };
1414
- },
1415
- errorTransformer: (err) => {
1416
- const transformedError = sdkTransformError(err, {
1417
- spreadPathsToArguments: {},
1418
- explicitPathsToArguments: { query: '$[0]' },
1419
- singleArgumentUnchanged: false,
1420
- });
1421
- throw transformedError;
1422
- },
1423
- pagingMethod: 'CURSOR',
1424
- transformationPaths: {},
1425
- });
1426
- }
1427
- /**
1428
- * 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))
1429
- * with the data from the draft post.
1430
- *
1431
- * If the draft post was already published, the published post will be updated with the latest values
1432
- * from the draft post.
1433
- * @param draftPostId - Draft post ID.
1434
- * @public
1435
- * @requiredField draftPostId
1436
- * @permissionId BLOG.PUBLISH-POST
1437
- * @permissionScope Manage Blog
1438
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1439
- * @permissionScope Manage Blog
1440
- * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
1441
- * @applicableIdentity APP
1442
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.PublishDraftPost
1443
- */
1444
- export async function publishDraftPost(draftPostId) {
1445
- // @ts-ignore
1446
- const { httpClient, sideEffects } = arguments[1];
1447
- const payload = renameKeysFromSDKRequestToRESTRequest({ draftPostId: draftPostId }, []);
1448
- const reqOpts = ambassadorWixBlogV3Draft.publishDraftPost(payload);
1449
- sideEffects?.onSiteCall?.();
1450
- try {
1451
- const result = await httpClient.request(reqOpts);
1452
- sideEffects?.onSuccess?.(result);
1453
- return renameKeysFromRESTResponseToSDKResponse(result.data, []);
1454
- }
1455
- catch (err) {
1456
- const transformedError = sdkTransformError(err, {
1457
- spreadPathsToArguments: {},
1458
- explicitPathsToArguments: { draftPostId: '$[0]' },
1459
- singleArgumentUnchanged: false,
1460
- }, ['draftPostId']);
1461
- sideEffects?.onError?.(err);
1462
- throw transformedError;
1463
- }
1464
- }
1465
- //# sourceMappingURL=blog-v3-draft-draft-posts.universal.js.map