@wix/auto_sdk_blog_posts 1.0.144 → 1.0.145

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.
@@ -4154,13 +4154,14 @@ declare function onPostUpdated(handler: (event: PostUpdatedEnvelope) => void | P
4154
4154
  /**
4155
4155
  * Retrieves the number of published posts per month within a specified time range.
4156
4156
  *
4157
- * The time range is set using the `rangeStart` and `months` properties.
4158
- * The time range always starts on the 1st day of the month set in `rangeStart` and
4159
- * includes the number of `months` following `rangeStart`.
4160
- * For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`,
4161
- * 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.
4162
- * > 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.
4157
+ *
4158
+ * The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
4159
+ *
4160
+ * 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.
4161
+ *
4162
+ * >**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.
4163
4163
  * @public
4164
+ * @param options - Options specifying time frame, sort, and filter.
4164
4165
  * @permissionId BLOG.READ-PUBLICATION
4165
4166
  * @applicableIdentity APP
4166
4167
  * @returns Get Blog Post Count Stats response
@@ -4201,6 +4202,7 @@ interface QueryPostCountStatsOptions {
4201
4202
  /**
4202
4203
  * Retrieves the total amount of published posts of the blog.
4203
4204
  * @public
4205
+ * @param options - Language Options.
4204
4206
  * @permissionId BLOG.READ-PUBLICATION
4205
4207
  * @applicableIdentity APP
4206
4208
  * @fqn com.wixpress.npm.communities.platformized.blog.BlogStatsService.GetTotalPosts
@@ -4221,12 +4223,12 @@ interface GetTotalPostsOptions {
4221
4223
  * @param postId - Post ID.
4222
4224
  * @public
4223
4225
  * @requiredField postId
4226
+ * @param options - Options specifying which fields to return.
4224
4227
  * @permissionId BLOG.READ-PUBLICATION
4225
4228
  * @applicableIdentity APP
4226
- * @returns Retrieved post info.
4227
4229
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPost
4228
4230
  */
4229
- declare function getPost(postId: string, options?: GetPostOptions): Promise<NonNullablePaths<Post, `_id` | `title` | `excerpt` | `slug` | `featured` | `pinned` | `categoryIds` | `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>>;
4231
+ 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.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>>;
4230
4232
  interface GetPostOptions {
4231
4233
  /**
4232
4234
  * List of additional post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
@@ -4246,6 +4248,7 @@ interface GetPostOptions {
4246
4248
  * @param slug - Slug of the post to retrieve.
4247
4249
  * @public
4248
4250
  * @requiredField slug
4251
+ * @param options - Options specifying which fields to return.
4249
4252
  * @permissionId BLOG.READ-PUBLICATION
4250
4253
  * @applicableIdentity APP
4251
4254
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.GetPostBySlug
@@ -4273,6 +4276,7 @@ interface GetPostBySlugOptions {
4273
4276
  * - `paging.limit` is `50`.
4274
4277
  * - `paging.offset` is `0`.
4275
4278
  * @public
4279
+ * @param options - Sort, filter, and paging options.
4276
4280
  * @permissionId BLOG.READ-PUBLICATION
4277
4281
  * @applicableIdentity APP
4278
4282
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.ListPosts
@@ -4343,18 +4347,26 @@ interface ListPostsOptions {
4343
4347
  fieldsets?: PostFieldFieldWithLiterals[];
4344
4348
  }
4345
4349
  /**
4346
- * Retrieves a list of up to 100 posts, given the provided paging, filtering, and sorting.
4350
+ * Creates a query to retrieve a list of posts.
4347
4351
  *
4348
- * Query Posts runs with these defaults, which you can override:
4349
- * - `firstPublishedDate` is sorted in descending order, with pinned posts first.
4350
- * - `paging.limit` is `50`.
4351
- * - `paging.offset` is `0`.
4352
4352
  *
4353
- * To learn about working with _Query_ endpoints, see
4354
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
4355
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and
4356
- * [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
4353
+ * The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a `PostsQueryBuilder` object.
4354
+ *
4355
+ * The returned object contains the query definition which is typically used to run the query using the `find()` function.
4356
+ *
4357
+ * 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.
4358
+ *
4359
+ * `queryPosts()` runs with these `PostsQueryBuilder` defaults that you can override:
4360
+ * + `limit(50)`
4361
+ * + `descending('firstPublishedDate')`
4362
+ *
4363
+ * Note that the default limit is `'50'`, but the max limit is `'100'`.
4364
+ *
4365
+ * To learn how to query posts, refer to the table below.
4366
+ *
4367
+ * 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`.
4357
4368
  * @public
4369
+ * @param options - Options specifying which fields to return.
4358
4370
  * @permissionId BLOG.READ-PUBLICATION
4359
4371
  * @applicableIdentity APP
4360
4372
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts
@@ -1609,8 +1609,8 @@ async function getPost2(postId, options) {
1609
1609
  paths: [{ path: "post.media.wixMedia.videoV2" }]
1610
1610
  }
1611
1611
  ]),
1612
- ["post.richContent"]
1613
- )?.post;
1612
+ ["post.richContent", "post.rich_content"]
1613
+ );
1614
1614
  } catch (err) {
1615
1615
  const transformedError = (0, import_transform_error.transformError)(
1616
1616
  err,
@@ -1657,7 +1657,7 @@ async function getPostBySlug2(slug, options) {
1657
1657
  paths: [{ path: "post.media.wixMedia.videoV2" }]
1658
1658
  }
1659
1659
  ]),
1660
- ["post.richContent"]
1660
+ ["post.richContent", "post.rich_content"]
1661
1661
  );
1662
1662
  } catch (err) {
1663
1663
  const transformedError = (0, import_transform_error.transformError)(
@@ -1716,7 +1716,7 @@ async function listPosts2(options) {
1716
1716
  paths: [{ path: "posts.media.wixMedia.videoV2" }]
1717
1717
  }
1718
1718
  ]),
1719
- ["posts.richContent"]
1719
+ ["posts.richContent", "posts.rich_content"]
1720
1720
  );
1721
1721
  } catch (err) {
1722
1722
  const transformedError = (0, import_transform_error.transformError)(
@@ -1786,7 +1786,7 @@ function queryPosts2(options) {
1786
1786
  paths: [{ path: "posts.media.wixMedia.videoV2" }]
1787
1787
  }
1788
1788
  ]),
1789
- ["posts.richContent"]
1789
+ ["posts.richContent", "posts.rich_content"]
1790
1790
  );
1791
1791
  return {
1792
1792
  items: transformedData?.posts,
@@ -1834,7 +1834,7 @@ async function typedQueryPosts(query, options) {
1834
1834
  paths: [{ path: "posts.media.wixMedia.videoV2" }]
1835
1835
  }
1836
1836
  ]),
1837
- ["posts.richContent"]
1837
+ ["posts.richContent", "posts.rich_content"]
1838
1838
  );
1839
1839
  } catch (err) {
1840
1840
  const transformedError = (0, import_transform_error.transformError)(