@wix/blog 1.0.217 → 1.0.218

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 (87) hide show
  1. package/build/cjs/index.js +5 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.js +5 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.js +5 -1
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/src/blog-v3-category.http.js +54 -61
  8. package/build/cjs/src/blog-v3-category.http.js.map +1 -1
  9. package/build/cjs/src/blog-v3-category.meta.d.ts +1 -1
  10. package/build/cjs/src/blog-v3-category.meta.js +5 -1
  11. package/build/cjs/src/blog-v3-category.meta.js.map +1 -1
  12. package/build/cjs/src/blog-v3-category.public.d.ts +5 -5
  13. package/build/cjs/src/blog-v3-category.types.d.ts +41 -1
  14. package/build/cjs/src/blog-v3-category.types.js +4 -2
  15. package/build/cjs/src/blog-v3-category.types.js.map +1 -1
  16. package/build/cjs/src/blog-v3-category.universal.d.ts +13 -1
  17. package/build/cjs/src/blog-v3-category.universal.js +15 -7
  18. package/build/cjs/src/blog-v3-category.universal.js.map +1 -1
  19. package/build/cjs/src/blog-v3-draft.http.js +898 -578
  20. package/build/cjs/src/blog-v3-draft.http.js.map +1 -1
  21. package/build/cjs/src/blog-v3-draft.meta.d.ts +1 -1
  22. package/build/cjs/src/blog-v3-draft.meta.js +5 -1
  23. package/build/cjs/src/blog-v3-draft.meta.js.map +1 -1
  24. package/build/cjs/src/blog-v3-draft.public.d.ts +8 -8
  25. package/build/cjs/src/blog-v3-draft.types.d.ts +1 -1
  26. package/build/cjs/src/blog-v3-draft.types.js +38 -38
  27. package/build/cjs/src/blog-v3-draft.types.js.map +1 -1
  28. package/build/cjs/src/blog-v3-draft.universal.d.ts +1 -1
  29. package/build/cjs/src/blog-v3-draft.universal.js +43 -39
  30. package/build/cjs/src/blog-v3-draft.universal.js.map +1 -1
  31. package/build/cjs/src/blog-v3-post.http.js +283 -269
  32. package/build/cjs/src/blog-v3-post.http.js.map +1 -1
  33. package/build/cjs/src/blog-v3-post.meta.d.ts +1 -1
  34. package/build/cjs/src/blog-v3-post.meta.js +5 -1
  35. package/build/cjs/src/blog-v3-post.meta.js.map +1 -1
  36. package/build/cjs/src/blog-v3-post.public.d.ts +7 -7
  37. package/build/cjs/src/blog-v3-post.types.d.ts +11 -1
  38. package/build/cjs/src/blog-v3-post.types.js +39 -39
  39. package/build/cjs/src/blog-v3-post.types.js.map +1 -1
  40. package/build/cjs/src/blog-v3-post.universal.d.ts +11 -1
  41. package/build/cjs/src/blog-v3-post.universal.js +44 -40
  42. package/build/cjs/src/blog-v3-post.universal.js.map +1 -1
  43. package/build/cjs/src/blog-v3-tag.http.js +34 -41
  44. package/build/cjs/src/blog-v3-tag.http.js.map +1 -1
  45. package/build/cjs/src/blog-v3-tag.meta.d.ts +1 -1
  46. package/build/cjs/src/blog-v3-tag.meta.js +5 -1
  47. package/build/cjs/src/blog-v3-tag.meta.js.map +1 -1
  48. package/build/cjs/src/blog-v3-tag.public.d.ts +4 -4
  49. package/build/cjs/src/blog-v3-tag.types.js +2 -2
  50. package/build/cjs/src/blog-v3-tag.types.js.map +1 -1
  51. package/build/cjs/src/blog-v3-tag.universal.js +7 -3
  52. package/build/cjs/src/blog-v3-tag.universal.js.map +1 -1
  53. package/build/es/src/blog-v3-category.http.js +54 -61
  54. package/build/es/src/blog-v3-category.http.js.map +1 -1
  55. package/build/es/src/blog-v3-category.meta.d.ts +1 -1
  56. package/build/es/src/blog-v3-category.public.d.ts +5 -5
  57. package/build/es/src/blog-v3-category.types.d.ts +41 -1
  58. package/build/es/src/blog-v3-category.types.js +2 -0
  59. package/build/es/src/blog-v3-category.types.js.map +1 -1
  60. package/build/es/src/blog-v3-category.universal.d.ts +13 -1
  61. package/build/es/src/blog-v3-category.universal.js +8 -4
  62. package/build/es/src/blog-v3-category.universal.js.map +1 -1
  63. package/build/es/src/blog-v3-draft.http.js +898 -578
  64. package/build/es/src/blog-v3-draft.http.js.map +1 -1
  65. package/build/es/src/blog-v3-draft.meta.d.ts +1 -1
  66. package/build/es/src/blog-v3-draft.public.d.ts +8 -8
  67. package/build/es/src/blog-v3-draft.types.d.ts +1 -1
  68. package/build/es/src/blog-v3-draft.types.js +1 -1
  69. package/build/es/src/blog-v3-draft.universal.d.ts +1 -1
  70. package/build/es/src/blog-v3-draft.universal.js +1 -1
  71. package/build/es/src/blog-v3-draft.universal.js.map +1 -1
  72. package/build/es/src/blog-v3-post.http.js +283 -269
  73. package/build/es/src/blog-v3-post.http.js.map +1 -1
  74. package/build/es/src/blog-v3-post.meta.d.ts +1 -1
  75. package/build/es/src/blog-v3-post.public.d.ts +7 -7
  76. package/build/es/src/blog-v3-post.types.d.ts +11 -1
  77. package/build/es/src/blog-v3-post.types.js +1 -1
  78. package/build/es/src/blog-v3-post.types.js.map +1 -1
  79. package/build/es/src/blog-v3-post.universal.d.ts +11 -1
  80. package/build/es/src/blog-v3-post.universal.js +1 -1
  81. package/build/es/src/blog-v3-post.universal.js.map +1 -1
  82. package/build/es/src/blog-v3-tag.http.js +34 -41
  83. package/build/es/src/blog-v3-tag.http.js.map +1 -1
  84. package/build/es/src/blog-v3-tag.meta.d.ts +1 -1
  85. package/build/es/src/blog-v3-tag.public.d.ts +4 -4
  86. package/build/es/src/blog-v3-tag.universal.js.map +1 -1
  87. package/package.json +9 -5
@@ -1,91 +1,10 @@
1
1
  import { toURLSearchParams } from '@wix/metro-runtime';
2
- import { serializer } from '@wix/metro-runtime/ambassador';
2
+ import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
3
+ import { transformRESTBytesToSDKBytes } from '@wix/sdk-runtime/transformations/bytes';
4
+ import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
5
+ import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
6
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
3
7
  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 _commonImage = { urlExpirationDate: 'google.protobuf.Timestamp' };
8
- const _commonVideo = { thumbnail: '_commonImage' };
9
- const _coverMedia = { image: '_commonImage', video: '_commonVideo' };
10
- const _design = { poll: '_pollDesign' };
11
- const _galleryData = { items: '_item', options: '_galleryOptions' };
12
- const _galleryOptions = { item: '_itemStyle' };
13
- const _getPostBySlugRequest = {};
14
- const _getPostBySlugResponse = { post: '_post' };
15
- const _getPostMetricsRequest = {};
16
- const _getPostMetricsResponse = { metrics: '_metrics' };
17
- const _getPostRequest = {};
18
- const _getPostResponse = { post: '_post' };
19
- const _getTotalPostsRequest = {};
20
- const _getTotalPostsResponse = {};
21
- const _image = { media: '_v1Media' };
22
- const _imageData = { image: '_v1Media' };
23
- const _item = { image: '_image', video: '_video' };
24
- const _itemStyle = { ratio: 'google.protobuf.DoubleValue' };
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 = { averageRating: 'FLOAT' };
38
- const _moderationDetails = {
39
- submittedDate: 'google.protobuf.Timestamp',
40
- moderationDate: 'google.protobuf.Timestamp',
41
- };
42
- const _node = {
43
- galleryData: '_galleryData',
44
- imageData: '_imageData',
45
- mapData: '_mapData',
46
- pollData: '_pollData',
47
- appEmbedData: '_appEmbedData',
48
- videoData: '_videoData',
49
- audioData: '_audioData',
50
- nodes: '_node',
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
- richContentCompressed: 'google.protobuf.BytesValue',
61
- coverMedia: '_coverMedia',
62
- heroImage: '_commonImage',
63
- metrics: '_metrics',
64
- richContent: '_richContent',
65
- moderationDetails: '_moderationDetails',
66
- media: '_media',
67
- };
68
- const _queryPostCountStatsRequest = {
69
- rangeStart: 'google.protobuf.Timestamp',
70
- rangeEnd: 'google.protobuf.Timestamp',
71
- };
72
- const _queryPostCountStatsResponse = { stats: '_periodPostCount' };
73
- const _queryPostsRequest = {};
74
- const _queryPostsResponse = { posts: '_post' };
75
- const _richContent = { nodes: '_node', metadata: '_metadata' };
76
- const _v1Media = { duration: 'google.protobuf.DoubleValue' };
77
- const _video = { media: '_v1Media', thumbnail: '_v1Media' };
78
- const _videoData = { video: '_v1Media', thumbnail: '_v1Media' };
79
- const _videoResolution = {
80
- urlExpirationDate: 'google.protobuf.Timestamp',
81
- poster: '_commonImage',
82
- };
83
- const _videoV2 = {
84
- urlExpirationDate: 'google.protobuf.Timestamp',
85
- resolutions: '_videoResolution',
86
- posters: '_commonImage',
87
- };
88
- const _wixMedia = { image: '_commonImage', videoV2: '_videoV2' };
89
8
  function resolveComWixpressNpmCommunitiesPlatformizedBlogBlogStatsServiceUrl(opts) {
90
9
  const domainToMappings = {
91
10
  'api._api_base_domain_': [
@@ -492,58 +411,80 @@ function resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl(opts)
492
411
  *
493
412
  */
494
413
  export function getPost(payload) {
495
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_getPostRequest, {});
496
- const { fromJSON: fromRes } = serializer(_getPostResponse, {
497
- _appEmbedData,
498
- _audioData,
499
- _background,
500
- _commonImage,
501
- _commonVideo,
502
- _coverMedia,
503
- _design,
504
- _galleryData,
505
- _galleryOptions,
506
- _image,
507
- _imageData,
508
- _item,
509
- _itemStyle,
510
- _mapData,
511
- _mapSettings,
512
- _media,
513
- _metadata,
514
- _metrics,
515
- _moderationDetails,
516
- _node,
517
- _option,
518
- _poll,
519
- _pollData,
520
- _pollDesign,
521
- _post,
522
- _richContent,
523
- _v1Media,
524
- _video,
525
- _videoData,
526
- _videoResolution,
527
- _videoV2,
528
- _wixMedia,
529
- });
530
414
  function __getPost({ host }) {
531
- const serializedData = toReq(payload);
532
415
  const metadata = {
533
416
  entityFqdn: 'wix.blog.v3.post',
534
417
  method: 'GET',
535
418
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost',
536
419
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
537
420
  protoPath: '/v3/posts/{postId}',
538
- data: serializedData,
421
+ data: payload,
539
422
  host,
540
423
  }),
541
- params: toURLSearchParams(serializedData),
542
- transformResponse: fromRes,
424
+ params: toURLSearchParams(payload),
425
+ transformResponse: (payload) => transformPaths(payload, [
426
+ {
427
+ transformFn: transformRESTTimestampToSDKTimestamp,
428
+ paths: [
429
+ { path: 'post.firstPublishedDate' },
430
+ { path: 'post.lastPublishedDate' },
431
+ { path: 'post.coverMedia.image.urlExpirationDate' },
432
+ { path: 'post.coverMedia.video.thumbnail.urlExpirationDate' },
433
+ { path: 'post.heroImage.urlExpirationDate' },
434
+ { path: 'post.richContent.metadata.createdTimestamp' },
435
+ { path: 'post.richContent.metadata.updatedTimestamp' },
436
+ { path: 'post.moderationDetails.submittedDate' },
437
+ { path: 'post.moderationDetails.moderationDate' },
438
+ { path: 'post.media.wixMedia.image.urlExpirationDate' },
439
+ { path: 'post.media.wixMedia.videoV2.urlExpirationDate' },
440
+ {
441
+ path: 'post.media.wixMedia.videoV2.resolutions.urlExpirationDate',
442
+ },
443
+ {
444
+ path: 'post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate',
445
+ },
446
+ { path: 'post.media.wixMedia.videoV2.posters.urlExpirationDate' },
447
+ ],
448
+ },
449
+ {
450
+ transformFn: transformRESTBytesToSDKBytes,
451
+ paths: [{ path: 'post.richContentCompressed' }],
452
+ },
453
+ {
454
+ transformFn: transformRESTFloatToSDKFloat,
455
+ paths: [
456
+ { path: 'post.metrics.averageRating' },
457
+ {
458
+ path: 'post.richContent.nodes.galleryData.items.image.media.duration',
459
+ },
460
+ {
461
+ path: 'post.richContent.nodes.galleryData.items.video.media.duration',
462
+ },
463
+ {
464
+ path: 'post.richContent.nodes.galleryData.items.video.thumbnail.duration',
465
+ },
466
+ { path: 'post.richContent.nodes.galleryData.options.item.ratio' },
467
+ { path: 'post.richContent.nodes.imageData.image.duration' },
468
+ { path: 'post.richContent.nodes.mapData.mapSettings.lat' },
469
+ { path: 'post.richContent.nodes.mapData.mapSettings.lng' },
470
+ { path: 'post.richContent.nodes.pollData.poll.image.duration' },
471
+ {
472
+ path: 'post.richContent.nodes.pollData.poll.options.image.duration',
473
+ },
474
+ {
475
+ path: 'post.richContent.nodes.pollData.design.poll.background.image.duration',
476
+ },
477
+ { path: 'post.richContent.nodes.appEmbedData.image.duration' },
478
+ { path: 'post.richContent.nodes.videoData.video.duration' },
479
+ { path: 'post.richContent.nodes.videoData.thumbnail.duration' },
480
+ { path: 'post.richContent.nodes.audioData.audio.duration' },
481
+ { path: 'post.richContent.nodes.audioData.coverImage.duration' },
482
+ ],
483
+ },
484
+ ]),
543
485
  };
544
486
  return metadata;
545
487
  }
546
- __getPost.fromReq = fromReq;
547
488
  return __getPost;
548
489
  }
549
490
  /**
@@ -555,58 +496,80 @@ export function getPost(payload) {
555
496
  * 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.
556
497
  */
557
498
  export function getPostBySlug(payload) {
558
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_getPostBySlugRequest, {});
559
- const { fromJSON: fromRes } = serializer(_getPostBySlugResponse, {
560
- _appEmbedData,
561
- _audioData,
562
- _background,
563
- _commonImage,
564
- _commonVideo,
565
- _coverMedia,
566
- _design,
567
- _galleryData,
568
- _galleryOptions,
569
- _image,
570
- _imageData,
571
- _item,
572
- _itemStyle,
573
- _mapData,
574
- _mapSettings,
575
- _media,
576
- _metadata,
577
- _metrics,
578
- _moderationDetails,
579
- _node,
580
- _option,
581
- _poll,
582
- _pollData,
583
- _pollDesign,
584
- _post,
585
- _richContent,
586
- _v1Media,
587
- _video,
588
- _videoData,
589
- _videoResolution,
590
- _videoV2,
591
- _wixMedia,
592
- });
593
499
  function __getPostBySlug({ host }) {
594
- const serializedData = toReq(payload);
595
500
  const metadata = {
596
501
  entityFqdn: 'wix.blog.v3.post',
597
502
  method: 'GET',
598
503
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostBySlug',
599
504
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
600
505
  protoPath: '/v3/posts/slugs/{slug}',
601
- data: serializedData,
506
+ data: payload,
602
507
  host,
603
508
  }),
604
- params: toURLSearchParams(serializedData),
605
- transformResponse: fromRes,
509
+ params: toURLSearchParams(payload),
510
+ transformResponse: (payload) => transformPaths(payload, [
511
+ {
512
+ transformFn: transformRESTTimestampToSDKTimestamp,
513
+ paths: [
514
+ { path: 'post.firstPublishedDate' },
515
+ { path: 'post.lastPublishedDate' },
516
+ { path: 'post.coverMedia.image.urlExpirationDate' },
517
+ { path: 'post.coverMedia.video.thumbnail.urlExpirationDate' },
518
+ { path: 'post.heroImage.urlExpirationDate' },
519
+ { path: 'post.richContent.metadata.createdTimestamp' },
520
+ { path: 'post.richContent.metadata.updatedTimestamp' },
521
+ { path: 'post.moderationDetails.submittedDate' },
522
+ { path: 'post.moderationDetails.moderationDate' },
523
+ { path: 'post.media.wixMedia.image.urlExpirationDate' },
524
+ { path: 'post.media.wixMedia.videoV2.urlExpirationDate' },
525
+ {
526
+ path: 'post.media.wixMedia.videoV2.resolutions.urlExpirationDate',
527
+ },
528
+ {
529
+ path: 'post.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate',
530
+ },
531
+ { path: 'post.media.wixMedia.videoV2.posters.urlExpirationDate' },
532
+ ],
533
+ },
534
+ {
535
+ transformFn: transformRESTBytesToSDKBytes,
536
+ paths: [{ path: 'post.richContentCompressed' }],
537
+ },
538
+ {
539
+ transformFn: transformRESTFloatToSDKFloat,
540
+ paths: [
541
+ { path: 'post.metrics.averageRating' },
542
+ {
543
+ path: 'post.richContent.nodes.galleryData.items.image.media.duration',
544
+ },
545
+ {
546
+ path: 'post.richContent.nodes.galleryData.items.video.media.duration',
547
+ },
548
+ {
549
+ path: 'post.richContent.nodes.galleryData.items.video.thumbnail.duration',
550
+ },
551
+ { path: 'post.richContent.nodes.galleryData.options.item.ratio' },
552
+ { path: 'post.richContent.nodes.imageData.image.duration' },
553
+ { path: 'post.richContent.nodes.mapData.mapSettings.lat' },
554
+ { path: 'post.richContent.nodes.mapData.mapSettings.lng' },
555
+ { path: 'post.richContent.nodes.pollData.poll.image.duration' },
556
+ {
557
+ path: 'post.richContent.nodes.pollData.poll.options.image.duration',
558
+ },
559
+ {
560
+ path: 'post.richContent.nodes.pollData.design.poll.background.image.duration',
561
+ },
562
+ { path: 'post.richContent.nodes.appEmbedData.image.duration' },
563
+ { path: 'post.richContent.nodes.videoData.video.duration' },
564
+ { path: 'post.richContent.nodes.videoData.thumbnail.duration' },
565
+ { path: 'post.richContent.nodes.audioData.audio.duration' },
566
+ { path: 'post.richContent.nodes.audioData.coverImage.duration' },
567
+ ],
568
+ },
569
+ ]),
606
570
  };
607
571
  return metadata;
608
572
  }
609
- __getPostBySlug.fromReq = fromReq;
610
573
  return __getPostBySlug;
611
574
  }
612
575
  /**
@@ -620,58 +583,84 @@ export function getPostBySlug(payload) {
620
583
  * By default, the list is sorted by `firstPublishedDate` in descending order, and the amount of posts returned is 50.
621
584
  */
622
585
  export function listPosts(payload) {
623
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_listPostsRequest, {});
624
- const { fromJSON: fromRes } = serializer(_listPostsResponse, {
625
- _appEmbedData,
626
- _audioData,
627
- _background,
628
- _commonImage,
629
- _commonVideo,
630
- _coverMedia,
631
- _design,
632
- _galleryData,
633
- _galleryOptions,
634
- _image,
635
- _imageData,
636
- _item,
637
- _itemStyle,
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
586
  function __listPosts({ host }) {
659
- const serializedData = toReq(payload);
660
587
  const metadata = {
661
588
  entityFqdn: 'wix.blog.v3.post',
662
589
  method: 'GET',
663
590
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.v3.PostService.ListPosts',
664
591
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
665
592
  protoPath: '/v3/posts',
666
- data: serializedData,
593
+ data: payload,
667
594
  host,
668
595
  }),
669
- params: toURLSearchParams(serializedData),
670
- transformResponse: fromRes,
596
+ params: toURLSearchParams(payload),
597
+ transformResponse: (payload) => transformPaths(payload, [
598
+ {
599
+ transformFn: transformRESTTimestampToSDKTimestamp,
600
+ paths: [
601
+ { path: 'posts.firstPublishedDate' },
602
+ { path: 'posts.lastPublishedDate' },
603
+ { path: 'posts.coverMedia.image.urlExpirationDate' },
604
+ { path: 'posts.coverMedia.video.thumbnail.urlExpirationDate' },
605
+ { path: 'posts.heroImage.urlExpirationDate' },
606
+ { path: 'posts.richContent.metadata.createdTimestamp' },
607
+ { path: 'posts.richContent.metadata.updatedTimestamp' },
608
+ { path: 'posts.moderationDetails.submittedDate' },
609
+ { path: 'posts.moderationDetails.moderationDate' },
610
+ { path: 'posts.media.wixMedia.image.urlExpirationDate' },
611
+ { path: 'posts.media.wixMedia.videoV2.urlExpirationDate' },
612
+ {
613
+ path: 'posts.media.wixMedia.videoV2.resolutions.urlExpirationDate',
614
+ },
615
+ {
616
+ path: 'posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate',
617
+ },
618
+ {
619
+ path: 'posts.media.wixMedia.videoV2.posters.urlExpirationDate',
620
+ },
621
+ ],
622
+ },
623
+ {
624
+ transformFn: transformRESTBytesToSDKBytes,
625
+ paths: [{ path: 'posts.richContentCompressed' }],
626
+ },
627
+ {
628
+ transformFn: transformRESTFloatToSDKFloat,
629
+ paths: [
630
+ { path: 'posts.metrics.averageRating' },
631
+ {
632
+ path: 'posts.richContent.nodes.galleryData.items.image.media.duration',
633
+ },
634
+ {
635
+ path: 'posts.richContent.nodes.galleryData.items.video.media.duration',
636
+ },
637
+ {
638
+ path: 'posts.richContent.nodes.galleryData.items.video.thumbnail.duration',
639
+ },
640
+ {
641
+ path: 'posts.richContent.nodes.galleryData.options.item.ratio',
642
+ },
643
+ { path: 'posts.richContent.nodes.imageData.image.duration' },
644
+ { path: 'posts.richContent.nodes.mapData.mapSettings.lat' },
645
+ { path: 'posts.richContent.nodes.mapData.mapSettings.lng' },
646
+ { path: 'posts.richContent.nodes.pollData.poll.image.duration' },
647
+ {
648
+ path: 'posts.richContent.nodes.pollData.poll.options.image.duration',
649
+ },
650
+ {
651
+ path: 'posts.richContent.nodes.pollData.design.poll.background.image.duration',
652
+ },
653
+ { path: 'posts.richContent.nodes.appEmbedData.image.duration' },
654
+ { path: 'posts.richContent.nodes.videoData.video.duration' },
655
+ { path: 'posts.richContent.nodes.videoData.thumbnail.duration' },
656
+ { path: 'posts.richContent.nodes.audioData.audio.duration' },
657
+ { path: 'posts.richContent.nodes.audioData.coverImage.duration' },
658
+ ],
659
+ },
660
+ ]),
671
661
  };
672
662
  return metadata;
673
663
  }
674
- __listPosts.fromReq = fromReq;
675
664
  return __listPosts;
676
665
  }
677
666
  /**
@@ -695,58 +684,84 @@ export function listPosts(payload) {
695
684
  * 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`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult/items) property in [`PostsQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult).
696
685
  */
697
686
  export function queryPosts(payload) {
698
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_queryPostsRequest, {});
699
- const { fromJSON: fromRes } = serializer(_queryPostsResponse, {
700
- _appEmbedData,
701
- _audioData,
702
- _background,
703
- _commonImage,
704
- _commonVideo,
705
- _coverMedia,
706
- _design,
707
- _galleryData,
708
- _galleryOptions,
709
- _image,
710
- _imageData,
711
- _item,
712
- _itemStyle,
713
- _mapData,
714
- _mapSettings,
715
- _media,
716
- _metadata,
717
- _metrics,
718
- _moderationDetails,
719
- _node,
720
- _option,
721
- _poll,
722
- _pollData,
723
- _pollDesign,
724
- _post,
725
- _richContent,
726
- _v1Media,
727
- _video,
728
- _videoData,
729
- _videoResolution,
730
- _videoV2,
731
- _wixMedia,
732
- });
733
687
  function __queryPosts({ host }) {
734
- const serializedData = toReq(payload);
735
688
  const metadata = {
736
689
  entityFqdn: 'wix.blog.v3.post',
737
690
  method: 'POST',
738
691
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts',
739
692
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
740
693
  protoPath: '/v3/posts/query',
741
- data: serializedData,
694
+ data: payload,
742
695
  host,
743
696
  }),
744
- data: serializedData,
745
- transformResponse: fromRes,
697
+ data: payload,
698
+ transformResponse: (payload) => transformPaths(payload, [
699
+ {
700
+ transformFn: transformRESTTimestampToSDKTimestamp,
701
+ paths: [
702
+ { path: 'posts.firstPublishedDate' },
703
+ { path: 'posts.lastPublishedDate' },
704
+ { path: 'posts.coverMedia.image.urlExpirationDate' },
705
+ { path: 'posts.coverMedia.video.thumbnail.urlExpirationDate' },
706
+ { path: 'posts.heroImage.urlExpirationDate' },
707
+ { path: 'posts.richContent.metadata.createdTimestamp' },
708
+ { path: 'posts.richContent.metadata.updatedTimestamp' },
709
+ { path: 'posts.moderationDetails.submittedDate' },
710
+ { path: 'posts.moderationDetails.moderationDate' },
711
+ { path: 'posts.media.wixMedia.image.urlExpirationDate' },
712
+ { path: 'posts.media.wixMedia.videoV2.urlExpirationDate' },
713
+ {
714
+ path: 'posts.media.wixMedia.videoV2.resolutions.urlExpirationDate',
715
+ },
716
+ {
717
+ path: 'posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate',
718
+ },
719
+ {
720
+ path: 'posts.media.wixMedia.videoV2.posters.urlExpirationDate',
721
+ },
722
+ ],
723
+ },
724
+ {
725
+ transformFn: transformRESTBytesToSDKBytes,
726
+ paths: [{ path: 'posts.richContentCompressed' }],
727
+ },
728
+ {
729
+ transformFn: transformRESTFloatToSDKFloat,
730
+ paths: [
731
+ { path: 'posts.metrics.averageRating' },
732
+ {
733
+ path: 'posts.richContent.nodes.galleryData.items.image.media.duration',
734
+ },
735
+ {
736
+ path: 'posts.richContent.nodes.galleryData.items.video.media.duration',
737
+ },
738
+ {
739
+ path: 'posts.richContent.nodes.galleryData.items.video.thumbnail.duration',
740
+ },
741
+ {
742
+ path: 'posts.richContent.nodes.galleryData.options.item.ratio',
743
+ },
744
+ { path: 'posts.richContent.nodes.imageData.image.duration' },
745
+ { path: 'posts.richContent.nodes.mapData.mapSettings.lat' },
746
+ { path: 'posts.richContent.nodes.mapData.mapSettings.lng' },
747
+ { path: 'posts.richContent.nodes.pollData.poll.image.duration' },
748
+ {
749
+ path: 'posts.richContent.nodes.pollData.poll.options.image.duration',
750
+ },
751
+ {
752
+ path: 'posts.richContent.nodes.pollData.design.poll.background.image.duration',
753
+ },
754
+ { path: 'posts.richContent.nodes.appEmbedData.image.duration' },
755
+ { path: 'posts.richContent.nodes.videoData.video.duration' },
756
+ { path: 'posts.richContent.nodes.videoData.thumbnail.duration' },
757
+ { path: 'posts.richContent.nodes.audioData.audio.duration' },
758
+ { path: 'posts.richContent.nodes.audioData.coverImage.duration' },
759
+ ],
760
+ },
761
+ ]),
746
762
  };
747
763
  return metadata;
748
764
  }
749
- __queryPosts.fromReq = fromReq;
750
765
  return __queryPosts;
751
766
  }
752
767
  /**
@@ -758,27 +773,26 @@ export function queryPosts(payload) {
758
773
  * A post's metrics include the comments, likes, and views the post receives.
759
774
  */
760
775
  export function getPostMetrics(payload) {
761
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_getPostMetricsRequest, {});
762
- const { fromJSON: fromRes } = serializer(_getPostMetricsResponse, {
763
- _metrics,
764
- });
765
776
  function __getPostMetrics({ host }) {
766
- const serializedData = toReq(payload);
767
777
  const metadata = {
768
778
  entityFqdn: 'wix.blog.v3.post',
769
779
  method: 'GET',
770
780
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostMetrics',
771
781
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3PostServiceUrl({
772
782
  protoPath: '/v3/posts/{postId}/metrics',
773
- data: serializedData,
783
+ data: payload,
774
784
  host,
775
785
  }),
776
- params: toURLSearchParams(serializedData),
777
- transformResponse: fromRes,
786
+ params: toURLSearchParams(payload),
787
+ transformResponse: (payload) => transformPaths(payload, [
788
+ {
789
+ transformFn: transformRESTFloatToSDKFloat,
790
+ paths: [{ path: 'metrics.averageRating' }],
791
+ },
792
+ ]),
778
793
  };
779
794
  return metadata;
780
795
  }
781
- __getPostMetrics.fromReq = fromReq;
782
796
  return __getPostMetrics;
783
797
  }
784
798
  /**
@@ -792,12 +806,13 @@ export function getPostMetrics(payload) {
792
806
  * >**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.
793
807
  */
794
808
  export function queryPostCountStats(payload) {
795
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_queryPostCountStatsRequest, {});
796
- const { fromJSON: fromRes } = serializer(_queryPostCountStatsResponse, {
797
- _periodPostCount,
798
- });
799
809
  function __queryPostCountStats({ host }) {
800
- const serializedData = toReq(payload);
810
+ const serializedData = transformPaths(payload, [
811
+ {
812
+ transformFn: transformSDKTimestampToRESTTimestamp,
813
+ paths: [{ path: 'rangeStart' }, { path: 'rangeEnd' }],
814
+ },
815
+ ]);
801
816
  const metadata = {
802
817
  entityFqdn: 'wix.blog.v3.post',
803
818
  method: 'GET',
@@ -808,11 +823,15 @@ export function queryPostCountStats(payload) {
808
823
  host,
809
824
  }),
810
825
  params: toURLSearchParams(serializedData),
811
- transformResponse: fromRes,
826
+ transformResponse: (payload) => transformPaths(payload, [
827
+ {
828
+ transformFn: transformRESTTimestampToSDKTimestamp,
829
+ paths: [{ path: 'stats.periodStart' }],
830
+ },
831
+ ]),
812
832
  };
813
833
  return metadata;
814
834
  }
815
- __queryPostCountStats.fromReq = fromReq;
816
835
  return __queryPostCountStats;
817
836
  }
818
837
  /**
@@ -825,25 +844,20 @@ export function queryPostCountStats(payload) {
825
844
  * You can use the `language` option to filter posts for a specified language.
826
845
  */
827
846
  export function getTotalPosts(payload) {
828
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_getTotalPostsRequest, {});
829
- const { fromJSON: fromRes } = serializer(_getTotalPostsResponse, {});
830
847
  function __getTotalPosts({ host }) {
831
- const serializedData = toReq(payload);
832
848
  const metadata = {
833
849
  entityFqdn: 'wix.blog.v3.post',
834
850
  method: 'GET',
835
851
  methodFqn: 'com.wixpress.npm.communities.platformized.blog.BlogStatsService.GetTotalPosts',
836
852
  url: resolveComWixpressNpmCommunitiesPlatformizedBlogBlogStatsServiceUrl({
837
853
  protoPath: '/v2/stats/posts/total',
838
- data: serializedData,
854
+ data: payload,
839
855
  host,
840
856
  }),
841
- params: toURLSearchParams(serializedData),
842
- transformResponse: fromRes,
857
+ params: toURLSearchParams(payload),
843
858
  };
844
859
  return metadata;
845
860
  }
846
- __getTotalPosts.fromReq = fromReq;
847
861
  return __getTotalPosts;
848
862
  }
849
863
  //# sourceMappingURL=blog-v3-post.http.js.map