@wix/auto_sdk_blog_draft-posts 1.0.127 → 1.0.129

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.
@@ -3649,15 +3649,13 @@ declare enum Field {
3649
3649
  UNKNOWN = "UNKNOWN",
3650
3650
  /** Includes draft post preview URL. */
3651
3651
  URL = "URL",
3652
- /** Includes content field. */
3653
- CONTENT = "CONTENT",
3654
3652
  /** Includes rich content field. */
3655
3653
  RICH_CONTENT = "RICH_CONTENT",
3656
3654
  /** If the user has not set excerpt, returns the one autogenerated from content. */
3657
3655
  GENERATED_EXCERPT = "GENERATED_EXCERPT"
3658
3656
  }
3659
3657
  /** @enumType */
3660
- type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'CONTENT' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3658
+ type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3661
3659
  interface CreateDraftPostResponse {
3662
3660
  /** Created draft post info. */
3663
3661
  draftPost?: DraftPost;
@@ -3751,9 +3749,12 @@ interface MaskedDraftPosts {
3751
3749
  fieldMask?: string[];
3752
3750
  }
3753
3751
  declare enum Action {
3754
- /** Update the draft post. */
3752
+ /** Update the draft post. If the post is already published, the published post isn't changed. */
3755
3753
  UPDATE = "UPDATE",
3756
- /** Update and publish a draft post. */
3754
+ /**
3755
+ * Update and publish a draft post. If the post is already published, the published post is updated
3756
+ * with the draft post's values in the same call.
3757
+ */
3757
3758
  UPDATE_PUBLISH = "UPDATE_PUBLISH",
3758
3759
  /** Update the draft post and schedule a publish date. */
3759
3760
  UPDATE_SCHEDULE = "UPDATE_SCHEDULE",
@@ -3763,7 +3764,7 @@ declare enum Action {
3763
3764
  UPDATE_CANCEL_SCHEDULE = "UPDATE_CANCEL_SCHEDULE",
3764
3765
  /** Update and reject draft post. */
3765
3766
  UPDATE_REJECT = "UPDATE_REJECT",
3766
- /** Update a post that's already been published. This creates and updates a draft version of the post. The original post is still published. */
3767
+ /** Update a post that's already been published. The changes are saved to the draft post and applied to the published post. */
3767
3768
  UPDATE_PUBLICATION = "UPDATE_PUBLICATION"
3768
3769
  }
3769
3770
  /** @enumType */
@@ -4319,7 +4320,6 @@ interface TranslateDraftRequest {
4319
4320
  * Predefined sets of fields to return in the created draft post, in addition to the core draft post fields.
4320
4321
  *
4321
4322
  * - `URL`: Returns the draft post's preview URL.
4322
- * - `CONTENT`: Returns the draft post's content.
4323
4323
  * - `RICH_CONTENT`: Returns the draft post's rich content.
4324
4324
  * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4325
4325
  *
@@ -4375,7 +4375,6 @@ interface UpdateDraftPostLanguageRequest {
4375
4375
  * Predefined sets of fields to return in the updated draft post, in addition to the core draft post fields.
4376
4376
  *
4377
4377
  * - `URL`: Returns the draft post's preview URL.
4378
- * - `CONTENT`: Returns the draft post's content.
4379
4378
  * - `RICH_CONTENT`: Returns the draft post's rich content.
4380
4379
  * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4381
4380
  *
@@ -4518,6 +4517,16 @@ declare function onDraftUpdated(handler: (event: DraftUpdatedEnvelope) => void |
4518
4517
  /**
4519
4518
  * Creates a draft post.
4520
4519
  *
4520
+ * The `title` is optional. A missing, empty or whitespace-only title creates an untitled draft post,
4521
+ * which is returned with an empty `title`. An untitled draft post can't be published or scheduled,
4522
+ * so creating it with `publish` set to `true` fails with the `POST_TITLE_REQUIRED` application error.
4523
+ *
4524
+ * The response includes `richContent` only when `fieldsets` contains `RICH_CONTENT`. The content is saved either way,
4525
+ * so a response without `richContent` doesn't mean the content wasn't saved.
4526
+ *
4527
+ * Each successful call creates a new draft post, even when a draft post with the same title and content already exists.
4528
+ * To read a draft post that you created, call Get Draft Post with its `id` instead of creating it again.
4529
+ *
4521
4530
  * For 3rd-party apps, `memberId` is a required field.
4522
4531
  *
4523
4532
  * In `categoryIds`, only categories that already exist will be added to the draft post. Including
@@ -4528,13 +4537,12 @@ declare function onDraftUpdated(handler: (event: DraftUpdatedEnvelope) => void |
4528
4537
  * @param draftPost - Draft post to create.
4529
4538
  * @public
4530
4539
  * @requiredField draftPost
4531
- * @requiredField draftPost.title
4532
4540
  * @param options - Options for creating a draft post.
4533
4541
  * @permissionId BLOG.CREATE-DRAFT
4534
4542
  * @applicableIdentity APP
4535
4543
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.CreateDraftPost
4536
4544
  */
4537
- declare function createDraftPost(draftPost: NonNullablePaths<DraftPost, `title`, 0>, options?: CreateDraftPostOptions): Promise<NonNullablePaths<CreateDraftPostResponse, `draftPost._id` | `draftPost.title` | `draftPost.categoryIds` | `draftPost.hashtags` | `draftPost.minutesToRead` | `draftPost.tagIds` | `draftPost.relatedPostIds` | `draftPost.pricingPlanIds` | `draftPost.status` | `draftPost.moderationDetails.submittedBy` | `draftPost.moderationDetails.status` | `draftPost.hasUnpublishedChanges` | `draftPost.seoData.tags` | `draftPost.seoData.tags.${number}.type` | `draftPost.seoData.tags.${number}.children` | `draftPost.seoData.tags.${number}.custom` | `draftPost.seoData.tags.${number}.disabled` | `draftPost.seoData.settings.preventAutoRedirect` | `draftPost.seoData.settings.keywords` | `draftPost.seoData.settings.keywords.${number}.term` | `draftPost.seoData.settings.keywords.${number}.isMain` | `draftPost.media.embedMedia.thumbnail.url` | `draftPost.media.embedMedia.thumbnail.width` | `draftPost.media.embedMedia.thumbnail.height` | `draftPost.media.embedMedia.video.url` | `draftPost.media.embedMedia.video.width` | `draftPost.media.embedMedia.video.height` | `draftPost.media.displayed` | `draftPost.media.custom`, 5>>;
4545
+ declare function createDraftPost(draftPost: DraftPost, options?: CreateDraftPostOptions): Promise<NonNullablePaths<CreateDraftPostResponse, `draftPost._id` | `draftPost.title` | `draftPost.categoryIds` | `draftPost.hashtags` | `draftPost.minutesToRead` | `draftPost.tagIds` | `draftPost.relatedPostIds` | `draftPost.pricingPlanIds` | `draftPost.status` | `draftPost.moderationDetails.submittedBy` | `draftPost.moderationDetails.status` | `draftPost.hasUnpublishedChanges` | `draftPost.seoData.tags` | `draftPost.seoData.tags.${number}.type` | `draftPost.seoData.tags.${number}.children` | `draftPost.seoData.tags.${number}.custom` | `draftPost.seoData.tags.${number}.disabled` | `draftPost.seoData.settings.preventAutoRedirect` | `draftPost.seoData.settings.keywords` | `draftPost.seoData.settings.keywords.${number}.term` | `draftPost.seoData.settings.keywords.${number}.isMain` | `draftPost.media.embedMedia.thumbnail.url` | `draftPost.media.embedMedia.thumbnail.width` | `draftPost.media.embedMedia.thumbnail.height` | `draftPost.media.embedMedia.video.url` | `draftPost.media.embedMedia.video.width` | `draftPost.media.embedMedia.video.height` | `draftPost.media.displayed` | `draftPost.media.custom`, 5>>;
4538
4546
  interface CreateDraftPostOptions {
4539
4547
  /**
4540
4548
  * Whether the draft post should be published on creation.
@@ -4552,16 +4560,18 @@ interface CreateDraftPostOptions {
4552
4560
  }
4553
4561
  /**
4554
4562
  * Creates multiple draft posts.
4563
+ *
4564
+ * The `title` of each draft post is optional, as in Create Draft Post. When `publish` is `true` and any
4565
+ * draft post has no title, the whole request fails with the `POST_TITLE_REQUIRED` application error.
4555
4566
  * @param draftPosts - Draft posts to create.
4556
4567
  * @public
4557
4568
  * @requiredField draftPosts
4558
- * @requiredField draftPosts.title
4559
4569
  * @param options - Options for creating multiple draft posts.
4560
4570
  * @permissionId BLOG.CREATE-DRAFT
4561
4571
  * @applicableIdentity APP
4562
4572
  * @fqn com.wixpress.npm.communities.platformized.blog.v3.DraftPostService.BulkCreateDraftPosts
4563
4573
  */
4564
- declare function bulkCreateDraftPosts(draftPosts: NonNullablePaths<DraftPost, `title`, 0>[], options?: BulkCreateDraftPostsOptions): Promise<NonNullablePaths<BulkCreateDraftPostsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item._id` | `results.${number}.item.title` | `results.${number}.item.minutesToRead` | `results.${number}.item.status` | `results.${number}.item.moderationDetails.submittedBy` | `results.${number}.item.moderationDetails.status` | `results.${number}.item.hasUnpublishedChanges` | `results.${number}.item.media.displayed` | `results.${number}.item.media.custom` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4>>;
4574
+ declare function bulkCreateDraftPosts(draftPosts: DraftPost[], options?: BulkCreateDraftPostsOptions): Promise<NonNullablePaths<BulkCreateDraftPostsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item._id` | `results.${number}.item.title` | `results.${number}.item.minutesToRead` | `results.${number}.item.status` | `results.${number}.item.moderationDetails.submittedBy` | `results.${number}.item.moderationDetails.status` | `results.${number}.item.hasUnpublishedChanges` | `results.${number}.item.media.displayed` | `results.${number}.item.media.custom` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4>>;
4565
4575
  interface BulkCreateDraftPostsOptions {
4566
4576
  /** Whether the draft post should be published after creation. */
4567
4577
  publish?: boolean;
@@ -4577,6 +4587,9 @@ interface BulkCreateDraftPostsOptions {
4577
4587
  }
4578
4588
  /**
4579
4589
  * Updates multiple draft posts.
4590
+ *
4591
+ * An item fails with the `POST_TITLE_REQUIRED` application error when it would publish or schedule a draft post
4592
+ * without a title, or clear the title of a scheduled draft post.
4580
4593
  * @public
4581
4594
  * @requiredField options.draftPosts.draftPost
4582
4595
  * @requiredField options.draftPosts.draftPost._id
@@ -4678,6 +4691,16 @@ interface GetDraftPostOptions {
4678
4691
  }
4679
4692
  /**
4680
4693
  * Updates a draft post.
4694
+ *
4695
+ * If the post is already published, the default `UPDATE` action changes only the draft post. The published post
4696
+ * stays as it was until the draft post is published. To apply the changes to the published post, set `action` to
4697
+ * `UPDATE_PUBLISH`, which updates and publishes in one call, or call Publish Draft Post afterward.
4698
+ *
4699
+ * An empty or whitespace-only `title` clears the title. Fails with the `POST_TITLE_REQUIRED` application error
4700
+ * when `action` is `UPDATE_PUBLISH`, `UPDATE_SCHEDULE` or `UPDATE_PUBLICATION` and the draft post has no title,
4701
+ * or when the update clears the title of a scheduled draft post.
4702
+ * With `action` set to `UPDATE`, clearing the title of a published post's draft succeeds: the published post
4703
+ * keeps its title, and only publishing the untitled draft post fails.
4681
4704
  * @param _id - Draft post ID.
4682
4705
  * @public
4683
4706
  * @requiredField _id
@@ -5178,6 +5201,8 @@ declare const utils: {
5178
5201
  *
5179
5202
  * If the draft post was already published, the published post will be updated with the latest values
5180
5203
  * from the draft post.
5204
+ *
5205
+ * Fails with the `POST_TITLE_REQUIRED` application error when the draft post has no title.
5181
5206
  * @param draftPostId - Draft post ID.
5182
5207
  * @public
5183
5208
  * @requiredField draftPostId
@@ -5224,7 +5249,6 @@ interface TranslateDraftOptions {
5224
5249
  * Predefined sets of fields to return in the created draft post, in addition to the core draft post fields.
5225
5250
  *
5226
5251
  * - `URL`: Returns the draft post's preview URL.
5227
- * - `CONTENT`: Returns the draft post's content.
5228
5252
  * - `RICH_CONTENT`: Returns the draft post's rich content.
5229
5253
  * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
5230
5254
  *
@@ -5262,7 +5286,6 @@ interface UpdateDraftPostLanguageOptions {
5262
5286
  * Predefined sets of fields to return in the updated draft post, in addition to the core draft post fields.
5263
5287
  *
5264
5288
  * - `URL`: Returns the draft post's preview URL.
5265
- * - `CONTENT`: Returns the draft post's content.
5266
5289
  * - `RICH_CONTENT`: Returns the draft post's rich content.
5267
5290
  * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
5268
5291
  *