@wix/auto_sdk_blog_draft-posts 1.0.14 → 1.0.16

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 (130) hide show
  1. package/build/{internal/cjs/src/blog-v3-draft-draft-posts.universal.d.ts → blog-v3-draft-draft-posts.universal-vVP72XfS.d.mts} +311 -958
  2. package/build/{internal/es/src/blog-v3-draft-draft-posts.universal.d.ts → blog-v3-draft-draft-posts.universal-vVP72XfS.d.ts} +311 -958
  3. package/build/index.d.mts +193 -0
  4. package/build/index.d.ts +193 -0
  5. package/build/index.js +3411 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +3331 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{cjs/src/blog-v3-draft-draft-posts.universal.d.ts → internal/blog-v3-draft-draft-posts.universal-vVP72XfS.d.mts} +311 -958
  10. package/build/{es/src/blog-v3-draft-draft-posts.universal.d.ts → internal/blog-v3-draft-draft-posts.universal-vVP72XfS.d.ts} +311 -958
  11. package/build/internal/index.d.mts +193 -0
  12. package/build/internal/index.d.ts +193 -0
  13. package/build/internal/index.js +3411 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +3331 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/{es/src/blog-v3-draft-draft-posts.types.d.ts → internal/meta.d.mts} +269 -1445
  18. package/build/internal/{cjs/src/blog-v3-draft-draft-posts.types.d.ts → meta.d.ts} +269 -1445
  19. package/build/internal/meta.js +2057 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +2017 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/{cjs/src/blog-v3-draft-draft-posts.types.d.ts → meta.d.mts} +269 -1445
  24. package/build/{internal/es/src/blog-v3-draft-draft-posts.types.d.ts → meta.d.ts} +269 -1445
  25. package/build/meta.js +2057 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +2017 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  40. package/build/cjs/src/blog-v3-draft-draft-posts.context.js +0 -78
  41. package/build/cjs/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  42. package/build/cjs/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  43. package/build/cjs/src/blog-v3-draft-draft-posts.http.js +0 -1803
  44. package/build/cjs/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  45. package/build/cjs/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  46. package/build/cjs/src/blog-v3-draft-draft-posts.meta.js +0 -294
  47. package/build/cjs/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  48. package/build/cjs/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  49. package/build/cjs/src/blog-v3-draft-draft-posts.public.js +0 -339
  50. package/build/cjs/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  51. package/build/cjs/src/blog-v3-draft-draft-posts.types.js +0 -476
  52. package/build/cjs/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  53. package/build/cjs/src/blog-v3-draft-draft-posts.universal.js +0 -1497
  54. package/build/cjs/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  66. package/build/es/src/blog-v3-draft-draft-posts.context.js +0 -34
  67. package/build/es/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  68. package/build/es/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  69. package/build/es/src/blog-v3-draft-draft-posts.http.js +0 -1786
  70. package/build/es/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  71. package/build/es/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  72. package/build/es/src/blog-v3-draft-draft-posts.meta.js +0 -254
  73. package/build/es/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  74. package/build/es/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  75. package/build/es/src/blog-v3-draft-draft-posts.public.js +0 -281
  76. package/build/es/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  77. package/build/es/src/blog-v3-draft-draft-posts.types.js +0 -473
  78. package/build/es/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  79. package/build/es/src/blog-v3-draft-draft-posts.universal.js +0 -1456
  80. package/build/es/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  91. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.js +0 -78
  92. package/build/internal/cjs/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  93. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  94. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.js +0 -1803
  95. package/build/internal/cjs/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  96. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  97. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.js +0 -294
  98. package/build/internal/cjs/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  99. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  100. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.js +0 -339
  101. package/build/internal/cjs/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  102. package/build/internal/cjs/src/blog-v3-draft-draft-posts.types.js +0 -476
  103. package/build/internal/cjs/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  104. package/build/internal/cjs/src/blog-v3-draft-draft-posts.universal.js +0 -1497
  105. package/build/internal/cjs/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
  106. package/build/internal/es/index.d.ts +0 -1
  107. package/build/internal/es/index.js +0 -2
  108. package/build/internal/es/index.js.map +0 -1
  109. package/build/internal/es/index.typings.d.ts +0 -1
  110. package/build/internal/es/index.typings.js +0 -2
  111. package/build/internal/es/index.typings.js.map +0 -1
  112. package/build/internal/es/meta.d.ts +0 -1
  113. package/build/internal/es/meta.js +0 -2
  114. package/build/internal/es/meta.js.map +0 -1
  115. package/build/internal/es/src/blog-v3-draft-draft-posts.context.d.ts +0 -34
  116. package/build/internal/es/src/blog-v3-draft-draft-posts.context.js +0 -34
  117. package/build/internal/es/src/blog-v3-draft-draft-posts.context.js.map +0 -1
  118. package/build/internal/es/src/blog-v3-draft-draft-posts.http.d.ts +0 -83
  119. package/build/internal/es/src/blog-v3-draft-draft-posts.http.js +0 -1786
  120. package/build/internal/es/src/blog-v3-draft-draft-posts.http.js.map +0 -1
  121. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.d.ts +0 -40
  122. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.js +0 -254
  123. package/build/internal/es/src/blog-v3-draft-draft-posts.meta.js.map +0 -1
  124. package/build/internal/es/src/blog-v3-draft-draft-posts.public.d.ts +0 -168
  125. package/build/internal/es/src/blog-v3-draft-draft-posts.public.js +0 -281
  126. package/build/internal/es/src/blog-v3-draft-draft-posts.public.js.map +0 -1
  127. package/build/internal/es/src/blog-v3-draft-draft-posts.types.js +0 -473
  128. package/build/internal/es/src/blog-v3-draft-draft-posts.types.js.map +0 -1
  129. package/build/internal/es/src/blog-v3-draft-draft-posts.universal.js +0 -1456
  130. package/build/internal/es/src/blog-v3-draft-draft-posts.universal.js.map +0 -1
@@ -1,1456 +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 || (DecorationType = {}));
349
- export var FontType;
350
- (function (FontType) {
351
- FontType["PX"] = "PX";
352
- FontType["EM"] = "EM";
353
- })(FontType || (FontType = {}));
354
- export var AppType;
355
- (function (AppType) {
356
- AppType["PRODUCT"] = "PRODUCT";
357
- AppType["EVENT"] = "EVENT";
358
- AppType["BOOKING"] = "BOOKING";
359
- })(AppType || (AppType = {}));
360
- export var InitialExpandedItems;
361
- (function (InitialExpandedItems) {
362
- /** First item will be expended initally */
363
- InitialExpandedItems["FIRST"] = "FIRST";
364
- /** All items will expended initally */
365
- InitialExpandedItems["ALL"] = "ALL";
366
- /** All items collapsed initally */
367
- InitialExpandedItems["NONE"] = "NONE";
368
- })(InitialExpandedItems || (InitialExpandedItems = {}));
369
- export var Direction;
370
- (function (Direction) {
371
- /** Left-to-right */
372
- Direction["LTR"] = "LTR";
373
- /** Right-to-left */
374
- Direction["RTL"] = "RTL";
375
- })(Direction || (Direction = {}));
376
- export var VerticalAlignment;
377
- (function (VerticalAlignment) {
378
- /** Top alignment */
379
- VerticalAlignment["TOP"] = "TOP";
380
- /** Middle alignment */
381
- VerticalAlignment["MIDDLE"] = "MIDDLE";
382
- /** Bottom alignment */
383
- VerticalAlignment["BOTTOM"] = "BOTTOM";
384
- })(VerticalAlignment || (VerticalAlignment = {}));
385
- /**
386
- * `NullValue` is a singleton enumeration to represent the null value for the
387
- * `Value` type union.
388
- *
389
- * The JSON representation for `NullValue` is JSON `null`.
390
- */
391
- export var NullValue;
392
- (function (NullValue) {
393
- /** Null value. */
394
- NullValue["NULL_VALUE"] = "NULL_VALUE";
395
- })(NullValue || (NullValue = {}));
396
- export var Status;
397
- (function (Status) {
398
- Status["UNKNOWN"] = "UNKNOWN";
399
- /** Status indicating the draft post is published. */
400
- Status["PUBLISHED"] = "PUBLISHED";
401
- /** Status indicating the draft post is unpublished. */
402
- Status["UNPUBLISHED"] = "UNPUBLISHED";
403
- /** Status indicating the draft post is scheduled for publication. */
404
- Status["SCHEDULED"] = "SCHEDULED";
405
- /** Status indicating the draft post is deleted. */
406
- Status["DELETED"] = "DELETED";
407
- /** Status indicating the draft post is in review. */
408
- Status["IN_REVIEW"] = "IN_REVIEW";
409
- })(Status || (Status = {}));
410
- export var ModerationStatusStatus;
411
- (function (ModerationStatusStatus) {
412
- ModerationStatusStatus["UNKNOWN"] = "UNKNOWN";
413
- ModerationStatusStatus["APPROVED"] = "APPROVED";
414
- ModerationStatusStatus["REJECTED"] = "REJECTED";
415
- })(ModerationStatusStatus || (ModerationStatusStatus = {}));
416
- export var TotalDraftPostsGroupingField;
417
- (function (TotalDraftPostsGroupingField) {
418
- /** Groups results by status. */
419
- TotalDraftPostsGroupingField["STATUS"] = "STATUS";
420
- /** Groups results by language. */
421
- TotalDraftPostsGroupingField["LANGUAGE"] = "LANGUAGE";
422
- })(TotalDraftPostsGroupingField || (TotalDraftPostsGroupingField = {}));
423
- export var WebhookIdentityType;
424
- (function (WebhookIdentityType) {
425
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
426
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
427
- WebhookIdentityType["MEMBER"] = "MEMBER";
428
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
429
- WebhookIdentityType["APP"] = "APP";
430
- })(WebhookIdentityType || (WebhookIdentityType = {}));
431
- export var Type;
432
- (function (Type) {
433
- Type["UNKNOWN"] = "UNKNOWN";
434
- /** Manually saved. */
435
- Type["MANUAL"] = "MANUAL";
436
- /** Triggered by autosave. */
437
- Type["AUTO_SAVE"] = "AUTO_SAVE";
438
- /** Copied from template during provisioning flow. */
439
- Type["PROVISIONING"] = "PROVISIONING";
440
- /** Imported from another blog. */
441
- Type["IMPORT"] = "IMPORT";
442
- /** Triggered by autosave when post created by AI tool. */
443
- Type["AI_AUTO_SAVE"] = "AI_AUTO_SAVE";
444
- })(Type || (Type = {}));
445
- export var Field;
446
- (function (Field) {
447
- /** Unknown field. */
448
- Field["UNKNOWN"] = "UNKNOWN";
449
- /** Includes draft post preview URL. */
450
- Field["URL"] = "URL";
451
- /** Includes content field. */
452
- Field["CONTENT"] = "CONTENT";
453
- /** Includes rich content field. */
454
- Field["RICH_CONTENT"] = "RICH_CONTENT";
455
- /** If the user has not set excerpt, returns the one autogenerated from content. */
456
- Field["GENERATED_EXCERPT"] = "GENERATED_EXCERPT";
457
- })(Field || (Field = {}));
458
- export var Action;
459
- (function (Action) {
460
- /** Update the draft post. */
461
- Action["UPDATE"] = "UPDATE";
462
- /** Update and publish a draft post. */
463
- Action["UPDATE_PUBLISH"] = "UPDATE_PUBLISH";
464
- /** Update the draft post and schedule a publish date. */
465
- Action["UPDATE_SCHEDULE"] = "UPDATE_SCHEDULE";
466
- /** Update the post and revert it to draft. */
467
- Action["UPDATE_REVERT_TO_DRAFT"] = "UPDATE_REVERT_TO_DRAFT";
468
- /** Update the draft post and cancel the scheduled publish date. */
469
- Action["UPDATE_CANCEL_SCHEDULE"] = "UPDATE_CANCEL_SCHEDULE";
470
- /** Update and reject draft post. */
471
- Action["UPDATE_REJECT"] = "UPDATE_REJECT";
472
- /** Update a post that's already been published. This creates and updates a draft version of the post. The original post is still published. */
473
- Action["UPDATE_PUBLICATION"] = "UPDATE_PUBLICATION";
474
- })(Action || (Action = {}));
475
- export var GetDraftPostsSort;
476
- (function (GetDraftPostsSort) {
477
- /** Sort by `editedDate` in descending order. */
478
- GetDraftPostsSort["EDITING_DATE_DESC"] = "EDITING_DATE_DESC";
479
- /** Sort by `editedDate` in ascending order. */
480
- GetDraftPostsSort["EDITING_DATE_ASC"] = "EDITING_DATE_ASC";
481
- })(GetDraftPostsSort || (GetDraftPostsSort = {}));
482
- export var SortOrder;
483
- (function (SortOrder) {
484
- SortOrder["ASC"] = "ASC";
485
- SortOrder["DESC"] = "DESC";
486
- })(SortOrder || (SortOrder = {}));
487
- /**
488
- * Creates a draft post.
489
- *
490
- * For 3rd-party apps, `memberId` is a required field.
491
- *
492
- * In `categoryIds`, only categories that already exist will be added to the draft post. Including
493
- * `categoryIds` that do not exist will not return an error, but they will not be added to the `categoryIds` array.
494
- * If some of the categories exist, those will be added while those that do not exist will not be added to `categoryIds`.
495
- * You can check which categories are available with
496
- * 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)).
497
- * @param draftPost - Draft post to create.
498
- * @public
499
- * @requiredField draftPost
500
- * @requiredField draftPost.title
501
- * @param options - Options for creating a draft post.
502
- * @permissionId BLOG.CREATE-DRAFT
503
- * @permissionScope Manage Blog
504
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
505
- * @applicableIdentity APP
506
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.CreateDraftPost
507
- */
508
- export async function createDraftPost(draftPost, options) {
509
- // @ts-ignore
510
- const { httpClient, sideEffects } = arguments[2];
511
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
512
- draftPost: draftPost,
513
- publish: options?.publish,
514
- fieldsets: options?.fieldsets,
515
- }), [
516
- {
517
- transformFn: transformSDKImageToRESTImage,
518
- paths: [
519
- { path: 'draftPost.heroImage' },
520
- { path: 'draftPost.coverMedia.image' },
521
- { path: 'draftPost.media.wixMedia.image' },
522
- ],
523
- },
524
- {
525
- transformFn: transformSDKPageURLToRESTPageURL,
526
- paths: [
527
- { path: 'draftPost.url' },
528
- { path: 'draftPost.translations.url' },
529
- ],
530
- },
531
- {
532
- transformFn: transformSDKVideoToRESTVideo,
533
- paths: [{ path: 'draftPost.coverMedia.video' }],
534
- },
535
- {
536
- transformFn: transformSDKVideoV2ToRESTVideoV2,
537
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
538
- },
539
- ]);
540
- const reqOpts = ambassadorWixBlogV3Draft.createDraftPost(payload);
541
- sideEffects?.onSiteCall?.();
542
- try {
543
- const result = await httpClient.request(reqOpts);
544
- sideEffects?.onSuccess?.(result);
545
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
546
- {
547
- transformFn: transformRESTImageToSDKImage,
548
- paths: [
549
- { path: 'draftPost.heroImage' },
550
- { path: 'draftPost.coverMedia.image' },
551
- { path: 'draftPost.media.wixMedia.image' },
552
- ],
553
- },
554
- {
555
- transformFn: transformRESTPageURLToSDKPageURL,
556
- paths: [
557
- { path: 'draftPost.url' },
558
- { path: 'draftPost.translations.url' },
559
- ],
560
- },
561
- {
562
- transformFn: transformRESTVideoToSDKVideo,
563
- paths: [{ path: 'draftPost.coverMedia.video' }],
564
- },
565
- {
566
- transformFn: transformRESTVideoV2ToSDKVideoV2,
567
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
568
- },
569
- ]));
570
- }
571
- catch (err) {
572
- const transformedError = sdkTransformError(err, {
573
- spreadPathsToArguments: {},
574
- explicitPathsToArguments: {
575
- draftPost: '$[0]',
576
- publish: '$[1].publish',
577
- fieldsets: '$[1].fieldsets',
578
- },
579
- singleArgumentUnchanged: false,
580
- }, ['draftPost', 'options']);
581
- sideEffects?.onError?.(err);
582
- throw transformedError;
583
- }
584
- }
585
- /**
586
- * Creates multiple draft posts.
587
- * @param draftPosts - Draft posts to create.
588
- * @public
589
- * @requiredField draftPosts
590
- * @requiredField draftPosts.title
591
- * @param options - Options for creating multiple draft posts.
592
- * @permissionId BLOG.CREATE-DRAFT
593
- * @permissionScope Manage Blog
594
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
595
- * @applicableIdentity APP
596
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkCreateDraftPosts
597
- */
598
- export async function bulkCreateDraftPosts(draftPosts, options) {
599
- // @ts-ignore
600
- const { httpClient, sideEffects } = arguments[2];
601
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
602
- draftPosts: draftPosts,
603
- publish: options?.publish,
604
- returnFullEntity: options?.returnFullEntity,
605
- fieldsets: options?.fieldsets,
606
- }), [
607
- {
608
- transformFn: transformSDKImageToRESTImage,
609
- paths: [
610
- { path: 'draftPosts.heroImage' },
611
- { path: 'draftPosts.coverMedia.image' },
612
- { path: 'draftPosts.media.wixMedia.image' },
613
- ],
614
- },
615
- {
616
- transformFn: transformSDKPageURLToRESTPageURL,
617
- paths: [
618
- { path: 'draftPosts.url' },
619
- { path: 'draftPosts.translations.url' },
620
- ],
621
- },
622
- {
623
- transformFn: transformSDKVideoToRESTVideo,
624
- paths: [{ path: 'draftPosts.coverMedia.video' }],
625
- },
626
- {
627
- transformFn: transformSDKVideoV2ToRESTVideoV2,
628
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
629
- },
630
- ]);
631
- const reqOpts = ambassadorWixBlogV3Draft.bulkCreateDraftPosts(payload);
632
- sideEffects?.onSiteCall?.();
633
- try {
634
- const result = await httpClient.request(reqOpts);
635
- sideEffects?.onSuccess?.(result);
636
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
637
- {
638
- transformFn: transformRESTImageToSDKImage,
639
- paths: [
640
- { path: 'results.item.heroImage' },
641
- { path: 'results.item.coverMedia.image' },
642
- { path: 'results.item.media.wixMedia.image' },
643
- ],
644
- },
645
- {
646
- transformFn: transformRESTPageURLToSDKPageURL,
647
- paths: [
648
- { path: 'results.item.url' },
649
- { path: 'results.item.translations.url' },
650
- ],
651
- },
652
- {
653
- transformFn: transformRESTVideoToSDKVideo,
654
- paths: [{ path: 'results.item.coverMedia.video' }],
655
- },
656
- {
657
- transformFn: transformRESTVideoV2ToSDKVideoV2,
658
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
659
- },
660
- ]));
661
- }
662
- catch (err) {
663
- const transformedError = sdkTransformError(err, {
664
- spreadPathsToArguments: {},
665
- explicitPathsToArguments: {
666
- draftPosts: '$[0]',
667
- publish: '$[1].publish',
668
- returnFullEntity: '$[1].returnFullEntity',
669
- fieldsets: '$[1].fieldsets',
670
- },
671
- singleArgumentUnchanged: false,
672
- }, ['draftPosts', 'options']);
673
- sideEffects?.onError?.(err);
674
- throw transformedError;
675
- }
676
- }
677
- /**
678
- * Updates multiple draft posts.
679
- * @public
680
- * @requiredField options.draftPosts.draftPost
681
- * @requiredField options.draftPosts.draftPost._id
682
- * @param options - Options for updating multiple draft posts.
683
- * @permissionId BLOG.EDIT-DRAFT
684
- * @permissionScope Manage Blog
685
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
686
- * @applicableIdentity APP
687
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkUpdateDraftPosts
688
- */
689
- export async function bulkUpdateDraftPosts(options) {
690
- // @ts-ignore
691
- const { httpClient, sideEffects } = arguments[1];
692
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
693
- draftPosts: options?.draftPosts,
694
- action: options?.action,
695
- scheduledPublishDate: options?.scheduledPublishDate,
696
- returnFullEntity: options?.returnFullEntity,
697
- fieldsets: options?.fieldsets,
698
- }), [
699
- {
700
- transformFn: transformSDKImageToRESTImage,
701
- paths: [
702
- { path: 'draftPosts.draftPost.heroImage' },
703
- { path: 'draftPosts.draftPost.coverMedia.image' },
704
- { path: 'draftPosts.draftPost.media.wixMedia.image' },
705
- ],
706
- },
707
- {
708
- transformFn: transformSDKPageURLToRESTPageURL,
709
- paths: [
710
- { path: 'draftPosts.draftPost.url' },
711
- { path: 'draftPosts.draftPost.translations.url' },
712
- ],
713
- },
714
- {
715
- transformFn: transformSDKVideoToRESTVideo,
716
- paths: [{ path: 'draftPosts.draftPost.coverMedia.video' }],
717
- },
718
- {
719
- transformFn: transformSDKVideoV2ToRESTVideoV2,
720
- paths: [{ path: 'draftPosts.draftPost.media.wixMedia.videoV2' }],
721
- },
722
- ]);
723
- const reqOpts = ambassadorWixBlogV3Draft.bulkUpdateDraftPosts(payload);
724
- sideEffects?.onSiteCall?.();
725
- try {
726
- const result = await httpClient.request(reqOpts);
727
- sideEffects?.onSuccess?.(result);
728
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
729
- {
730
- transformFn: transformRESTImageToSDKImage,
731
- paths: [
732
- { path: 'results.item.heroImage' },
733
- { path: 'results.item.coverMedia.image' },
734
- { path: 'results.item.media.wixMedia.image' },
735
- ],
736
- },
737
- {
738
- transformFn: transformRESTPageURLToSDKPageURL,
739
- paths: [
740
- { path: 'results.item.url' },
741
- { path: 'results.item.translations.url' },
742
- ],
743
- },
744
- {
745
- transformFn: transformRESTVideoToSDKVideo,
746
- paths: [{ path: 'results.item.coverMedia.video' }],
747
- },
748
- {
749
- transformFn: transformRESTVideoV2ToSDKVideoV2,
750
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
751
- },
752
- ]));
753
- }
754
- catch (err) {
755
- const transformedError = sdkTransformError(err, {
756
- spreadPathsToArguments: {},
757
- explicitPathsToArguments: {
758
- draftPosts: '$[0].draftPosts',
759
- action: '$[0].action',
760
- scheduledPublishDate: '$[0].scheduledPublishDate',
761
- returnFullEntity: '$[0].returnFullEntity',
762
- fieldsets: '$[0].fieldsets',
763
- },
764
- singleArgumentUnchanged: false,
765
- }, ['options']);
766
- sideEffects?.onError?.(err);
767
- throw transformedError;
768
- }
769
- }
770
- /**
771
- * Retrieves a list of up to 100 deleted draft posts.
772
- *
773
- * List Draft Posts runs with these defaults, which you can override:
774
- * - `editedDate` is sorted in descending order. In this case,`editedDate` implies the date the post was deleted.
775
- * - `paging.limit` is `50`.
776
- * - `paging.offset` is `0`.
777
- * @public
778
- * @param options - Options for listing deleted draft posts.
779
- * @permissionId BLOG.READ_DRAFT
780
- * @permissionScope Manage Blog
781
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
782
- * @applicableIdentity APP
783
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.ListDeletedDraftPosts
784
- */
785
- export async function listDeletedDraftPosts(options) {
786
- // @ts-ignore
787
- const { httpClient, sideEffects } = arguments[1];
788
- const payload = renameKeysFromSDKRequestToRESTRequest({
789
- language: options?.language,
790
- sort: options?.sort,
791
- paging: options?.paging,
792
- fieldsets: options?.fieldsets,
793
- draftPostIds: options?.draftPostIds,
794
- });
795
- const reqOpts = ambassadorWixBlogV3Draft.listDeletedDraftPosts(payload);
796
- sideEffects?.onSiteCall?.();
797
- try {
798
- const result = await httpClient.request(reqOpts);
799
- sideEffects?.onSuccess?.(result);
800
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
801
- {
802
- transformFn: transformRESTImageToSDKImage,
803
- paths: [
804
- { path: 'draftPosts.heroImage' },
805
- { path: 'draftPosts.coverMedia.image' },
806
- { path: 'draftPosts.media.wixMedia.image' },
807
- ],
808
- },
809
- {
810
- transformFn: transformRESTPageURLToSDKPageURL,
811
- paths: [
812
- { path: 'draftPosts.url' },
813
- { path: 'draftPosts.translations.url' },
814
- ],
815
- },
816
- {
817
- transformFn: transformRESTVideoToSDKVideo,
818
- paths: [{ path: 'draftPosts.coverMedia.video' }],
819
- },
820
- {
821
- transformFn: transformRESTVideoV2ToSDKVideoV2,
822
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
823
- },
824
- ]));
825
- }
826
- catch (err) {
827
- const transformedError = sdkTransformError(err, {
828
- spreadPathsToArguments: {},
829
- explicitPathsToArguments: {
830
- language: '$[0].language',
831
- sort: '$[0].sort',
832
- paging: '$[0].paging',
833
- fieldsets: '$[0].fieldsets',
834
- draftPostIds: '$[0].draftPostIds',
835
- },
836
- singleArgumentUnchanged: false,
837
- }, ['options']);
838
- sideEffects?.onError?.(err);
839
- throw transformedError;
840
- }
841
- }
842
- /**
843
- * Retrieves a draft post by the provided ID.
844
- * @param draftPostId - Draft post ID.
845
- * @public
846
- * @requiredField draftPostId
847
- * @param options - Options for getting a draft post.
848
- * @permissionId BLOG.READ_DRAFT
849
- * @permissionScope Manage Blog
850
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
851
- * @applicableIdentity APP
852
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.GetDraftPost
853
- */
854
- export async function getDraftPost(draftPostId, options) {
855
- // @ts-ignore
856
- const { httpClient, sideEffects } = arguments[2];
857
- const payload = renameKeysFromSDKRequestToRESTRequest({
858
- draftPostId: draftPostId,
859
- fieldsets: options?.fieldsets,
860
- });
861
- const reqOpts = ambassadorWixBlogV3Draft.getDraftPost(payload);
862
- sideEffects?.onSiteCall?.();
863
- try {
864
- const result = await httpClient.request(reqOpts);
865
- sideEffects?.onSuccess?.(result);
866
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
867
- {
868
- transformFn: transformRESTImageToSDKImage,
869
- paths: [
870
- { path: 'draftPost.heroImage' },
871
- { path: 'draftPost.coverMedia.image' },
872
- { path: 'draftPost.media.wixMedia.image' },
873
- ],
874
- },
875
- {
876
- transformFn: transformRESTPageURLToSDKPageURL,
877
- paths: [
878
- { path: 'draftPost.url' },
879
- { path: 'draftPost.translations.url' },
880
- ],
881
- },
882
- {
883
- transformFn: transformRESTVideoToSDKVideo,
884
- paths: [{ path: 'draftPost.coverMedia.video' }],
885
- },
886
- {
887
- transformFn: transformRESTVideoV2ToSDKVideoV2,
888
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
889
- },
890
- ]));
891
- }
892
- catch (err) {
893
- const transformedError = sdkTransformError(err, {
894
- spreadPathsToArguments: {},
895
- explicitPathsToArguments: {
896
- draftPostId: '$[0]',
897
- fieldsets: '$[1].fieldsets',
898
- },
899
- singleArgumentUnchanged: false,
900
- }, ['draftPostId', 'options']);
901
- sideEffects?.onError?.(err);
902
- throw transformedError;
903
- }
904
- }
905
- /**
906
- * Updates a draft post.
907
- * @param _id - Draft post ID.
908
- * @public
909
- * @requiredField _id
910
- * @requiredField draftPost
911
- * @param options - Options for updating a draft post.
912
- * @param draftPost - Draft Post info.
913
- * @permissionId BLOG.EDIT-DRAFT
914
- * @permissionScope Manage Blog
915
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
916
- * @applicableIdentity APP
917
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.UpdateDraftPost
918
- */
919
- export async function updateDraftPost(_id, draftPost, options) {
920
- // @ts-ignore
921
- const { httpClient, sideEffects } = arguments[3];
922
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
923
- draftPost: { ...draftPost, id: _id },
924
- action: options?.action,
925
- scheduledPublishDate: options?.scheduledPublishDate,
926
- fieldsets: options?.fieldsets,
927
- }), [
928
- {
929
- transformFn: transformSDKImageToRESTImage,
930
- paths: [
931
- { path: 'draftPost.heroImage' },
932
- { path: 'draftPost.coverMedia.image' },
933
- { path: 'draftPost.media.wixMedia.image' },
934
- ],
935
- },
936
- {
937
- transformFn: transformSDKPageURLToRESTPageURL,
938
- paths: [
939
- { path: 'draftPost.url' },
940
- { path: 'draftPost.translations.url' },
941
- ],
942
- },
943
- {
944
- transformFn: transformSDKVideoToRESTVideo,
945
- paths: [{ path: 'draftPost.coverMedia.video' }],
946
- },
947
- {
948
- transformFn: transformSDKVideoV2ToRESTVideoV2,
949
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
950
- },
951
- ]);
952
- const reqOpts = ambassadorWixBlogV3Draft.updateDraftPost(payload);
953
- sideEffects?.onSiteCall?.();
954
- try {
955
- const result = await httpClient.request(reqOpts);
956
- sideEffects?.onSuccess?.(result);
957
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
958
- {
959
- transformFn: transformRESTImageToSDKImage,
960
- paths: [
961
- { path: 'draftPost.heroImage' },
962
- { path: 'draftPost.coverMedia.image' },
963
- { path: 'draftPost.media.wixMedia.image' },
964
- ],
965
- },
966
- {
967
- transformFn: transformRESTPageURLToSDKPageURL,
968
- paths: [
969
- { path: 'draftPost.url' },
970
- { path: 'draftPost.translations.url' },
971
- ],
972
- },
973
- {
974
- transformFn: transformRESTVideoToSDKVideo,
975
- paths: [{ path: 'draftPost.coverMedia.video' }],
976
- },
977
- {
978
- transformFn: transformRESTVideoV2ToSDKVideoV2,
979
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
980
- },
981
- ]));
982
- }
983
- catch (err) {
984
- const transformedError = sdkTransformError(err, {
985
- spreadPathsToArguments: { draftPost: '$[1]' },
986
- explicitPathsToArguments: {
987
- 'draftPost.id': '$[0]',
988
- action: '$[2].action',
989
- scheduledPublishDate: '$[2].scheduledPublishDate',
990
- fieldsets: '$[2].fieldsets',
991
- },
992
- singleArgumentUnchanged: false,
993
- }, ['_id', 'draftPost', 'options']);
994
- sideEffects?.onError?.(err);
995
- throw transformedError;
996
- }
997
- }
998
- /**
999
- * Moves a draft post to the trash bin.
1000
- * 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.
1001
- *
1002
- * To permanently delete a post bypassing the trash bin, set the `permanent` field value to `true`. The post can't be restored after this.
1003
- * @param draftPostId - Draft post ID.
1004
- * @public
1005
- * @requiredField draftPostId
1006
- * @param options - Options for deleting a draft post.
1007
- * @permissionId BLOG.DELETE-DRAFT
1008
- * @permissionScope Manage Blog
1009
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1010
- * @applicableIdentity APP
1011
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.DeleteDraftPost
1012
- */
1013
- export async function deleteDraftPost(draftPostId, options) {
1014
- // @ts-ignore
1015
- const { httpClient, sideEffects } = arguments[2];
1016
- const payload = renameKeysFromSDKRequestToRESTRequest({
1017
- draftPostId: draftPostId,
1018
- permanent: options?.permanent,
1019
- });
1020
- const reqOpts = ambassadorWixBlogV3Draft.deleteDraftPost(payload);
1021
- sideEffects?.onSiteCall?.();
1022
- try {
1023
- const result = await httpClient.request(reqOpts);
1024
- sideEffects?.onSuccess?.(result);
1025
- }
1026
- catch (err) {
1027
- const transformedError = sdkTransformError(err, {
1028
- spreadPathsToArguments: {},
1029
- explicitPathsToArguments: {
1030
- draftPostId: '$[0]',
1031
- permanent: '$[1].permanent',
1032
- },
1033
- singleArgumentUnchanged: false,
1034
- }, ['draftPostId', 'options']);
1035
- sideEffects?.onError?.(err);
1036
- throw transformedError;
1037
- }
1038
- }
1039
- /**
1040
- * Permanently deletes a draft post that is currently in the trash bin.
1041
- *
1042
- * This action is permanent and can't be reversed.
1043
- * @param draftPostId - Draft post ID.
1044
- * @public
1045
- * @requiredField draftPostId
1046
- * @permissionId BLOG.DELETE-DRAFT
1047
- * @permissionScope Manage Blog
1048
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1049
- * @applicableIdentity APP
1050
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.RemoveFromTrashBin
1051
- */
1052
- export async function removeFromTrashBin(draftPostId) {
1053
- // @ts-ignore
1054
- const { httpClient, sideEffects } = arguments[1];
1055
- const payload = renameKeysFromSDKRequestToRESTRequest({
1056
- draftPostId: draftPostId,
1057
- });
1058
- const reqOpts = ambassadorWixBlogV3Draft.removeFromTrashBin(payload);
1059
- sideEffects?.onSiteCall?.();
1060
- try {
1061
- const result = await httpClient.request(reqOpts);
1062
- sideEffects?.onSuccess?.(result);
1063
- }
1064
- catch (err) {
1065
- const transformedError = sdkTransformError(err, {
1066
- spreadPathsToArguments: {},
1067
- explicitPathsToArguments: { draftPostId: '$[0]' },
1068
- singleArgumentUnchanged: false,
1069
- }, ['draftPostId']);
1070
- sideEffects?.onError?.(err);
1071
- throw transformedError;
1072
- }
1073
- }
1074
- /**
1075
- * Deletes multiple draft posts.
1076
- * @param postIds - Post IDs.
1077
- * @public
1078
- * @requiredField postIds
1079
- * @param options - Options for deleting multiple draft posts.
1080
- * @permissionId BLOG.DELETE-DRAFT
1081
- * @permissionScope Manage Blog
1082
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1083
- * @applicableIdentity APP
1084
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkDeleteDraftPosts
1085
- */
1086
- export async function bulkDeleteDraftPosts(postIds, options) {
1087
- // @ts-ignore
1088
- const { httpClient, sideEffects } = arguments[2];
1089
- const payload = renameKeysFromSDKRequestToRESTRequest({
1090
- postIds: postIds,
1091
- permanent: options?.permanent,
1092
- });
1093
- const reqOpts = ambassadorWixBlogV3Draft.bulkDeleteDraftPosts(payload);
1094
- sideEffects?.onSiteCall?.();
1095
- try {
1096
- const result = await httpClient.request(reqOpts);
1097
- sideEffects?.onSuccess?.(result);
1098
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1099
- {
1100
- transformFn: transformRESTImageToSDKImage,
1101
- paths: [
1102
- { path: 'results.item.heroImage' },
1103
- { path: 'results.item.coverMedia.image' },
1104
- { path: 'results.item.media.wixMedia.image' },
1105
- ],
1106
- },
1107
- {
1108
- transformFn: transformRESTPageURLToSDKPageURL,
1109
- paths: [
1110
- { path: 'results.item.url' },
1111
- { path: 'results.item.translations.url' },
1112
- ],
1113
- },
1114
- {
1115
- transformFn: transformRESTVideoToSDKVideo,
1116
- paths: [{ path: 'results.item.coverMedia.video' }],
1117
- },
1118
- {
1119
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1120
- paths: [{ path: 'results.item.media.wixMedia.videoV2' }],
1121
- },
1122
- ]));
1123
- }
1124
- catch (err) {
1125
- const transformedError = sdkTransformError(err, {
1126
- spreadPathsToArguments: {},
1127
- explicitPathsToArguments: {
1128
- postIds: '$[0]',
1129
- permanent: '$[1].permanent',
1130
- },
1131
- singleArgumentUnchanged: false,
1132
- }, ['postIds', 'options']);
1133
- sideEffects?.onError?.(err);
1134
- throw transformedError;
1135
- }
1136
- }
1137
- /**
1138
- * Retrieves a list of up to 100 draft posts per request.
1139
- *
1140
- * List Draft Posts runs with these defaults, which you can override:
1141
- * - `editedDate` is sorted in descending order.
1142
- * - `paging.limit` is `50`.
1143
- * - `paging.offset` is `0`.
1144
- * @public
1145
- * @param options - Options for listing multiple draft posts.
1146
- * @permissionId BLOG.READ_DRAFT
1147
- * @permissionScope Manage Blog
1148
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1149
- * @applicableIdentity APP
1150
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.ListDraftPosts
1151
- */
1152
- export async function listDraftPosts(options) {
1153
- // @ts-ignore
1154
- const { httpClient, sideEffects } = arguments[1];
1155
- const payload = renameKeysFromSDKRequestToRESTRequest({
1156
- status: options?.status,
1157
- language: options?.language,
1158
- sort: options?.sort,
1159
- paging: options?.paging,
1160
- fieldsets: options?.fieldsets,
1161
- });
1162
- const reqOpts = ambassadorWixBlogV3Draft.listDraftPosts(payload);
1163
- sideEffects?.onSiteCall?.();
1164
- try {
1165
- const result = await httpClient.request(reqOpts);
1166
- sideEffects?.onSuccess?.(result);
1167
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1168
- {
1169
- transformFn: transformRESTImageToSDKImage,
1170
- paths: [
1171
- { path: 'draftPosts.heroImage' },
1172
- { path: 'draftPosts.coverMedia.image' },
1173
- { path: 'draftPosts.media.wixMedia.image' },
1174
- ],
1175
- },
1176
- {
1177
- transformFn: transformRESTPageURLToSDKPageURL,
1178
- paths: [
1179
- { path: 'draftPosts.url' },
1180
- { path: 'draftPosts.translations.url' },
1181
- ],
1182
- },
1183
- {
1184
- transformFn: transformRESTVideoToSDKVideo,
1185
- paths: [{ path: 'draftPosts.coverMedia.video' }],
1186
- },
1187
- {
1188
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1189
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
1190
- },
1191
- ]));
1192
- }
1193
- catch (err) {
1194
- const transformedError = sdkTransformError(err, {
1195
- spreadPathsToArguments: {},
1196
- explicitPathsToArguments: {
1197
- status: '$[0].status',
1198
- language: '$[0].language',
1199
- sort: '$[0].sort',
1200
- paging: '$[0].paging',
1201
- fieldsets: '$[0].fieldsets',
1202
- },
1203
- singleArgumentUnchanged: false,
1204
- }, ['options']);
1205
- sideEffects?.onError?.(err);
1206
- throw transformedError;
1207
- }
1208
- }
1209
- /**
1210
- * Retrieves a deleted draft post from the trash bin by the provided ID.
1211
- * @param draftPostId - Draft post ID.
1212
- * @public
1213
- * @requiredField draftPostId
1214
- * @permissionId BLOG.READ_DRAFT
1215
- * @permissionScope Manage Blog
1216
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1217
- * @applicableIdentity APP
1218
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.GetDeletedDraftPost
1219
- */
1220
- export async function getDeletedDraftPost(draftPostId) {
1221
- // @ts-ignore
1222
- const { httpClient, sideEffects } = arguments[1];
1223
- const payload = renameKeysFromSDKRequestToRESTRequest({
1224
- draftPostId: draftPostId,
1225
- });
1226
- const reqOpts = ambassadorWixBlogV3Draft.getDeletedDraftPost(payload);
1227
- sideEffects?.onSiteCall?.();
1228
- try {
1229
- const result = await httpClient.request(reqOpts);
1230
- sideEffects?.onSuccess?.(result);
1231
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1232
- {
1233
- transformFn: transformRESTImageToSDKImage,
1234
- paths: [
1235
- { path: 'draftPost.heroImage' },
1236
- { path: 'draftPost.coverMedia.image' },
1237
- { path: 'draftPost.media.wixMedia.image' },
1238
- ],
1239
- },
1240
- {
1241
- transformFn: transformRESTPageURLToSDKPageURL,
1242
- paths: [
1243
- { path: 'draftPost.url' },
1244
- { path: 'draftPost.translations.url' },
1245
- ],
1246
- },
1247
- {
1248
- transformFn: transformRESTVideoToSDKVideo,
1249
- paths: [{ path: 'draftPost.coverMedia.video' }],
1250
- },
1251
- {
1252
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1253
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
1254
- },
1255
- ]));
1256
- }
1257
- catch (err) {
1258
- const transformedError = sdkTransformError(err, {
1259
- spreadPathsToArguments: {},
1260
- explicitPathsToArguments: { draftPostId: '$[0]' },
1261
- singleArgumentUnchanged: false,
1262
- }, ['draftPostId']);
1263
- sideEffects?.onError?.(err);
1264
- throw transformedError;
1265
- }
1266
- }
1267
- /**
1268
- * Restores a deleted draft post from the trash bin by the provided ID.
1269
- * @param draftPostId - Draft post ID.
1270
- * @public
1271
- * @requiredField draftPostId
1272
- * @permissionId BLOG.EDIT-DRAFT
1273
- * @permissionScope Manage Blog
1274
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1275
- * @applicableIdentity APP
1276
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.RestoreFromTrashBin
1277
- */
1278
- export async function restoreFromTrashBin(draftPostId) {
1279
- // @ts-ignore
1280
- const { httpClient, sideEffects } = arguments[1];
1281
- const payload = renameKeysFromSDKRequestToRESTRequest({
1282
- draftPostId: draftPostId,
1283
- });
1284
- const reqOpts = ambassadorWixBlogV3Draft.restoreFromTrashBin(payload);
1285
- sideEffects?.onSiteCall?.();
1286
- try {
1287
- const result = await httpClient.request(reqOpts);
1288
- sideEffects?.onSuccess?.(result);
1289
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
1290
- {
1291
- transformFn: transformRESTImageToSDKImage,
1292
- paths: [
1293
- { path: 'draftPost.heroImage' },
1294
- { path: 'draftPost.coverMedia.image' },
1295
- { path: 'draftPost.media.wixMedia.image' },
1296
- ],
1297
- },
1298
- {
1299
- transformFn: transformRESTPageURLToSDKPageURL,
1300
- paths: [
1301
- { path: 'draftPost.url' },
1302
- { path: 'draftPost.translations.url' },
1303
- ],
1304
- },
1305
- {
1306
- transformFn: transformRESTVideoToSDKVideo,
1307
- paths: [{ path: 'draftPost.coverMedia.video' }],
1308
- },
1309
- {
1310
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1311
- paths: [{ path: 'draftPost.media.wixMedia.videoV2' }],
1312
- },
1313
- ]));
1314
- }
1315
- catch (err) {
1316
- const transformedError = sdkTransformError(err, {
1317
- spreadPathsToArguments: {},
1318
- explicitPathsToArguments: { draftPostId: '$[0]' },
1319
- singleArgumentUnchanged: false,
1320
- }, ['draftPostId']);
1321
- sideEffects?.onError?.(err);
1322
- throw transformedError;
1323
- }
1324
- }
1325
- /**
1326
- * Creates a query to retrieve a list of up to 100 draft posts.
1327
- *
1328
- *
1329
- * The `queryDraftPosts()` function builds a query to retrieve a list of up to 100 draft posts, and returns a `DraftPostsQueryBuilder` object.
1330
- *
1331
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
1332
- *
1333
- * 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.
1334
- *
1335
- * `queryDraftPosts()` runs with these `DraftPostsQueryBuilder` defaults that can be overridden:
1336
- * - `limit(50)`
1337
- * - `ascending('_id')`
1338
- *
1339
- * 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`.
1340
- * @public
1341
- * @param options - Options for querying draft posts.
1342
- * @permissionScope Manage Blog
1343
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1344
- * @permissionId BLOG.READ_DRAFT
1345
- * @applicableIdentity APP
1346
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.QueryDraftPosts
1347
- */
1348
- export function queryDraftPosts(options) {
1349
- // @ts-ignore
1350
- const { httpClient, sideEffects } = arguments[1];
1351
- return queryBuilder({
1352
- func: async (payload) => {
1353
- const reqOpts = ambassadorWixBlogV3Draft.queryDraftPosts({
1354
- ...payload,
1355
- ...(options ?? {}),
1356
- });
1357
- sideEffects?.onSiteCall?.();
1358
- try {
1359
- const result = await httpClient.request(reqOpts);
1360
- sideEffects?.onSuccess?.(result);
1361
- return result;
1362
- }
1363
- catch (err) {
1364
- sideEffects?.onError?.(err);
1365
- throw err;
1366
- }
1367
- },
1368
- requestTransformer: (query) => {
1369
- const args = [query, options];
1370
- return renameKeysFromSDKRequestToRESTRequest({
1371
- ...args?.[1],
1372
- query: args?.[0],
1373
- });
1374
- },
1375
- responseTransformer: ({ data }) => {
1376
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
1377
- {
1378
- transformFn: transformRESTImageToSDKImage,
1379
- paths: [
1380
- { path: 'draftPosts.heroImage' },
1381
- { path: 'draftPosts.coverMedia.image' },
1382
- { path: 'draftPosts.media.wixMedia.image' },
1383
- ],
1384
- },
1385
- {
1386
- transformFn: transformRESTPageURLToSDKPageURL,
1387
- paths: [
1388
- { path: 'draftPosts.url' },
1389
- { path: 'draftPosts.translations.url' },
1390
- ],
1391
- },
1392
- {
1393
- transformFn: transformRESTVideoToSDKVideo,
1394
- paths: [{ path: 'draftPosts.coverMedia.video' }],
1395
- },
1396
- {
1397
- transformFn: transformRESTVideoV2ToSDKVideoV2,
1398
- paths: [{ path: 'draftPosts.media.wixMedia.videoV2' }],
1399
- },
1400
- ]));
1401
- return {
1402
- items: transformedData?.draftPosts,
1403
- pagingMetadata: transformedData?.pagingMetadata,
1404
- };
1405
- },
1406
- errorTransformer: (err) => {
1407
- const transformedError = sdkTransformError(err, {
1408
- spreadPathsToArguments: {},
1409
- explicitPathsToArguments: { query: '$[0]' },
1410
- singleArgumentUnchanged: false,
1411
- });
1412
- throw transformedError;
1413
- },
1414
- pagingMethod: 'CURSOR',
1415
- transformationPaths: {},
1416
- });
1417
- }
1418
- /**
1419
- * 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))
1420
- * with the data from the draft post.
1421
- *
1422
- * If the draft post was already published, the published post will be updated with the latest values
1423
- * from the draft post.
1424
- * @param draftPostId - Draft post ID.
1425
- * @public
1426
- * @requiredField draftPostId
1427
- * @permissionId BLOG.PUBLISH-POST
1428
- * @permissionScope Manage Blog
1429
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1430
- * @applicableIdentity APP
1431
- * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.PublishDraftPost
1432
- */
1433
- export async function publishDraftPost(draftPostId) {
1434
- // @ts-ignore
1435
- const { httpClient, sideEffects } = arguments[1];
1436
- const payload = renameKeysFromSDKRequestToRESTRequest({
1437
- draftPostId: draftPostId,
1438
- });
1439
- const reqOpts = ambassadorWixBlogV3Draft.publishDraftPost(payload);
1440
- sideEffects?.onSiteCall?.();
1441
- try {
1442
- const result = await httpClient.request(reqOpts);
1443
- sideEffects?.onSuccess?.(result);
1444
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1445
- }
1446
- catch (err) {
1447
- const transformedError = sdkTransformError(err, {
1448
- spreadPathsToArguments: {},
1449
- explicitPathsToArguments: { draftPostId: '$[0]' },
1450
- singleArgumentUnchanged: false,
1451
- }, ['draftPostId']);
1452
- sideEffects?.onError?.(err);
1453
- throw transformedError;
1454
- }
1455
- }
1456
- //# sourceMappingURL=blog-v3-draft-draft-posts.universal.js.map