@wix/auto_sdk_blog_posts 1.0.45 → 1.0.47

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.
@@ -2953,6 +2953,11 @@ interface GetPostBySlugRequest {
2953
2953
  * @maxSize 20
2954
2954
  */
2955
2955
  fieldsets?: PostFieldFieldWithLiterals[];
2956
+ /**
2957
+ * Language of the post.
2958
+ * @format LANGUAGE_TAG
2959
+ */
2960
+ language?: string | null;
2956
2961
  }
2957
2962
  interface GetPostBySlugResponse {
2958
2963
  /** Retrieved post info. */
@@ -3618,13 +3623,14 @@ declare function onPostUpdated(handler: (event: PostUpdatedEnvelope) => void | P
3618
3623
  /**
3619
3624
  * Retrieves the number of published posts per month within a specified time range.
3620
3625
  *
3621
- * The time range is set using the `rangeStart` and `months` properties.
3622
- * The time range always starts on the 1st day of the month set in `rangeStart` and
3623
- * includes the number of `months` following `rangeStart`.
3624
- * For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`,
3625
- * the time range will be from `'2022-03-01'` until `'2022-06-30'`. The time range always ends on the last day of the month.
3626
- * > Note: If there are no published posts in a month within the time range, 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.
3626
+ *
3627
+ * The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
3628
+ *
3629
+ * 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.
3630
+ *
3631
+ * >**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.
3627
3632
  * @public
3633
+ * @param options - Options specifying time frame, sort, and filter.
3628
3634
  * @permissionId BLOG.READ-PUBLICATION
3629
3635
  * @applicableIdentity APP
3630
3636
  * @returns Get Blog Post Count Stats response
@@ -3665,6 +3671,7 @@ interface QueryPostCountStatsOptions {
3665
3671
  /**
3666
3672
  * Retrieves the total amount of published posts of the blog.
3667
3673
  * @public
3674
+ * @param options - Language Options.
3668
3675
  * @permissionId BLOG.READ-PUBLICATION
3669
3676
  * @applicableIdentity APP
3670
3677
  * @fqn com.wixpress.npm.communities.platformized.blog.BlogStatsService.GetTotalPosts
@@ -3685,12 +3692,12 @@ interface GetTotalPostsOptions {
3685
3692
  * @param postId - Post ID.
3686
3693
  * @public
3687
3694
  * @requiredField postId
3695
+ * @param options - Options specifying which fields to return.
3688
3696
  * @permissionId BLOG.READ-PUBLICATION
3689
3697
  * @applicableIdentity APP
3690
- * @returns Retrieved post info.
3691
3698
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost
3692
3699
  */
3693
- declare function getPost(postId: string, options?: GetPostOptions): Promise<NonNullablePaths<Post, `_id` | `title` | `excerpt` | `slug` | `featured` | `pinned` | `categoryIds` | `coverMedia.enabled` | `coverMedia.displayed` | `coverMedia.custom` | `memberId` | `hashtags` | `commentingEnabled` | `minutesToRead` | `tagIds` | `relatedPostIds` | `pricingPlanIds` | `seoData.tags` | `seoData.tags.${number}.type` | `seoData.tags.${number}.children` | `seoData.tags.${number}.custom` | `seoData.tags.${number}.disabled` | `seoData.settings.preventAutoRedirect` | `seoData.settings.keywords` | `seoData.settings.keywords.${number}.term` | `seoData.settings.keywords.${number}.isMain` | `preview` | `moderationDetails.submittedBy` | `moderationDetails.status` | `media.embedMedia.thumbnail.url` | `media.embedMedia.thumbnail.width` | `media.embedMedia.thumbnail.height` | `media.embedMedia.video.url` | `media.embedMedia.video.width` | `media.embedMedia.video.height` | `media.displayed` | `media.custom` | `hasUnpublishedChanges`, 6>>;
3700
+ declare function getPost(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>>;
3694
3701
  interface GetPostOptions {
3695
3702
  /**
3696
3703
  * List of additional post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
@@ -3710,6 +3717,7 @@ interface GetPostOptions {
3710
3717
  * @param slug - Slug of the post to retrieve.
3711
3718
  * @public
3712
3719
  * @requiredField slug
3720
+ * @param options - Options specifying which fields to return.
3713
3721
  * @permissionId BLOG.READ-PUBLICATION
3714
3722
  * @applicableIdentity APP
3715
3723
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostBySlug
@@ -3723,6 +3731,11 @@ interface GetPostBySlugOptions {
3723
3731
  * @maxSize 20
3724
3732
  */
3725
3733
  fieldsets?: PostFieldFieldWithLiterals[];
3734
+ /**
3735
+ * Language of the post.
3736
+ * @format LANGUAGE_TAG
3737
+ */
3738
+ language?: string | null;
3726
3739
  }
3727
3740
  /**
3728
3741
  * Retrieves a list of up to 100 published posts per request.
@@ -3732,6 +3745,7 @@ interface GetPostBySlugOptions {
3732
3745
  * - `paging.limit` is `50`.
3733
3746
  * - `paging.offset` is `0`.
3734
3747
  * @public
3748
+ * @param options - Sort, filter, and paging options.
3735
3749
  * @permissionId BLOG.READ-PUBLICATION
3736
3750
  * @applicableIdentity APP
3737
3751
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.ListPosts
@@ -3802,23 +3816,26 @@ interface ListPostsOptions {
3802
3816
  fieldsets?: PostFieldFieldWithLiterals[];
3803
3817
  }
3804
3818
  /**
3805
- * Retrieves a list of up to 100 posts, given the provided paging, filtering, and sorting.
3819
+ * Creates a query to retrieve a list of posts.
3806
3820
  *
3807
- * Query Posts runs with these defaults, which you can override:
3808
- * - `firstPublishedDate` is sorted in descending order, with pinned posts first.
3809
- * - `paging.limit` is `50`.
3810
- * - `paging.offset` is `0`.
3811
3821
  *
3812
- * For field support for filters and sorting, see
3813
- * [Field Support for Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/blog/posts-stats/filter-and-sort).
3822
+ * The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a `PostsQueryBuilder` object.
3823
+ *
3824
+ * The returned object contains the query definition which is typically used to run the query using the `find()` function.
3825
+ *
3826
+ * 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.
3827
+ *
3828
+ * `queryPosts()` runs with these `PostsQueryBuilder` defaults that you can override:
3829
+ * + `limit(50)`
3830
+ * + `descending('firstPublishedDate')`
3831
+ *
3832
+ * Note that the default limit is `'50'`, but the max limit is `'100'`.
3833
+ *
3834
+ * To learn how to query posts, refer to the table below.
3814
3835
  *
3815
- * To learn about working with _Query_ endpoints, see
3816
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
3817
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and
3818
- * [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
3819
- * For a detailed list of supported filters and sortable fields, see
3820
- * [Field Support for Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/blog/posts-stats/filter-and-sort).
3836
+ * 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`.
3821
3837
  * @public
3838
+ * @param options - Options specifying which fields to return.
3822
3839
  * @permissionId BLOG.READ-PUBLICATION
3823
3840
  * @applicableIdentity APP
3824
3841
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts
@@ -1313,8 +1313,8 @@ async function getPost2(postId, options) {
1313
1313
  paths: [{ path: "post.media.wixMedia.videoV2" }]
1314
1314
  }
1315
1315
  ]),
1316
- ["post.richContent"]
1317
- )?.post;
1316
+ ["post.richContent", "post.rich_content"]
1317
+ );
1318
1318
  } catch (err) {
1319
1319
  const transformedError = sdkTransformError(
1320
1320
  err,
@@ -1335,7 +1335,7 @@ async function getPost2(postId, options) {
1335
1335
  async function getPostBySlug2(slug, options) {
1336
1336
  const { httpClient, sideEffects } = arguments[2];
1337
1337
  const payload = renameKeysFromSDKRequestToRESTRequest(
1338
- { slug, fieldsets: options?.fieldsets },
1338
+ { slug, fieldsets: options?.fieldsets, language: options?.language },
1339
1339
  []
1340
1340
  );
1341
1341
  const reqOpts = getPostBySlug(payload);
@@ -1366,14 +1366,18 @@ async function getPostBySlug2(slug, options) {
1366
1366
  paths: [{ path: "post.media.wixMedia.videoV2" }]
1367
1367
  }
1368
1368
  ]),
1369
- ["post.richContent"]
1369
+ ["post.richContent", "post.rich_content"]
1370
1370
  );
1371
1371
  } catch (err) {
1372
1372
  const transformedError = sdkTransformError(
1373
1373
  err,
1374
1374
  {
1375
1375
  spreadPathsToArguments: {},
1376
- explicitPathsToArguments: { slug: "$[0]", fieldsets: "$[1].fieldsets" },
1376
+ explicitPathsToArguments: {
1377
+ slug: "$[0]",
1378
+ fieldsets: "$[1].fieldsets",
1379
+ language: "$[1].language"
1380
+ },
1377
1381
  singleArgumentUnchanged: false
1378
1382
  },
1379
1383
  ["slug", "options"]
@@ -1426,7 +1430,7 @@ async function listPosts2(options) {
1426
1430
  paths: [{ path: "posts.media.wixMedia.videoV2" }]
1427
1431
  }
1428
1432
  ]),
1429
- ["posts.richContent"]
1433
+ ["posts.richContent", "posts.rich_content"]
1430
1434
  );
1431
1435
  } catch (err) {
1432
1436
  const transformedError = sdkTransformError(
@@ -1501,7 +1505,7 @@ function queryPosts2(options) {
1501
1505
  paths: [{ path: "posts.media.wixMedia.videoV2" }]
1502
1506
  }
1503
1507
  ]),
1504
- ["posts.richContent"]
1508
+ ["posts.richContent", "posts.rich_content"]
1505
1509
  );
1506
1510
  return {
1507
1511
  items: transformedData?.posts,