@wix/auto_sdk_blog_posts 1.0.20 → 1.0.22

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