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