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