@wix/auto_sdk_blog_draft-posts 1.0.23 → 1.0.25

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