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