@wix/blog 1.0.113
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 +3 -0
- package/build/cjs/index.js +26 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/blog-v3-category.http.d.ts +50 -0
- package/build/cjs/src/blog-v3-category.http.js +421 -0
- package/build/cjs/src/blog-v3-category.http.js.map +1 -0
- package/build/cjs/src/blog-v3-category.public.d.ts +11 -0
- package/build/cjs/src/blog-v3-category.public.js +50 -0
- package/build/cjs/src/blog-v3-category.public.js.map +1 -0
- package/build/cjs/src/blog-v3-category.types.d.ts +391 -0
- package/build/cjs/src/blog-v3-category.types.js +22 -0
- package/build/cjs/src/blog-v3-category.types.js.map +1 -0
- package/build/cjs/src/blog-v3-category.universal.d.ts +582 -0
- package/build/cjs/src/blog-v3-category.universal.js +460 -0
- package/build/cjs/src/blog-v3-category.universal.js.map +1 -0
- package/build/cjs/src/blog-v3-post.http.d.ts +81 -0
- package/build/cjs/src/blog-v3-post.http.js +844 -0
- package/build/cjs/src/blog-v3-post.http.js.map +1 -0
- package/build/cjs/src/blog-v3-post.public.d.ts +11 -0
- package/build/cjs/src/blog-v3-post.public.js +86 -0
- package/build/cjs/src/blog-v3-post.public.js.map +1 -0
- package/build/cjs/src/blog-v3-post.types.d.ts +2227 -0
- package/build/cjs/src/blog-v3-post.types.js +464 -0
- package/build/cjs/src/blog-v3-post.types.js.map +1 -0
- package/build/cjs/src/blog-v3-post.universal.d.ts +2488 -0
- package/build/cjs/src/blog-v3-post.universal.js +935 -0
- package/build/cjs/src/blog-v3-post.universal.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.http.d.ts +45 -0
- package/build/cjs/src/blog-v3-tag.http.js +385 -0
- package/build/cjs/src/blog-v3-tag.http.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.public.d.ts +10 -0
- package/build/cjs/src/blog-v3-tag.public.js +44 -0
- package/build/cjs/src/blog-v3-tag.public.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.types.d.ts +345 -0
- package/build/cjs/src/blog-v3-tag.types.js +15 -0
- package/build/cjs/src/blog-v3-tag.types.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.universal.d.ts +512 -0
- package/build/cjs/src/blog-v3-tag.universal.js +390 -0
- package/build/cjs/src/blog-v3-tag.universal.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/blog-v3-category.http.d.ts +50 -0
- package/build/es/src/blog-v3-category.http.js +411 -0
- package/build/es/src/blog-v3-category.http.js.map +1 -0
- package/build/es/src/blog-v3-category.public.d.ts +11 -0
- package/build/es/src/blog-v3-category.public.js +38 -0
- package/build/es/src/blog-v3-category.public.js.map +1 -0
- package/build/es/src/blog-v3-category.types.d.ts +391 -0
- package/build/es/src/blog-v3-category.types.js +19 -0
- package/build/es/src/blog-v3-category.types.js.map +1 -0
- package/build/es/src/blog-v3-category.universal.d.ts +582 -0
- package/build/es/src/blog-v3-category.universal.js +431 -0
- package/build/es/src/blog-v3-category.universal.js.map +1 -0
- package/build/es/src/blog-v3-post.http.d.ts +81 -0
- package/build/es/src/blog-v3-post.http.js +834 -0
- package/build/es/src/blog-v3-post.http.js.map +1 -0
- package/build/es/src/blog-v3-post.public.d.ts +11 -0
- package/build/es/src/blog-v3-post.public.js +38 -0
- package/build/es/src/blog-v3-post.public.js.map +1 -0
- package/build/es/src/blog-v3-post.types.d.ts +2227 -0
- package/build/es/src/blog-v3-post.types.js +461 -0
- package/build/es/src/blog-v3-post.types.js.map +1 -0
- package/build/es/src/blog-v3-post.universal.d.ts +2488 -0
- package/build/es/src/blog-v3-post.universal.js +906 -0
- package/build/es/src/blog-v3-post.universal.js.map +1 -0
- package/build/es/src/blog-v3-tag.http.d.ts +45 -0
- package/build/es/src/blog-v3-tag.http.js +376 -0
- package/build/es/src/blog-v3-tag.http.js.map +1 -0
- package/build/es/src/blog-v3-tag.public.d.ts +10 -0
- package/build/es/src/blog-v3-tag.public.js +33 -0
- package/build/es/src/blog-v3-tag.public.js.map +1 -0
- package/build/es/src/blog-v3-tag.types.d.ts +345 -0
- package/build/es/src/blog-v3-tag.types.js +12 -0
- package/build/es/src/blog-v3-tag.types.js.map +1 -0
- package/build/es/src/blog-v3-tag.universal.d.ts +512 -0
- package/build/es/src/blog-v3-tag.universal.js +362 -0
- package/build/es/src/blog-v3-tag.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
|
|
11
|
+
import * as ambassadorWixBlogV3Post from './blog-v3-post.http';
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
|
|
14
|
+
let __verbose = false;
|
|
15
|
+
function __log(...args) {
|
|
16
|
+
__verbose && console.log(...args);
|
|
17
|
+
}
|
|
18
|
+
function __inspect(obj) {
|
|
19
|
+
return obj;
|
|
20
|
+
}
|
|
21
|
+
export const __debug = {
|
|
22
|
+
verboseLogging: {
|
|
23
|
+
on: () => (__verbose = true),
|
|
24
|
+
off: () => (__verbose = false),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const _toVeloEntity = '$';
|
|
28
|
+
const _fromVeloEntity = '$';
|
|
29
|
+
export var NodeType;
|
|
30
|
+
(function (NodeType) {
|
|
31
|
+
NodeType["PARAGRAPH"] = "PARAGRAPH";
|
|
32
|
+
NodeType["TEXT"] = "TEXT";
|
|
33
|
+
NodeType["HEADING"] = "HEADING";
|
|
34
|
+
NodeType["BULLETED_LIST"] = "BULLETED_LIST";
|
|
35
|
+
NodeType["ORDERED_LIST"] = "ORDERED_LIST";
|
|
36
|
+
NodeType["LIST_ITEM"] = "LIST_ITEM";
|
|
37
|
+
NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
38
|
+
NodeType["CODE_BLOCK"] = "CODE_BLOCK";
|
|
39
|
+
NodeType["VIDEO"] = "VIDEO";
|
|
40
|
+
NodeType["DIVIDER"] = "DIVIDER";
|
|
41
|
+
NodeType["FILE"] = "FILE";
|
|
42
|
+
NodeType["GALLERY"] = "GALLERY";
|
|
43
|
+
NodeType["GIF"] = "GIF";
|
|
44
|
+
NodeType["HTML"] = "HTML";
|
|
45
|
+
NodeType["IMAGE"] = "IMAGE";
|
|
46
|
+
NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
|
|
47
|
+
NodeType["MAP"] = "MAP";
|
|
48
|
+
NodeType["POLL"] = "POLL";
|
|
49
|
+
NodeType["APP_EMBED"] = "APP_EMBED";
|
|
50
|
+
NodeType["BUTTON"] = "BUTTON";
|
|
51
|
+
NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
|
|
52
|
+
NodeType["TABLE"] = "TABLE";
|
|
53
|
+
NodeType["EMBED"] = "EMBED";
|
|
54
|
+
NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
|
|
55
|
+
NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
|
|
56
|
+
NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
|
|
57
|
+
NodeType["TABLE_CELL"] = "TABLE_CELL";
|
|
58
|
+
NodeType["TABLE_ROW"] = "TABLE_ROW";
|
|
59
|
+
NodeType["EXTERNAL"] = "EXTERNAL";
|
|
60
|
+
NodeType["AUDIO"] = "AUDIO";
|
|
61
|
+
})(NodeType || (NodeType = {}));
|
|
62
|
+
export var WidthType;
|
|
63
|
+
(function (WidthType) {
|
|
64
|
+
/** Width matches the content width */
|
|
65
|
+
WidthType["CONTENT"] = "CONTENT";
|
|
66
|
+
/** Small Width */
|
|
67
|
+
WidthType["SMALL"] = "SMALL";
|
|
68
|
+
/** Width will match the original asset width */
|
|
69
|
+
WidthType["ORIGINAL"] = "ORIGINAL";
|
|
70
|
+
/** coast-to-coast display */
|
|
71
|
+
WidthType["FULL_WIDTH"] = "FULL_WIDTH";
|
|
72
|
+
})(WidthType || (WidthType = {}));
|
|
73
|
+
export var PluginContainerDataAlignment;
|
|
74
|
+
(function (PluginContainerDataAlignment) {
|
|
75
|
+
/** Center Alignment */
|
|
76
|
+
PluginContainerDataAlignment["CENTER"] = "CENTER";
|
|
77
|
+
/** Left Alignment */
|
|
78
|
+
PluginContainerDataAlignment["LEFT"] = "LEFT";
|
|
79
|
+
/** Right Alignment */
|
|
80
|
+
PluginContainerDataAlignment["RIGHT"] = "RIGHT";
|
|
81
|
+
})(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
|
|
82
|
+
export var Type;
|
|
83
|
+
(function (Type) {
|
|
84
|
+
/** Regular link button */
|
|
85
|
+
Type["LINK"] = "LINK";
|
|
86
|
+
/** Triggers custom action that is defined in plugin configuration by the consumer */
|
|
87
|
+
Type["ACTION"] = "ACTION";
|
|
88
|
+
})(Type || (Type = {}));
|
|
89
|
+
export var Target;
|
|
90
|
+
(function (Target) {
|
|
91
|
+
/** Opens the linked document in the same frame as it was clicked (this is default) */
|
|
92
|
+
Target["SELF"] = "SELF";
|
|
93
|
+
/** Opens the linked document in a new window or tab */
|
|
94
|
+
Target["BLANK"] = "BLANK";
|
|
95
|
+
/** Opens the linked document in the parent frame */
|
|
96
|
+
Target["PARENT"] = "PARENT";
|
|
97
|
+
/** Opens the linked document in the full body of the window */
|
|
98
|
+
Target["TOP"] = "TOP";
|
|
99
|
+
})(Target || (Target = {}));
|
|
100
|
+
export var TextAlignment;
|
|
101
|
+
(function (TextAlignment) {
|
|
102
|
+
/** browser default, eqivalent to `initial` */
|
|
103
|
+
TextAlignment["AUTO"] = "AUTO";
|
|
104
|
+
/** Left align */
|
|
105
|
+
TextAlignment["LEFT"] = "LEFT";
|
|
106
|
+
/** Right align */
|
|
107
|
+
TextAlignment["RIGHT"] = "RIGHT";
|
|
108
|
+
/** Center align */
|
|
109
|
+
TextAlignment["CENTER"] = "CENTER";
|
|
110
|
+
/** 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 */
|
|
111
|
+
TextAlignment["JUSTIFY"] = "JUSTIFY";
|
|
112
|
+
})(TextAlignment || (TextAlignment = {}));
|
|
113
|
+
export var LineStyle;
|
|
114
|
+
(function (LineStyle) {
|
|
115
|
+
/** Single Line */
|
|
116
|
+
LineStyle["SINGLE"] = "SINGLE";
|
|
117
|
+
/** Double Line */
|
|
118
|
+
LineStyle["DOUBLE"] = "DOUBLE";
|
|
119
|
+
/** Dashed Line */
|
|
120
|
+
LineStyle["DASHED"] = "DASHED";
|
|
121
|
+
/** Dotted Line */
|
|
122
|
+
LineStyle["DOTTED"] = "DOTTED";
|
|
123
|
+
})(LineStyle || (LineStyle = {}));
|
|
124
|
+
export var Width;
|
|
125
|
+
(function (Width) {
|
|
126
|
+
/** Large line */
|
|
127
|
+
Width["LARGE"] = "LARGE";
|
|
128
|
+
/** Medium line */
|
|
129
|
+
Width["MEDIUM"] = "MEDIUM";
|
|
130
|
+
/** Small line */
|
|
131
|
+
Width["SMALL"] = "SMALL";
|
|
132
|
+
})(Width || (Width = {}));
|
|
133
|
+
export var Alignment;
|
|
134
|
+
(function (Alignment) {
|
|
135
|
+
/** Center alignment */
|
|
136
|
+
Alignment["CENTER"] = "CENTER";
|
|
137
|
+
/** Left alignment */
|
|
138
|
+
Alignment["LEFT"] = "LEFT";
|
|
139
|
+
/** Right alignment */
|
|
140
|
+
Alignment["RIGHT"] = "RIGHT";
|
|
141
|
+
})(Alignment || (Alignment = {}));
|
|
142
|
+
export var ViewMode;
|
|
143
|
+
(function (ViewMode) {
|
|
144
|
+
/** No PDF view */
|
|
145
|
+
ViewMode["NONE"] = "NONE";
|
|
146
|
+
/** Full PDF view */
|
|
147
|
+
ViewMode["FULL"] = "FULL";
|
|
148
|
+
/** Mini PDF view */
|
|
149
|
+
ViewMode["MINI"] = "MINI";
|
|
150
|
+
})(ViewMode || (ViewMode = {}));
|
|
151
|
+
export var LayoutType;
|
|
152
|
+
(function (LayoutType) {
|
|
153
|
+
/** Collage type */
|
|
154
|
+
LayoutType["COLLAGE"] = "COLLAGE";
|
|
155
|
+
/** Masonry type */
|
|
156
|
+
LayoutType["MASONRY"] = "MASONRY";
|
|
157
|
+
/** Grid type */
|
|
158
|
+
LayoutType["GRID"] = "GRID";
|
|
159
|
+
/** Thumbnail type */
|
|
160
|
+
LayoutType["THUMBNAIL"] = "THUMBNAIL";
|
|
161
|
+
/** Slider type */
|
|
162
|
+
LayoutType["SLIDER"] = "SLIDER";
|
|
163
|
+
/** Slideshow type */
|
|
164
|
+
LayoutType["SLIDESHOW"] = "SLIDESHOW";
|
|
165
|
+
/** Panorama type */
|
|
166
|
+
LayoutType["PANORAMA"] = "PANORAMA";
|
|
167
|
+
/** Column type */
|
|
168
|
+
LayoutType["COLUMN"] = "COLUMN";
|
|
169
|
+
/** Magic type */
|
|
170
|
+
LayoutType["MAGIC"] = "MAGIC";
|
|
171
|
+
/** Fullsize images type */
|
|
172
|
+
LayoutType["FULLSIZE"] = "FULLSIZE";
|
|
173
|
+
})(LayoutType || (LayoutType = {}));
|
|
174
|
+
export var Orientation;
|
|
175
|
+
(function (Orientation) {
|
|
176
|
+
/** Rows Orientation */
|
|
177
|
+
Orientation["ROWS"] = "ROWS";
|
|
178
|
+
/** Columns Orientation */
|
|
179
|
+
Orientation["COLUMNS"] = "COLUMNS";
|
|
180
|
+
})(Orientation || (Orientation = {}));
|
|
181
|
+
export var Crop;
|
|
182
|
+
(function (Crop) {
|
|
183
|
+
/** Crop to fill */
|
|
184
|
+
Crop["FILL"] = "FILL";
|
|
185
|
+
/** Crop to fit */
|
|
186
|
+
Crop["FIT"] = "FIT";
|
|
187
|
+
})(Crop || (Crop = {}));
|
|
188
|
+
export var ThumbnailsAlignment;
|
|
189
|
+
(function (ThumbnailsAlignment) {
|
|
190
|
+
/** Top alignment */
|
|
191
|
+
ThumbnailsAlignment["TOP"] = "TOP";
|
|
192
|
+
/** Right alignment */
|
|
193
|
+
ThumbnailsAlignment["RIGHT"] = "RIGHT";
|
|
194
|
+
/** Bottom alignment */
|
|
195
|
+
ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
|
|
196
|
+
/** Left alignment */
|
|
197
|
+
ThumbnailsAlignment["LEFT"] = "LEFT";
|
|
198
|
+
/** No thumbnail */
|
|
199
|
+
ThumbnailsAlignment["NONE"] = "NONE";
|
|
200
|
+
})(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
|
|
201
|
+
export var Source;
|
|
202
|
+
(function (Source) {
|
|
203
|
+
Source["HTML"] = "HTML";
|
|
204
|
+
Source["ADSENSE"] = "ADSENSE";
|
|
205
|
+
})(Source || (Source = {}));
|
|
206
|
+
export var MapType;
|
|
207
|
+
(function (MapType) {
|
|
208
|
+
/** Roadmap map type */
|
|
209
|
+
MapType["ROADMAP"] = "ROADMAP";
|
|
210
|
+
/** Satellite map type */
|
|
211
|
+
MapType["SATELITE"] = "SATELITE";
|
|
212
|
+
/** Hybrid map type */
|
|
213
|
+
MapType["HYBRID"] = "HYBRID";
|
|
214
|
+
/** Terrain map type */
|
|
215
|
+
MapType["TERRAIN"] = "TERRAIN";
|
|
216
|
+
})(MapType || (MapType = {}));
|
|
217
|
+
export var ViewRole;
|
|
218
|
+
(function (ViewRole) {
|
|
219
|
+
/** Only Poll creator can view the results */
|
|
220
|
+
ViewRole["CREATOR"] = "CREATOR";
|
|
221
|
+
/** Anyone who voted can see the results */
|
|
222
|
+
ViewRole["VOTERS"] = "VOTERS";
|
|
223
|
+
/** Anyone can see the results, even if one didn't vote */
|
|
224
|
+
ViewRole["EVERYONE"] = "EVERYONE";
|
|
225
|
+
})(ViewRole || (ViewRole = {}));
|
|
226
|
+
export var VoteRole;
|
|
227
|
+
(function (VoteRole) {
|
|
228
|
+
/** Logged in member */
|
|
229
|
+
VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
|
|
230
|
+
/** Anyone */
|
|
231
|
+
VoteRole["ALL"] = "ALL";
|
|
232
|
+
})(VoteRole || (VoteRole = {}));
|
|
233
|
+
export var PollLayoutType;
|
|
234
|
+
(function (PollLayoutType) {
|
|
235
|
+
/** List */
|
|
236
|
+
PollLayoutType["LIST"] = "LIST";
|
|
237
|
+
/** Grid */
|
|
238
|
+
PollLayoutType["GRID"] = "GRID";
|
|
239
|
+
})(PollLayoutType || (PollLayoutType = {}));
|
|
240
|
+
export var PollLayoutDirection;
|
|
241
|
+
(function (PollLayoutDirection) {
|
|
242
|
+
/** Left-to-right */
|
|
243
|
+
PollLayoutDirection["LTR"] = "LTR";
|
|
244
|
+
/** Right-to-left */
|
|
245
|
+
PollLayoutDirection["RTL"] = "RTL";
|
|
246
|
+
})(PollLayoutDirection || (PollLayoutDirection = {}));
|
|
247
|
+
export var BackgroundType;
|
|
248
|
+
(function (BackgroundType) {
|
|
249
|
+
/** Color background type */
|
|
250
|
+
BackgroundType["COLOR"] = "COLOR";
|
|
251
|
+
/** Image background type */
|
|
252
|
+
BackgroundType["IMAGE"] = "IMAGE";
|
|
253
|
+
/** Gradiant background type */
|
|
254
|
+
BackgroundType["GRADIENT"] = "GRADIENT";
|
|
255
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
256
|
+
export var DecorationType;
|
|
257
|
+
(function (DecorationType) {
|
|
258
|
+
DecorationType["BOLD"] = "BOLD";
|
|
259
|
+
DecorationType["ITALIC"] = "ITALIC";
|
|
260
|
+
DecorationType["UNDERLINE"] = "UNDERLINE";
|
|
261
|
+
DecorationType["SPOILER"] = "SPOILER";
|
|
262
|
+
DecorationType["ANCHOR"] = "ANCHOR";
|
|
263
|
+
DecorationType["MENTION"] = "MENTION";
|
|
264
|
+
DecorationType["LINK"] = "LINK";
|
|
265
|
+
DecorationType["COLOR"] = "COLOR";
|
|
266
|
+
DecorationType["FONT_SIZE"] = "FONT_SIZE";
|
|
267
|
+
DecorationType["EXTERNAL"] = "EXTERNAL";
|
|
268
|
+
})(DecorationType || (DecorationType = {}));
|
|
269
|
+
export var FontType;
|
|
270
|
+
(function (FontType) {
|
|
271
|
+
FontType["PX"] = "PX";
|
|
272
|
+
FontType["EM"] = "EM";
|
|
273
|
+
})(FontType || (FontType = {}));
|
|
274
|
+
export var AppType;
|
|
275
|
+
(function (AppType) {
|
|
276
|
+
AppType["PRODUCT"] = "PRODUCT";
|
|
277
|
+
AppType["EVENT"] = "EVENT";
|
|
278
|
+
AppType["BOOKING"] = "BOOKING";
|
|
279
|
+
})(AppType || (AppType = {}));
|
|
280
|
+
export var InitialExpandedItems;
|
|
281
|
+
(function (InitialExpandedItems) {
|
|
282
|
+
/** First item will be expended initally */
|
|
283
|
+
InitialExpandedItems["FIRST"] = "FIRST";
|
|
284
|
+
/** All items will expended initally */
|
|
285
|
+
InitialExpandedItems["ALL"] = "ALL";
|
|
286
|
+
/** All items collapsed initally */
|
|
287
|
+
InitialExpandedItems["NONE"] = "NONE";
|
|
288
|
+
})(InitialExpandedItems || (InitialExpandedItems = {}));
|
|
289
|
+
export var Direction;
|
|
290
|
+
(function (Direction) {
|
|
291
|
+
/** Left-to-right */
|
|
292
|
+
Direction["LTR"] = "LTR";
|
|
293
|
+
/** Right-to-left */
|
|
294
|
+
Direction["RTL"] = "RTL";
|
|
295
|
+
})(Direction || (Direction = {}));
|
|
296
|
+
export var VerticalAlignment;
|
|
297
|
+
(function (VerticalAlignment) {
|
|
298
|
+
/** Top alignment */
|
|
299
|
+
VerticalAlignment["TOP"] = "TOP";
|
|
300
|
+
/** Middle alignment */
|
|
301
|
+
VerticalAlignment["MIDDLE"] = "MIDDLE";
|
|
302
|
+
/** Bottom alignment */
|
|
303
|
+
VerticalAlignment["BOTTOM"] = "BOTTOM";
|
|
304
|
+
})(VerticalAlignment || (VerticalAlignment = {}));
|
|
305
|
+
/**
|
|
306
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
307
|
+
* `Value` type union.
|
|
308
|
+
*
|
|
309
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
310
|
+
*/
|
|
311
|
+
export var NullValue;
|
|
312
|
+
(function (NullValue) {
|
|
313
|
+
/** Null value. */
|
|
314
|
+
NullValue["NULL_VALUE"] = "NULL_VALUE";
|
|
315
|
+
})(NullValue || (NullValue = {}));
|
|
316
|
+
export var ModerationStatusStatus;
|
|
317
|
+
(function (ModerationStatusStatus) {
|
|
318
|
+
ModerationStatusStatus["UNKNOWN"] = "UNKNOWN";
|
|
319
|
+
ModerationStatusStatus["APPROVED"] = "APPROVED";
|
|
320
|
+
ModerationStatusStatus["REJECTED"] = "REJECTED";
|
|
321
|
+
})(ModerationStatusStatus || (ModerationStatusStatus = {}));
|
|
322
|
+
export var GetPostTemplatesSort;
|
|
323
|
+
(function (GetPostTemplatesSort) {
|
|
324
|
+
/** Sorting by publishing date ascending */
|
|
325
|
+
GetPostTemplatesSort["PUBLISHED_DATE_ASC"] = "PUBLISHED_DATE_ASC";
|
|
326
|
+
/** Sorting by publishing date descending */
|
|
327
|
+
GetPostTemplatesSort["PUBLISHED_DATE_DESC"] = "PUBLISHED_DATE_DESC";
|
|
328
|
+
})(GetPostTemplatesSort || (GetPostTemplatesSort = {}));
|
|
329
|
+
export var Origin;
|
|
330
|
+
(function (Origin) {
|
|
331
|
+
Origin["UNKNOWN"] = "UNKNOWN";
|
|
332
|
+
/** Changed by admin */
|
|
333
|
+
Origin["ADMIN"] = "ADMIN";
|
|
334
|
+
/** Categories were changed */
|
|
335
|
+
Origin["ADD_CATEGORIES"] = "ADD_CATEGORIES";
|
|
336
|
+
/** Saved automatically */
|
|
337
|
+
Origin["AUTO_SAVE"] = "AUTO_SAVE";
|
|
338
|
+
/** Copied from template */
|
|
339
|
+
Origin["COPY_TEMPLATE"] = "COPY_TEMPLATE";
|
|
340
|
+
/** Imported */
|
|
341
|
+
Origin["IMPORT"] = "IMPORT";
|
|
342
|
+
/** Imported in bulk */
|
|
343
|
+
Origin["IMPORT_BULK"] = "IMPORT_BULK";
|
|
344
|
+
/** Imported with html import */
|
|
345
|
+
Origin["IMPORT_HTML"] = "IMPORT_HTML";
|
|
346
|
+
/** Patch import */
|
|
347
|
+
Origin["IMPORT_PATCH"] = "IMPORT_PATCH";
|
|
348
|
+
/** Changed language */
|
|
349
|
+
Origin["LANGUAGE_CHANGE"] = "LANGUAGE_CHANGE";
|
|
350
|
+
/** Saved manually */
|
|
351
|
+
Origin["MANUAL_SAVE"] = "MANUAL_SAVE";
|
|
352
|
+
/** Affected by migration */
|
|
353
|
+
Origin["MIGRATION"] = "MIGRATION";
|
|
354
|
+
/** Affected by moderation */
|
|
355
|
+
Origin["MODERATION"] = "MODERATION";
|
|
356
|
+
/** Moved to trash */
|
|
357
|
+
Origin["MOVE_TO_TRASH"] = "MOVE_TO_TRASH";
|
|
358
|
+
/** Pricing plans were changed */
|
|
359
|
+
Origin["PRICING_PLANS_CHANGE"] = "PRICING_PLANS_CHANGE";
|
|
360
|
+
/** Was provisioned */
|
|
361
|
+
Origin["PROVISION"] = "PROVISION";
|
|
362
|
+
/** Was published */
|
|
363
|
+
Origin["PUBLISH"] = "PUBLISH";
|
|
364
|
+
/** Owner was reassigned */
|
|
365
|
+
Origin["REASSIGN_OWNER"] = "REASSIGN_OWNER";
|
|
366
|
+
/** Was reblogged */
|
|
367
|
+
Origin["REBLOG"] = "REBLOG";
|
|
368
|
+
/** Was restored */
|
|
369
|
+
Origin["RESTORE"] = "RESTORE";
|
|
370
|
+
/** Reverted to draft */
|
|
371
|
+
Origin["REVERT_TO_DRAFT"] = "REVERT_TO_DRAFT";
|
|
372
|
+
/** Was translated */
|
|
373
|
+
Origin["TRANSLATION"] = "TRANSLATION";
|
|
374
|
+
/** Was unpublished */
|
|
375
|
+
Origin["UNPUBLISH"] = "UNPUBLISH";
|
|
376
|
+
/** Was unscheduled */
|
|
377
|
+
Origin["UNSCHEDULE"] = "UNSCHEDULE";
|
|
378
|
+
/** New edit session started which updated editing_session_id id */
|
|
379
|
+
Origin["NEW_EDIT_SESSION"] = "NEW_EDIT_SESSION";
|
|
380
|
+
/** Was scheduled by Later */
|
|
381
|
+
Origin["SCHEDULING_SERVICE_SCHEDULE"] = "SCHEDULING_SERVICE_SCHEDULE";
|
|
382
|
+
/** Was unscheduled by Later */
|
|
383
|
+
Origin["SCHEDULING_SERVICE_UNSCHEDULE"] = "SCHEDULING_SERVICE_UNSCHEDULE";
|
|
384
|
+
/** Was published by Later */
|
|
385
|
+
Origin["SCHEDULING_SERVICE_PUBLISH"] = "SCHEDULING_SERVICE_PUBLISH";
|
|
386
|
+
/** Was scheduled */
|
|
387
|
+
Origin["SCHEDULE"] = "SCHEDULE";
|
|
388
|
+
/** Was removed from moderation */
|
|
389
|
+
Origin["REMOVE_FROM_MODERATION"] = "REMOVE_FROM_MODERATION";
|
|
390
|
+
/** Was rejected from moderation */
|
|
391
|
+
Origin["REJECT_FROM_MODERATION"] = "REJECT_FROM_MODERATION";
|
|
392
|
+
/** Was approved in moderation */
|
|
393
|
+
Origin["APPROVE_IN_MODERATION"] = "APPROVE_IN_MODERATION";
|
|
394
|
+
/** Tag was deleted */
|
|
395
|
+
Origin["DELETE_TAG"] = "DELETE_TAG";
|
|
396
|
+
})(Origin || (Origin = {}));
|
|
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
|
+
/** Deprecated. Use `IN_REVIEW` instead. Status indicating the draft post is in review. */
|
|
409
|
+
Status["IN_MODERATION"] = "IN_MODERATION";
|
|
410
|
+
/** Status indicating the draft post is in review. */
|
|
411
|
+
Status["IN_REVIEW"] = "IN_REVIEW";
|
|
412
|
+
})(Status || (Status = {}));
|
|
413
|
+
export var Field;
|
|
414
|
+
(function (Field) {
|
|
415
|
+
Field["UNKNOWN"] = "UNKNOWN";
|
|
416
|
+
/** Total comments field. */
|
|
417
|
+
Field["TOTAL_COMMENTS"] = "TOTAL_COMMENTS";
|
|
418
|
+
/** Like count field. */
|
|
419
|
+
Field["LIKE_COUNT"] = "LIKE_COUNT";
|
|
420
|
+
/** View count field. */
|
|
421
|
+
Field["VIEW_COUNT"] = "VIEW_COUNT";
|
|
422
|
+
/** Rating count field */
|
|
423
|
+
Field["RATING_COUNT"] = "RATING_COUNT";
|
|
424
|
+
})(Field || (Field = {}));
|
|
425
|
+
export var PostFieldField;
|
|
426
|
+
(function (PostFieldField) {
|
|
427
|
+
PostFieldField["UNKNOWN"] = "UNKNOWN";
|
|
428
|
+
/** Deprecated use `METRICS` instead */
|
|
429
|
+
PostFieldField["COUNTERS"] = "COUNTERS";
|
|
430
|
+
/** Includes Post url when present */
|
|
431
|
+
PostFieldField["URL"] = "URL";
|
|
432
|
+
/** Includes Post content text string when present */
|
|
433
|
+
PostFieldField["CONTENT_TEXT"] = "CONTENT_TEXT";
|
|
434
|
+
/** Includes Post metrics when present */
|
|
435
|
+
PostFieldField["METRICS"] = "METRICS";
|
|
436
|
+
/** Includes SEO data */
|
|
437
|
+
PostFieldField["SEO"] = "SEO";
|
|
438
|
+
/**
|
|
439
|
+
* Includes Post content as a stringified DraftJS document
|
|
440
|
+
* Reserved for internal use
|
|
441
|
+
*/
|
|
442
|
+
PostFieldField["CONTENT"] = "CONTENT";
|
|
443
|
+
/**
|
|
444
|
+
* Includes internal id field
|
|
445
|
+
* Reserved for internal use
|
|
446
|
+
*/
|
|
447
|
+
PostFieldField["INTERNAL_ID"] = "INTERNAL_ID";
|
|
448
|
+
/** Includes post owners Contact Id */
|
|
449
|
+
PostFieldField["CONTACT_ID"] = "CONTACT_ID";
|
|
450
|
+
/** Includes post rich content */
|
|
451
|
+
PostFieldField["RICH_CONTENT"] = "RICH_CONTENT";
|
|
452
|
+
})(PostFieldField || (PostFieldField = {}));
|
|
453
|
+
export var GetPostsSort;
|
|
454
|
+
(function (GetPostsSort) {
|
|
455
|
+
/** Sorting by publishing date descending with pinned posts first. The default value */
|
|
456
|
+
GetPostsSort["FEED"] = "FEED";
|
|
457
|
+
/** Sorting by publishing date ascending */
|
|
458
|
+
GetPostsSort["PUBLISHED_DATE_ASC"] = "PUBLISHED_DATE_ASC";
|
|
459
|
+
/** Sorting by publishing date descending */
|
|
460
|
+
GetPostsSort["PUBLISHED_DATE_DESC"] = "PUBLISHED_DATE_DESC";
|
|
461
|
+
/** Sorting by view count descending */
|
|
462
|
+
GetPostsSort["VIEW_COUNT"] = "VIEW_COUNT";
|
|
463
|
+
/** Sorting by like count descending */
|
|
464
|
+
GetPostsSort["LIKE_COUNT"] = "LIKE_COUNT";
|
|
465
|
+
/** Sorting by title ascending */
|
|
466
|
+
GetPostsSort["TITLE_ASC"] = "TITLE_ASC";
|
|
467
|
+
/** Sorting by title descending */
|
|
468
|
+
GetPostsSort["TITLE_DESC"] = "TITLE_DESC";
|
|
469
|
+
/** Sorting by post rating descending. */
|
|
470
|
+
GetPostsSort["RATING"] = "RATING";
|
|
471
|
+
})(GetPostsSort || (GetPostsSort = {}));
|
|
472
|
+
export var SortOrder;
|
|
473
|
+
(function (SortOrder) {
|
|
474
|
+
SortOrder["ASC"] = "ASC";
|
|
475
|
+
SortOrder["DESC"] = "DESC";
|
|
476
|
+
})(SortOrder || (SortOrder = {}));
|
|
477
|
+
export var QueryPublicationsCountStatsRequestOrder;
|
|
478
|
+
(function (QueryPublicationsCountStatsRequestOrder) {
|
|
479
|
+
QueryPublicationsCountStatsRequestOrder["UNKNOWN"] = "UNKNOWN";
|
|
480
|
+
QueryPublicationsCountStatsRequestOrder["OLDEST"] = "OLDEST";
|
|
481
|
+
QueryPublicationsCountStatsRequestOrder["NEWEST"] = "NEWEST";
|
|
482
|
+
})(QueryPublicationsCountStatsRequestOrder || (QueryPublicationsCountStatsRequestOrder = {}));
|
|
483
|
+
export var Order;
|
|
484
|
+
(function (Order) {
|
|
485
|
+
Order["UNKNOWN"] = "UNKNOWN";
|
|
486
|
+
Order["OLDEST"] = "OLDEST";
|
|
487
|
+
Order["NEWEST"] = "NEWEST";
|
|
488
|
+
})(Order || (Order = {}));
|
|
489
|
+
const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
|
|
490
|
+
const _getPostBySlugRequest = {};
|
|
491
|
+
const _getPostBySlugResponse = { post: '_post' };
|
|
492
|
+
const _getPostMetricsRequest = {};
|
|
493
|
+
const _getPostMetricsResponse = {};
|
|
494
|
+
const _getPostRequest = {};
|
|
495
|
+
const _getPostResponse = { post: '_post' };
|
|
496
|
+
const _getTotalPostsRequest = {};
|
|
497
|
+
const _getTotalPostsResponse = {};
|
|
498
|
+
const _listPostsRequest = {};
|
|
499
|
+
const _listPostsResponse = { posts: '_post' };
|
|
500
|
+
const _media = { wixMedia: '_wixMedia' };
|
|
501
|
+
const _node = { nodes: '_node' };
|
|
502
|
+
const _post = {
|
|
503
|
+
url: 'wix.common.PageUrl',
|
|
504
|
+
heroImage: 'wix.common.Image',
|
|
505
|
+
coverMedia: '_coverMedia',
|
|
506
|
+
richContent: '_richContent',
|
|
507
|
+
media: '_media',
|
|
508
|
+
};
|
|
509
|
+
const _queryPostCountStatsRequest = {};
|
|
510
|
+
const _queryPostCountStatsResponse = {};
|
|
511
|
+
const _queryPostsRequest = {};
|
|
512
|
+
const _queryPostsResponse = { posts: '_post' };
|
|
513
|
+
const _richContent = { nodes: '_node' };
|
|
514
|
+
const _wixMedia = { image: 'wix.common.Image', videoV2: 'wix.common.VideoV2' };
|
|
515
|
+
/**
|
|
516
|
+
* Gets a post by the specified ID.
|
|
517
|
+
*
|
|
518
|
+
*
|
|
519
|
+
* The `getPost()` function returns a Promise that resolves to a post whose ID matches the given ID.
|
|
520
|
+
*
|
|
521
|
+
* @param postId - Post ID.
|
|
522
|
+
* @public
|
|
523
|
+
* @requiredField postId
|
|
524
|
+
* @param options - Options specifying which fields to return.
|
|
525
|
+
* @returns Fulfilled - The requested post.
|
|
526
|
+
*/
|
|
527
|
+
export function getPost(postId, options) {
|
|
528
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
529
|
+
const requestTransformation = { postId: '$[0]', fieldsets: '$[1].fieldsets' };
|
|
530
|
+
const responseTransformation = '$';
|
|
531
|
+
// @ts-ignore
|
|
532
|
+
const httpClient = arguments[2].httpClient;
|
|
533
|
+
const { toAmbassadorRequest } = serializer({
|
|
534
|
+
rootSchema: _getPostRequest,
|
|
535
|
+
depSchemas: {},
|
|
536
|
+
fqdnTransformation: {
|
|
537
|
+
paths: [],
|
|
538
|
+
transformation: _fromVeloEntity,
|
|
539
|
+
},
|
|
540
|
+
customTransformation: requestTransformation,
|
|
541
|
+
});
|
|
542
|
+
const { fromJSON } = serializer({
|
|
543
|
+
rootSchema: _getPostResponse,
|
|
544
|
+
depSchemas: { _coverMedia, _media, _node, _post, _richContent, _wixMedia },
|
|
545
|
+
fqdnTransformation: {
|
|
546
|
+
paths: [...['post']],
|
|
547
|
+
transformation: _toVeloEntity,
|
|
548
|
+
},
|
|
549
|
+
customTransformation: responseTransformation,
|
|
550
|
+
});
|
|
551
|
+
const payload = toAmbassadorRequest([postId, options]);
|
|
552
|
+
const reqOpts = ambassadorWixBlogV3Post.getPost(payload);
|
|
553
|
+
__log(`"GetPost" sending request with: ${__inspect(reqOpts)}`);
|
|
554
|
+
try {
|
|
555
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
556
|
+
return fromJSON(data);
|
|
557
|
+
}
|
|
558
|
+
catch (err) {
|
|
559
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
560
|
+
'postId',
|
|
561
|
+
'options',
|
|
562
|
+
]);
|
|
563
|
+
throw transformedError;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Gets a post by the provided slug.
|
|
569
|
+
*
|
|
570
|
+
*
|
|
571
|
+
* The `getPostBySlug()` function returns a Promise that resolves to a post whose slug matches the given slug.
|
|
572
|
+
*
|
|
573
|
+
* The `slug` is the end of a post's URL that refers to a specific post. For example, if a post's URL is `https:/example.com/blog/post/my-post-slug`, the slug is `my-post-slug`. The slug is case-sensitive, and is generally derived from the post title, unless specified otherwise.
|
|
574
|
+
* @public
|
|
575
|
+
* @requiredField GetPostBySlugRequest
|
|
576
|
+
* @requiredField slug
|
|
577
|
+
* @param options - Options specifying which fields to return.
|
|
578
|
+
* @param slug - Slug of the post to retrieve.
|
|
579
|
+
*
|
|
580
|
+
* The end of a post's URL, for example, `https:/example.com/blog/post/my-post-slug`. Case sensitive and generally based on the post title if not specified.
|
|
581
|
+
* @returns Fulfilled - The requested post.
|
|
582
|
+
*/
|
|
583
|
+
export function getPostBySlug(slug, options) {
|
|
584
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
585
|
+
const requestTransformation = { slug: '$[0]', fieldsets: '$[1].fieldsets' };
|
|
586
|
+
const responseTransformation = '$';
|
|
587
|
+
// @ts-ignore
|
|
588
|
+
const httpClient = arguments[2].httpClient;
|
|
589
|
+
const { toAmbassadorRequest } = serializer({
|
|
590
|
+
rootSchema: _getPostBySlugRequest,
|
|
591
|
+
depSchemas: {},
|
|
592
|
+
fqdnTransformation: {
|
|
593
|
+
paths: [],
|
|
594
|
+
transformation: _fromVeloEntity,
|
|
595
|
+
},
|
|
596
|
+
customTransformation: requestTransformation,
|
|
597
|
+
});
|
|
598
|
+
const { fromJSON } = serializer({
|
|
599
|
+
rootSchema: _getPostBySlugResponse,
|
|
600
|
+
depSchemas: { _coverMedia, _media, _node, _post, _richContent, _wixMedia },
|
|
601
|
+
fqdnTransformation: {
|
|
602
|
+
paths: [...['post']],
|
|
603
|
+
transformation: _toVeloEntity,
|
|
604
|
+
},
|
|
605
|
+
customTransformation: responseTransformation,
|
|
606
|
+
});
|
|
607
|
+
const payload = toAmbassadorRequest([slug, options]);
|
|
608
|
+
const reqOpts = ambassadorWixBlogV3Post.getPostBySlug(payload);
|
|
609
|
+
__log(`"GetPostBySlug" sending request with: ${__inspect(reqOpts)}`);
|
|
610
|
+
try {
|
|
611
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
612
|
+
return fromJSON(data);
|
|
613
|
+
}
|
|
614
|
+
catch (err) {
|
|
615
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
616
|
+
'slug',
|
|
617
|
+
'options',
|
|
618
|
+
]);
|
|
619
|
+
throw transformedError;
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Retrieves a list of published posts.
|
|
625
|
+
*
|
|
626
|
+
*
|
|
627
|
+
* The `listPosts()` function returns a Promise that resolves to a list of up to 100 published posts.
|
|
628
|
+
*
|
|
629
|
+
* Using the `options` parameter, you can filter your list of posts, set the amount of posts to be returned, and sort your list in a specified order.
|
|
630
|
+
*
|
|
631
|
+
* By default, the list is sorted by `firstPublishedDate` in descending order, and the amount of posts returned is 50.
|
|
632
|
+
* @public
|
|
633
|
+
* @param options - Sort, filter, and paging options.
|
|
634
|
+
* @returns Fulfilled - List of retrieved posts.
|
|
635
|
+
*/
|
|
636
|
+
export function listPosts(options) {
|
|
637
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
638
|
+
const requestTransformation = {
|
|
639
|
+
featured: '$[0].featured',
|
|
640
|
+
hashtags: '$[0].hashtags',
|
|
641
|
+
categoryIds: '$[0].categoryIds',
|
|
642
|
+
tagIds: '$[0].tagIds',
|
|
643
|
+
sort: '$[0].sort',
|
|
644
|
+
paging: '$[0].paging',
|
|
645
|
+
language: '$[0].language',
|
|
646
|
+
memberId: '$[0].memberId',
|
|
647
|
+
fieldsets: '$[0].fieldsets',
|
|
648
|
+
};
|
|
649
|
+
const responseTransformation = '$';
|
|
650
|
+
// @ts-ignore
|
|
651
|
+
const httpClient = arguments[1].httpClient;
|
|
652
|
+
const { toAmbassadorRequest } = serializer({
|
|
653
|
+
rootSchema: _listPostsRequest,
|
|
654
|
+
depSchemas: {},
|
|
655
|
+
fqdnTransformation: {
|
|
656
|
+
paths: [],
|
|
657
|
+
transformation: _fromVeloEntity,
|
|
658
|
+
},
|
|
659
|
+
customTransformation: requestTransformation,
|
|
660
|
+
});
|
|
661
|
+
const { fromJSON } = serializer({
|
|
662
|
+
rootSchema: _listPostsResponse,
|
|
663
|
+
depSchemas: { _coverMedia, _media, _node, _post, _richContent, _wixMedia },
|
|
664
|
+
fqdnTransformation: {
|
|
665
|
+
paths: [...['Array#posts']],
|
|
666
|
+
transformation: _toVeloEntity,
|
|
667
|
+
},
|
|
668
|
+
customTransformation: responseTransformation,
|
|
669
|
+
});
|
|
670
|
+
const payload = toAmbassadorRequest([options]);
|
|
671
|
+
const reqOpts = ambassadorWixBlogV3Post.listPosts(payload);
|
|
672
|
+
__log(`"ListPosts" sending request with: ${__inspect(reqOpts)}`);
|
|
673
|
+
try {
|
|
674
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
675
|
+
return fromJSON(data);
|
|
676
|
+
}
|
|
677
|
+
catch (err) {
|
|
678
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
679
|
+
'options',
|
|
680
|
+
]);
|
|
681
|
+
throw transformedError;
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Creates a query to retrieve a list of posts.
|
|
687
|
+
*
|
|
688
|
+
*
|
|
689
|
+
* The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a [`PostsQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/post/postsquerybuilder) object.
|
|
690
|
+
*
|
|
691
|
+
* The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-blog-backend/post/postsquerybuilder/find) function.
|
|
692
|
+
*
|
|
693
|
+
* You can refine the query by chaining `PostsQueryBuilder` functions onto the query. `PostsQueryBuilder` functions enable you to sort, filter, and control the results that `queryPosts()` returns.
|
|
694
|
+
*
|
|
695
|
+
* `queryPosts()` runs with these `PostsQueryBuilder` defaults that can be overridden:
|
|
696
|
+
* + `limit(50)`
|
|
697
|
+
* + `descending('firstPublishedDate')`
|
|
698
|
+
*
|
|
699
|
+
* Note that the default limit is `'50'`, but the max limit is `'100'`.
|
|
700
|
+
*
|
|
701
|
+
* To learn how to query posts, refer to the table below.
|
|
702
|
+
*
|
|
703
|
+
* The following `PostsQueryBuilder` functions are supported for the `queryPosts()` function. For a full description of the Posts object, see the object returned for the `items` property in `PostsQueryResult`.
|
|
704
|
+
* @public */
|
|
705
|
+
export function queryPosts() {
|
|
706
|
+
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
707
|
+
const responseTransformation = {
|
|
708
|
+
items: '$.posts',
|
|
709
|
+
pagingMetadata: '$.pagingMetadata',
|
|
710
|
+
};
|
|
711
|
+
// @ts-ignore
|
|
712
|
+
const httpClient = arguments[0].httpClient;
|
|
713
|
+
const { toAmbassadorRequest } = serializer({
|
|
714
|
+
rootSchema: _queryPostsRequest,
|
|
715
|
+
depSchemas: {},
|
|
716
|
+
fqdnTransformation: {
|
|
717
|
+
paths: [],
|
|
718
|
+
transformation: _fromVeloEntity,
|
|
719
|
+
},
|
|
720
|
+
customTransformation: requestTransformation,
|
|
721
|
+
});
|
|
722
|
+
const { fromJSON } = serializer({
|
|
723
|
+
rootSchema: _queryPostsResponse,
|
|
724
|
+
depSchemas: { _coverMedia, _media, _node, _post, _richContent, _wixMedia },
|
|
725
|
+
fqdnTransformation: {
|
|
726
|
+
paths: [...['Array#posts']],
|
|
727
|
+
transformation: _toVeloEntity,
|
|
728
|
+
},
|
|
729
|
+
customTransformation: responseTransformation,
|
|
730
|
+
});
|
|
731
|
+
return wrapWithQueryBuilder({
|
|
732
|
+
func: (payload) => {
|
|
733
|
+
const reqOpts = ambassadorWixBlogV3Post.queryPosts(payload);
|
|
734
|
+
return httpClient.request(reqOpts);
|
|
735
|
+
},
|
|
736
|
+
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
737
|
+
responseTransformer: ({ data }) => fromJSON(data),
|
|
738
|
+
errorTransformer: (err) => {
|
|
739
|
+
const transformedError = transformError(err, requestTransformation);
|
|
740
|
+
throw transformedError;
|
|
741
|
+
},
|
|
742
|
+
pagingMethod: 'OFFSET',
|
|
743
|
+
transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
|
|
744
|
+
})({ cursorWithEmptyFilterAndSort: true });
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Gets a specified post's metrics.
|
|
748
|
+
*
|
|
749
|
+
*
|
|
750
|
+
* The `getPostMetrics()` function returns a Promise that resolves to the specified post's metrics.
|
|
751
|
+
*
|
|
752
|
+
* A post's metrics include the comments, likes, and views the post receives.
|
|
753
|
+
* @param postId - Post ID.
|
|
754
|
+
* @public
|
|
755
|
+
* @requiredField postId
|
|
756
|
+
* @returns Fulfilled - Post metrics.
|
|
757
|
+
*/
|
|
758
|
+
export function getPostMetrics(postId) {
|
|
759
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
760
|
+
const requestTransformation = { postId: '$[0]' };
|
|
761
|
+
const responseTransformation = '$';
|
|
762
|
+
// @ts-ignore
|
|
763
|
+
const httpClient = arguments[1].httpClient;
|
|
764
|
+
const { toAmbassadorRequest } = serializer({
|
|
765
|
+
rootSchema: _getPostMetricsRequest,
|
|
766
|
+
depSchemas: {},
|
|
767
|
+
fqdnTransformation: {
|
|
768
|
+
paths: [],
|
|
769
|
+
transformation: _fromVeloEntity,
|
|
770
|
+
},
|
|
771
|
+
customTransformation: requestTransformation,
|
|
772
|
+
});
|
|
773
|
+
const { fromJSON } = serializer({
|
|
774
|
+
rootSchema: _getPostMetricsResponse,
|
|
775
|
+
depSchemas: {},
|
|
776
|
+
fqdnTransformation: {
|
|
777
|
+
paths: [],
|
|
778
|
+
transformation: _toVeloEntity,
|
|
779
|
+
},
|
|
780
|
+
customTransformation: responseTransformation,
|
|
781
|
+
});
|
|
782
|
+
const payload = toAmbassadorRequest([postId]);
|
|
783
|
+
const reqOpts = ambassadorWixBlogV3Post.getPostMetrics(payload);
|
|
784
|
+
__log(`"GetPostMetrics" sending request with: ${__inspect(reqOpts)}`);
|
|
785
|
+
try {
|
|
786
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
787
|
+
return fromJSON(data);
|
|
788
|
+
}
|
|
789
|
+
catch (err) {
|
|
790
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
791
|
+
'postId',
|
|
792
|
+
]);
|
|
793
|
+
throw transformedError;
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Retrieves the number of published posts per month within a specified time range.
|
|
799
|
+
*
|
|
800
|
+
*
|
|
801
|
+
* The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
|
|
802
|
+
*
|
|
803
|
+
* You can set the time range using the `rangeStart` and `months` properties. The time range always starts on the 1st of the month set in `rangeStart`. It includes the number of `months` following `rangeStart`. For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`, the time range will be from `'2022-03-01'` until `'2022-06-30'`. Notice that the time range ends on the last of the month.
|
|
804
|
+
*
|
|
805
|
+
* >**Note:** If there are no published posts in a specific month, that month is not included in the response. For example, let's say a blog has `0` posts dated in February 2022. `months` and `rangeStart` are set to `3` and `'2022-01-01'` respectively. Your result will only include the `postCount` from January and March.
|
|
806
|
+
* @public
|
|
807
|
+
* @param options - Options specifying time frame, sort, and filter.
|
|
808
|
+
* @returns Fulfilled - Post count stats.
|
|
809
|
+
*/
|
|
810
|
+
export function queryPostCountStats(options) {
|
|
811
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
812
|
+
const requestTransformation = {
|
|
813
|
+
rangeStart: '$[0].rangeStart',
|
|
814
|
+
order: '$[0].order',
|
|
815
|
+
months: '$[0].months',
|
|
816
|
+
language: '$[0].language',
|
|
817
|
+
timeZone: '$[0].timeZone',
|
|
818
|
+
};
|
|
819
|
+
const responseTransformation = '$';
|
|
820
|
+
// @ts-ignore
|
|
821
|
+
const httpClient = arguments[1].httpClient;
|
|
822
|
+
const { toAmbassadorRequest } = serializer({
|
|
823
|
+
rootSchema: _queryPostCountStatsRequest,
|
|
824
|
+
depSchemas: {},
|
|
825
|
+
fqdnTransformation: {
|
|
826
|
+
paths: [],
|
|
827
|
+
transformation: _fromVeloEntity,
|
|
828
|
+
},
|
|
829
|
+
customTransformation: requestTransformation,
|
|
830
|
+
});
|
|
831
|
+
const { fromJSON } = serializer({
|
|
832
|
+
rootSchema: _queryPostCountStatsResponse,
|
|
833
|
+
depSchemas: {},
|
|
834
|
+
fqdnTransformation: {
|
|
835
|
+
paths: [],
|
|
836
|
+
transformation: _toVeloEntity,
|
|
837
|
+
},
|
|
838
|
+
customTransformation: responseTransformation,
|
|
839
|
+
});
|
|
840
|
+
const payload = toAmbassadorRequest([options]);
|
|
841
|
+
const reqOpts = ambassadorWixBlogV3Post.queryPostCountStats(payload);
|
|
842
|
+
__log(`"QueryPostCountStats" sending request with: ${__inspect(reqOpts)}`);
|
|
843
|
+
try {
|
|
844
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
845
|
+
return fromJSON(data);
|
|
846
|
+
}
|
|
847
|
+
catch (err) {
|
|
848
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
849
|
+
'options',
|
|
850
|
+
]);
|
|
851
|
+
throw transformedError;
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Gets the total amount of published posts on the blog.
|
|
857
|
+
*
|
|
858
|
+
*
|
|
859
|
+
* The `getTotalPosts()` function returns a Promise that resolves to the total amount of published posts on your blog's site.
|
|
860
|
+
*
|
|
861
|
+
*
|
|
862
|
+
* You can use the `language` option to filter posts for a specified language.
|
|
863
|
+
* @public
|
|
864
|
+
* @param options - Language Options.
|
|
865
|
+
* @returns Fulfilled - Total number of posts.
|
|
866
|
+
*/
|
|
867
|
+
export function getTotalPosts(options) {
|
|
868
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
869
|
+
const requestTransformation = { language: '$[0].language' };
|
|
870
|
+
const responseTransformation = '$';
|
|
871
|
+
// @ts-ignore
|
|
872
|
+
const httpClient = arguments[1].httpClient;
|
|
873
|
+
const { toAmbassadorRequest } = serializer({
|
|
874
|
+
rootSchema: _getTotalPostsRequest,
|
|
875
|
+
depSchemas: {},
|
|
876
|
+
fqdnTransformation: {
|
|
877
|
+
paths: [],
|
|
878
|
+
transformation: _fromVeloEntity,
|
|
879
|
+
},
|
|
880
|
+
customTransformation: requestTransformation,
|
|
881
|
+
});
|
|
882
|
+
const { fromJSON } = serializer({
|
|
883
|
+
rootSchema: _getTotalPostsResponse,
|
|
884
|
+
depSchemas: {},
|
|
885
|
+
fqdnTransformation: {
|
|
886
|
+
paths: [],
|
|
887
|
+
transformation: _toVeloEntity,
|
|
888
|
+
},
|
|
889
|
+
customTransformation: responseTransformation,
|
|
890
|
+
});
|
|
891
|
+
const payload = toAmbassadorRequest([options]);
|
|
892
|
+
const reqOpts = ambassadorWixBlogV3Post.getTotalPosts(payload);
|
|
893
|
+
__log(`"GetTotalPosts" sending request with: ${__inspect(reqOpts)}`);
|
|
894
|
+
try {
|
|
895
|
+
const { data } = yield httpClient.request(reqOpts);
|
|
896
|
+
return fromJSON(data);
|
|
897
|
+
}
|
|
898
|
+
catch (err) {
|
|
899
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
900
|
+
'options',
|
|
901
|
+
]);
|
|
902
|
+
throw transformedError;
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
//# sourceMappingURL=blog-v3-post.universal.js.map
|