@wix/auto_sdk_blog_draft-posts 1.0.117 → 1.0.119

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.
@@ -1034,6 +1034,8 @@ interface TextStyle {
1034
1034
  textAlignment?: TextAlignmentWithLiterals;
1035
1035
  /** A CSS `line-height` value for the text expressed as a ratio relative to the font size. For example, if the font size is 20px, a `lineHeight` value of `'1.5'`` results in a line height of 30px. */
1036
1036
  lineHeight?: string | null;
1037
+ /** Font size of an empty block: it sizes the empty line, its list marker and the text typed into it. Ignored on a block with text, which is sized by its text's `FONT_SIZE` decorations. */
1038
+ fontSize?: FontSizeData;
1037
1039
  }
1038
1040
  declare enum TextAlignment {
1039
1041
  /** browser default, eqivalent to `initial` */
@@ -1049,6 +1051,18 @@ declare enum TextAlignment {
1049
1051
  }
1050
1052
  /** @enumType */
1051
1053
  type TextAlignmentWithLiterals = TextAlignment | 'AUTO' | 'LEFT' | 'RIGHT' | 'CENTER' | 'JUSTIFY';
1054
+ interface FontSizeData {
1055
+ /** The units used for the font size. */
1056
+ unit?: FontTypeWithLiterals;
1057
+ /** Font size value. */
1058
+ value?: number | null;
1059
+ }
1060
+ declare enum FontType {
1061
+ PX = "PX",
1062
+ EM = "EM"
1063
+ }
1064
+ /** @enumType */
1065
+ type FontTypeWithLiterals = FontType | 'PX' | 'EM';
1052
1066
  interface DividerData {
1053
1067
  /** Styling for the divider's container. */
1054
1068
  containerData?: PluginContainerData;
@@ -1913,18 +1927,6 @@ interface MentionData {
1913
1927
  /** The kind of entity the mention refers to. Any value is accepted, and it's usually used to mark a mention as a group mention (for example, `group`). When empty, the mention refers to a member. */
1914
1928
  type?: string | null;
1915
1929
  }
1916
- interface FontSizeData {
1917
- /** The units used for the font size. */
1918
- unit?: FontTypeWithLiterals;
1919
- /** Font size value. */
1920
- value?: number | null;
1921
- }
1922
- declare enum FontType {
1923
- PX = "PX",
1924
- EM = "EM"
1925
- }
1926
- /** @enumType */
1927
- type FontTypeWithLiterals = FontType | 'PX' | 'EM';
1928
1930
  interface SpoilerData {
1929
1931
  /** Spoiler ID. */
1930
1932
  id?: string | null;
@@ -3530,10 +3532,6 @@ interface DraftPostTranslation {
3530
3532
  /** Post URL. */
3531
3533
  url?: PageUrl;
3532
3534
  }
3533
- interface InitialDraftPostsCopied {
3534
- /** Number of draft posts copied. */
3535
- count?: number;
3536
- }
3537
3535
  interface DraftCategoriesUpdated {
3538
3536
  /**
3539
3537
  * Draft post ID.
@@ -3572,368 +3570,258 @@ interface DraftTagsUpdated {
3572
3570
  */
3573
3571
  previousTags?: string[];
3574
3572
  }
3575
- interface CreateDraftPostRequest {
3576
- /** Draft post to create. */
3577
- draftPost: DraftPost;
3578
- /**
3579
- * Whether the draft post should be published on creation.
3580
- *
3581
- * Default: `false`
3582
- */
3583
- publish?: boolean;
3573
+ interface GetDraftPostTotalsRequest {
3584
3574
  /**
3585
- * Save type.
3586
- * @internal
3575
+ * Group results by fields (defaults to grouping by status).
3576
+ * If, for example, grouping by language is passed, language values in response will be filled.
3577
+ * If, for example, grouping by language is not passed, null values will be filled in language field in response.
3578
+ * @maxSize 10
3587
3579
  */
3588
- saveType?: TypeWithLiterals;
3580
+ groupBy?: TotalDraftPostsGroupingFieldWithLiterals[];
3589
3581
  /**
3590
- * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3591
- * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3592
- * only the draft post's base fields are returned.
3593
- * @maxSize 10
3582
+ * Optional language filter by provided language code. Useful in multilingual context.
3583
+ * @format LANGUAGE_TAG
3594
3584
  */
3595
- fieldsets?: FieldWithLiterals[];
3585
+ language?: string | null;
3596
3586
  }
3597
- declare enum Type {
3598
- UNKNOWN = "UNKNOWN",
3599
- /** Manually saved. */
3600
- MANUAL = "MANUAL",
3601
- /** Triggered by autosave. */
3602
- AUTO_SAVE = "AUTO_SAVE",
3603
- /** Copied from template during provisioning flow. */
3604
- PROVISIONING = "PROVISIONING",
3605
- /** Imported from another blog. */
3606
- IMPORT = "IMPORT",
3607
- /** Triggered by autosave when post created by AI tool. */
3608
- AI_AUTO_SAVE = "AI_AUTO_SAVE"
3587
+ declare enum TotalDraftPostsGroupingField {
3588
+ /** Groups results by status. */
3589
+ STATUS = "STATUS",
3590
+ /** Groups results by language. */
3591
+ LANGUAGE = "LANGUAGE"
3609
3592
  }
3610
3593
  /** @enumType */
3611
- type TypeWithLiterals = Type | 'UNKNOWN' | 'MANUAL' | 'AUTO_SAVE' | 'PROVISIONING' | 'IMPORT' | 'AI_AUTO_SAVE';
3612
- declare enum Field {
3613
- /** Unknown field. */
3614
- UNKNOWN = "UNKNOWN",
3615
- /** Includes draft post preview URL. */
3616
- URL = "URL",
3594
+ type TotalDraftPostsGroupingFieldWithLiterals = TotalDraftPostsGroupingField | 'STATUS' | 'LANGUAGE';
3595
+ interface GetDraftPostTotalsResponse {
3596
+ /** Draft post totals. */
3597
+ totalDraftPosts?: TotalDraftPosts[];
3598
+ }
3599
+ interface TotalDraftPosts {
3600
+ /** Draft post totals in that group. */
3601
+ total?: number;
3602
+ /** Draft post status (only has value when grouping by status, otherwise null). */
3603
+ status?: StatusWithLiterals;
3617
3604
  /**
3618
- * Includes internal id field.
3619
- * Reserved for internal use.
3620
- * @internal
3605
+ * Draft post language code (only has value when grouping by language, otherwise null).
3606
+ * @format LANGUAGE_TAG
3621
3607
  */
3622
- INTERNAL_ID = "INTERNAL_ID",
3623
- /** Includes content field. */
3624
- CONTENT = "CONTENT",
3625
- /** Includes rich content field. */
3626
- RICH_CONTENT = "RICH_CONTENT",
3608
+ language?: string | null;
3609
+ }
3610
+ interface DomainEvent extends DomainEventBodyOneOf {
3611
+ createdEvent?: EntityCreatedEvent;
3612
+ updatedEvent?: EntityUpdatedEvent;
3613
+ deletedEvent?: EntityDeletedEvent;
3614
+ actionEvent?: ActionEvent;
3615
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
3616
+ id?: string;
3627
3617
  /**
3628
- * Includes draft post translations when present.
3629
- * @internal
3618
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
3619
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
3630
3620
  */
3631
- TRANSLATIONS = "TRANSLATIONS",
3632
- /** If the user has not set excerpt, returns the one autogenerated from content. */
3633
- GENERATED_EXCERPT = "GENERATED_EXCERPT"
3634
- }
3635
- /** @enumType */
3636
- type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'CONTENT' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3637
- interface CreateDraftPostResponse {
3638
- /** Created draft post info. */
3639
- draftPost?: DraftPost;
3640
- }
3641
- interface BulkCreateDraftPostsRequest {
3621
+ entityFqdn?: string;
3642
3622
  /**
3643
- * Draft posts to create.
3644
- * @minSize 1
3645
- * @maxSize 20
3623
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
3624
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
3646
3625
  */
3647
- draftPosts: DraftPost[];
3648
- /** Whether the draft post should be published after creation. */
3649
- publish?: boolean;
3626
+ slug?: string;
3627
+ /** ID of the entity associated with the event. */
3628
+ entityId?: string;
3629
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
3630
+ eventTime?: Date | null;
3650
3631
  /**
3651
- * Save type.
3652
- * @internal
3632
+ * Whether the event was triggered as a result of a privacy regulation application
3633
+ * (for example, GDPR).
3653
3634
  */
3654
- saveType?: TypeWithLiterals;
3655
- /** Whether to return the full created draft post entities in the response. */
3656
- returnFullEntity?: boolean;
3635
+ triggeredByAnonymizeRequest?: boolean | null;
3636
+ /** If present, indicates the action that triggered the event. */
3637
+ originatedFrom?: string | null;
3657
3638
  /**
3658
- * List of draft post fields to be included in the response if the entities are present.
3659
- * Base default fieldset returns all core draft post properties (all properties that are not a supported fieldset value).
3660
- * For example, when `URL` fieldset is selected, returned draft post will include the set of base properties and the draft post's preview url.
3661
- * @maxSize 10
3639
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
3640
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
3662
3641
  */
3663
- fieldsets?: FieldWithLiterals[];
3664
- }
3665
- interface BulkCreateDraftPostsResponse {
3666
- /** Draft posts created by bulk action. */
3667
- results?: BulkDraftPostResult[];
3668
- /** Bulk action metadata. */
3669
- bulkActionMetadata?: BulkActionMetadata;
3670
- }
3671
- interface BulkDraftPostResult {
3672
- /** Bulk actions metadata for draft post. */
3673
- itemMetadata?: ItemMetadata;
3674
- /** Optional full draft post. */
3675
- item?: DraftPost;
3642
+ entityEventSequence?: string | null;
3676
3643
  }
3677
- interface ItemMetadata {
3678
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
3679
- id?: string | null;
3680
- /** Index of the item within the request array. Allows for correlation between request and response items. */
3681
- originalIndex?: number;
3682
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
3683
- success?: boolean;
3684
- /** Details about the error in case of failure. */
3685
- error?: ApplicationError;
3644
+ /** @oneof */
3645
+ interface DomainEventBodyOneOf {
3646
+ createdEvent?: EntityCreatedEvent;
3647
+ updatedEvent?: EntityUpdatedEvent;
3648
+ deletedEvent?: EntityDeletedEvent;
3649
+ actionEvent?: ActionEvent;
3686
3650
  }
3687
- interface ApplicationError {
3688
- /** Error code. */
3689
- code?: string;
3690
- /** Description of the error. */
3691
- description?: string;
3692
- /** Data related to the error. */
3693
- data?: Record<string, any> | null;
3651
+ interface EntityCreatedEvent {
3652
+ entityAsJson?: string;
3653
+ /**
3654
+ * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity
3655
+ * @internal
3656
+ */
3657
+ triggeredByUndelete?: boolean | null;
3658
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
3659
+ restoreInfo?: RestoreInfo;
3660
+ /**
3661
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
3662
+ * @internal
3663
+ */
3664
+ additionalMetadataAsJson?: string | null;
3694
3665
  }
3695
- interface BulkActionMetadata {
3696
- /** Number of items that were successfully processed. */
3697
- totalSuccesses?: number;
3698
- /** Number of items that couldn't be processed. */
3699
- totalFailures?: number;
3700
- /** Number of failures without details because detailed failure threshold was exceeded. */
3701
- undetailedFailures?: number;
3666
+ interface RestoreInfo {
3667
+ deletedDate?: Date | null;
3702
3668
  }
3703
- interface BulkUpdateDraftPostsRequest {
3669
+ interface EntityUpdatedEvent {
3704
3670
  /**
3705
- * Draft posts to update.
3706
- * @minSize 1
3707
- * @maxSize 20
3671
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3672
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3673
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3708
3674
  */
3709
- draftPosts?: MaskedDraftPosts[];
3675
+ currentEntityAsJson?: string;
3710
3676
  /**
3711
- * Action to perform on the posts.
3712
- *
3713
- * Default: `UPDATE`
3677
+ * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard
3678
+ * wont populate it / have any reference to it in the API.
3679
+ * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,
3680
+ * the developer should send only the new (current) entity.
3681
+ * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big
3682
+ * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.
3683
+ * @internal
3684
+ * @deprecated
3714
3685
  */
3715
- action?: ActionWithLiterals;
3716
- /** Posts' scheduled publish date when `action` is set to `UPDATE_SCHEDULE`. */
3717
- scheduledPublishDate?: Date | null;
3686
+ previousEntityAsJson?: string | null;
3718
3687
  /**
3719
- * Save type.
3688
+ * Map of fully qualified field paths to their previous values for fields that changed.
3689
+ * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format)
3720
3690
  * @internal
3721
3691
  */
3722
- saveType?: TypeWithLiterals;
3723
- /** Whether to return the full updated draft post entities in the response. */
3724
- returnFullEntity?: boolean;
3692
+ modifiedFields?: Record<string, any>;
3725
3693
  /**
3726
- * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3727
- * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3728
- * only the draft post's base fields are returned.
3729
- * @maxSize 10
3694
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
3695
+ * @internal
3730
3696
  */
3731
- fieldsets?: FieldWithLiterals[];
3732
- }
3733
- interface MaskedDraftPosts {
3734
- /** Draft post */
3735
- draftPost?: DraftPost;
3736
- /** Field mask of fields to update. */
3737
- fieldMask?: string[];
3697
+ additionalMetadataAsJson?: string | null;
3738
3698
  }
3739
- declare enum Action {
3740
- /** Update the draft post. */
3741
- UPDATE = "UPDATE",
3742
- /** Update and publish a draft post. */
3743
- UPDATE_PUBLISH = "UPDATE_PUBLISH",
3744
- /** Update the draft post and schedule a publish date. */
3745
- UPDATE_SCHEDULE = "UPDATE_SCHEDULE",
3746
- /** Update the post and revert it to draft. */
3747
- UPDATE_REVERT_TO_DRAFT = "UPDATE_REVERT_TO_DRAFT",
3748
- /** Update the draft post and cancel the scheduled publish date. */
3749
- UPDATE_CANCEL_SCHEDULE = "UPDATE_CANCEL_SCHEDULE",
3750
- /** Update and reject draft post. */
3751
- UPDATE_REJECT = "UPDATE_REJECT",
3752
- /** Update a post that's already been published. This creates and updates a draft version of the post. The original post is still published. */
3753
- UPDATE_PUBLICATION = "UPDATE_PUBLICATION"
3754
- }
3755
- /** @enumType */
3756
- type ActionWithLiterals = Action | 'UPDATE' | 'UPDATE_PUBLISH' | 'UPDATE_SCHEDULE' | 'UPDATE_REVERT_TO_DRAFT' | 'UPDATE_CANCEL_SCHEDULE' | 'UPDATE_REJECT' | 'UPDATE_PUBLICATION';
3757
- interface BulkUpdateDraftPostsResponse {
3758
- /** Draft posts updated by bulk action. */
3759
- results?: BulkDraftPostResult[];
3760
- /** Bulk action metadata. */
3761
- bulkActionMetadata?: BulkActionMetadata;
3762
- }
3763
- interface DraftPostOwnerChanged {
3699
+ interface EntityDeletedEvent {
3764
3700
  /**
3765
- * Member ID of the draft post's owner before the change.
3701
+ * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
3766
3702
  * @internal
3767
- * @format GUID
3768
3703
  */
3769
- oldMemberId?: string;
3704
+ movedToTrash?: boolean | null;
3705
+ /** Entity that was deleted. */
3706
+ deletedEntityAsJson?: string | null;
3770
3707
  /**
3771
- * Member ID of the draft post's owner after the change.
3708
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
3772
3709
  * @internal
3773
- * @format GUID
3774
3710
  */
3775
- newMemberId?: string;
3711
+ additionalMetadataAsJson?: string | null;
3776
3712
  }
3777
- interface ListDeletedDraftPostsRequest {
3778
- /**
3779
- * Language filter.
3780
- *
3781
- * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3782
- * If omitted, deleted draft posts in all languages are returned.
3783
- * @format LANGUAGE_TAG
3784
- */
3785
- language?: string | null;
3786
- /**
3787
- * Sorting options.
3788
- *
3789
- * Default: `EDITING_DATE_DESCENDING`
3790
- */
3791
- sort?: GetDraftPostsSortWithLiterals;
3792
- /** Pagination options. */
3793
- paging?: BlogPaging;
3713
+ interface ActionEvent {
3714
+ bodyAsJson?: string;
3715
+ }
3716
+ interface MessageEnvelope {
3794
3717
  /**
3795
- * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3796
- * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3797
- * only the draft post's base fields are returned.
3798
- * @maxSize 10
3718
+ * App instance ID.
3719
+ * @format GUID
3799
3720
  */
3800
- fieldsets?: FieldWithLiterals[];
3721
+ instanceId?: string | null;
3801
3722
  /**
3802
- * Draft post ids.
3803
- * @maxSize 100
3804
- * @format GUID
3723
+ * Event type.
3724
+ * @maxLength 150
3805
3725
  */
3806
- draftPostIds?: string[];
3807
- }
3808
- declare enum GetDraftPostsSort {
3809
- /** Sort by `editedDate` in descending order. */
3810
- EDITING_DATE_DESC = "EDITING_DATE_DESC",
3811
- /** Sort by `editedDate` in ascending order. */
3812
- EDITING_DATE_ASC = "EDITING_DATE_ASC"
3726
+ eventType?: string;
3727
+ /** The identification type and identity data. */
3728
+ identity?: IdentificationData;
3729
+ /** Stringify payload. */
3730
+ data?: string;
3731
+ /** Details related to the account */
3732
+ accountInfo?: AccountInfo;
3813
3733
  }
3814
- /** @enumType */
3815
- type GetDraftPostsSortWithLiterals = GetDraftPostsSort | 'EDITING_DATE_DESC' | 'EDITING_DATE_ASC';
3816
- interface BlogPaging {
3734
+ interface IdentificationData extends IdentificationDataIdOneOf {
3817
3735
  /**
3818
- * Number of items to skip in the current sort order.
3819
- *
3820
- *
3821
- * Default: `0`
3736
+ * ID of a site visitor that has not logged in to the site.
3737
+ * @format GUID
3822
3738
  */
3823
- offset?: number;
3739
+ anonymousVisitorId?: string;
3824
3740
  /**
3825
- * Number of items to return.
3826
- *
3827
- *
3828
- * Default:`50`
3829
- * @min 1
3830
- * @max 100
3741
+ * ID of a site visitor that has logged in to the site.
3742
+ * @format GUID
3831
3743
  */
3832
- limit?: number;
3744
+ memberId?: string;
3833
3745
  /**
3834
- * Pointer to the next or previous page in the list of results.
3835
- * @maxLength 2000
3746
+ * ID of a Wix user (site owner, contributor, etc.).
3747
+ * @format GUID
3836
3748
  */
3837
- cursor?: string | null;
3838
- }
3839
- interface ListDeletedDraftPostsResponse {
3840
- /** List of draft posts. */
3841
- draftPosts?: DraftPost[];
3842
- /** Details on the paged set of results returned. */
3843
- pagingMetadata?: PagingMetadataV2;
3844
- }
3845
- interface PagingMetadataV2 {
3846
- /** Number of items returned in the response. */
3847
- count?: number | null;
3848
- /** Offset that was requested. */
3849
- offset?: number | null;
3850
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
3851
- total?: number | null;
3852
- /** Flag that indicates the server failed to calculate the `total` field. */
3853
- tooManyToCount?: boolean | null;
3854
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
3855
- cursors?: Cursors;
3749
+ wixUserId?: string;
3856
3750
  /**
3857
- * Indicates if there are more results after the current page.
3858
- * If `true`, another page of results can be retrieved.
3859
- * If `false`, this is the last page.
3860
- * @internal
3751
+ * ID of an app.
3752
+ * @format GUID
3861
3753
  */
3862
- hasNext?: boolean | null;
3754
+ appId?: string;
3755
+ /** @readonly */
3756
+ identityType?: WebhookIdentityTypeWithLiterals;
3863
3757
  }
3864
- interface Cursors {
3758
+ /** @oneof */
3759
+ interface IdentificationDataIdOneOf {
3865
3760
  /**
3866
- * Cursor pointing to next page in the list of results.
3867
- * @maxLength 2000
3761
+ * ID of a site visitor that has not logged in to the site.
3762
+ * @format GUID
3868
3763
  */
3869
- next?: string | null;
3764
+ anonymousVisitorId?: string;
3870
3765
  /**
3871
- * Cursor pointing to previous page in the list of results.
3872
- * @maxLength 2000
3766
+ * ID of a site visitor that has logged in to the site.
3767
+ * @format GUID
3873
3768
  */
3874
- prev?: string | null;
3875
- }
3876
- interface GetDraftPostRequest {
3769
+ memberId?: string;
3877
3770
  /**
3878
- * Draft post ID.
3879
- * @maxLength 38
3771
+ * ID of a Wix user (site owner, contributor, etc.).
3772
+ * @format GUID
3880
3773
  */
3881
- draftPostId: string;
3774
+ wixUserId?: string;
3882
3775
  /**
3883
- * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3884
- * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3885
- * only the draft post's base fields are returned.
3886
- * @maxSize 10
3776
+ * ID of an app.
3777
+ * @format GUID
3887
3778
  */
3888
- fieldsets?: FieldWithLiterals[];
3779
+ appId?: string;
3889
3780
  }
3890
- interface GetDraftPostResponse {
3891
- /** Draft post info. */
3892
- draftPost?: DraftPost;
3781
+ declare enum WebhookIdentityType {
3782
+ UNKNOWN = "UNKNOWN",
3783
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
3784
+ MEMBER = "MEMBER",
3785
+ WIX_USER = "WIX_USER",
3786
+ APP = "APP"
3893
3787
  }
3894
- interface UpdateDraftPostContentRequest {
3788
+ /** @enumType */
3789
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
3790
+ interface AccountInfo {
3895
3791
  /**
3896
- * Draft post ID.
3897
- * @maxLength 38
3792
+ * ID of the Wix account associated with the event.
3793
+ * @format GUID
3898
3794
  */
3899
- draftPostId?: string;
3900
- /** Change origin. */
3901
- changeOrigin?: OriginWithLiterals;
3795
+ accountId?: string | null;
3902
3796
  /**
3903
- * List of draft post fields to be included if entities are present in the response.
3904
- * Base fieldset, which is default, will return all core draft post properties.
3905
- * Example: When URL fieldset is selected, returned draft post will have a set of base properties and draft post preview url.
3906
- * @maxSize 10
3797
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
3798
+ * @format GUID
3907
3799
  */
3908
- fieldsets?: FieldWithLiterals[];
3909
- /** Draft Post rich content. */
3910
- richContent?: RichContent;
3800
+ parentAccountId?: string | null;
3801
+ /**
3802
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
3803
+ * @format GUID
3804
+ */
3805
+ siteId?: string | null;
3911
3806
  }
3912
- interface UpdateDraftPostContentResponse {
3913
- /** Updated draft post info. */
3914
- draftPost?: DraftPost;
3807
+ interface InitialDraftPostsCopied {
3808
+ /** Number of draft posts copied. */
3809
+ count?: number;
3915
3810
  }
3916
- interface UpdateDraftPostRequest {
3917
- /** Draft post to update. */
3811
+ interface CreateDraftPostRequest {
3812
+ /** Draft post to create. */
3918
3813
  draftPost: DraftPost;
3919
3814
  /**
3920
- * Field mask of fields to update.
3921
- * @internal
3815
+ * Whether the draft post should be published on creation.
3816
+ *
3817
+ * Default: `false`
3922
3818
  */
3923
- fieldMask?: string[];
3819
+ publish?: boolean;
3924
3820
  /**
3925
3821
  * Save type.
3926
3822
  * @internal
3927
3823
  */
3928
3824
  saveType?: TypeWithLiterals;
3929
- /**
3930
- * Action to perform on the post.
3931
- *
3932
- * Default: `UPDATE`
3933
- */
3934
- action?: ActionWithLiterals;
3935
- /** Post publish schedule date if `action` is set to `UPDATE_SCHEDULE`. */
3936
- scheduledPublishDate?: Date | null;
3937
3825
  /**
3938
3826
  * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3939
3827
  * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
@@ -3942,68 +3830,197 @@ interface UpdateDraftPostRequest {
3942
3830
  */
3943
3831
  fieldsets?: FieldWithLiterals[];
3944
3832
  }
3945
- interface UpdateDraftPostResponse {
3946
- /** Updated draft post info. */
3947
- draftPost?: DraftPost;
3833
+ declare enum Type {
3834
+ UNKNOWN = "UNKNOWN",
3835
+ /** Manually saved. */
3836
+ MANUAL = "MANUAL",
3837
+ /** Triggered by autosave. */
3838
+ AUTO_SAVE = "AUTO_SAVE",
3839
+ /** Copied from template during provisioning flow. */
3840
+ PROVISIONING = "PROVISIONING",
3841
+ /** Imported from another blog. */
3842
+ IMPORT = "IMPORT",
3843
+ /** Triggered by autosave when post created by AI tool. */
3844
+ AI_AUTO_SAVE = "AI_AUTO_SAVE"
3948
3845
  }
3949
- interface DeleteDraftPostRequest {
3950
- /**
3951
- * Draft post ID.
3952
- * @maxLength 38
3953
- */
3954
- draftPostId: string;
3955
- /**
3956
- * Whether to bypass the trash bin and delete the post permanently.
3957
- *
3958
- * Default: `false`
3846
+ /** @enumType */
3847
+ type TypeWithLiterals = Type | 'UNKNOWN' | 'MANUAL' | 'AUTO_SAVE' | 'PROVISIONING' | 'IMPORT' | 'AI_AUTO_SAVE';
3848
+ declare enum Field {
3849
+ /** Unknown field. */
3850
+ UNKNOWN = "UNKNOWN",
3851
+ /** Includes draft post preview URL. */
3852
+ URL = "URL",
3853
+ /**
3854
+ * Includes internal id field.
3855
+ * Reserved for internal use.
3856
+ * @internal
3959
3857
  */
3960
- permanent?: boolean;
3858
+ INTERNAL_ID = "INTERNAL_ID",
3859
+ /** Includes content field. */
3860
+ CONTENT = "CONTENT",
3861
+ /** Includes rich content field. */
3862
+ RICH_CONTENT = "RICH_CONTENT",
3863
+ /**
3864
+ * Includes draft post translations when present.
3865
+ * @internal
3866
+ */
3867
+ TRANSLATIONS = "TRANSLATIONS",
3868
+ /** If the user has not set excerpt, returns the one autogenerated from content. */
3869
+ GENERATED_EXCERPT = "GENERATED_EXCERPT"
3961
3870
  }
3962
- interface DeleteDraftPostResponse {
3871
+ /** @enumType */
3872
+ type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'CONTENT' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3873
+ interface CreateDraftPostResponse {
3874
+ /** Created draft post info. */
3875
+ draftPost?: DraftPost;
3963
3876
  }
3964
- interface RemoveFromTrashBinRequest {
3877
+ interface BulkCreateDraftPostsRequest {
3965
3878
  /**
3966
- * Draft post ID.
3967
- * @maxLength 38
3879
+ * Draft posts to create.
3880
+ * @minSize 1
3881
+ * @maxSize 20
3968
3882
  */
3969
- draftPostId: string;
3883
+ draftPosts: DraftPost[];
3884
+ /** Whether the draft post should be published after creation. */
3885
+ publish?: boolean;
3886
+ /**
3887
+ * Save type.
3888
+ * @internal
3889
+ */
3890
+ saveType?: TypeWithLiterals;
3891
+ /** Whether to return the full created draft post entities in the response. */
3892
+ returnFullEntity?: boolean;
3893
+ /**
3894
+ * List of draft post fields to be included in the response if the entities are present.
3895
+ * Base default fieldset returns all core draft post properties (all properties that are not a supported fieldset value).
3896
+ * For example, when `URL` fieldset is selected, returned draft post will include the set of base properties and the draft post's preview url.
3897
+ * @maxSize 10
3898
+ */
3899
+ fieldsets?: FieldWithLiterals[];
3970
3900
  }
3971
- interface RemoveFromTrashBinResponse {
3901
+ interface BulkCreateDraftPostsResponse {
3902
+ /** Draft posts created by bulk action. */
3903
+ results?: BulkDraftPostResult[];
3904
+ /** Bulk action metadata. */
3905
+ bulkActionMetadata?: BulkActionMetadata;
3972
3906
  }
3973
- interface BulkDeleteDraftPostsRequest {
3907
+ interface BulkDraftPostResult {
3908
+ /** Bulk actions metadata for draft post. */
3909
+ itemMetadata?: ItemMetadata;
3910
+ /** Optional full draft post. */
3911
+ item?: DraftPost;
3912
+ }
3913
+ interface ItemMetadata {
3914
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
3915
+ id?: string | null;
3916
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
3917
+ originalIndex?: number;
3918
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
3919
+ success?: boolean;
3920
+ /** Details about the error in case of failure. */
3921
+ error?: ApplicationError;
3922
+ }
3923
+ interface ApplicationError {
3924
+ /** Error code. */
3925
+ code?: string;
3926
+ /** Description of the error. */
3927
+ description?: string;
3928
+ /** Data related to the error. */
3929
+ data?: Record<string, any> | null;
3930
+ }
3931
+ interface BulkActionMetadata {
3932
+ /** Number of items that were successfully processed. */
3933
+ totalSuccesses?: number;
3934
+ /** Number of items that couldn't be processed. */
3935
+ totalFailures?: number;
3936
+ /** Number of failures without details because detailed failure threshold was exceeded. */
3937
+ undetailedFailures?: number;
3938
+ }
3939
+ interface BulkUpdateDraftPostsRequest {
3974
3940
  /**
3975
- * Post IDs.
3941
+ * Draft posts to update.
3976
3942
  * @minSize 1
3977
- * @maxSize 100
3978
- * @maxLength 38
3943
+ * @maxSize 20
3979
3944
  */
3980
- postIds: string[];
3981
- /** Should delete bypassing the trash-bin. */
3982
- permanent?: boolean;
3945
+ draftPosts?: MaskedDraftPosts[];
3946
+ /**
3947
+ * Action to perform on the posts.
3948
+ *
3949
+ * Default: `UPDATE`
3950
+ */
3951
+ action?: ActionWithLiterals;
3952
+ /** Posts' scheduled publish date when `action` is set to `UPDATE_SCHEDULE`. */
3953
+ scheduledPublishDate?: Date | null;
3954
+ /**
3955
+ * Save type.
3956
+ * @internal
3957
+ */
3958
+ saveType?: TypeWithLiterals;
3959
+ /** Whether to return the full updated draft post entities in the response. */
3960
+ returnFullEntity?: boolean;
3961
+ /**
3962
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3963
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3964
+ * only the draft post's base fields are returned.
3965
+ * @maxSize 10
3966
+ */
3967
+ fieldsets?: FieldWithLiterals[];
3983
3968
  }
3984
- interface BulkDeleteDraftPostsResponse {
3985
- /** Bulk action results. */
3969
+ interface MaskedDraftPosts {
3970
+ /** Draft post */
3971
+ draftPost?: DraftPost;
3972
+ /** Field mask of fields to update. */
3973
+ fieldMask?: string[];
3974
+ }
3975
+ declare enum Action {
3976
+ /** Update the draft post. */
3977
+ UPDATE = "UPDATE",
3978
+ /** Update and publish a draft post. */
3979
+ UPDATE_PUBLISH = "UPDATE_PUBLISH",
3980
+ /** Update the draft post and schedule a publish date. */
3981
+ UPDATE_SCHEDULE = "UPDATE_SCHEDULE",
3982
+ /** Update the post and revert it to draft. */
3983
+ UPDATE_REVERT_TO_DRAFT = "UPDATE_REVERT_TO_DRAFT",
3984
+ /** Update the draft post and cancel the scheduled publish date. */
3985
+ UPDATE_CANCEL_SCHEDULE = "UPDATE_CANCEL_SCHEDULE",
3986
+ /** Update and reject draft post. */
3987
+ UPDATE_REJECT = "UPDATE_REJECT",
3988
+ /** Update a post that's already been published. This creates and updates a draft version of the post. The original post is still published. */
3989
+ UPDATE_PUBLICATION = "UPDATE_PUBLICATION"
3990
+ }
3991
+ /** @enumType */
3992
+ type ActionWithLiterals = Action | 'UPDATE' | 'UPDATE_PUBLISH' | 'UPDATE_SCHEDULE' | 'UPDATE_REVERT_TO_DRAFT' | 'UPDATE_CANCEL_SCHEDULE' | 'UPDATE_REJECT' | 'UPDATE_PUBLICATION';
3993
+ interface BulkUpdateDraftPostsResponse {
3994
+ /** Draft posts updated by bulk action. */
3986
3995
  results?: BulkDraftPostResult[];
3987
3996
  /** Bulk action metadata. */
3988
3997
  bulkActionMetadata?: BulkActionMetadata;
3989
3998
  }
3990
- interface ListDraftPostsRequest {
3999
+ interface DraftPostOwnerChanged {
3991
4000
  /**
3992
- * Draft post status filter.
3993
- *
3994
- * If omitted, draft posts with all statuses are returned.
4001
+ * Member ID of the draft post's owner before the change.
4002
+ * @internal
4003
+ * @format GUID
3995
4004
  */
3996
- status?: StatusWithLiterals;
4005
+ oldMemberId?: string;
4006
+ /**
4007
+ * Member ID of the draft post's owner after the change.
4008
+ * @internal
4009
+ * @format GUID
4010
+ */
4011
+ newMemberId?: string;
4012
+ }
4013
+ interface ListDeletedDraftPostsRequest {
3997
4014
  /**
3998
4015
  * Language filter.
3999
4016
  *
4000
4017
  * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4001
- * If omitted, draft posts in all languages are returned.
4018
+ * If omitted, deleted draft posts in all languages are returned.
4002
4019
  * @format LANGUAGE_TAG
4003
4020
  */
4004
4021
  language?: string | null;
4005
4022
  /**
4006
- * Sort options.
4023
+ * Sorting options.
4007
4024
  *
4008
4025
  * Default: `EDITING_DATE_DESCENDING`
4009
4026
  */
@@ -4017,49 +4034,87 @@ interface ListDraftPostsRequest {
4017
4034
  * @maxSize 10
4018
4035
  */
4019
4036
  fieldsets?: FieldWithLiterals[];
4037
+ /**
4038
+ * Draft post ids.
4039
+ * @maxSize 100
4040
+ * @format GUID
4041
+ */
4042
+ draftPostIds?: string[];
4020
4043
  }
4021
- interface ListDraftPostsResponse {
4022
- /** List of draft posts. */
4023
- draftPosts?: DraftPost[];
4024
- /** Details on the paged set of results returned. */
4025
- metaData?: MetaData;
4044
+ declare enum GetDraftPostsSort {
4045
+ /** Sort by `editedDate` in descending order. */
4046
+ EDITING_DATE_DESC = "EDITING_DATE_DESC",
4047
+ /** Sort by `editedDate` in ascending order. */
4048
+ EDITING_DATE_ASC = "EDITING_DATE_ASC"
4026
4049
  }
4027
- interface MetaData {
4028
- /** Number of items returned in this response. */
4029
- count?: number;
4030
- /** Requested offset. */
4050
+ /** @enumType */
4051
+ type GetDraftPostsSortWithLiterals = GetDraftPostsSort | 'EDITING_DATE_DESC' | 'EDITING_DATE_ASC';
4052
+ interface BlogPaging {
4053
+ /**
4054
+ * Number of items to skip in the current sort order.
4055
+ *
4056
+ *
4057
+ * Default: `0`
4058
+ */
4031
4059
  offset?: number;
4032
- /** Total number of items that match the query. */
4033
- total?: number;
4060
+ /**
4061
+ * Number of items to return.
4062
+ *
4063
+ *
4064
+ * Default:`50`
4065
+ * @min 1
4066
+ * @max 100
4067
+ */
4068
+ limit?: number;
4034
4069
  /**
4035
4070
  * Pointer to the next or previous page in the list of results.
4036
4071
  * @maxLength 2000
4037
4072
  */
4038
4073
  cursor?: string | null;
4039
4074
  }
4040
- interface GetDeletedDraftPostRequest {
4075
+ interface ListDeletedDraftPostsResponse {
4076
+ /** List of draft posts. */
4077
+ draftPosts?: DraftPost[];
4078
+ /** Details on the paged set of results returned. */
4079
+ pagingMetadata?: PagingMetadataV2;
4080
+ }
4081
+ interface PagingMetadataV2 {
4082
+ /** Number of items returned in the response. */
4083
+ count?: number | null;
4084
+ /** Offset that was requested. */
4085
+ offset?: number | null;
4086
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
4087
+ total?: number | null;
4088
+ /** Flag that indicates the server failed to calculate the `total` field. */
4089
+ tooManyToCount?: boolean | null;
4090
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
4091
+ cursors?: Cursors;
4041
4092
  /**
4042
- * Draft post ID.
4043
- * @maxLength 38
4093
+ * Indicates if there are more results after the current page.
4094
+ * If `true`, another page of results can be retrieved.
4095
+ * If `false`, this is the last page.
4096
+ * @internal
4044
4097
  */
4045
- draftPostId: string;
4046
- }
4047
- interface GetDeletedDraftPostResponse {
4048
- /** Draft post info. */
4049
- draftPost?: DraftPost;
4098
+ hasNext?: boolean | null;
4050
4099
  }
4051
- interface RestoreFromTrashBinRequest {
4100
+ interface Cursors {
4052
4101
  /**
4053
- * Draft post ID.
4054
- * @maxLength 38
4102
+ * Cursor pointing to next page in the list of results.
4103
+ * @maxLength 2000
4055
4104
  */
4056
- draftPostId: string;
4057
- }
4058
- interface RestoreFromTrashBinResponse {
4059
- /** Restored draft post info. */
4060
- draftPost?: DraftPost;
4105
+ next?: string | null;
4106
+ /**
4107
+ * Cursor pointing to previous page in the list of results.
4108
+ * @maxLength 2000
4109
+ */
4110
+ prev?: string | null;
4061
4111
  }
4062
- interface QueryDraftPostsRequest {
4112
+ interface GetDraftPostRequest {
4113
+ /**
4114
+ * Draft post ID.
4115
+ * @maxLength 38
4116
+ */
4117
+ draftPostId: string;
4063
4118
  /**
4064
4119
  * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
4065
4120
  * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
@@ -4067,485 +4122,340 @@ interface QueryDraftPostsRequest {
4067
4122
  * @maxSize 10
4068
4123
  */
4069
4124
  fieldsets?: FieldWithLiterals[];
4070
- /** Query options. */
4071
- query?: PlatformQuery;
4072
- }
4073
- interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
4074
- /** Paging options to limit and skip the number of items. */
4075
- paging?: Paging;
4076
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
4077
- cursorPaging?: CursorPaging;
4078
- /**
4079
- * Filter object in the following format:
4080
- * `"filter" : {
4081
- * "fieldName1": "value1",
4082
- * "fieldName2":{"$operator":"value2"}
4083
- * }`
4084
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
4085
- */
4086
- filter?: Record<string, any> | null;
4087
- /**
4088
- * Sort object in the following format:
4089
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
4090
- * @maxSize 3
4091
- */
4092
- sort?: Sorting[];
4093
4125
  }
4094
- /** @oneof */
4095
- interface PlatformQueryPagingMethodOneOf {
4096
- /** Paging options to limit and skip the number of items. */
4097
- paging?: Paging;
4098
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
4099
- cursorPaging?: CursorPaging;
4126
+ interface GetDraftPostResponse {
4127
+ /** Draft post info. */
4128
+ draftPost?: DraftPost;
4100
4129
  }
4101
- interface Sorting {
4130
+ interface UpdateDraftPostContentRequest {
4102
4131
  /**
4103
- * Name of the field to sort by.
4104
- * @maxLength 512
4132
+ * Draft post ID.
4133
+ * @maxLength 38
4105
4134
  */
4106
- fieldName?: string;
4107
- /** Sort order. */
4108
- order?: SortOrderWithLiterals;
4135
+ draftPostId?: string;
4136
+ /** Change origin. */
4137
+ changeOrigin?: OriginWithLiterals;
4109
4138
  /**
4110
- * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
4111
- * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
4112
- *
4113
- * If multiple filters are provided, they are combined with AND operator.
4114
- *
4115
- * Example:
4116
- * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
4117
- * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
4118
- * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
4119
- * @internal
4139
+ * List of draft post fields to be included if entities are present in the response.
4140
+ * Base fieldset, which is default, will return all core draft post properties.
4141
+ * Example: When URL fieldset is selected, returned draft post will have a set of base properties and draft post preview url.
4120
4142
  * @maxSize 10
4121
4143
  */
4122
- selectItemsBy?: Record<string, any>[] | null;
4123
- /**
4124
- * Origin point for geo-distance sorting on a GEO field
4125
- * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
4126
- */
4127
- origin?: AddressLocation;
4128
- }
4129
- declare enum SortOrder {
4130
- ASC = "ASC",
4131
- DESC = "DESC"
4144
+ fieldsets?: FieldWithLiterals[];
4145
+ /** Draft Post rich content. */
4146
+ richContent?: RichContent;
4132
4147
  }
4133
- /** @enumType */
4134
- type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
4135
- interface AddressLocation {
4136
- /** Address latitude. */
4137
- latitude?: number | null;
4138
- /** Address longitude. */
4139
- longitude?: number | null;
4148
+ interface UpdateDraftPostContentResponse {
4149
+ /** Updated draft post info. */
4150
+ draftPost?: DraftPost;
4140
4151
  }
4141
- interface Paging {
4152
+ interface UpdateDraftPostRequest {
4153
+ /** Draft post to update. */
4154
+ draftPost: DraftPost;
4142
4155
  /**
4143
- * Number of items to load.
4144
- * @max 100
4156
+ * Field mask of fields to update.
4157
+ * @internal
4145
4158
  */
4146
- limit?: number | null;
4147
- /** Number of items to skip in the current sort order. */
4148
- offset?: number | null;
4149
- }
4150
- interface CursorPaging {
4159
+ fieldMask?: string[];
4151
4160
  /**
4152
- * Number of items to load.
4153
- * @max 100
4161
+ * Save type.
4162
+ * @internal
4154
4163
  */
4155
- limit?: number | null;
4164
+ saveType?: TypeWithLiterals;
4156
4165
  /**
4157
- * Pointer to the next or previous page in the list of results.
4166
+ * Action to perform on the post.
4158
4167
  *
4159
- * You can get the relevant cursor token
4160
- * from the `pagingMetadata` object in the previous call's response.
4161
- * Not relevant for the first request.
4162
- * @maxLength 2000
4168
+ * Default: `UPDATE`
4163
4169
  */
4164
- cursor?: string | null;
4170
+ action?: ActionWithLiterals;
4171
+ /** Post publish schedule date if `action` is set to `UPDATE_SCHEDULE`. */
4172
+ scheduledPublishDate?: Date | null;
4173
+ /**
4174
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
4175
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
4176
+ * only the draft post's base fields are returned.
4177
+ * @maxSize 10
4178
+ */
4179
+ fieldsets?: FieldWithLiterals[];
4165
4180
  }
4166
- interface QueryDraftPostsResponse {
4167
- /** List of posts. */
4168
- draftPosts?: DraftPost[];
4169
- /** Details on the paged set of results returned. */
4170
- pagingMetadata?: PagingMetadataV2;
4181
+ interface UpdateDraftPostResponse {
4182
+ /** Updated draft post info. */
4183
+ draftPost?: DraftPost;
4171
4184
  }
4172
- interface PublishDraftPostRequest {
4185
+ interface DeleteDraftPostRequest {
4173
4186
  /**
4174
4187
  * Draft post ID.
4175
4188
  * @maxLength 38
4176
4189
  */
4177
4190
  draftPostId: string;
4178
- }
4179
- interface PublishDraftPostResponse {
4180
4191
  /**
4181
- * Published post ID.
4182
- * @format GUID
4192
+ * Whether to bypass the trash bin and delete the post permanently.
4193
+ *
4194
+ * Default: `false`
4183
4195
  */
4184
- postId?: string;
4196
+ permanent?: boolean;
4185
4197
  }
4186
- interface UnpublishPostRequest {
4198
+ interface DeleteDraftPostResponse {
4199
+ }
4200
+ interface RemoveFromTrashBinRequest {
4187
4201
  /**
4188
4202
  * Draft post ID.
4189
4203
  * @maxLength 38
4190
4204
  */
4191
- draftPostId?: string;
4205
+ draftPostId: string;
4192
4206
  }
4193
- interface UnpublishPostResponse {
4207
+ interface RemoveFromTrashBinResponse {
4194
4208
  }
4195
- interface GetDraftPostCountsRequest {
4196
- /**
4197
- * Tag IDs to count draft posts for.
4198
- * @maxSize 50
4199
- * @format GUID
4200
- */
4201
- tagIds?: string[];
4209
+ interface BulkDeleteDraftPostsRequest {
4202
4210
  /**
4203
- * Category IDs to count draft posts for.
4204
- * @maxSize 50
4205
- * @format GUID
4211
+ * Post IDs.
4212
+ * @minSize 1
4213
+ * @maxSize 100
4214
+ * @maxLength 38
4206
4215
  */
4207
- categoryIds?: string[];
4208
- }
4209
- interface GetDraftPostCountsResponse {
4210
- /** Draft post counts per tag. */
4211
- tagPostCounts?: DraftPostCount[];
4212
- /** Draft post counts per category. */
4213
- categoryPostCounts?: DraftPostCount[];
4216
+ postIds: string[];
4217
+ /** Should delete bypassing the trash-bin. */
4218
+ permanent?: boolean;
4214
4219
  }
4215
- interface DraftPostCount {
4216
- /**
4217
- * Tag or Category ID.
4218
- * @format GUID
4219
- */
4220
- id?: string;
4221
- /** Number of posts. */
4222
- postCount?: number;
4220
+ interface BulkDeleteDraftPostsResponse {
4221
+ /** Bulk action results. */
4222
+ results?: BulkDraftPostResult[];
4223
+ /** Bulk action metadata. */
4224
+ bulkActionMetadata?: BulkActionMetadata;
4223
4225
  }
4224
- interface DomainEvent extends DomainEventBodyOneOf {
4225
- createdEvent?: EntityCreatedEvent;
4226
- updatedEvent?: EntityUpdatedEvent;
4227
- deletedEvent?: EntityDeletedEvent;
4228
- actionEvent?: ActionEvent;
4229
- /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
4230
- id?: string;
4226
+ interface ListDraftPostsRequest {
4231
4227
  /**
4232
- * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
4233
- * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
4228
+ * Draft post status filter.
4229
+ *
4230
+ * If omitted, draft posts with all statuses are returned.
4234
4231
  */
4235
- entityFqdn?: string;
4232
+ status?: StatusWithLiterals;
4236
4233
  /**
4237
- * Event action name, placed at the top level to make it easier for users to dispatch messages.
4238
- * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
4234
+ * Language filter.
4235
+ *
4236
+ * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4237
+ * If omitted, draft posts in all languages are returned.
4238
+ * @format LANGUAGE_TAG
4239
4239
  */
4240
- slug?: string;
4241
- /** ID of the entity associated with the event. */
4242
- entityId?: string;
4243
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
4244
- eventTime?: Date | null;
4240
+ language?: string | null;
4245
4241
  /**
4246
- * Whether the event was triggered as a result of a privacy regulation application
4247
- * (for example, GDPR).
4242
+ * Sort options.
4243
+ *
4244
+ * Default: `EDITING_DATE_DESCENDING`
4248
4245
  */
4249
- triggeredByAnonymizeRequest?: boolean | null;
4250
- /** If present, indicates the action that triggered the event. */
4251
- originatedFrom?: string | null;
4246
+ sort?: GetDraftPostsSortWithLiterals;
4247
+ /** Pagination options. */
4248
+ paging?: BlogPaging;
4252
4249
  /**
4253
- * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
4254
- * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
4250
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
4251
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
4252
+ * only the draft post's base fields are returned.
4253
+ * @maxSize 10
4255
4254
  */
4256
- entityEventSequence?: string | null;
4255
+ fieldsets?: FieldWithLiterals[];
4257
4256
  }
4258
- /** @oneof */
4259
- interface DomainEventBodyOneOf {
4260
- createdEvent?: EntityCreatedEvent;
4261
- updatedEvent?: EntityUpdatedEvent;
4262
- deletedEvent?: EntityDeletedEvent;
4263
- actionEvent?: ActionEvent;
4257
+ interface ListDraftPostsResponse {
4258
+ /** List of draft posts. */
4259
+ draftPosts?: DraftPost[];
4260
+ /** Details on the paged set of results returned. */
4261
+ metaData?: MetaData;
4264
4262
  }
4265
- interface EntityCreatedEvent {
4266
- entityAsJson?: string;
4267
- /**
4268
- * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity
4269
- * @internal
4270
- */
4271
- triggeredByUndelete?: boolean | null;
4272
- /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
4273
- restoreInfo?: RestoreInfo;
4263
+ interface MetaData {
4264
+ /** Number of items returned in this response. */
4265
+ count?: number;
4266
+ /** Requested offset. */
4267
+ offset?: number;
4268
+ /** Total number of items that match the query. */
4269
+ total?: number;
4274
4270
  /**
4275
- * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4276
- * @internal
4271
+ * Pointer to the next or previous page in the list of results.
4272
+ * @maxLength 2000
4277
4273
  */
4278
- additionalMetadataAsJson?: string | null;
4279
- }
4280
- interface RestoreInfo {
4281
- deletedDate?: Date | null;
4274
+ cursor?: string | null;
4282
4275
  }
4283
- interface EntityUpdatedEvent {
4284
- /**
4285
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
4286
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
4287
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
4288
- */
4289
- currentEntityAsJson?: string;
4290
- /**
4291
- * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard
4292
- * wont populate it / have any reference to it in the API.
4293
- * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,
4294
- * the developer should send only the new (current) entity.
4295
- * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big
4296
- * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.
4297
- * @internal
4298
- * @deprecated
4299
- */
4300
- previousEntityAsJson?: string | null;
4301
- /**
4302
- * Map of fully qualified field paths to their previous values for fields that changed.
4303
- * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format)
4304
- * @internal
4305
- */
4306
- modifiedFields?: Record<string, any>;
4276
+ interface GetDeletedDraftPostRequest {
4307
4277
  /**
4308
- * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4309
- * @internal
4278
+ * Draft post ID.
4279
+ * @maxLength 38
4310
4280
  */
4311
- additionalMetadataAsJson?: string | null;
4281
+ draftPostId: string;
4312
4282
  }
4313
- interface EntityDeletedEvent {
4314
- /**
4315
- * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
4316
- * @internal
4317
- */
4318
- movedToTrash?: boolean | null;
4319
- /** Entity that was deleted. */
4320
- deletedEntityAsJson?: string | null;
4283
+ interface GetDeletedDraftPostResponse {
4284
+ /** Draft post info. */
4285
+ draftPost?: DraftPost;
4286
+ }
4287
+ interface RestoreFromTrashBinRequest {
4321
4288
  /**
4322
- * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4323
- * @internal
4289
+ * Draft post ID.
4290
+ * @maxLength 38
4324
4291
  */
4325
- additionalMetadataAsJson?: string | null;
4292
+ draftPostId: string;
4326
4293
  }
4327
- interface ActionEvent {
4328
- bodyAsJson?: string;
4294
+ interface RestoreFromTrashBinResponse {
4295
+ /** Restored draft post info. */
4296
+ draftPost?: DraftPost;
4329
4297
  }
4330
- interface MessageEnvelope {
4331
- /**
4332
- * App instance ID.
4333
- * @format GUID
4334
- */
4335
- instanceId?: string | null;
4298
+ interface QueryDraftPostsRequest {
4336
4299
  /**
4337
- * Event type.
4338
- * @maxLength 150
4300
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
4301
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
4302
+ * only the draft post's base fields are returned.
4303
+ * @maxSize 10
4339
4304
  */
4340
- eventType?: string;
4341
- /** The identification type and identity data. */
4342
- identity?: IdentificationData;
4343
- /** Stringify payload. */
4344
- data?: string;
4345
- /** Details related to the account */
4346
- accountInfo?: AccountInfo;
4305
+ fieldsets?: FieldWithLiterals[];
4306
+ /** Query options. */
4307
+ query?: PlatformQuery;
4347
4308
  }
4348
- interface IdentificationData extends IdentificationDataIdOneOf {
4349
- /**
4350
- * ID of a site visitor that has not logged in to the site.
4351
- * @format GUID
4352
- */
4353
- anonymousVisitorId?: string;
4354
- /**
4355
- * ID of a site visitor that has logged in to the site.
4356
- * @format GUID
4357
- */
4358
- memberId?: string;
4309
+ interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
4310
+ /** Paging options to limit and skip the number of items. */
4311
+ paging?: Paging;
4312
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
4313
+ cursorPaging?: CursorPaging;
4359
4314
  /**
4360
- * ID of a Wix user (site owner, contributor, etc.).
4361
- * @format GUID
4315
+ * Filter object in the following format:
4316
+ * `"filter" : {
4317
+ * "fieldName1": "value1",
4318
+ * "fieldName2":{"$operator":"value2"}
4319
+ * }`
4320
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
4362
4321
  */
4363
- wixUserId?: string;
4322
+ filter?: Record<string, any> | null;
4364
4323
  /**
4365
- * ID of an app.
4366
- * @format GUID
4324
+ * Sort object in the following format:
4325
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
4326
+ * @maxSize 3
4367
4327
  */
4368
- appId?: string;
4369
- /** @readonly */
4370
- identityType?: WebhookIdentityTypeWithLiterals;
4328
+ sort?: Sorting[];
4371
4329
  }
4372
4330
  /** @oneof */
4373
- interface IdentificationDataIdOneOf {
4374
- /**
4375
- * ID of a site visitor that has not logged in to the site.
4376
- * @format GUID
4377
- */
4378
- anonymousVisitorId?: string;
4379
- /**
4380
- * ID of a site visitor that has logged in to the site.
4381
- * @format GUID
4382
- */
4383
- memberId?: string;
4384
- /**
4385
- * ID of a Wix user (site owner, contributor, etc.).
4386
- * @format GUID
4387
- */
4388
- wixUserId?: string;
4389
- /**
4390
- * ID of an app.
4391
- * @format GUID
4392
- */
4393
- appId?: string;
4394
- }
4395
- declare enum WebhookIdentityType {
4396
- UNKNOWN = "UNKNOWN",
4397
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
4398
- MEMBER = "MEMBER",
4399
- WIX_USER = "WIX_USER",
4400
- APP = "APP"
4331
+ interface PlatformQueryPagingMethodOneOf {
4332
+ /** Paging options to limit and skip the number of items. */
4333
+ paging?: Paging;
4334
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
4335
+ cursorPaging?: CursorPaging;
4401
4336
  }
4402
- /** @enumType */
4403
- type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
4404
- interface AccountInfo {
4405
- /**
4406
- * ID of the Wix account associated with the event.
4407
- * @format GUID
4408
- */
4409
- accountId?: string | null;
4410
- /**
4411
- * ID of the parent Wix account. Only included when accountId belongs to a child account.
4412
- * @format GUID
4413
- */
4414
- parentAccountId?: string | null;
4337
+ interface Sorting {
4415
4338
  /**
4416
- * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
4417
- * @format GUID
4339
+ * Name of the field to sort by.
4340
+ * @maxLength 512
4418
4341
  */
4419
- siteId?: string | null;
4420
- }
4421
- interface GetDraftPostTotalsRequest {
4342
+ fieldName?: string;
4343
+ /** Sort order. */
4344
+ order?: SortOrderWithLiterals;
4422
4345
  /**
4423
- * Group results by fields (defaults to grouping by status).
4424
- * If, for example, grouping by language is passed, language values in response will be filled.
4425
- * If, for example, grouping by language is not passed, null values will be filled in language field in response.
4346
+ * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
4347
+ * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
4348
+ *
4349
+ * If multiple filters are provided, they are combined with AND operator.
4350
+ *
4351
+ * Example:
4352
+ * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
4353
+ * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
4354
+ * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
4355
+ * @internal
4426
4356
  * @maxSize 10
4427
4357
  */
4428
- groupBy?: TotalDraftPostsGroupingFieldWithLiterals[];
4358
+ selectItemsBy?: Record<string, any>[] | null;
4429
4359
  /**
4430
- * Optional language filter by provided language code. Useful in multilingual context.
4431
- * @format LANGUAGE_TAG
4360
+ * Origin point for geo-distance sorting on a GEO field
4361
+ * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
4432
4362
  */
4433
- language?: string | null;
4363
+ origin?: AddressLocation;
4434
4364
  }
4435
- declare enum TotalDraftPostsGroupingField {
4436
- /** Groups results by status. */
4437
- STATUS = "STATUS",
4438
- /** Groups results by language. */
4439
- LANGUAGE = "LANGUAGE"
4365
+ declare enum SortOrder {
4366
+ ASC = "ASC",
4367
+ DESC = "DESC"
4440
4368
  }
4441
4369
  /** @enumType */
4442
- type TotalDraftPostsGroupingFieldWithLiterals = TotalDraftPostsGroupingField | 'STATUS' | 'LANGUAGE';
4443
- interface GetDraftPostTotalsResponse {
4444
- /** Draft post totals. */
4445
- totalDraftPosts?: TotalDraftPosts[];
4370
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
4371
+ interface AddressLocation {
4372
+ /** Address latitude. */
4373
+ latitude?: number | null;
4374
+ /** Address longitude. */
4375
+ longitude?: number | null;
4446
4376
  }
4447
- interface TotalDraftPosts {
4448
- /** Draft post totals in that group. */
4449
- total?: number;
4450
- /** Draft post status (only has value when grouping by status, otherwise null). */
4451
- status?: StatusWithLiterals;
4377
+ interface Paging {
4452
4378
  /**
4453
- * Draft post language code (only has value when grouping by language, otherwise null).
4454
- * @format LANGUAGE_TAG
4379
+ * Number of items to load.
4380
+ * @max 100
4455
4381
  */
4456
- language?: string | null;
4382
+ limit?: number | null;
4383
+ /** Number of items to skip in the current sort order. */
4384
+ offset?: number | null;
4457
4385
  }
4458
- interface TranslateDraftRequest {
4459
- /**
4460
- * ID of the draft post or published post to translate.
4461
- * @format GUID
4462
- */
4463
- postId: string;
4464
- /**
4465
- * Language to translate the post into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4466
- * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4467
- * @format LANGUAGE_TAG
4468
- */
4469
- language: string;
4386
+ interface CursorPaging {
4470
4387
  /**
4471
- * Predefined sets of fields to return in the created draft post, in addition to the core draft post fields.
4472
- *
4473
- * - `URL`: Returns the draft post's preview URL.
4474
- * - `CONTENT`: Returns the draft post's content.
4475
- * - `RICH_CONTENT`: Returns the draft post's rich content.
4476
- * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4477
- *
4478
- * Default: Core draft post fields only.
4479
- * @maxSize 10
4388
+ * Number of items to load.
4389
+ * @max 100
4480
4390
  */
4481
- fieldsets?: FieldWithLiterals[];
4391
+ limit?: number | null;
4482
4392
  /**
4483
- * Whether to machine translate the title and content into the target language.
4393
+ * Pointer to the next or previous page in the list of results.
4484
4394
  *
4485
- * Default: `false`
4486
- * @internal
4395
+ * You can get the relevant cursor token
4396
+ * from the `pagingMetadata` object in the previous call's response.
4397
+ * Not relevant for the first request.
4398
+ * @maxLength 2000
4487
4399
  */
4488
- useAutoTranslation?: boolean;
4400
+ cursor?: string | null;
4489
4401
  }
4490
- interface TranslateDraftResponse {
4491
- /** Created draft post. */
4492
- draftPost?: DraftPost;
4402
+ interface QueryDraftPostsResponse {
4403
+ /** List of posts. */
4404
+ draftPosts?: DraftPost[];
4405
+ /** Details on the paged set of results returned. */
4406
+ pagingMetadata?: PagingMetadataV2;
4493
4407
  }
4494
- interface IsDraftPostAutoTranslatableRequest {
4408
+ interface PublishDraftPostRequest {
4495
4409
  /**
4496
4410
  * Draft post ID.
4411
+ * @maxLength 38
4412
+ */
4413
+ draftPostId: string;
4414
+ }
4415
+ interface PublishDraftPostResponse {
4416
+ /**
4417
+ * Published post ID.
4497
4418
  * @format GUID
4498
4419
  */
4499
- draftPostId?: string;
4420
+ postId?: string;
4500
4421
  }
4501
- interface IsDraftPostAutoTranslatableResponse {
4422
+ interface UnpublishPostRequest {
4502
4423
  /**
4503
4424
  * Draft post ID.
4504
- * @format GUID
4425
+ * @maxLength 38
4505
4426
  */
4506
4427
  draftPostId?: string;
4507
- /** Whether enough machine translation word credits are available to translate the draft post. */
4508
- translatable?: boolean;
4509
- /** Number of words in the draft post's title. */
4510
- titleWordCount?: number;
4511
- /** Number of words in the draft post's content. */
4512
- contentWordCount?: number;
4513
- /** Number of machine translation word credits currently available. `-1` if the site's quota is unlimited. */
4514
- availableAutoTranslateWords?: number;
4515
- /** Number of machine translation word credits that remain after translating the draft post. `-1` if the site's quota is unlimited. */
4516
- availableAutoTranslateWordsAfter?: number;
4517
- /** Number of characters in the draft post's plain text content. */
4518
- contentTextCharacterCount?: number;
4519
4428
  }
4520
- interface UpdateDraftPostLanguageRequest {
4429
+ interface UnpublishPostResponse {
4430
+ }
4431
+ interface GetDraftPostCountsRequest {
4521
4432
  /**
4522
- * ID of the draft post to update.
4433
+ * Tag IDs to count draft posts for.
4434
+ * @maxSize 50
4523
4435
  * @format GUID
4524
4436
  */
4525
- postId: string;
4437
+ tagIds?: string[];
4526
4438
  /**
4527
- * New language of the draft post, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4528
- * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4529
- * @minLength 2
4530
- * @format LANGUAGE_TAG
4439
+ * Category IDs to count draft posts for.
4440
+ * @maxSize 50
4441
+ * @format GUID
4531
4442
  */
4532
- language: string;
4443
+ categoryIds?: string[];
4444
+ }
4445
+ interface GetDraftPostCountsResponse {
4446
+ /** Draft post counts per tag. */
4447
+ tagPostCounts?: DraftPostCount[];
4448
+ /** Draft post counts per category. */
4449
+ categoryPostCounts?: DraftPostCount[];
4450
+ }
4451
+ interface DraftPostCount {
4533
4452
  /**
4534
- * Predefined sets of fields to return in the updated draft post, in addition to the core draft post fields.
4535
- *
4536
- * - `URL`: Returns the draft post's preview URL.
4537
- * - `CONTENT`: Returns the draft post's content.
4538
- * - `RICH_CONTENT`: Returns the draft post's rich content.
4539
- * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4540
- *
4541
- * Default: Core draft post fields only.
4542
- * @maxSize 10
4453
+ * Tag or Category ID.
4454
+ * @format GUID
4543
4455
  */
4544
- fieldsets?: FieldWithLiterals[];
4545
- }
4546
- interface UpdateDraftPostLanguageResponse {
4547
- /** Updated draft post. */
4548
- draftPost?: DraftPost;
4456
+ id?: string;
4457
+ /** Number of posts. */
4458
+ postCount?: number;
4549
4459
  }
4550
4460
  interface BulkRevertToUnpublishedRequest {
4551
4461
  /**
@@ -4694,6 +4604,98 @@ interface MarkPostAsInModerationResponse {
4694
4604
  /** Updated post draft. */
4695
4605
  draftPost?: DraftPost;
4696
4606
  }
4607
+ interface TranslateDraftRequest {
4608
+ /**
4609
+ * ID of the draft post or published post to translate.
4610
+ * @format GUID
4611
+ */
4612
+ postId: string;
4613
+ /**
4614
+ * Language to translate the post into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4615
+ * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4616
+ * @format LANGUAGE_TAG
4617
+ */
4618
+ language: string;
4619
+ /**
4620
+ * Predefined sets of fields to return in the created draft post, in addition to the core draft post fields.
4621
+ *
4622
+ * - `URL`: Returns the draft post's preview URL.
4623
+ * - `CONTENT`: Returns the draft post's content.
4624
+ * - `RICH_CONTENT`: Returns the draft post's rich content.
4625
+ * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4626
+ *
4627
+ * Default: Core draft post fields only.
4628
+ * @maxSize 10
4629
+ */
4630
+ fieldsets?: FieldWithLiterals[];
4631
+ /**
4632
+ * Whether to machine translate the title and content into the target language.
4633
+ *
4634
+ * Default: `false`
4635
+ * @internal
4636
+ */
4637
+ useAutoTranslation?: boolean;
4638
+ }
4639
+ interface TranslateDraftResponse {
4640
+ /** Created draft post. */
4641
+ draftPost?: DraftPost;
4642
+ }
4643
+ interface IsDraftPostAutoTranslatableRequest {
4644
+ /**
4645
+ * Draft post ID.
4646
+ * @format GUID
4647
+ */
4648
+ draftPostId?: string;
4649
+ }
4650
+ interface IsDraftPostAutoTranslatableResponse {
4651
+ /**
4652
+ * Draft post ID.
4653
+ * @format GUID
4654
+ */
4655
+ draftPostId?: string;
4656
+ /** Whether enough machine translation word credits are available to translate the draft post. */
4657
+ translatable?: boolean;
4658
+ /** Number of words in the draft post's title. */
4659
+ titleWordCount?: number;
4660
+ /** Number of words in the draft post's content. */
4661
+ contentWordCount?: number;
4662
+ /** Number of machine translation word credits currently available. `-1` if the site's quota is unlimited. */
4663
+ availableAutoTranslateWords?: number;
4664
+ /** Number of machine translation word credits that remain after translating the draft post. `-1` if the site's quota is unlimited. */
4665
+ availableAutoTranslateWordsAfter?: number;
4666
+ /** Number of characters in the draft post's plain text content. */
4667
+ contentTextCharacterCount?: number;
4668
+ }
4669
+ interface UpdateDraftPostLanguageRequest {
4670
+ /**
4671
+ * ID of the draft post to update.
4672
+ * @format GUID
4673
+ */
4674
+ postId: string;
4675
+ /**
4676
+ * New language of the draft post, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4677
+ * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4678
+ * @minLength 2
4679
+ * @format LANGUAGE_TAG
4680
+ */
4681
+ language: string;
4682
+ /**
4683
+ * Predefined sets of fields to return in the updated draft post, in addition to the core draft post fields.
4684
+ *
4685
+ * - `URL`: Returns the draft post's preview URL.
4686
+ * - `CONTENT`: Returns the draft post's content.
4687
+ * - `RICH_CONTENT`: Returns the draft post's rich content.
4688
+ * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4689
+ *
4690
+ * Default: Core draft post fields only.
4691
+ * @maxSize 10
4692
+ */
4693
+ fieldsets?: FieldWithLiterals[];
4694
+ }
4695
+ interface UpdateDraftPostLanguageResponse {
4696
+ /** Updated draft post. */
4697
+ draftPost?: DraftPost;
4698
+ }
4697
4699
 
4698
4700
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4699
4701
  getUrl: (context: any) => string;