@wix/blog 1.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.js +26 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/blog-v3-category.http.d.ts +50 -0
  5. package/build/cjs/src/blog-v3-category.http.js +421 -0
  6. package/build/cjs/src/blog-v3-category.http.js.map +1 -0
  7. package/build/cjs/src/blog-v3-category.public.d.ts +11 -0
  8. package/build/cjs/src/blog-v3-category.public.js +50 -0
  9. package/build/cjs/src/blog-v3-category.public.js.map +1 -0
  10. package/build/cjs/src/blog-v3-category.types.d.ts +391 -0
  11. package/build/cjs/src/blog-v3-category.types.js +22 -0
  12. package/build/cjs/src/blog-v3-category.types.js.map +1 -0
  13. package/build/cjs/src/blog-v3-category.universal.d.ts +582 -0
  14. package/build/cjs/src/blog-v3-category.universal.js +460 -0
  15. package/build/cjs/src/blog-v3-category.universal.js.map +1 -0
  16. package/build/cjs/src/blog-v3-post.http.d.ts +81 -0
  17. package/build/cjs/src/blog-v3-post.http.js +844 -0
  18. package/build/cjs/src/blog-v3-post.http.js.map +1 -0
  19. package/build/cjs/src/blog-v3-post.public.d.ts +11 -0
  20. package/build/cjs/src/blog-v3-post.public.js +86 -0
  21. package/build/cjs/src/blog-v3-post.public.js.map +1 -0
  22. package/build/cjs/src/blog-v3-post.types.d.ts +2227 -0
  23. package/build/cjs/src/blog-v3-post.types.js +464 -0
  24. package/build/cjs/src/blog-v3-post.types.js.map +1 -0
  25. package/build/cjs/src/blog-v3-post.universal.d.ts +2488 -0
  26. package/build/cjs/src/blog-v3-post.universal.js +935 -0
  27. package/build/cjs/src/blog-v3-post.universal.js.map +1 -0
  28. package/build/cjs/src/blog-v3-tag.http.d.ts +45 -0
  29. package/build/cjs/src/blog-v3-tag.http.js +385 -0
  30. package/build/cjs/src/blog-v3-tag.http.js.map +1 -0
  31. package/build/cjs/src/blog-v3-tag.public.d.ts +10 -0
  32. package/build/cjs/src/blog-v3-tag.public.js +44 -0
  33. package/build/cjs/src/blog-v3-tag.public.js.map +1 -0
  34. package/build/cjs/src/blog-v3-tag.types.d.ts +345 -0
  35. package/build/cjs/src/blog-v3-tag.types.js +15 -0
  36. package/build/cjs/src/blog-v3-tag.types.js.map +1 -0
  37. package/build/cjs/src/blog-v3-tag.universal.d.ts +512 -0
  38. package/build/cjs/src/blog-v3-tag.universal.js +390 -0
  39. package/build/cjs/src/blog-v3-tag.universal.js.map +1 -0
  40. package/build/es/index.d.ts +3 -0
  41. package/build/es/index.js +4 -0
  42. package/build/es/index.js.map +1 -0
  43. package/build/es/src/blog-v3-category.http.d.ts +50 -0
  44. package/build/es/src/blog-v3-category.http.js +411 -0
  45. package/build/es/src/blog-v3-category.http.js.map +1 -0
  46. package/build/es/src/blog-v3-category.public.d.ts +11 -0
  47. package/build/es/src/blog-v3-category.public.js +38 -0
  48. package/build/es/src/blog-v3-category.public.js.map +1 -0
  49. package/build/es/src/blog-v3-category.types.d.ts +391 -0
  50. package/build/es/src/blog-v3-category.types.js +19 -0
  51. package/build/es/src/blog-v3-category.types.js.map +1 -0
  52. package/build/es/src/blog-v3-category.universal.d.ts +582 -0
  53. package/build/es/src/blog-v3-category.universal.js +431 -0
  54. package/build/es/src/blog-v3-category.universal.js.map +1 -0
  55. package/build/es/src/blog-v3-post.http.d.ts +81 -0
  56. package/build/es/src/blog-v3-post.http.js +834 -0
  57. package/build/es/src/blog-v3-post.http.js.map +1 -0
  58. package/build/es/src/blog-v3-post.public.d.ts +11 -0
  59. package/build/es/src/blog-v3-post.public.js +38 -0
  60. package/build/es/src/blog-v3-post.public.js.map +1 -0
  61. package/build/es/src/blog-v3-post.types.d.ts +2227 -0
  62. package/build/es/src/blog-v3-post.types.js +461 -0
  63. package/build/es/src/blog-v3-post.types.js.map +1 -0
  64. package/build/es/src/blog-v3-post.universal.d.ts +2488 -0
  65. package/build/es/src/blog-v3-post.universal.js +906 -0
  66. package/build/es/src/blog-v3-post.universal.js.map +1 -0
  67. package/build/es/src/blog-v3-tag.http.d.ts +45 -0
  68. package/build/es/src/blog-v3-tag.http.js +376 -0
  69. package/build/es/src/blog-v3-tag.http.js.map +1 -0
  70. package/build/es/src/blog-v3-tag.public.d.ts +10 -0
  71. package/build/es/src/blog-v3-tag.public.js +33 -0
  72. package/build/es/src/blog-v3-tag.public.js.map +1 -0
  73. package/build/es/src/blog-v3-tag.types.d.ts +345 -0
  74. package/build/es/src/blog-v3-tag.types.js +12 -0
  75. package/build/es/src/blog-v3-tag.types.js.map +1 -0
  76. package/build/es/src/blog-v3-tag.universal.d.ts +512 -0
  77. package/build/es/src/blog-v3-tag.universal.js +362 -0
  78. package/build/es/src/blog-v3-tag.universal.js.map +1 -0
  79. package/package.json +37 -0
@@ -0,0 +1,844 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTotalPosts = exports.queryPostCountStats = exports.getPostMetrics = exports.queryPosts = exports.listPosts = exports.getPostBySlug = exports.getPost = void 0;
4
+ const metro_runtime_1 = require("@wix/metro-runtime");
5
+ const ambassador_1 = require("@wix/metro-runtime/ambassador");
6
+ const metro_runtime_2 = require("@wix/metro-runtime");
7
+ const _appEmbedData = { image: '_v1Media' };
8
+ const _audioData = { audio: '_v1Media', coverImage: '_v1Media' };
9
+ const _background = { image: '_v1Media' };
10
+ const _coverMedia = { image: '_image', video: '_video' };
11
+ const _design = { poll: '_pollDesign' };
12
+ const _galleryData = { items: '_item', options: '_galleryOptions' };
13
+ const _galleryOptions = { item: '_itemStyle' };
14
+ const _getPostBySlugRequest = {};
15
+ const _getPostBySlugResponse = { post: '_post' };
16
+ const _getPostMetricsRequest = {};
17
+ const _getPostMetricsResponse = { metrics: '_metrics' };
18
+ const _getPostRequest = {};
19
+ const _getPostResponse = { post: '_post' };
20
+ const _getTotalPostsRequest = {};
21
+ const _getTotalPostsResponse = {};
22
+ const _image = { urlExpirationDate: 'google.protobuf.Timestamp' };
23
+ const _imageData = { image: '_v1Media' };
24
+ const _item = { image: '_itemImage', video: '_itemVideo' };
25
+ const _itemImage = { media: '_v1Media' };
26
+ const _itemStyle = { ratio: 'google.protobuf.DoubleValue' };
27
+ const _itemVideo = { media: '_v1Media', thumbnail: '_v1Media' };
28
+ const _listPostsRequest = {};
29
+ const _listPostsResponse = { posts: '_post' };
30
+ const _mapData = { mapSettings: '_mapSettings' };
31
+ const _mapSettings = {
32
+ lat: 'google.protobuf.DoubleValue',
33
+ lng: 'google.protobuf.DoubleValue',
34
+ };
35
+ const _media = { wixMedia: '_wixMedia' };
36
+ const _metadata = {
37
+ createdTimestamp: 'google.protobuf.Timestamp',
38
+ updatedTimestamp: 'google.protobuf.Timestamp',
39
+ };
40
+ const _metrics = { rating: 'FLOAT' };
41
+ const _moderationDetails = {
42
+ submittedDate: 'google.protobuf.Timestamp',
43
+ moderationDate: 'google.protobuf.Timestamp',
44
+ };
45
+ const _node = {
46
+ nodes: '_node',
47
+ galleryData: '_galleryData',
48
+ imageData: '_imageData',
49
+ mapData: '_mapData',
50
+ pollData: '_pollData',
51
+ appEmbedData: '_appEmbedData',
52
+ videoData: '_videoData',
53
+ audioData: '_audioData',
54
+ };
55
+ const _option = { image: '_v1Media' };
56
+ const _periodPostCount = { periodStart: 'google.protobuf.Timestamp' };
57
+ const _poll = { image: '_v1Media', options: '_option' };
58
+ const _pollData = { poll: '_poll', design: '_design' };
59
+ const _pollDesign = { background: '_background' };
60
+ const _post = {
61
+ firstPublishedDate: 'google.protobuf.Timestamp',
62
+ lastPublishedDate: 'google.protobuf.Timestamp',
63
+ coverMedia: '_coverMedia',
64
+ heroImage: '_image',
65
+ metrics: '_metrics',
66
+ richContent: '_richContent',
67
+ moderationDetails: '_moderationDetails',
68
+ media: '_media',
69
+ };
70
+ const _queryPostCountStatsRequest = {
71
+ rangeStart: 'google.protobuf.Timestamp',
72
+ rangeEnd: 'google.protobuf.Timestamp',
73
+ };
74
+ const _queryPostCountStatsResponse = { stats: '_periodPostCount' };
75
+ const _queryPostsRequest = {};
76
+ const _queryPostsResponse = { posts: '_post' };
77
+ const _richContent = { nodes: '_node', metadata: '_metadata' };
78
+ const _v1Media = { duration: 'google.protobuf.DoubleValue' };
79
+ const _video = { thumbnail: '_image' };
80
+ const _videoData = { video: '_v1Media', thumbnail: '_v1Media' };
81
+ const _videoResolution = {
82
+ urlExpirationDate: 'google.protobuf.Timestamp',
83
+ poster: '_image',
84
+ };
85
+ const _videoV2 = {
86
+ urlExpirationDate: 'google.protobuf.Timestamp',
87
+ resolutions: '_videoResolution',
88
+ posters: '_image',
89
+ };
90
+ const _wixMedia = { image: '_image', videoV2: '_videoV2' };
91
+ function resolveComWixpressNpmCommunitiesPlatformizedBlogBlogStatsServiceUrl(opts) {
92
+ const domainToMappings = {
93
+ 'api._api_base_domain_': [
94
+ {
95
+ srcPath: '/communities-blog-node-api',
96
+ destPath: '',
97
+ },
98
+ ],
99
+ 'www._base_domain_': [
100
+ {
101
+ srcPath: '/_api/communities-blog-node-api',
102
+ destPath: '',
103
+ },
104
+ {
105
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
106
+ destPath: '/v3/posts',
107
+ },
108
+ {
109
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
110
+ destPath: '/v3/categories',
111
+ },
112
+ {
113
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
114
+ destPath: '/v3/tags',
115
+ },
116
+ {
117
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
118
+ destPath: '/v2/stats',
119
+ },
120
+ ],
121
+ 'apps._base_domain_': [
122
+ {
123
+ srcPath: '/_api/communities-blog-node-api',
124
+ destPath: '',
125
+ },
126
+ {
127
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
128
+ destPath: '/v3/posts',
129
+ },
130
+ {
131
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
132
+ destPath: '/v3/categories',
133
+ },
134
+ {
135
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
136
+ destPath: '/v3/tags',
137
+ },
138
+ {
139
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
140
+ destPath: '/v2/stats',
141
+ },
142
+ ],
143
+ _: [
144
+ {
145
+ srcPath: '/_api/communities-blog-node-api',
146
+ destPath: '',
147
+ },
148
+ {
149
+ srcPath: '/_api/communities-blog-node-api/_api/blogs/this',
150
+ destPath: '/_api/blogs/this',
151
+ },
152
+ {
153
+ srcPath: '/_api/communities-blog-node-api/_api/categories',
154
+ destPath: '/_api/categories',
155
+ },
156
+ {
157
+ srcPath: '/_api/communities-blog-node-api/_api/site-properties',
158
+ destPath: '/_api/site-properties',
159
+ },
160
+ {
161
+ srcPath: '/_api/communities-blog-node-api/_api/posts/content',
162
+ destPath: '/_api/posts/content',
163
+ },
164
+ {
165
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
166
+ destPath: '/v3/posts',
167
+ },
168
+ {
169
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
170
+ destPath: '/v3/categories',
171
+ },
172
+ {
173
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
174
+ destPath: '/v3/tags',
175
+ },
176
+ {
177
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
178
+ destPath: '/v2/stats',
179
+ },
180
+ ],
181
+ 'editor._base_domain_': [
182
+ {
183
+ srcPath: '/_api/communities-blog-node-api',
184
+ destPath: '',
185
+ },
186
+ ],
187
+ 'blocks._base_domain_': [
188
+ {
189
+ srcPath: '/_api/communities-blog-node-api',
190
+ destPath: '',
191
+ },
192
+ ],
193
+ 'create.editorx': [
194
+ {
195
+ srcPath: '/_api/communities-blog-node-api',
196
+ destPath: '',
197
+ },
198
+ ],
199
+ '*.dev.wix-code.com': [
200
+ {
201
+ srcPath: '/_api/communities-blog-node-api',
202
+ destPath: '',
203
+ },
204
+ ],
205
+ '*.pub.wix-code.com': [
206
+ {
207
+ srcPath: '/_api/communities-blog-node-api',
208
+ destPath: '',
209
+ },
210
+ ],
211
+ 'bo._base_domain_': [
212
+ {
213
+ srcPath: '/_api/communities-blog-node-api',
214
+ destPath: '',
215
+ },
216
+ {
217
+ srcPath: '/_api/communities-blog-node-api',
218
+ destPath: '',
219
+ },
220
+ ],
221
+ 'manage._base_domain_': [
222
+ {
223
+ srcPath: '/_api/communities-blog-node-api',
224
+ destPath: '',
225
+ },
226
+ ],
227
+ 'social-blog._base_domain_': [
228
+ {
229
+ srcPath: '/_api/communities-blog-node-api',
230
+ destPath: '',
231
+ },
232
+ ],
233
+ 'editor.wixapps.net': [
234
+ {
235
+ srcPath: '/_api/communities-blog-node-api',
236
+ destPath: '',
237
+ },
238
+ ],
239
+ 'dev._base_domain_': [
240
+ {
241
+ srcPath: '/_api/communities-blog-node-api',
242
+ destPath: '',
243
+ },
244
+ ],
245
+ 'www.wixapis.com': [
246
+ {
247
+ srcPath: '/blog/v2',
248
+ destPath: '/v2',
249
+ },
250
+ {
251
+ srcPath: '/blog/v3',
252
+ destPath: '/v3',
253
+ },
254
+ {
255
+ srcPath: '/v2/stats',
256
+ destPath: '/v2/stats',
257
+ },
258
+ {
259
+ srcPath: '/v3/tags',
260
+ destPath: '/v3/tags',
261
+ },
262
+ {
263
+ srcPath: '/v3/categories',
264
+ destPath: '/v3/categories',
265
+ },
266
+ {
267
+ srcPath: '/v3/posts',
268
+ destPath: '/v3/posts',
269
+ },
270
+ {
271
+ srcPath: '/blog/v3/posts',
272
+ destPath: '/v3/posts',
273
+ },
274
+ {
275
+ srcPath: '/blog/v3/categories',
276
+ destPath: '/v3/categories',
277
+ },
278
+ {
279
+ srcPath: '/blog/v3/tags',
280
+ destPath: '/v3/tags',
281
+ },
282
+ {
283
+ srcPath: '/blog/v2/stats',
284
+ destPath: '/v2/stats',
285
+ },
286
+ ],
287
+ };
288
+ return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
289
+ }
290
+ function resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl(opts) {
291
+ const domainToMappings = {
292
+ 'api._api_base_domain_': [
293
+ {
294
+ srcPath: '/communities-blog-node-api',
295
+ destPath: '',
296
+ },
297
+ ],
298
+ 'www._base_domain_': [
299
+ {
300
+ srcPath: '/_api/communities-blog-node-api',
301
+ destPath: '',
302
+ },
303
+ {
304
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
305
+ destPath: '/v3/posts',
306
+ },
307
+ {
308
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
309
+ destPath: '/v3/categories',
310
+ },
311
+ {
312
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
313
+ destPath: '/v3/tags',
314
+ },
315
+ {
316
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
317
+ destPath: '/v2/stats',
318
+ },
319
+ ],
320
+ 'apps._base_domain_': [
321
+ {
322
+ srcPath: '/_api/communities-blog-node-api',
323
+ destPath: '',
324
+ },
325
+ {
326
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
327
+ destPath: '/v3/posts',
328
+ },
329
+ {
330
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
331
+ destPath: '/v3/categories',
332
+ },
333
+ {
334
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
335
+ destPath: '/v3/tags',
336
+ },
337
+ {
338
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
339
+ destPath: '/v2/stats',
340
+ },
341
+ ],
342
+ _: [
343
+ {
344
+ srcPath: '/_api/communities-blog-node-api',
345
+ destPath: '',
346
+ },
347
+ {
348
+ srcPath: '/_api/communities-blog-node-api/_api/blogs/this',
349
+ destPath: '/_api/blogs/this',
350
+ },
351
+ {
352
+ srcPath: '/_api/communities-blog-node-api/_api/categories',
353
+ destPath: '/_api/categories',
354
+ },
355
+ {
356
+ srcPath: '/_api/communities-blog-node-api/_api/site-properties',
357
+ destPath: '/_api/site-properties',
358
+ },
359
+ {
360
+ srcPath: '/_api/communities-blog-node-api/_api/posts/content',
361
+ destPath: '/_api/posts/content',
362
+ },
363
+ {
364
+ srcPath: '/_api/communities-blog-node-api/v3/posts',
365
+ destPath: '/v3/posts',
366
+ },
367
+ {
368
+ srcPath: '/_api/communities-blog-node-api/v3/categories',
369
+ destPath: '/v3/categories',
370
+ },
371
+ {
372
+ srcPath: '/_api/communities-blog-node-api/v3/tags',
373
+ destPath: '/v3/tags',
374
+ },
375
+ {
376
+ srcPath: '/_api/communities-blog-node-api/v2/stats',
377
+ destPath: '/v2/stats',
378
+ },
379
+ ],
380
+ 'editor._base_domain_': [
381
+ {
382
+ srcPath: '/_api/communities-blog-node-api',
383
+ destPath: '',
384
+ },
385
+ ],
386
+ 'blocks._base_domain_': [
387
+ {
388
+ srcPath: '/_api/communities-blog-node-api',
389
+ destPath: '',
390
+ },
391
+ ],
392
+ 'create.editorx': [
393
+ {
394
+ srcPath: '/_api/communities-blog-node-api',
395
+ destPath: '',
396
+ },
397
+ ],
398
+ '*.dev.wix-code.com': [
399
+ {
400
+ srcPath: '/_api/communities-blog-node-api',
401
+ destPath: '',
402
+ },
403
+ ],
404
+ '*.pub.wix-code.com': [
405
+ {
406
+ srcPath: '/_api/communities-blog-node-api',
407
+ destPath: '',
408
+ },
409
+ ],
410
+ 'bo._base_domain_': [
411
+ {
412
+ srcPath: '/_api/communities-blog-node-api',
413
+ destPath: '',
414
+ },
415
+ {
416
+ srcPath: '/_api/communities-blog-node-api',
417
+ destPath: '',
418
+ },
419
+ ],
420
+ 'manage._base_domain_': [
421
+ {
422
+ srcPath: '/_api/communities-blog-node-api',
423
+ destPath: '',
424
+ },
425
+ ],
426
+ 'social-blog._base_domain_': [
427
+ {
428
+ srcPath: '/_api/communities-blog-node-api',
429
+ destPath: '',
430
+ },
431
+ ],
432
+ 'editor.wixapps.net': [
433
+ {
434
+ srcPath: '/_api/communities-blog-node-api',
435
+ destPath: '',
436
+ },
437
+ ],
438
+ 'dev._base_domain_': [
439
+ {
440
+ srcPath: '/_api/communities-blog-node-api',
441
+ destPath: '',
442
+ },
443
+ ],
444
+ 'www.wixapis.com': [
445
+ {
446
+ srcPath: '/blog/v2',
447
+ destPath: '/v2',
448
+ },
449
+ {
450
+ srcPath: '/blog/v3',
451
+ destPath: '/v3',
452
+ },
453
+ {
454
+ srcPath: '/v2/stats',
455
+ destPath: '/v2/stats',
456
+ },
457
+ {
458
+ srcPath: '/v3/tags',
459
+ destPath: '/v3/tags',
460
+ },
461
+ {
462
+ srcPath: '/v3/categories',
463
+ destPath: '/v3/categories',
464
+ },
465
+ {
466
+ srcPath: '/v3/posts',
467
+ destPath: '/v3/posts',
468
+ },
469
+ {
470
+ srcPath: '/blog/v3/posts',
471
+ destPath: '/v3/posts',
472
+ },
473
+ {
474
+ srcPath: '/blog/v3/categories',
475
+ destPath: '/v3/categories',
476
+ },
477
+ {
478
+ srcPath: '/blog/v3/tags',
479
+ destPath: '/v3/tags',
480
+ },
481
+ {
482
+ srcPath: '/blog/v2/stats',
483
+ destPath: '/v2/stats',
484
+ },
485
+ ],
486
+ };
487
+ return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
488
+ }
489
+ /**
490
+ * Gets a post by the specified ID.
491
+ *
492
+ *
493
+ * The `getPost()` function returns a Promise that resolves to a post whose ID matches the given ID.
494
+ *
495
+ */
496
+ function getPost(payload) {
497
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getPostRequest, {});
498
+ const { fromJSON: fromRes } = ambassador_1.serializer(_getPostResponse, {
499
+ _appEmbedData,
500
+ _audioData,
501
+ _background,
502
+ _coverMedia,
503
+ _design,
504
+ _galleryData,
505
+ _galleryOptions,
506
+ _image,
507
+ _imageData,
508
+ _item,
509
+ _itemImage,
510
+ _itemStyle,
511
+ _itemVideo,
512
+ _mapData,
513
+ _mapSettings,
514
+ _media,
515
+ _metadata,
516
+ _metrics,
517
+ _moderationDetails,
518
+ _node,
519
+ _option,
520
+ _poll,
521
+ _pollData,
522
+ _pollDesign,
523
+ _post,
524
+ _richContent,
525
+ _v1Media,
526
+ _video,
527
+ _videoData,
528
+ _videoResolution,
529
+ _videoV2,
530
+ _wixMedia,
531
+ });
532
+ function __getPost({ host }) {
533
+ const serializedData = toReq(payload);
534
+ const metadata = {
535
+ method: 'GET',
536
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
537
+ protoPath: '/v3/posts/{postId}',
538
+ data: serializedData,
539
+ host,
540
+ }),
541
+ params: metro_runtime_1.toURLSearchParams(serializedData),
542
+ transformResponse: fromRes,
543
+ };
544
+ return metadata;
545
+ }
546
+ __getPost.fromReq = fromReq;
547
+ return __getPost;
548
+ }
549
+ exports.getPost = getPost;
550
+ /**
551
+ * Gets a post by the provided slug.
552
+ *
553
+ *
554
+ * The `getPostBySlug()` function returns a Promise that resolves to a post whose slug matches the given slug.
555
+ *
556
+ * The `slug` is the end of a post's URL that refers to a specific post. For example, if a post's URL is `https:/example.com/blog/post/my-post-slug`, the slug is `my-post-slug`. The slug is case-sensitive, and is generally derived from the post title, unless specified otherwise.
557
+ */
558
+ function getPostBySlug(payload) {
559
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getPostBySlugRequest, {});
560
+ const { fromJSON: fromRes } = ambassador_1.serializer(_getPostBySlugResponse, {
561
+ _appEmbedData,
562
+ _audioData,
563
+ _background,
564
+ _coverMedia,
565
+ _design,
566
+ _galleryData,
567
+ _galleryOptions,
568
+ _image,
569
+ _imageData,
570
+ _item,
571
+ _itemImage,
572
+ _itemStyle,
573
+ _itemVideo,
574
+ _mapData,
575
+ _mapSettings,
576
+ _media,
577
+ _metadata,
578
+ _metrics,
579
+ _moderationDetails,
580
+ _node,
581
+ _option,
582
+ _poll,
583
+ _pollData,
584
+ _pollDesign,
585
+ _post,
586
+ _richContent,
587
+ _v1Media,
588
+ _video,
589
+ _videoData,
590
+ _videoResolution,
591
+ _videoV2,
592
+ _wixMedia,
593
+ });
594
+ function __getPostBySlug({ host }) {
595
+ const serializedData = toReq(payload);
596
+ const metadata = {
597
+ method: 'GET',
598
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
599
+ protoPath: '/v3/posts/slugs/{slug}',
600
+ data: serializedData,
601
+ host,
602
+ }),
603
+ params: metro_runtime_1.toURLSearchParams(serializedData),
604
+ transformResponse: fromRes,
605
+ };
606
+ return metadata;
607
+ }
608
+ __getPostBySlug.fromReq = fromReq;
609
+ return __getPostBySlug;
610
+ }
611
+ exports.getPostBySlug = getPostBySlug;
612
+ /**
613
+ * Retrieves a list of published posts.
614
+ *
615
+ *
616
+ * The `listPosts()` function returns a Promise that resolves to a list of up to 100 published posts.
617
+ *
618
+ * Using the `options` parameter, you can filter your list of posts, set the amount of posts to be returned, and sort your list in a specified order.
619
+ *
620
+ * By default, the list is sorted by `firstPublishedDate` in descending order, and the amount of posts returned is 50.
621
+ */
622
+ function listPosts(payload) {
623
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_listPostsRequest, {});
624
+ const { fromJSON: fromRes } = ambassador_1.serializer(_listPostsResponse, {
625
+ _appEmbedData,
626
+ _audioData,
627
+ _background,
628
+ _coverMedia,
629
+ _design,
630
+ _galleryData,
631
+ _galleryOptions,
632
+ _image,
633
+ _imageData,
634
+ _item,
635
+ _itemImage,
636
+ _itemStyle,
637
+ _itemVideo,
638
+ _mapData,
639
+ _mapSettings,
640
+ _media,
641
+ _metadata,
642
+ _metrics,
643
+ _moderationDetails,
644
+ _node,
645
+ _option,
646
+ _poll,
647
+ _pollData,
648
+ _pollDesign,
649
+ _post,
650
+ _richContent,
651
+ _v1Media,
652
+ _video,
653
+ _videoData,
654
+ _videoResolution,
655
+ _videoV2,
656
+ _wixMedia,
657
+ });
658
+ function __listPosts({ host }) {
659
+ const serializedData = toReq(payload);
660
+ const metadata = {
661
+ method: 'GET',
662
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
663
+ protoPath: '/v3/posts',
664
+ data: serializedData,
665
+ host,
666
+ }),
667
+ params: metro_runtime_1.toURLSearchParams(serializedData),
668
+ transformResponse: fromRes,
669
+ };
670
+ return metadata;
671
+ }
672
+ __listPosts.fromReq = fromReq;
673
+ return __listPosts;
674
+ }
675
+ exports.listPosts = listPosts;
676
+ /**
677
+ * Creates a query to retrieve a list of posts.
678
+ *
679
+ *
680
+ * The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a [`PostsQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/post/postsquerybuilder) object.
681
+ *
682
+ * The returned object contains the query definition which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-blog-backend/post/postsquerybuilder/find) function.
683
+ *
684
+ * 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.
685
+ *
686
+ * `queryPosts()` runs with these `PostsQueryBuilder` defaults that can be overridden:
687
+ * + `limit(50)`
688
+ * + `descending('firstPublishedDate')`
689
+ *
690
+ * Note that the default limit is `'50'`, but the max limit is `'100'`.
691
+ *
692
+ * To learn how to query posts, refer to the table below.
693
+ *
694
+ * 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`.
695
+ */
696
+ function queryPosts(payload) {
697
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_queryPostsRequest, {});
698
+ const { fromJSON: fromRes } = ambassador_1.serializer(_queryPostsResponse, {
699
+ _appEmbedData,
700
+ _audioData,
701
+ _background,
702
+ _coverMedia,
703
+ _design,
704
+ _galleryData,
705
+ _galleryOptions,
706
+ _image,
707
+ _imageData,
708
+ _item,
709
+ _itemImage,
710
+ _itemStyle,
711
+ _itemVideo,
712
+ _mapData,
713
+ _mapSettings,
714
+ _media,
715
+ _metadata,
716
+ _metrics,
717
+ _moderationDetails,
718
+ _node,
719
+ _option,
720
+ _poll,
721
+ _pollData,
722
+ _pollDesign,
723
+ _post,
724
+ _richContent,
725
+ _v1Media,
726
+ _video,
727
+ _videoData,
728
+ _videoResolution,
729
+ _videoV2,
730
+ _wixMedia,
731
+ });
732
+ function __queryPosts({ host }) {
733
+ const serializedData = toReq(payload);
734
+ const metadata = {
735
+ method: 'POST',
736
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
737
+ protoPath: '/v3/posts/query',
738
+ data: serializedData,
739
+ host,
740
+ }),
741
+ data: serializedData,
742
+ transformResponse: fromRes,
743
+ };
744
+ return metadata;
745
+ }
746
+ __queryPosts.fromReq = fromReq;
747
+ return __queryPosts;
748
+ }
749
+ exports.queryPosts = queryPosts;
750
+ /**
751
+ * Gets a specified post's metrics.
752
+ *
753
+ *
754
+ * The `getPostMetrics()` function returns a Promise that resolves to the specified post's metrics.
755
+ *
756
+ * A post's metrics include the comments, likes, and views the post receives.
757
+ */
758
+ function getPostMetrics(payload) {
759
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getPostMetricsRequest, {});
760
+ const { fromJSON: fromRes } = ambassador_1.serializer(_getPostMetricsResponse, {
761
+ _metrics,
762
+ });
763
+ function __getPostMetrics({ host }) {
764
+ const serializedData = toReq(payload);
765
+ const metadata = {
766
+ method: 'GET',
767
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
768
+ protoPath: '/v3/posts/{postId}/metrics',
769
+ data: serializedData,
770
+ host,
771
+ }),
772
+ params: metro_runtime_1.toURLSearchParams(serializedData),
773
+ transformResponse: fromRes,
774
+ };
775
+ return metadata;
776
+ }
777
+ __getPostMetrics.fromReq = fromReq;
778
+ return __getPostMetrics;
779
+ }
780
+ exports.getPostMetrics = getPostMetrics;
781
+ /**
782
+ * Retrieves the number of published posts per month within a specified time range.
783
+ *
784
+ *
785
+ * The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
786
+ *
787
+ * You can set the time range using the `rangeStart` and `months` properties. The time range always starts on the 1st of the month set in `rangeStart`. It includes the number of `months` following `rangeStart`. For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`, the time range will be from `'2022-03-01'` until `'2022-06-30'`. Notice that the time range ends on the last of the month.
788
+ *
789
+ * >**Note:** If there are no published posts in a specific month, that month is not included in the response. For example, let's say a blog has `0` posts dated in February 2022. `months` and `rangeStart` are set to `3` and `'2022-01-01'` respectively. Your result will only include the `postCount` from January and March.
790
+ */
791
+ function queryPostCountStats(payload) {
792
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_queryPostCountStatsRequest, {});
793
+ const { fromJSON: fromRes } = ambassador_1.serializer(_queryPostCountStatsResponse, {
794
+ _periodPostCount,
795
+ });
796
+ function __queryPostCountStats({ host }) {
797
+ const serializedData = toReq(payload);
798
+ const metadata = {
799
+ method: 'GET',
800
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogBlogStatsServiceUrl({
801
+ protoPath: '/v2/stats/post/count',
802
+ data: serializedData,
803
+ host,
804
+ }),
805
+ params: metro_runtime_1.toURLSearchParams(serializedData),
806
+ transformResponse: fromRes,
807
+ };
808
+ return metadata;
809
+ }
810
+ __queryPostCountStats.fromReq = fromReq;
811
+ return __queryPostCountStats;
812
+ }
813
+ exports.queryPostCountStats = queryPostCountStats;
814
+ /**
815
+ * Gets the total amount of published posts on the blog.
816
+ *
817
+ *
818
+ * The `getTotalPosts()` function returns a Promise that resolves to the total amount of published posts on your blog's site.
819
+ *
820
+ *
821
+ * You can use the `language` option to filter posts for a specified language.
822
+ */
823
+ function getTotalPosts(payload) {
824
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getTotalPostsRequest, {});
825
+ const { fromJSON: fromRes } = ambassador_1.serializer(_getTotalPostsResponse, {});
826
+ function __getTotalPosts({ host }) {
827
+ const serializedData = toReq(payload);
828
+ const metadata = {
829
+ method: 'GET',
830
+ url: resolveComWixpressNpmCommunitiesPlatformizedBlogBlogStatsServiceUrl({
831
+ protoPath: '/v2/stats/posts/total',
832
+ data: serializedData,
833
+ host,
834
+ }),
835
+ params: metro_runtime_1.toURLSearchParams(serializedData),
836
+ transformResponse: fromRes,
837
+ };
838
+ return metadata;
839
+ }
840
+ __getTotalPosts.fromReq = fromReq;
841
+ return __getTotalPosts;
842
+ }
843
+ exports.getTotalPosts = getTotalPosts;
844
+ //# sourceMappingURL=blog-v3-post.http.js.map