@wix/auto_sdk_blog_posts 1.0.73 → 1.0.75
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.
- package/build/cjs/index.d.ts +22 -34
- package/build/cjs/index.js +86 -11
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +56 -24
- package/build/cjs/index.typings.js +59 -7
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +22 -3
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +22 -34
- package/build/es/index.mjs +86 -11
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +56 -24
- package/build/es/index.typings.mjs +57 -6
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +22 -3
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +22 -34
- package/build/internal/cjs/index.js +86 -11
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +56 -24
- package/build/internal/cjs/index.typings.js +59 -7
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +22 -3
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +22 -34
- package/build/internal/es/index.mjs +86 -11
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +56 -24
- package/build/internal/es/index.typings.mjs +57 -6
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +22 -3
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { QueryPostCountStatsOptions, QueryPostCountStatsResponse, GetTotalPostsOptions, GetTotalPostsResponse, GetPostOptions,
|
|
3
|
-
export { ActionEvent, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, BaseEventMetadata, BlockquoteData, BlogPaging, BookingData, Border, BorderColors, BulkGetPostReactionsRequest, BulkGetPostReactionsResponse, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, Category, CategoryTranslation, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, ConvertDraftJsToRichContentRequest, ConvertDraftJsToRichContentResponse, ConvertRichContentToDraftJsRequest, ConvertRichContentToDraftJsResponse, CoverMedia, CoverMediaMediaOneOf, CreateDraftPostFromTemplateRequest, CreateDraftPostFromTemplateResponse, Crop, CropWithLiterals, CursorPaging, Cursors, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, DraftPost, DraftPostTranslation, EmbedData, EmbedMedia, EmbedThumbnail, EmbedVideo, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, EventMetadata, Field, FieldWithLiterals, FileData, FileSource, FileSourceDataOneOf, FocalPoint, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GetPostBySlugRequest, GetPostMetricsRequest, GetPostRequest,
|
|
2
|
+
import { QueryPostCountStatsOptions, QueryPostCountStatsResponse, GetTotalPostsOptions, GetTotalPostsResponse, GetPostOptions, GetPostResponse, GetPostBySlugOptions, GetPostBySlugResponse, ListPostsOptions, ListPostsResponse, GetPostMetricsResponse, PostLikedEnvelope, PostUnlikedEnvelope, PostCreatedEnvelope, PostDeletedEnvelope, PostUpdatedEnvelope, PlatformQuery, typedQueryPosts, QueryPostsOptions, PostsQueryBuilder } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, BaseEventMetadata, BlockquoteData, BlogPaging, BookingData, Border, BorderColors, BulkGetPostReactionsRequest, BulkGetPostReactionsResponse, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, Category, CategoryTranslation, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, ConvertDraftJsToRichContentRequest, ConvertDraftJsToRichContentResponse, ConvertRichContentToDraftJsRequest, ConvertRichContentToDraftJsResponse, CoverMedia, CoverMediaMediaOneOf, CreateDraftPostFromTemplateRequest, CreateDraftPostFromTemplateResponse, Crop, CropWithLiterals, CursorPaging, Cursors, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, DraftPost, DraftPostTranslation, EmbedData, EmbedMedia, EmbedThumbnail, EmbedVideo, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, EventMetadata, Field, FieldWithLiterals, FileData, FileSource, FileSourceDataOneOf, FocalPoint, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GetPostBySlugRequest, GetPostCountPerMonthRequest, GetPostCountPerMonthResponse, GetPostMetricsRequest, GetPostRequest, GetPostTemplatesSort, GetPostTemplatesSortWithLiterals, GetPostsSort, GetPostsSortWithLiterals, GetTemplateRequest, GetTemplateResponse, GetTotalLikesPerMemberRequest, GetTotalLikesPerMemberResponse, GetTotalPostsRequest, GetTotalPublicationsRequest, GetTotalPublicationsResponse, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, IdentificationData, IdentificationDataIdOneOf, Image, ImageData, ImageDataStyles, ImagePosition, ImagePositionWithLiterals, ImageStyles, InitialExpandedItems, InitialExpandedItemsWithLiterals, InitialPostsCopied, Item, ItemDataOneOf, ItemStyle, Keyword, Layout, LayoutCellData, LayoutData, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LikePostRequest, LikePostResponse, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListDemoPostsRequest, ListDemoPostsResponse, ListPostsArchiveRequest, ListPostsArchiveResponse, ListPostsRequest, ListTemplatesRequest, ListTemplatesResponse, ListValue, MapData, MapSettings, MapType, MapTypeWithLiterals, Media, MediaMediaOneOf, MentionData, MessageEnvelope, MetaData, Metadata, Metrics, ModerationDetails, ModerationStatusStatus, ModerationStatusStatusWithLiterals, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, OldBlogMigratedEvent, Option, OptionDesign, OptionLayout, Order, OrderWithLiterals, OrderedListData, Orientation, OrientationWithLiterals, Origin, OriginWithLiterals, PDFSettings, Paging, PagingMetadataV2, ParagraphData, PeriodPostCount, PeriodPublicationsCount, Permissions, PinPostRequest, PinPostResponse, Placement, PlacementWithLiterals, PlatformQueryPagingMethodOneOf, PlaybackOptions, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, PollSettings, Position, PositionWithLiterals, Post, PostCategoriesUpdated, PostCountInfo, PostCountPerMonth, PostCountersUpdated, PostCountersUpdatedInitiatorOneOf, PostFieldField, PostFieldFieldWithLiterals, PostLiked, PostLikedInitiatorOneOf, PostOwnerChanged, PostTagsUpdated, PostTranslation, PostUnliked, PostUnlikedInitiatorOneOf, PostsQueryResult, PricingData, QueryPostCountStatsRequest, QueryPostsRequest, QueryPostsResponse, QueryPublicationsCountStatsRequest, QueryPublicationsCountStatsRequestOrder, QueryPublicationsCountStatsRequestOrderWithLiterals, QueryPublicationsCountStatsResponse, Reactions, Rel, Resizing, ResizingWithLiterals, ResponsivenessBehaviour, ResponsivenessBehaviourWithLiterals, RestoreInfo, RibbonStyles, RichContent, Scaling, ScalingWithLiterals, ScheduledPostPublished, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Source, SourceWithLiterals, Spoiler, SpoilerData, Status, StatusWithLiterals, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, TableCellData, TableData, Tag, Target, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, Type, TypeWithLiterals, UnlikePostRequest, UnlikePostResponse, UnpinPostRequest, UnpinPostResponse, V1Media, VerticalAlignment, VerticalAlignmentAlignment, VerticalAlignmentAlignmentWithLiterals, VerticalAlignmentWithLiterals, Video, VideoData, VideoResolution, ViewMode, ViewModeWithLiterals, ViewPostRequest, ViewPostResponse, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals, WixMedia } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function queryPostCountStats$1(httpClient: HttpClient): QueryPostCountStatsSignature;
|
|
6
6
|
interface QueryPostCountStatsSignature {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieves the number of published posts per month within a specified time range.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
13
|
-
* For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`,
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
|
|
12
|
+
*
|
|
13
|
+
* 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.
|
|
14
|
+
*
|
|
15
|
+
* >**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.
|
|
16
|
+
* @param - Options specifying time frame, sort, and filter.
|
|
16
17
|
* @returns Get Blog Post Count Stats response
|
|
17
18
|
*/
|
|
18
19
|
(options?: QueryPostCountStatsOptions): Promise<NonNullablePaths<QueryPostCountStatsResponse, `stats` | `stats.${number}.postCount`, 4>>;
|
|
@@ -21,6 +22,7 @@ declare function getTotalPosts$1(httpClient: HttpClient): GetTotalPostsSignature
|
|
|
21
22
|
interface GetTotalPostsSignature {
|
|
22
23
|
/**
|
|
23
24
|
* Retrieves the total amount of published posts of the blog.
|
|
25
|
+
* @param - Language Options.
|
|
24
26
|
*/
|
|
25
27
|
(options?: GetTotalPostsOptions): Promise<NonNullablePaths<GetTotalPostsResponse, `total`, 2>>;
|
|
26
28
|
}
|
|
@@ -29,9 +31,9 @@ interface GetPostSignature {
|
|
|
29
31
|
/**
|
|
30
32
|
* Retrieves a post by the specified ID.
|
|
31
33
|
* @param - Post ID.
|
|
32
|
-
* @
|
|
34
|
+
* @param - Options specifying which fields to return.
|
|
33
35
|
*/
|
|
34
|
-
(postId: string, options?: GetPostOptions): Promise<NonNullablePaths<
|
|
36
|
+
(postId: string, options?: GetPostOptions): Promise<NonNullablePaths<GetPostResponse, `post._id` | `post.title` | `post.excerpt` | `post.slug` | `post.featured` | `post.pinned` | `post.categoryIds` | `post.coverMedia.enabled` | `post.coverMedia.displayed` | `post.coverMedia.custom` | `post.memberId` | `post.hashtags` | `post.commentingEnabled` | `post.minutesToRead` | `post.tagIds` | `post.relatedPostIds` | `post.pricingPlanIds` | `post.seoData.tags` | `post.seoData.tags.${number}.type` | `post.seoData.tags.${number}.children` | `post.seoData.tags.${number}.custom` | `post.seoData.tags.${number}.disabled` | `post.seoData.settings.preventAutoRedirect` | `post.seoData.settings.keywords` | `post.seoData.settings.keywords.${number}.term` | `post.seoData.settings.keywords.${number}.isMain` | `post.preview` | `post.moderationDetails.submittedBy` | `post.moderationDetails.status` | `post.media.embedMedia.thumbnail.url` | `post.media.embedMedia.thumbnail.width` | `post.media.embedMedia.thumbnail.height` | `post.media.embedMedia.video.url` | `post.media.embedMedia.video.width` | `post.media.embedMedia.video.height` | `post.media.displayed` | `post.media.custom` | `post.hasUnpublishedChanges`, 7>>;
|
|
35
37
|
}
|
|
36
38
|
declare function getPostBySlug$1(httpClient: HttpClient): GetPostBySlugSignature;
|
|
37
39
|
interface GetPostBySlugSignature {
|
|
@@ -43,6 +45,7 @@ interface GetPostBySlugSignature {
|
|
|
43
45
|
* the slug is `my-post-slug`. The slug is case-sensitive, and is generally derived from the post title,
|
|
44
46
|
* unless specified otherwise.
|
|
45
47
|
* @param - Slug of the post to retrieve.
|
|
48
|
+
* @param - Options specifying which fields to return.
|
|
46
49
|
*/
|
|
47
50
|
(slug: string, options?: GetPostBySlugOptions): Promise<NonNullablePaths<GetPostBySlugResponse, `post._id` | `post.title` | `post.excerpt` | `post.slug` | `post.featured` | `post.pinned` | `post.categoryIds` | `post.coverMedia.enabled` | `post.coverMedia.displayed` | `post.coverMedia.custom` | `post.memberId` | `post.hashtags` | `post.commentingEnabled` | `post.minutesToRead` | `post.tagIds` | `post.relatedPostIds` | `post.pricingPlanIds` | `post.seoData.tags` | `post.seoData.tags.${number}.type` | `post.seoData.tags.${number}.children` | `post.seoData.tags.${number}.custom` | `post.seoData.tags.${number}.disabled` | `post.seoData.settings.preventAutoRedirect` | `post.seoData.settings.keywords` | `post.seoData.settings.keywords.${number}.term` | `post.seoData.settings.keywords.${number}.isMain` | `post.preview` | `post.moderationDetails.submittedBy` | `post.moderationDetails.status` | `post.media.embedMedia.thumbnail.url` | `post.media.embedMedia.thumbnail.width` | `post.media.embedMedia.thumbnail.height` | `post.media.embedMedia.video.url` | `post.media.embedMedia.video.width` | `post.media.embedMedia.video.height` | `post.media.displayed` | `post.media.custom` | `post.hasUnpublishedChanges`, 7>>;
|
|
48
51
|
}
|
|
@@ -55,31 +58,10 @@ interface ListPostsSignature {
|
|
|
55
58
|
* - `firstPublishedDate` is sorted in descending order, with pinned posts first.
|
|
56
59
|
* - `paging.limit` is `50`.
|
|
57
60
|
* - `paging.offset` is `0`.
|
|
61
|
+
* @param - Sort, filter, and paging options.
|
|
58
62
|
*/
|
|
59
63
|
(options?: ListPostsOptions): Promise<NonNullablePaths<ListPostsResponse, `posts` | `posts.${number}._id` | `posts.${number}.title` | `posts.${number}.excerpt` | `posts.${number}.slug` | `posts.${number}.featured` | `posts.${number}.pinned` | `posts.${number}.coverMedia.enabled` | `posts.${number}.coverMedia.displayed` | `posts.${number}.coverMedia.custom` | `posts.${number}.memberId` | `posts.${number}.commentingEnabled` | `posts.${number}.minutesToRead` | `posts.${number}.seoData.settings.preventAutoRedirect` | `posts.${number}.preview` | `posts.${number}.moderationDetails.submittedBy` | `posts.${number}.moderationDetails.status` | `posts.${number}.media.displayed` | `posts.${number}.media.custom` | `posts.${number}.hasUnpublishedChanges` | `metaData.count` | `metaData.offset` | `metaData.total`, 6>>;
|
|
60
64
|
}
|
|
61
|
-
declare function queryPosts$1(httpClient: HttpClient): QueryPostsSignature;
|
|
62
|
-
interface QueryPostsSignature {
|
|
63
|
-
/**
|
|
64
|
-
* Retrieves a list of up to 100 posts, given the provided paging, filtering, and sorting.
|
|
65
|
-
*
|
|
66
|
-
* Query Posts runs with these defaults, which you can override:
|
|
67
|
-
* - `firstPublishedDate` is sorted in descending order, with pinned posts first.
|
|
68
|
-
* - `paging.limit` is `50`.
|
|
69
|
-
* - `paging.offset` is `0`.
|
|
70
|
-
*
|
|
71
|
-
* For field support for filters and sorting, see
|
|
72
|
-
* [Field Support for Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/blog/posts-stats/filter-and-sort).
|
|
73
|
-
*
|
|
74
|
-
* To learn about working with _Query_ endpoints, see
|
|
75
|
-
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
76
|
-
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and
|
|
77
|
-
* [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
78
|
-
* For a detailed list of supported filters and sortable fields, see
|
|
79
|
-
* [Field Support for Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/blog/posts-stats/filter-and-sort).
|
|
80
|
-
*/
|
|
81
|
-
(options?: QueryPostsOptions): PostsQueryBuilder;
|
|
82
|
-
}
|
|
83
65
|
declare function getPostMetrics$1(httpClient: HttpClient): GetPostMetricsSignature;
|
|
84
66
|
interface GetPostMetricsSignature {
|
|
85
67
|
/**
|
|
@@ -96,13 +78,19 @@ declare const onPostCreated$1: EventDefinition<PostCreatedEnvelope, "wix.blog.v3
|
|
|
96
78
|
declare const onPostDeleted$1: EventDefinition<PostDeletedEnvelope, "wix.blog.v3.post_deleted">;
|
|
97
79
|
declare const onPostUpdated$1: EventDefinition<PostUpdatedEnvelope, "wix.blog.v3.post_updated">;
|
|
98
80
|
|
|
81
|
+
declare function customQueryPosts(httpClient: HttpClient): {
|
|
82
|
+
(query: PlatformQuery): ReturnType<typeof typedQueryPosts>;
|
|
83
|
+
(query: PlatformQuery, options: QueryPostsOptions): ReturnType<typeof typedQueryPosts>;
|
|
84
|
+
(): PostsQueryBuilder;
|
|
85
|
+
(options: QueryPostsOptions): PostsQueryBuilder;
|
|
86
|
+
};
|
|
99
87
|
declare const queryPostCountStats: MaybeContext<BuildRESTFunction<typeof queryPostCountStats$1> & typeof queryPostCountStats$1>;
|
|
100
88
|
declare const getTotalPosts: MaybeContext<BuildRESTFunction<typeof getTotalPosts$1> & typeof getTotalPosts$1>;
|
|
101
89
|
declare const getPost: MaybeContext<BuildRESTFunction<typeof getPost$1> & typeof getPost$1>;
|
|
102
90
|
declare const getPostBySlug: MaybeContext<BuildRESTFunction<typeof getPostBySlug$1> & typeof getPostBySlug$1>;
|
|
103
91
|
declare const listPosts: MaybeContext<BuildRESTFunction<typeof listPosts$1> & typeof listPosts$1>;
|
|
104
|
-
declare const queryPosts: MaybeContext<BuildRESTFunction<typeof queryPosts$1> & typeof queryPosts$1>;
|
|
105
92
|
declare const getPostMetrics: MaybeContext<BuildRESTFunction<typeof getPostMetrics$1> & typeof getPostMetrics$1>;
|
|
93
|
+
declare const queryPosts: MaybeContext<BuildRESTFunction<typeof customQueryPosts> & typeof customQueryPosts>;
|
|
106
94
|
/** */
|
|
107
95
|
declare const onPostLiked: BuildEventDefinition<typeof onPostLiked$1> & typeof onPostLiked$1;
|
|
108
96
|
/** */
|
|
@@ -120,4 +108,4 @@ declare const onPostDeleted: BuildEventDefinition<typeof onPostDeleted$1> & type
|
|
|
120
108
|
*/
|
|
121
109
|
declare const onPostUpdated: BuildEventDefinition<typeof onPostUpdated$1> & typeof onPostUpdated$1;
|
|
122
110
|
|
|
123
|
-
export { GetPostBySlugOptions, GetPostBySlugResponse, GetPostMetricsResponse, GetPostOptions, GetTotalPostsOptions, GetTotalPostsResponse, ListPostsOptions, ListPostsResponse,
|
|
111
|
+
export { GetPostBySlugOptions, GetPostBySlugResponse, GetPostMetricsResponse, GetPostOptions, GetPostResponse, GetTotalPostsOptions, GetTotalPostsResponse, ListPostsOptions, ListPostsResponse, PlatformQuery, PostCreatedEnvelope, PostDeletedEnvelope, PostLikedEnvelope, PostUnlikedEnvelope, PostUpdatedEnvelope, PostsQueryBuilder, QueryPostCountStatsOptions, QueryPostCountStatsResponse, QueryPostsOptions, getPost, getPostBySlug, getPostMetrics, getTotalPosts, listPosts, onPostCreated, onPostDeleted, onPostLiked, onPostUnliked, onPostUpdated, queryPostCountStats, queryPosts };
|
package/build/cjs/index.js
CHANGED
|
@@ -1285,8 +1285,8 @@ async function getPost2(postId, options) {
|
|
|
1285
1285
|
paths: [{ path: "post.media.wixMedia.videoV2" }]
|
|
1286
1286
|
}
|
|
1287
1287
|
]),
|
|
1288
|
-
["post.richContent"]
|
|
1289
|
-
)
|
|
1288
|
+
["post.richContent", "post.rich_content"]
|
|
1289
|
+
);
|
|
1290
1290
|
} catch (err) {
|
|
1291
1291
|
const transformedError = (0, import_transform_error.transformError)(
|
|
1292
1292
|
err,
|
|
@@ -1338,7 +1338,7 @@ async function getPostBySlug2(slug, options) {
|
|
|
1338
1338
|
paths: [{ path: "post.media.wixMedia.videoV2" }]
|
|
1339
1339
|
}
|
|
1340
1340
|
]),
|
|
1341
|
-
["post.richContent"]
|
|
1341
|
+
["post.richContent", "post.rich_content"]
|
|
1342
1342
|
);
|
|
1343
1343
|
} catch (err) {
|
|
1344
1344
|
const transformedError = (0, import_transform_error.transformError)(
|
|
@@ -1402,7 +1402,7 @@ async function listPosts2(options) {
|
|
|
1402
1402
|
paths: [{ path: "posts.media.wixMedia.videoV2" }]
|
|
1403
1403
|
}
|
|
1404
1404
|
]),
|
|
1405
|
-
["posts.richContent"]
|
|
1405
|
+
["posts.richContent", "posts.rich_content"]
|
|
1406
1406
|
);
|
|
1407
1407
|
} catch (err) {
|
|
1408
1408
|
const transformedError = (0, import_transform_error.transformError)(
|
|
@@ -1477,7 +1477,7 @@ function queryPosts2(options) {
|
|
|
1477
1477
|
paths: [{ path: "posts.media.wixMedia.videoV2" }]
|
|
1478
1478
|
}
|
|
1479
1479
|
]),
|
|
1480
|
-
["posts.richContent"]
|
|
1480
|
+
["posts.richContent", "posts.rich_content"]
|
|
1481
1481
|
);
|
|
1482
1482
|
return {
|
|
1483
1483
|
items: transformedData?.posts,
|
|
@@ -1496,6 +1496,56 @@ function queryPosts2(options) {
|
|
|
1496
1496
|
transformationPaths: {}
|
|
1497
1497
|
});
|
|
1498
1498
|
}
|
|
1499
|
+
async function typedQueryPosts(query, options) {
|
|
1500
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1501
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)(
|
|
1502
|
+
{ query, ...options },
|
|
1503
|
+
[]
|
|
1504
|
+
);
|
|
1505
|
+
const reqOpts = queryPosts(payload);
|
|
1506
|
+
sideEffects?.onSiteCall?.();
|
|
1507
|
+
try {
|
|
1508
|
+
const result = await httpClient.request(reqOpts);
|
|
1509
|
+
sideEffects?.onSuccess?.(result);
|
|
1510
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1511
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1512
|
+
{
|
|
1513
|
+
transformFn: import_page_url.transformRESTPageURLToSDKPageURL,
|
|
1514
|
+
paths: [{ path: "posts.url" }, { path: "posts.translations.url" }]
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
transformFn: import_image.transformRESTImageToSDKImage,
|
|
1518
|
+
paths: [
|
|
1519
|
+
{ path: "posts.heroImage" },
|
|
1520
|
+
{ path: "posts.coverMedia.image" },
|
|
1521
|
+
{ path: "posts.media.wixMedia.image" }
|
|
1522
|
+
]
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
transformFn: import_video.transformRESTVideoToSDKVideo,
|
|
1526
|
+
paths: [{ path: "posts.coverMedia.video" }]
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
transformFn: import_video_v2.transformRESTVideoV2ToSDKVideoV2,
|
|
1530
|
+
paths: [{ path: "posts.media.wixMedia.videoV2" }]
|
|
1531
|
+
}
|
|
1532
|
+
]),
|
|
1533
|
+
["posts.richContent", "posts.rich_content"]
|
|
1534
|
+
);
|
|
1535
|
+
} catch (err) {
|
|
1536
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1537
|
+
err,
|
|
1538
|
+
{
|
|
1539
|
+
spreadPathsToArguments: {},
|
|
1540
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1541
|
+
singleArgumentUnchanged: false
|
|
1542
|
+
},
|
|
1543
|
+
["query", "options"]
|
|
1544
|
+
);
|
|
1545
|
+
sideEffects?.onError?.(err);
|
|
1546
|
+
throw transformedError;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1499
1549
|
async function getPostMetrics2(postId) {
|
|
1500
1550
|
const { httpClient, sideEffects } = arguments[1];
|
|
1501
1551
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ postId }, []);
|
|
@@ -1565,6 +1615,14 @@ function queryPosts3(httpClient) {
|
|
|
1565
1615
|
{ httpClient }
|
|
1566
1616
|
);
|
|
1567
1617
|
}
|
|
1618
|
+
function typedQueryPosts2(httpClient) {
|
|
1619
|
+
return (query, options) => typedQueryPosts(
|
|
1620
|
+
query,
|
|
1621
|
+
options,
|
|
1622
|
+
// @ts-ignore
|
|
1623
|
+
{ httpClient }
|
|
1624
|
+
);
|
|
1625
|
+
}
|
|
1568
1626
|
function getPostMetrics3(httpClient) {
|
|
1569
1627
|
return (postId) => getPostMetrics2(
|
|
1570
1628
|
postId,
|
|
@@ -1581,7 +1639,8 @@ var onPostLiked = (0, import_sdk_types.EventDefinition)(
|
|
|
1581
1639
|
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
1582
1640
|
paths: [{ path: "metadata.eventTime" }]
|
|
1583
1641
|
}
|
|
1584
|
-
])
|
|
1642
|
+
]),
|
|
1643
|
+
["entity.rich_content"]
|
|
1585
1644
|
)
|
|
1586
1645
|
)();
|
|
1587
1646
|
var onPostUnliked = (0, import_sdk_types.EventDefinition)(
|
|
@@ -1593,7 +1652,8 @@ var onPostUnliked = (0, import_sdk_types.EventDefinition)(
|
|
|
1593
1652
|
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
1594
1653
|
paths: [{ path: "metadata.eventTime" }]
|
|
1595
1654
|
}
|
|
1596
|
-
])
|
|
1655
|
+
]),
|
|
1656
|
+
["entity.rich_content"]
|
|
1597
1657
|
)
|
|
1598
1658
|
)();
|
|
1599
1659
|
var onPostCreated = (0, import_sdk_types.EventDefinition)(
|
|
@@ -1668,7 +1728,8 @@ var onPostCreated = (0, import_sdk_types.EventDefinition)(
|
|
|
1668
1728
|
transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
|
|
1669
1729
|
paths: [{ path: "entity.media.wixMedia.videoV2" }]
|
|
1670
1730
|
}
|
|
1671
|
-
])
|
|
1731
|
+
]),
|
|
1732
|
+
["entity.rich_content"]
|
|
1672
1733
|
)
|
|
1673
1734
|
)();
|
|
1674
1735
|
var onPostDeleted = (0, import_sdk_types.EventDefinition)(
|
|
@@ -1743,7 +1804,8 @@ var onPostDeleted = (0, import_sdk_types.EventDefinition)(
|
|
|
1743
1804
|
transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
|
|
1744
1805
|
paths: [{ path: "entity.media.wixMedia.videoV2" }]
|
|
1745
1806
|
}
|
|
1746
|
-
])
|
|
1807
|
+
]),
|
|
1808
|
+
["entity.rich_content"]
|
|
1747
1809
|
)
|
|
1748
1810
|
)();
|
|
1749
1811
|
var onPostUpdated = (0, import_sdk_types.EventDefinition)(
|
|
@@ -1818,20 +1880,33 @@ var onPostUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
1818
1880
|
transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
|
|
1819
1881
|
paths: [{ path: "entity.media.wixMedia.videoV2" }]
|
|
1820
1882
|
}
|
|
1821
|
-
])
|
|
1883
|
+
]),
|
|
1884
|
+
["entity.rich_content"]
|
|
1822
1885
|
)
|
|
1823
1886
|
)();
|
|
1824
1887
|
|
|
1825
1888
|
// src/blog-v3-post-posts.context.ts
|
|
1826
1889
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
1827
1890
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
1891
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
1892
|
+
function customQueryPosts(httpClient) {
|
|
1893
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
1894
|
+
builderQueryFunction: (options) => queryPosts3(httpClient)(options),
|
|
1895
|
+
typedQueryFunction: (query, options) => typedQueryPosts2(httpClient)(query, options),
|
|
1896
|
+
hasOptionsParameter: true
|
|
1897
|
+
});
|
|
1898
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1899
|
+
return router(...arguments);
|
|
1900
|
+
}
|
|
1901
|
+
return overloadedQuery;
|
|
1902
|
+
}
|
|
1828
1903
|
var queryPostCountStats4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryPostCountStats3);
|
|
1829
1904
|
var getTotalPosts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getTotalPosts3);
|
|
1830
1905
|
var getPost4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPost3);
|
|
1831
1906
|
var getPostBySlug4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPostBySlug3);
|
|
1832
1907
|
var listPosts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listPosts3);
|
|
1833
|
-
var queryPosts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryPosts3);
|
|
1834
1908
|
var getPostMetrics4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPostMetrics3);
|
|
1909
|
+
var queryPosts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryPosts);
|
|
1835
1910
|
var onPostLiked2 = (0, import_event_definition_modules.createEventModule)(onPostLiked);
|
|
1836
1911
|
var onPostUnliked2 = (0, import_event_definition_modules.createEventModule)(onPostUnliked);
|
|
1837
1912
|
var onPostCreated2 = (0, import_event_definition_modules.createEventModule)(onPostCreated);
|