@wix/auto_sdk_blog_draft-posts 1.0.119 → 1.0.120

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.
@@ -3209,73 +3209,117 @@ declare enum ModerationStatusStatus {
3209
3209
  /** @enumType */
3210
3210
  type ModerationStatusStatusWithLiterals = ModerationStatusStatus | 'UNKNOWN' | 'APPROVED' | 'REJECTED';
3211
3211
  /**
3212
- * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
3213
- * The search engines use this information for ranking purposes, or to display snippets in the search results.
3214
- * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
3212
+ * The SEO data for a single page or dynamic item, in the shape stored today.
3213
+ *
3214
+ * FROZEN. Existing server code maps onto this message field by field, so its
3215
+ * field set must never change (see the file header). New writers use
3216
+ * `SeoSchemaV2`.
3217
+ *
3218
+ * These tags are rendered into the <head> of the HTML document and are not
3219
+ * visible on the page itself. They override every other source of tags
3220
+ * (site defaults, vertical presets, patterns) for this page.
3215
3221
  */
3216
3222
  interface SeoSchema {
3217
- /** SEO tag information. */
3223
+ /**
3224
+ * The tags rendered into <head>, in no particular order. Render order is
3225
+ * decided by the renderer, not by position in this list.
3226
+ *
3227
+ * No maxSize: this list is already populated by data written years ago, and
3228
+ * a bound added now could reject a page that is already stored.
3229
+ */
3218
3230
  tags?: Tag[];
3219
- /** SEO general settings. */
3231
+ /** Page-level SEO settings that are not themselves tags. */
3220
3232
  settings?: Settings;
3221
3233
  }
3234
+ /** A keyword term the user is targeting. */
3222
3235
  interface Keyword {
3223
- /** Keyword value. */
3236
+ /**
3237
+ * The term itself, e.g. "trail running shoes".
3238
+ *
3239
+ * No maxLength, for the same reason as the legacy tag fields: keywords are
3240
+ * already stored, and a bound added now could reject a record written
3241
+ * before the bound existed. The flynt `missing-string-validations` warning
3242
+ * on this field is accepted deliberately.
3243
+ */
3224
3244
  term?: string;
3225
- /** Whether the keyword is the main focus keyword. */
3245
+ /** Whether this is the page's primary focus keyword. At most one per page. */
3226
3246
  isMain?: boolean;
3227
3247
  /**
3228
- * The source that added the keyword terms to the SEO settings.
3248
+ * Which surface added the term, e.g. a panel or a suggestion flow. Used for
3249
+ * attribution in BI. Opaque to the renderer.
3229
3250
  * @maxLength 1000
3230
3251
  */
3231
3252
  origin?: string | null;
3232
3253
  }
3254
+ /**
3255
+ * One tag in the page's <head>.
3256
+ *
3257
+ * Not deprecated, and with no removal date, deliberately: stored data is
3258
+ * never migrated, so this shape stays valid input forever. `seo-renderer`
3259
+ * normalizes both shapes on READ.
3260
+ */
3233
3261
  interface Tag {
3234
3262
  /**
3235
- * SEO tag type.
3236
- *
3263
+ * Legacy. Was a free-form string: "title" | "meta" | "script" | "link".
3264
+ * The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes
3265
+ * the invalid combinations unrepresentable rather than merely discouraged.
3237
3266
  *
3238
- * Supported values: `title`, `meta`, `script`, `link`.
3239
- *
3240
- * Which of these an API actually accepts depends on where the tag is being set: this
3241
- * list is not a blanket guarantee across every API that reuses this message. Site SEO
3242
- * Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects
3243
- * `title`/`script`/`link` with a validation error even though they appear here —
3244
- * check the field description of the specific `tags`-typed field you're writing to
3245
- * for the types it actually supports and the error it returns.
3267
+ * Which of these an API actually accepts depends on where the tag is being
3268
+ * set: this list is not a blanket guarantee across every API that reuses
3269
+ * this message. Site SEO Tags in particular accepts only `meta` (see
3270
+ * `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation
3271
+ * error even though they appear here — check the field description of the
3272
+ * specific `tags`-typed field you are writing to.
3246
3273
  *
3247
3274
  * Limitation: `title` and `script` (e.g. a `script` tag with `props.type`
3248
- * `"application/ld+json"` carrying structured data) are supported only when
3249
- * `custom` is unset or `false`. Setting `custom: true` on a `title` or `script`
3250
- * tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the
3251
- * write through the site's Advanced/Custom Tags list. To write structured data,
3252
- * omit `custom` (or set it to `false`).
3275
+ * "application/ld+json" carrying structured data) are supported only when
3276
+ * `custom` is unset or `false`. Setting `custom: true` on a `title` or
3277
+ * `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because
3278
+ * `custom: true` routes the write through the site's Advanced/Custom Tags
3279
+ * list. To write structured data, omit `custom` (or set it to `false`).
3280
+ *
3281
+ * No length limit: this field holds data written years ago by writers we
3282
+ * are not migrating. A constraint here could reject a record that is
3283
+ * already stored, which is exactly the promise this design makes.
3253
3284
  */
3254
3285
  type?: string;
3255
3286
  /**
3256
- * A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value.
3257
- * For example: `{"name": "description", "content": "the description itself"}`.
3287
+ * Legacy. Was an untyped bag of HTML attributes.
3288
+ * Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.
3258
3289
  */
3259
3290
  props?: Record<string, any> | null;
3260
- /** SEO tag metadata. For example, `{"height": 300, "width": 240}`. */
3291
+ /**
3292
+ * Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2`
3293
+ * its contents are split by purpose: per-page structured-data state moves to
3294
+ * StructuredDataTag, authorship to `written_by`, and render-time preset
3295
+ * logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the
3296
+ * stored document entirely — it belongs to the preset definition, not to the
3297
+ * page. See the design log for the full key-by-key mapping.
3298
+ */
3261
3299
  meta?: Record<string, any> | null;
3262
- /** SEO tag inner content. For example, `<title> inner content </title>`. */
3300
+ /**
3301
+ * Legacy. Was the tag's inner content, doubling as the JSON-LD payload
3302
+ * for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and
3303
+ * `StructuredDataTag.json_ld`.
3304
+ * No length limit, for the same reason as `type` above.
3305
+ */
3263
3306
  children?: string;
3264
3307
  /**
3265
3308
  * Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) —
3266
3309
  * i.e. an entry from the site's Advanced/Custom Tags list.
3267
3310
  *
3268
- * Setting this to `true` on a write restricts which `type` values are accepted
3269
- * — the same restriction the Advanced/Custom Tags UI enforces. `title` and
3270
- * `script` tags (including JSON-LD structured data) must be sent with `custom`
3271
- * omitted or `false`; sending them with `custom: true` is rejected with
3272
- * `TAG_TYPE_NOT_ALLOWED`.
3311
+ * Setting this to `true` on a write restricts which `type` values are
3312
+ * accepted — the same restriction the Advanced/Custom Tags UI enforces.
3313
+ * `title` and `script` tags (including JSON-LD structured data) must be sent
3314
+ * with `custom` omitted or `false`; sending them with `custom: true` is
3315
+ * rejected with `TAG_TYPE_NOT_ALLOWED`.
3273
3316
  *
3274
- * Note this is a separate restriction from Site SEO Tags' own type restriction on
3275
- * `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g.
3276
- * for site-wide structured data) unconditionally. There is currently no way to set
3277
- * site-wide, every-page structured data through any of these APIs — write a per-page
3278
- * `script` tag through the Item SEO Tags API instead.
3317
+ * Note this is a separate restriction from Site SEO Tags' own type
3318
+ * restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags
3319
+ * rejects `script` (e.g. for site-wide structured data) unconditionally.
3320
+ * There is currently no way to set site-wide, every-page structured data
3321
+ * through any of these APIs — write a per-page `script` tag through the Item
3322
+ * SEO Tags API instead.
3279
3323
  *
3280
3324
  * This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag
3281
3325
  * (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed
@@ -3288,22 +3332,39 @@ interface Tag {
3288
3332
  * or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the
3289
3333
  * response entirely — there, `false` means this API could not tell, not that no custom tag exists.
3290
3334
  * Pass `seoData` explicitly to resolve against a known set of tags.
3335
+ *
3336
+ * `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.
3291
3337
  */
3292
3338
  custom?: boolean;
3293
- /** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */
3339
+ /**
3340
+ * Whether the tag is excluded from the rendered <head>.
3341
+ *
3342
+ * A disabled tag is still stored, so the user can re-enable it and so a
3343
+ * pattern-provided tag stays suppressed on this page. Default false.
3344
+ */
3294
3345
  disabled?: boolean;
3295
3346
  }
3347
+ /** Page-level SEO settings that are not tags. */
3296
3348
  interface Settings {
3297
3349
  /**
3298
- * Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.
3350
+ * Whether to suppress the automatic redirect from this page's previous URL to
3351
+ * its current one after a slug change.
3299
3352
  *
3300
- *
3301
- * Default: `false` (automatical redirect is enabled).
3353
+ * Default false, meaning the redirect IS created. The field is named for the
3354
+ * exception rather than the rule, which reads backwards; kept as-is because
3355
+ * renaming a stored boolean is not worth the migration.
3302
3356
  */
3303
3357
  preventAutoRedirect?: boolean;
3304
3358
  /**
3305
- * User-selected keyword terms for a specific page.
3306
- * @maxSize 5
3359
+ * Keyword terms the user is targeting for this page. Used by the SEO
3360
+ * assistant and checklist; never rendered into <head>.
3361
+ *
3362
+ * 20 is a sanity bound, not the product limit. v1 declared 5 — the number
3363
+ * the panel happens to allow today — which is exactly the mistake we are
3364
+ * fixing for structured data. A product decision to allow 8 should not need
3365
+ * a proto release, so the panel owns that number and the proto only stops
3366
+ * something absurd.
3367
+ * @maxSize 20
3307
3368
  */
3308
3369
  keywords?: Keyword[];
3309
3370
  }
@@ -3532,6 +3593,10 @@ interface DraftPostTranslation {
3532
3593
  /** Post URL. */
3533
3594
  url?: PageUrl;
3534
3595
  }
3596
+ interface InitialDraftPostsCopied {
3597
+ /** Number of draft posts copied. */
3598
+ count?: number;
3599
+ }
3535
3600
  interface DraftCategoriesUpdated {
3536
3601
  /**
3537
3602
  * Draft post ID.
@@ -3570,258 +3635,368 @@ interface DraftTagsUpdated {
3570
3635
  */
3571
3636
  previousTags?: string[];
3572
3637
  }
3573
- interface GetDraftPostTotalsRequest {
3638
+ interface CreateDraftPostRequest {
3639
+ /** Draft post to create. */
3640
+ draftPost: DraftPost;
3574
3641
  /**
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
3642
+ * Whether the draft post should be published on creation.
3643
+ *
3644
+ * Default: `false`
3579
3645
  */
3580
- groupBy?: TotalDraftPostsGroupingFieldWithLiterals[];
3646
+ publish?: boolean;
3581
3647
  /**
3582
- * Optional language filter by provided language code. Useful in multilingual context.
3583
- * @format LANGUAGE_TAG
3648
+ * Save type.
3649
+ * @internal
3584
3650
  */
3585
- language?: string | null;
3651
+ saveType?: TypeWithLiterals;
3652
+ /**
3653
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3654
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3655
+ * only the draft post's base fields are returned.
3656
+ * @maxSize 10
3657
+ */
3658
+ fieldsets?: FieldWithLiterals[];
3586
3659
  }
3587
- declare enum TotalDraftPostsGroupingField {
3588
- /** Groups results by status. */
3589
- STATUS = "STATUS",
3590
- /** Groups results by language. */
3591
- LANGUAGE = "LANGUAGE"
3660
+ declare enum Type {
3661
+ UNKNOWN = "UNKNOWN",
3662
+ /** Manually saved. */
3663
+ MANUAL = "MANUAL",
3664
+ /** Triggered by autosave. */
3665
+ AUTO_SAVE = "AUTO_SAVE",
3666
+ /** Copied from template during provisioning flow. */
3667
+ PROVISIONING = "PROVISIONING",
3668
+ /** Imported from another blog. */
3669
+ IMPORT = "IMPORT",
3670
+ /** Triggered by autosave when post created by AI tool. */
3671
+ AI_AUTO_SAVE = "AI_AUTO_SAVE"
3592
3672
  }
3593
3673
  /** @enumType */
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;
3674
+ type TypeWithLiterals = Type | 'UNKNOWN' | 'MANUAL' | 'AUTO_SAVE' | 'PROVISIONING' | 'IMPORT' | 'AI_AUTO_SAVE';
3675
+ declare enum Field {
3676
+ /** Unknown field. */
3677
+ UNKNOWN = "UNKNOWN",
3678
+ /** Includes draft post preview URL. */
3679
+ URL = "URL",
3604
3680
  /**
3605
- * Draft post language code (only has value when grouping by language, otherwise null).
3606
- * @format LANGUAGE_TAG
3681
+ * Includes internal id field.
3682
+ * Reserved for internal use.
3683
+ * @internal
3607
3684
  */
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;
3685
+ INTERNAL_ID = "INTERNAL_ID",
3686
+ /** Includes content field. */
3687
+ CONTENT = "CONTENT",
3688
+ /** Includes rich content field. */
3689
+ RICH_CONTENT = "RICH_CONTENT",
3617
3690
  /**
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`.
3691
+ * Includes draft post translations when present.
3692
+ * @internal
3620
3693
  */
3621
- entityFqdn?: string;
3694
+ TRANSLATIONS = "TRANSLATIONS",
3695
+ /** If the user has not set excerpt, returns the one autogenerated from content. */
3696
+ GENERATED_EXCERPT = "GENERATED_EXCERPT"
3697
+ }
3698
+ /** @enumType */
3699
+ type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'CONTENT' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3700
+ interface CreateDraftPostResponse {
3701
+ /** Created draft post info. */
3702
+ draftPost?: DraftPost;
3703
+ }
3704
+ interface BulkCreateDraftPostsRequest {
3622
3705
  /**
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`.
3706
+ * Draft posts to create.
3707
+ * @minSize 1
3708
+ * @maxSize 20
3625
3709
  */
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;
3710
+ draftPosts: DraftPost[];
3711
+ /** Whether the draft post should be published after creation. */
3712
+ publish?: boolean;
3631
3713
  /**
3632
- * Whether the event was triggered as a result of a privacy regulation application
3633
- * (for example, GDPR).
3714
+ * Save type.
3715
+ * @internal
3634
3716
  */
3635
- triggeredByAnonymizeRequest?: boolean | null;
3636
- /** If present, indicates the action that triggered the event. */
3637
- originatedFrom?: string | null;
3717
+ saveType?: TypeWithLiterals;
3718
+ /** Whether to return the full created draft post entities in the response. */
3719
+ returnFullEntity?: boolean;
3638
3720
  /**
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.
3721
+ * List of draft post fields to be included in the response if the entities are present.
3722
+ * Base default fieldset returns all core draft post properties (all properties that are not a supported fieldset value).
3723
+ * For example, when `URL` fieldset is selected, returned draft post will include the set of base properties and the draft post's preview url.
3724
+ * @maxSize 10
3641
3725
  */
3642
- entityEventSequence?: string | null;
3726
+ fieldsets?: FieldWithLiterals[];
3643
3727
  }
3644
- /** @oneof */
3645
- interface DomainEventBodyOneOf {
3646
- createdEvent?: EntityCreatedEvent;
3647
- updatedEvent?: EntityUpdatedEvent;
3648
- deletedEvent?: EntityDeletedEvent;
3649
- actionEvent?: ActionEvent;
3728
+ interface BulkCreateDraftPostsResponse {
3729
+ /** Draft posts created by bulk action. */
3730
+ results?: BulkDraftPostResult[];
3731
+ /** Bulk action metadata. */
3732
+ bulkActionMetadata?: BulkActionMetadata;
3650
3733
  }
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;
3734
+ interface BulkDraftPostResult {
3735
+ /** Bulk actions metadata for draft post. */
3736
+ itemMetadata?: ItemMetadata;
3737
+ /** Optional full draft post. */
3738
+ item?: DraftPost;
3665
3739
  }
3666
- interface RestoreInfo {
3667
- deletedDate?: Date | null;
3740
+ interface ItemMetadata {
3741
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
3742
+ id?: string | null;
3743
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
3744
+ originalIndex?: number;
3745
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
3746
+ success?: boolean;
3747
+ /** Details about the error in case of failure. */
3748
+ error?: ApplicationError;
3668
3749
  }
3669
- interface EntityUpdatedEvent {
3750
+ interface ApplicationError {
3751
+ /** Error code. */
3752
+ code?: string;
3753
+ /** Description of the error. */
3754
+ description?: string;
3755
+ /** Data related to the error. */
3756
+ data?: Record<string, any> | null;
3757
+ }
3758
+ interface BulkActionMetadata {
3759
+ /** Number of items that were successfully processed. */
3760
+ totalSuccesses?: number;
3761
+ /** Number of items that couldn't be processed. */
3762
+ totalFailures?: number;
3763
+ /** Number of failures without details because detailed failure threshold was exceeded. */
3764
+ undetailedFailures?: number;
3765
+ }
3766
+ interface BulkUpdateDraftPostsRequest {
3670
3767
  /**
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.
3768
+ * Draft posts to update.
3769
+ * @minSize 1
3770
+ * @maxSize 20
3674
3771
  */
3675
- currentEntityAsJson?: string;
3772
+ draftPosts?: MaskedDraftPosts[];
3676
3773
  /**
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
3774
+ * Action to perform on the posts.
3775
+ *
3776
+ * Default: `UPDATE`
3685
3777
  */
3686
- previousEntityAsJson?: string | null;
3778
+ action?: ActionWithLiterals;
3779
+ /** Posts' scheduled publish date when `action` is set to `UPDATE_SCHEDULE`. */
3780
+ scheduledPublishDate?: Date | null;
3687
3781
  /**
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)
3782
+ * Save type.
3690
3783
  * @internal
3691
3784
  */
3692
- modifiedFields?: Record<string, any>;
3785
+ saveType?: TypeWithLiterals;
3786
+ /** Whether to return the full updated draft post entities in the response. */
3787
+ returnFullEntity?: boolean;
3693
3788
  /**
3694
- * Optional domain-specific metadata defined by the API owner, encoded as JSON.
3695
- * @internal
3789
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3790
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3791
+ * only the draft post's base fields are returned.
3792
+ * @maxSize 10
3696
3793
  */
3697
- additionalMetadataAsJson?: string | null;
3794
+ fieldsets?: FieldWithLiterals[];
3698
3795
  }
3699
- interface EntityDeletedEvent {
3700
- /**
3701
- * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
3702
- * @internal
3703
- */
3704
- movedToTrash?: boolean | null;
3705
- /** Entity that was deleted. */
3706
- deletedEntityAsJson?: string | null;
3707
- /**
3708
- * Optional domain-specific metadata defined by the API owner, encoded as JSON.
3709
- * @internal
3710
- */
3711
- additionalMetadataAsJson?: string | null;
3796
+ interface MaskedDraftPosts {
3797
+ /** Draft post */
3798
+ draftPost?: DraftPost;
3799
+ /** Field mask of fields to update. */
3800
+ fieldMask?: string[];
3712
3801
  }
3713
- interface ActionEvent {
3714
- bodyAsJson?: string;
3802
+ declare enum Action {
3803
+ /** Update the draft post. */
3804
+ UPDATE = "UPDATE",
3805
+ /** Update and publish a draft post. */
3806
+ UPDATE_PUBLISH = "UPDATE_PUBLISH",
3807
+ /** Update the draft post and schedule a publish date. */
3808
+ UPDATE_SCHEDULE = "UPDATE_SCHEDULE",
3809
+ /** Update the post and revert it to draft. */
3810
+ UPDATE_REVERT_TO_DRAFT = "UPDATE_REVERT_TO_DRAFT",
3811
+ /** Update the draft post and cancel the scheduled publish date. */
3812
+ UPDATE_CANCEL_SCHEDULE = "UPDATE_CANCEL_SCHEDULE",
3813
+ /** Update and reject draft post. */
3814
+ UPDATE_REJECT = "UPDATE_REJECT",
3815
+ /** Update a post that's already been published. This creates and updates a draft version of the post. The original post is still published. */
3816
+ UPDATE_PUBLICATION = "UPDATE_PUBLICATION"
3715
3817
  }
3716
- interface MessageEnvelope {
3818
+ /** @enumType */
3819
+ type ActionWithLiterals = Action | 'UPDATE' | 'UPDATE_PUBLISH' | 'UPDATE_SCHEDULE' | 'UPDATE_REVERT_TO_DRAFT' | 'UPDATE_CANCEL_SCHEDULE' | 'UPDATE_REJECT' | 'UPDATE_PUBLICATION';
3820
+ interface BulkUpdateDraftPostsResponse {
3821
+ /** Draft posts updated by bulk action. */
3822
+ results?: BulkDraftPostResult[];
3823
+ /** Bulk action metadata. */
3824
+ bulkActionMetadata?: BulkActionMetadata;
3825
+ }
3826
+ interface DraftPostOwnerChanged {
3717
3827
  /**
3718
- * App instance ID.
3828
+ * Member ID of the draft post's owner before the change.
3829
+ * @internal
3719
3830
  * @format GUID
3720
3831
  */
3721
- instanceId?: string | null;
3832
+ oldMemberId?: string;
3722
3833
  /**
3723
- * Event type.
3724
- * @maxLength 150
3834
+ * Member ID of the draft post's owner after the change.
3835
+ * @internal
3836
+ * @format GUID
3725
3837
  */
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;
3838
+ newMemberId?: string;
3733
3839
  }
3734
- interface IdentificationData extends IdentificationDataIdOneOf {
3840
+ interface ListDeletedDraftPostsRequest {
3735
3841
  /**
3736
- * ID of a site visitor that has not logged in to the site.
3737
- * @format GUID
3842
+ * Language filter.
3843
+ *
3844
+ * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3845
+ * If omitted, deleted draft posts in all languages are returned.
3846
+ * @format LANGUAGE_TAG
3738
3847
  */
3739
- anonymousVisitorId?: string;
3848
+ language?: string | null;
3740
3849
  /**
3741
- * ID of a site visitor that has logged in to the site.
3742
- * @format GUID
3850
+ * Sorting options.
3851
+ *
3852
+ * Default: `EDITING_DATE_DESCENDING`
3743
3853
  */
3744
- memberId?: string;
3854
+ sort?: GetDraftPostsSortWithLiterals;
3855
+ /** Pagination options. */
3856
+ paging?: BlogPaging;
3745
3857
  /**
3746
- * ID of a Wix user (site owner, contributor, etc.).
3747
- * @format GUID
3858
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3859
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3860
+ * only the draft post's base fields are returned.
3861
+ * @maxSize 10
3748
3862
  */
3749
- wixUserId?: string;
3863
+ fieldsets?: FieldWithLiterals[];
3750
3864
  /**
3751
- * ID of an app.
3865
+ * Draft post ids.
3866
+ * @maxSize 100
3752
3867
  * @format GUID
3753
3868
  */
3754
- appId?: string;
3755
- /** @readonly */
3756
- identityType?: WebhookIdentityTypeWithLiterals;
3869
+ draftPostIds?: string[];
3757
3870
  }
3758
- /** @oneof */
3759
- interface IdentificationDataIdOneOf {
3871
+ declare enum GetDraftPostsSort {
3872
+ /** Sort by `editedDate` in descending order. */
3873
+ EDITING_DATE_DESC = "EDITING_DATE_DESC",
3874
+ /** Sort by `editedDate` in ascending order. */
3875
+ EDITING_DATE_ASC = "EDITING_DATE_ASC"
3876
+ }
3877
+ /** @enumType */
3878
+ type GetDraftPostsSortWithLiterals = GetDraftPostsSort | 'EDITING_DATE_DESC' | 'EDITING_DATE_ASC';
3879
+ interface BlogPaging {
3760
3880
  /**
3761
- * ID of a site visitor that has not logged in to the site.
3762
- * @format GUID
3881
+ * Number of items to skip in the current sort order.
3882
+ *
3883
+ *
3884
+ * Default: `0`
3763
3885
  */
3764
- anonymousVisitorId?: string;
3886
+ offset?: number;
3765
3887
  /**
3766
- * ID of a site visitor that has logged in to the site.
3767
- * @format GUID
3888
+ * Number of items to return.
3889
+ *
3890
+ *
3891
+ * Default:`50`
3892
+ * @min 1
3893
+ * @max 100
3768
3894
  */
3769
- memberId?: string;
3895
+ limit?: number;
3770
3896
  /**
3771
- * ID of a Wix user (site owner, contributor, etc.).
3772
- * @format GUID
3897
+ * Pointer to the next or previous page in the list of results.
3898
+ * @maxLength 2000
3773
3899
  */
3774
- wixUserId?: string;
3900
+ cursor?: string | null;
3901
+ }
3902
+ interface ListDeletedDraftPostsResponse {
3903
+ /** List of draft posts. */
3904
+ draftPosts?: DraftPost[];
3905
+ /** Details on the paged set of results returned. */
3906
+ pagingMetadata?: PagingMetadataV2;
3907
+ }
3908
+ interface PagingMetadataV2 {
3909
+ /** Number of items returned in the response. */
3910
+ count?: number | null;
3911
+ /** Offset that was requested. */
3912
+ offset?: number | null;
3913
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
3914
+ total?: number | null;
3915
+ /** Flag that indicates the server failed to calculate the `total` field. */
3916
+ tooManyToCount?: boolean | null;
3917
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
3918
+ cursors?: Cursors;
3775
3919
  /**
3776
- * ID of an app.
3777
- * @format GUID
3920
+ * Indicates if there are more results after the current page.
3921
+ * If `true`, another page of results can be retrieved.
3922
+ * If `false`, this is the last page.
3923
+ * @internal
3778
3924
  */
3779
- appId?: string;
3925
+ hasNext?: boolean | null;
3780
3926
  }
3781
- declare enum WebhookIdentityType {
3782
- UNKNOWN = "UNKNOWN",
3783
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
3784
- MEMBER = "MEMBER",
3785
- WIX_USER = "WIX_USER",
3786
- APP = "APP"
3927
+ interface Cursors {
3928
+ /**
3929
+ * Cursor pointing to next page in the list of results.
3930
+ * @maxLength 2000
3931
+ */
3932
+ next?: string | null;
3933
+ /**
3934
+ * Cursor pointing to previous page in the list of results.
3935
+ * @maxLength 2000
3936
+ */
3937
+ prev?: string | null;
3787
3938
  }
3788
- /** @enumType */
3789
- type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
3790
- interface AccountInfo {
3939
+ interface GetDraftPostRequest {
3791
3940
  /**
3792
- * ID of the Wix account associated with the event.
3793
- * @format GUID
3941
+ * Draft post ID.
3942
+ * @maxLength 38
3794
3943
  */
3795
- accountId?: string | null;
3944
+ draftPostId: string;
3796
3945
  /**
3797
- * ID of the parent Wix account. Only included when accountId belongs to a child account.
3798
- * @format GUID
3946
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3947
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
3948
+ * only the draft post's base fields are returned.
3949
+ * @maxSize 10
3799
3950
  */
3800
- parentAccountId?: string | null;
3951
+ fieldsets?: FieldWithLiterals[];
3952
+ }
3953
+ interface GetDraftPostResponse {
3954
+ /** Draft post info. */
3955
+ draftPost?: DraftPost;
3956
+ }
3957
+ interface UpdateDraftPostContentRequest {
3801
3958
  /**
3802
- * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
3803
- * @format GUID
3959
+ * Draft post ID.
3960
+ * @maxLength 38
3804
3961
  */
3805
- siteId?: string | null;
3962
+ draftPostId?: string;
3963
+ /** Change origin. */
3964
+ changeOrigin?: OriginWithLiterals;
3965
+ /**
3966
+ * List of draft post fields to be included if entities are present in the response.
3967
+ * Base fieldset, which is default, will return all core draft post properties.
3968
+ * Example: When URL fieldset is selected, returned draft post will have a set of base properties and draft post preview url.
3969
+ * @maxSize 10
3970
+ */
3971
+ fieldsets?: FieldWithLiterals[];
3972
+ /** Draft Post rich content. */
3973
+ richContent?: RichContent;
3806
3974
  }
3807
- interface InitialDraftPostsCopied {
3808
- /** Number of draft posts copied. */
3809
- count?: number;
3975
+ interface UpdateDraftPostContentResponse {
3976
+ /** Updated draft post info. */
3977
+ draftPost?: DraftPost;
3810
3978
  }
3811
- interface CreateDraftPostRequest {
3812
- /** Draft post to create. */
3979
+ interface UpdateDraftPostRequest {
3980
+ /** Draft post to update. */
3813
3981
  draftPost: DraftPost;
3814
3982
  /**
3815
- * Whether the draft post should be published on creation.
3816
- *
3817
- * Default: `false`
3983
+ * Field mask of fields to update.
3984
+ * @internal
3818
3985
  */
3819
- publish?: boolean;
3986
+ fieldMask?: string[];
3820
3987
  /**
3821
3988
  * Save type.
3822
3989
  * @internal
3823
3990
  */
3824
3991
  saveType?: TypeWithLiterals;
3992
+ /**
3993
+ * Action to perform on the post.
3994
+ *
3995
+ * Default: `UPDATE`
3996
+ */
3997
+ action?: ActionWithLiterals;
3998
+ /** Post publish schedule date if `action` is set to `UPDATE_SCHEDULE`. */
3999
+ scheduledPublishDate?: Date | null;
3825
4000
  /**
3826
4001
  * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
3827
4002
  * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
@@ -3830,197 +4005,68 @@ interface CreateDraftPostRequest {
3830
4005
  */
3831
4006
  fieldsets?: FieldWithLiterals[];
3832
4007
  }
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"
4008
+ interface UpdateDraftPostResponse {
4009
+ /** Updated draft post info. */
4010
+ draftPost?: DraftPost;
3845
4011
  }
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",
4012
+ interface DeleteDraftPostRequest {
3853
4013
  /**
3854
- * Includes internal id field.
3855
- * Reserved for internal use.
3856
- * @internal
4014
+ * Draft post ID.
4015
+ * @maxLength 38
3857
4016
  */
3858
- INTERNAL_ID = "INTERNAL_ID",
3859
- /** Includes content field. */
3860
- CONTENT = "CONTENT",
3861
- /** Includes rich content field. */
3862
- RICH_CONTENT = "RICH_CONTENT",
4017
+ draftPostId: string;
3863
4018
  /**
3864
- * Includes draft post translations when present.
3865
- * @internal
4019
+ * Whether to bypass the trash bin and delete the post permanently.
4020
+ *
4021
+ * Default: `false`
3866
4022
  */
3867
- TRANSLATIONS = "TRANSLATIONS",
3868
- /** If the user has not set excerpt, returns the one autogenerated from content. */
3869
- GENERATED_EXCERPT = "GENERATED_EXCERPT"
4023
+ permanent?: boolean;
3870
4024
  }
3871
- /** @enumType */
3872
- type FieldWithLiterals = Field | 'UNKNOWN' | 'URL' | 'CONTENT' | 'RICH_CONTENT' | 'GENERATED_EXCERPT';
3873
- interface CreateDraftPostResponse {
3874
- /** Created draft post info. */
3875
- draftPost?: DraftPost;
4025
+ interface DeleteDraftPostResponse {
3876
4026
  }
3877
- interface BulkCreateDraftPostsRequest {
3878
- /**
3879
- * Draft posts to create.
3880
- * @minSize 1
3881
- * @maxSize 20
3882
- */
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;
4027
+ interface RemoveFromTrashBinRequest {
3893
4028
  /**
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
4029
+ * Draft post ID.
4030
+ * @maxLength 38
3898
4031
  */
3899
- fieldsets?: FieldWithLiterals[];
3900
- }
3901
- interface BulkCreateDraftPostsResponse {
3902
- /** Draft posts created by bulk action. */
3903
- results?: BulkDraftPostResult[];
3904
- /** Bulk action metadata. */
3905
- bulkActionMetadata?: BulkActionMetadata;
3906
- }
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;
4032
+ draftPostId: string;
3930
4033
  }
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;
4034
+ interface RemoveFromTrashBinResponse {
3938
4035
  }
3939
- interface BulkUpdateDraftPostsRequest {
4036
+ interface BulkDeleteDraftPostsRequest {
3940
4037
  /**
3941
- * Draft posts to update.
4038
+ * Post IDs.
3942
4039
  * @minSize 1
3943
- * @maxSize 20
3944
- */
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
4040
+ * @maxSize 100
4041
+ * @maxLength 38
3966
4042
  */
3967
- fieldsets?: FieldWithLiterals[];
3968
- }
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"
4043
+ postIds: string[];
4044
+ /** Should delete bypassing the trash-bin. */
4045
+ permanent?: boolean;
3990
4046
  }
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. */
4047
+ interface BulkDeleteDraftPostsResponse {
4048
+ /** Bulk action results. */
3995
4049
  results?: BulkDraftPostResult[];
3996
4050
  /** Bulk action metadata. */
3997
4051
  bulkActionMetadata?: BulkActionMetadata;
3998
4052
  }
3999
- interface DraftPostOwnerChanged {
4000
- /**
4001
- * Member ID of the draft post's owner before the change.
4002
- * @internal
4003
- * @format GUID
4004
- */
4005
- oldMemberId?: string;
4053
+ interface ListDraftPostsRequest {
4006
4054
  /**
4007
- * Member ID of the draft post's owner after the change.
4008
- * @internal
4009
- * @format GUID
4055
+ * Draft post status filter.
4056
+ *
4057
+ * If omitted, draft posts with all statuses are returned.
4010
4058
  */
4011
- newMemberId?: string;
4012
- }
4013
- interface ListDeletedDraftPostsRequest {
4059
+ status?: StatusWithLiterals;
4014
4060
  /**
4015
4061
  * Language filter.
4016
4062
  *
4017
4063
  * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4018
- * If omitted, deleted draft posts in all languages are returned.
4064
+ * If omitted, draft posts in all languages are returned.
4019
4065
  * @format LANGUAGE_TAG
4020
4066
  */
4021
4067
  language?: string | null;
4022
4068
  /**
4023
- * Sorting options.
4069
+ * Sort options.
4024
4070
  *
4025
4071
  * Default: `EDITING_DATE_DESCENDING`
4026
4072
  */
@@ -4034,428 +4080,535 @@ interface ListDeletedDraftPostsRequest {
4034
4080
  * @maxSize 10
4035
4081
  */
4036
4082
  fieldsets?: FieldWithLiterals[];
4037
- /**
4038
- * Draft post ids.
4039
- * @maxSize 100
4040
- * @format GUID
4041
- */
4042
- draftPostIds?: string[];
4043
- }
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"
4049
- }
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
- */
4059
- offset?: number;
4060
- /**
4061
- * Number of items to return.
4062
- *
4063
- *
4064
- * Default:`50`
4065
- * @min 1
4066
- * @max 100
4067
- */
4068
- limit?: number;
4069
- /**
4070
- * Pointer to the next or previous page in the list of results.
4071
- * @maxLength 2000
4072
- */
4073
- cursor?: string | null;
4074
4083
  }
4075
- interface ListDeletedDraftPostsResponse {
4084
+ interface ListDraftPostsResponse {
4076
4085
  /** List of draft posts. */
4077
4086
  draftPosts?: DraftPost[];
4078
4087
  /** 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;
4092
- /**
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
4097
- */
4098
- hasNext?: boolean | null;
4088
+ metaData?: MetaData;
4099
4089
  }
4100
- interface Cursors {
4101
- /**
4102
- * Cursor pointing to next page in the list of results.
4103
- * @maxLength 2000
4104
- */
4105
- next?: string | null;
4090
+ interface MetaData {
4091
+ /** Number of items returned in this response. */
4092
+ count?: number;
4093
+ /** Requested offset. */
4094
+ offset?: number;
4095
+ /** Total number of items that match the query. */
4096
+ total?: number;
4106
4097
  /**
4107
- * Cursor pointing to previous page in the list of results.
4098
+ * Pointer to the next or previous page in the list of results.
4108
4099
  * @maxLength 2000
4109
4100
  */
4110
- prev?: string | null;
4101
+ cursor?: string | null;
4111
4102
  }
4112
- interface GetDraftPostRequest {
4103
+ interface GetDeletedDraftPostRequest {
4113
4104
  /**
4114
4105
  * Draft post ID.
4115
4106
  * @maxLength 38
4116
4107
  */
4117
4108
  draftPostId: string;
4118
- /**
4119
- * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
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
4121
- * only the draft post's base fields are returned.
4122
- * @maxSize 10
4123
- */
4124
- fieldsets?: FieldWithLiterals[];
4125
4109
  }
4126
- interface GetDraftPostResponse {
4110
+ interface GetDeletedDraftPostResponse {
4127
4111
  /** Draft post info. */
4128
4112
  draftPost?: DraftPost;
4129
4113
  }
4130
- interface UpdateDraftPostContentRequest {
4114
+ interface RestoreFromTrashBinRequest {
4131
4115
  /**
4132
4116
  * Draft post ID.
4133
4117
  * @maxLength 38
4134
4118
  */
4135
- draftPostId?: string;
4136
- /** Change origin. */
4137
- changeOrigin?: OriginWithLiterals;
4119
+ draftPostId: string;
4120
+ }
4121
+ interface RestoreFromTrashBinResponse {
4122
+ /** Restored draft post info. */
4123
+ draftPost?: DraftPost;
4124
+ }
4125
+ interface QueryDraftPostsRequest {
4138
4126
  /**
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.
4127
+ * List of additional draft post fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
4128
+ * the response in addition to the draft post's base fields. Base fields don’t include any of the supported fieldset values. By default
4129
+ * only the draft post's base fields are returned.
4142
4130
  * @maxSize 10
4143
4131
  */
4144
4132
  fieldsets?: FieldWithLiterals[];
4145
- /** Draft Post rich content. */
4146
- richContent?: RichContent;
4147
- }
4148
- interface UpdateDraftPostContentResponse {
4149
- /** Updated draft post info. */
4150
- draftPost?: DraftPost;
4133
+ /** Query options. */
4134
+ query?: PlatformQuery;
4151
4135
  }
4152
- interface UpdateDraftPostRequest {
4153
- /** Draft post to update. */
4154
- draftPost: DraftPost;
4136
+ interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
4137
+ /** Paging options to limit and skip the number of items. */
4138
+ paging?: Paging;
4139
+ /** 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`. */
4140
+ cursorPaging?: CursorPaging;
4155
4141
  /**
4156
- * Field mask of fields to update.
4157
- * @internal
4142
+ * Filter object in the following format:
4143
+ * `"filter" : {
4144
+ * "fieldName1": "value1",
4145
+ * "fieldName2":{"$operator":"value2"}
4146
+ * }`
4147
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
4158
4148
  */
4159
- fieldMask?: string[];
4149
+ filter?: Record<string, any> | null;
4160
4150
  /**
4161
- * Save type.
4162
- * @internal
4151
+ * Sort object in the following format:
4152
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
4153
+ * @maxSize 3
4163
4154
  */
4164
- saveType?: TypeWithLiterals;
4155
+ sort?: Sorting[];
4156
+ }
4157
+ /** @oneof */
4158
+ interface PlatformQueryPagingMethodOneOf {
4159
+ /** Paging options to limit and skip the number of items. */
4160
+ paging?: Paging;
4161
+ /** 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`. */
4162
+ cursorPaging?: CursorPaging;
4163
+ }
4164
+ interface Sorting {
4165
4165
  /**
4166
- * Action to perform on the post.
4167
- *
4168
- * Default: `UPDATE`
4166
+ * Name of the field to sort by.
4167
+ * @maxLength 512
4169
4168
  */
4170
- action?: ActionWithLiterals;
4171
- /** Post publish schedule date if `action` is set to `UPDATE_SCHEDULE`. */
4172
- scheduledPublishDate?: Date | null;
4169
+ fieldName?: string;
4170
+ /** Sort order. */
4171
+ order?: SortOrderWithLiterals;
4173
4172
  /**
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.
4173
+ * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
4174
+ * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
4175
+ *
4176
+ * If multiple filters are provided, they are combined with AND operator.
4177
+ *
4178
+ * Example:
4179
+ * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
4180
+ * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
4181
+ * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
4182
+ * @internal
4177
4183
  * @maxSize 10
4178
4184
  */
4179
- fieldsets?: FieldWithLiterals[];
4185
+ selectItemsBy?: Record<string, any>[] | null;
4186
+ /**
4187
+ * Origin point for geo-distance sorting on a GEO field
4188
+ * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
4189
+ */
4190
+ origin?: AddressLocation;
4180
4191
  }
4181
- interface UpdateDraftPostResponse {
4182
- /** Updated draft post info. */
4183
- draftPost?: DraftPost;
4192
+ declare enum SortOrder {
4193
+ ASC = "ASC",
4194
+ DESC = "DESC"
4184
4195
  }
4185
- interface DeleteDraftPostRequest {
4196
+ /** @enumType */
4197
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
4198
+ interface AddressLocation {
4199
+ /** Address latitude. */
4200
+ latitude?: number | null;
4201
+ /** Address longitude. */
4202
+ longitude?: number | null;
4203
+ }
4204
+ interface Paging {
4186
4205
  /**
4187
- * Draft post ID.
4188
- * @maxLength 38
4206
+ * Number of items to load.
4207
+ * @max 100
4189
4208
  */
4190
- draftPostId: string;
4209
+ limit?: number | null;
4210
+ /** Number of items to skip in the current sort order. */
4211
+ offset?: number | null;
4212
+ }
4213
+ interface CursorPaging {
4191
4214
  /**
4192
- * Whether to bypass the trash bin and delete the post permanently.
4215
+ * Number of items to load.
4216
+ * @max 100
4217
+ */
4218
+ limit?: number | null;
4219
+ /**
4220
+ * Pointer to the next or previous page in the list of results.
4193
4221
  *
4194
- * Default: `false`
4222
+ * You can get the relevant cursor token
4223
+ * from the `pagingMetadata` object in the previous call's response.
4224
+ * Not relevant for the first request.
4225
+ * @maxLength 2000
4195
4226
  */
4196
- permanent?: boolean;
4227
+ cursor?: string | null;
4197
4228
  }
4198
- interface DeleteDraftPostResponse {
4229
+ interface QueryDraftPostsResponse {
4230
+ /** List of posts. */
4231
+ draftPosts?: DraftPost[];
4232
+ /** Details on the paged set of results returned. */
4233
+ pagingMetadata?: PagingMetadataV2;
4199
4234
  }
4200
- interface RemoveFromTrashBinRequest {
4235
+ interface PublishDraftPostRequest {
4201
4236
  /**
4202
4237
  * Draft post ID.
4203
4238
  * @maxLength 38
4204
4239
  */
4205
4240
  draftPostId: string;
4206
4241
  }
4207
- interface RemoveFromTrashBinResponse {
4242
+ interface PublishDraftPostResponse {
4243
+ /**
4244
+ * Published post ID.
4245
+ * @format GUID
4246
+ */
4247
+ postId?: string;
4208
4248
  }
4209
- interface BulkDeleteDraftPostsRequest {
4249
+ interface UnpublishPostRequest {
4210
4250
  /**
4211
- * Post IDs.
4212
- * @minSize 1
4213
- * @maxSize 100
4251
+ * Draft post ID.
4214
4252
  * @maxLength 38
4215
4253
  */
4216
- postIds: string[];
4217
- /** Should delete bypassing the trash-bin. */
4218
- permanent?: boolean;
4254
+ draftPostId?: string;
4219
4255
  }
4220
- interface BulkDeleteDraftPostsResponse {
4221
- /** Bulk action results. */
4222
- results?: BulkDraftPostResult[];
4223
- /** Bulk action metadata. */
4224
- bulkActionMetadata?: BulkActionMetadata;
4256
+ interface UnpublishPostResponse {
4225
4257
  }
4226
- interface ListDraftPostsRequest {
4258
+ interface GetDraftPostCountsRequest {
4227
4259
  /**
4228
- * Draft post status filter.
4229
- *
4230
- * If omitted, draft posts with all statuses are returned.
4260
+ * Tag IDs to count draft posts for.
4261
+ * @maxSize 50
4262
+ * @format GUID
4231
4263
  */
4232
- status?: StatusWithLiterals;
4264
+ tagIds?: string[];
4233
4265
  /**
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
4266
+ * Category IDs to count draft posts for.
4267
+ * @maxSize 50
4268
+ * @format GUID
4239
4269
  */
4240
- language?: string | null;
4270
+ categoryIds?: string[];
4271
+ }
4272
+ interface GetDraftPostCountsResponse {
4273
+ /** Draft post counts per tag. */
4274
+ tagPostCounts?: DraftPostCount[];
4275
+ /** Draft post counts per category. */
4276
+ categoryPostCounts?: DraftPostCount[];
4277
+ }
4278
+ interface DraftPostCount {
4241
4279
  /**
4242
- * Sort options.
4243
- *
4244
- * Default: `EDITING_DATE_DESCENDING`
4280
+ * Tag or Category ID.
4281
+ * @format GUID
4245
4282
  */
4246
- sort?: GetDraftPostsSortWithLiterals;
4247
- /** Pagination options. */
4248
- paging?: BlogPaging;
4283
+ id?: string;
4284
+ /** Number of posts. */
4285
+ postCount?: number;
4286
+ }
4287
+ interface DomainEvent extends DomainEventBodyOneOf {
4288
+ createdEvent?: EntityCreatedEvent;
4289
+ updatedEvent?: EntityUpdatedEvent;
4290
+ deletedEvent?: EntityDeletedEvent;
4291
+ actionEvent?: ActionEvent;
4292
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
4293
+ id?: string;
4249
4294
  /**
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
4295
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
4296
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
4254
4297
  */
4255
- fieldsets?: FieldWithLiterals[];
4298
+ entityFqdn?: string;
4299
+ /**
4300
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
4301
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
4302
+ */
4303
+ slug?: string;
4304
+ /** ID of the entity associated with the event. */
4305
+ entityId?: string;
4306
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
4307
+ eventTime?: Date | null;
4308
+ /**
4309
+ * Whether the event was triggered as a result of a privacy regulation application
4310
+ * (for example, GDPR).
4311
+ */
4312
+ triggeredByAnonymizeRequest?: boolean | null;
4313
+ /** If present, indicates the action that triggered the event. */
4314
+ originatedFrom?: string | null;
4315
+ /**
4316
+ * 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.
4317
+ * 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.
4318
+ */
4319
+ entityEventSequence?: string | null;
4256
4320
  }
4257
- interface ListDraftPostsResponse {
4258
- /** List of draft posts. */
4259
- draftPosts?: DraftPost[];
4260
- /** Details on the paged set of results returned. */
4261
- metaData?: MetaData;
4321
+ /** @oneof */
4322
+ interface DomainEventBodyOneOf {
4323
+ createdEvent?: EntityCreatedEvent;
4324
+ updatedEvent?: EntityUpdatedEvent;
4325
+ deletedEvent?: EntityDeletedEvent;
4326
+ actionEvent?: ActionEvent;
4262
4327
  }
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;
4328
+ interface EntityCreatedEvent {
4329
+ entityAsJson?: string;
4270
4330
  /**
4271
- * Pointer to the next or previous page in the list of results.
4272
- * @maxLength 2000
4331
+ * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity
4332
+ * @internal
4273
4333
  */
4274
- cursor?: string | null;
4275
- }
4276
- interface GetDeletedDraftPostRequest {
4334
+ triggeredByUndelete?: boolean | null;
4335
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
4336
+ restoreInfo?: RestoreInfo;
4277
4337
  /**
4278
- * Draft post ID.
4279
- * @maxLength 38
4338
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4339
+ * @internal
4280
4340
  */
4281
- draftPostId: string;
4341
+ additionalMetadataAsJson?: string | null;
4282
4342
  }
4283
- interface GetDeletedDraftPostResponse {
4284
- /** Draft post info. */
4285
- draftPost?: DraftPost;
4343
+ interface RestoreInfo {
4344
+ deletedDate?: Date | null;
4286
4345
  }
4287
- interface RestoreFromTrashBinRequest {
4346
+ interface EntityUpdatedEvent {
4288
4347
  /**
4289
- * Draft post ID.
4290
- * @maxLength 38
4348
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
4349
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
4350
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
4291
4351
  */
4292
- draftPostId: string;
4352
+ currentEntityAsJson?: string;
4353
+ /**
4354
+ * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard
4355
+ * wont populate it / have any reference to it in the API.
4356
+ * 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,
4357
+ * the developer should send only the new (current) entity.
4358
+ * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big
4359
+ * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.
4360
+ * @internal
4361
+ * @deprecated
4362
+ */
4363
+ previousEntityAsJson?: string | null;
4364
+ /**
4365
+ * Map of fully qualified field paths to their previous values for fields that changed.
4366
+ * 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)
4367
+ * @internal
4368
+ */
4369
+ modifiedFields?: Record<string, any>;
4370
+ /**
4371
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4372
+ * @internal
4373
+ */
4374
+ additionalMetadataAsJson?: string | null;
4293
4375
  }
4294
- interface RestoreFromTrashBinResponse {
4295
- /** Restored draft post info. */
4296
- draftPost?: DraftPost;
4376
+ interface EntityDeletedEvent {
4377
+ /**
4378
+ * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
4379
+ * @internal
4380
+ */
4381
+ movedToTrash?: boolean | null;
4382
+ /** Entity that was deleted. */
4383
+ deletedEntityAsJson?: string | null;
4384
+ /**
4385
+ * Optional domain-specific metadata defined by the API owner, encoded as JSON.
4386
+ * @internal
4387
+ */
4388
+ additionalMetadataAsJson?: string | null;
4297
4389
  }
4298
- interface QueryDraftPostsRequest {
4390
+ interface ActionEvent {
4391
+ bodyAsJson?: string;
4392
+ }
4393
+ interface MessageEnvelope {
4299
4394
  /**
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
4395
+ * App instance ID.
4396
+ * @format GUID
4304
4397
  */
4305
- fieldsets?: FieldWithLiterals[];
4306
- /** Query options. */
4307
- query?: PlatformQuery;
4398
+ instanceId?: string | null;
4399
+ /**
4400
+ * Event type.
4401
+ * @maxLength 150
4402
+ */
4403
+ eventType?: string;
4404
+ /** The identification type and identity data. */
4405
+ identity?: IdentificationData;
4406
+ /** Stringify payload. */
4407
+ data?: string;
4408
+ /** Details related to the account */
4409
+ accountInfo?: AccountInfo;
4308
4410
  }
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;
4411
+ interface IdentificationData extends IdentificationDataIdOneOf {
4314
4412
  /**
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`
4413
+ * ID of a site visitor that has not logged in to the site.
4414
+ * @format GUID
4321
4415
  */
4322
- filter?: Record<string, any> | null;
4416
+ anonymousVisitorId?: string;
4323
4417
  /**
4324
- * Sort object in the following format:
4325
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
4326
- * @maxSize 3
4418
+ * ID of a site visitor that has logged in to the site.
4419
+ * @format GUID
4327
4420
  */
4328
- sort?: Sorting[];
4421
+ memberId?: string;
4422
+ /**
4423
+ * ID of a Wix user (site owner, contributor, etc.).
4424
+ * @format GUID
4425
+ */
4426
+ wixUserId?: string;
4427
+ /**
4428
+ * ID of an app.
4429
+ * @format GUID
4430
+ */
4431
+ appId?: string;
4432
+ /** @readonly */
4433
+ identityType?: WebhookIdentityTypeWithLiterals;
4329
4434
  }
4330
4435
  /** @oneof */
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;
4436
+ interface IdentificationDataIdOneOf {
4437
+ /**
4438
+ * ID of a site visitor that has not logged in to the site.
4439
+ * @format GUID
4440
+ */
4441
+ anonymousVisitorId?: string;
4442
+ /**
4443
+ * ID of a site visitor that has logged in to the site.
4444
+ * @format GUID
4445
+ */
4446
+ memberId?: string;
4447
+ /**
4448
+ * ID of a Wix user (site owner, contributor, etc.).
4449
+ * @format GUID
4450
+ */
4451
+ wixUserId?: string;
4452
+ /**
4453
+ * ID of an app.
4454
+ * @format GUID
4455
+ */
4456
+ appId?: string;
4336
4457
  }
4337
- interface Sorting {
4458
+ declare enum WebhookIdentityType {
4459
+ UNKNOWN = "UNKNOWN",
4460
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
4461
+ MEMBER = "MEMBER",
4462
+ WIX_USER = "WIX_USER",
4463
+ APP = "APP"
4464
+ }
4465
+ /** @enumType */
4466
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
4467
+ interface AccountInfo {
4338
4468
  /**
4339
- * Name of the field to sort by.
4340
- * @maxLength 512
4469
+ * ID of the Wix account associated with the event.
4470
+ * @format GUID
4341
4471
  */
4342
- fieldName?: string;
4343
- /** Sort order. */
4344
- order?: SortOrderWithLiterals;
4472
+ accountId?: string | null;
4345
4473
  /**
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
4474
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
4475
+ * @format GUID
4476
+ */
4477
+ parentAccountId?: string | null;
4478
+ /**
4479
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
4480
+ * @format GUID
4481
+ */
4482
+ siteId?: string | null;
4483
+ }
4484
+ interface GetDraftPostTotalsRequest {
4485
+ /**
4486
+ * Group results by fields (defaults to grouping by status).
4487
+ * If, for example, grouping by language is passed, language values in response will be filled.
4488
+ * If, for example, grouping by language is not passed, null values will be filled in language field in response.
4356
4489
  * @maxSize 10
4357
4490
  */
4358
- selectItemsBy?: Record<string, any>[] | null;
4491
+ groupBy?: TotalDraftPostsGroupingFieldWithLiterals[];
4359
4492
  /**
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).
4493
+ * Optional language filter by provided language code. Useful in multilingual context.
4494
+ * @format LANGUAGE_TAG
4362
4495
  */
4363
- origin?: AddressLocation;
4496
+ language?: string | null;
4364
4497
  }
4365
- declare enum SortOrder {
4366
- ASC = "ASC",
4367
- DESC = "DESC"
4498
+ declare enum TotalDraftPostsGroupingField {
4499
+ /** Groups results by status. */
4500
+ STATUS = "STATUS",
4501
+ /** Groups results by language. */
4502
+ LANGUAGE = "LANGUAGE"
4368
4503
  }
4369
4504
  /** @enumType */
4370
- type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
4371
- interface AddressLocation {
4372
- /** Address latitude. */
4373
- latitude?: number | null;
4374
- /** Address longitude. */
4375
- longitude?: number | null;
4505
+ type TotalDraftPostsGroupingFieldWithLiterals = TotalDraftPostsGroupingField | 'STATUS' | 'LANGUAGE';
4506
+ interface GetDraftPostTotalsResponse {
4507
+ /** Draft post totals. */
4508
+ totalDraftPosts?: TotalDraftPosts[];
4376
4509
  }
4377
- interface Paging {
4510
+ interface TotalDraftPosts {
4511
+ /** Draft post totals in that group. */
4512
+ total?: number;
4513
+ /** Draft post status (only has value when grouping by status, otherwise null). */
4514
+ status?: StatusWithLiterals;
4378
4515
  /**
4379
- * Number of items to load.
4380
- * @max 100
4516
+ * Draft post language code (only has value when grouping by language, otherwise null).
4517
+ * @format LANGUAGE_TAG
4381
4518
  */
4382
- limit?: number | null;
4383
- /** Number of items to skip in the current sort order. */
4384
- offset?: number | null;
4519
+ language?: string | null;
4385
4520
  }
4386
- interface CursorPaging {
4521
+ interface TranslateDraftRequest {
4387
4522
  /**
4388
- * Number of items to load.
4389
- * @max 100
4523
+ * ID of the draft post or published post to translate.
4524
+ * @format GUID
4390
4525
  */
4391
- limit?: number | null;
4526
+ postId: string;
4392
4527
  /**
4393
- * Pointer to the next or previous page in the list of results.
4528
+ * Language to translate the post into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4529
+ * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4530
+ * @format LANGUAGE_TAG
4531
+ */
4532
+ language: string;
4533
+ /**
4534
+ * Predefined sets of fields to return in the created draft post, in addition to the core draft post fields.
4394
4535
  *
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
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
4399
4543
  */
4400
- cursor?: string | null;
4401
- }
4402
- interface QueryDraftPostsResponse {
4403
- /** List of posts. */
4404
- draftPosts?: DraftPost[];
4405
- /** Details on the paged set of results returned. */
4406
- pagingMetadata?: PagingMetadataV2;
4407
- }
4408
- interface PublishDraftPostRequest {
4544
+ fieldsets?: FieldWithLiterals[];
4409
4545
  /**
4410
- * Draft post ID.
4411
- * @maxLength 38
4546
+ * Whether to machine translate the title and content into the target language.
4547
+ *
4548
+ * Default: `false`
4549
+ * @internal
4412
4550
  */
4413
- draftPostId: string;
4551
+ useAutoTranslation?: boolean;
4414
4552
  }
4415
- interface PublishDraftPostResponse {
4553
+ interface TranslateDraftResponse {
4554
+ /** Created draft post. */
4555
+ draftPost?: DraftPost;
4556
+ }
4557
+ interface IsDraftPostAutoTranslatableRequest {
4416
4558
  /**
4417
- * Published post ID.
4559
+ * Draft post ID.
4418
4560
  * @format GUID
4419
4561
  */
4420
- postId?: string;
4562
+ draftPostId?: string;
4421
4563
  }
4422
- interface UnpublishPostRequest {
4564
+ interface IsDraftPostAutoTranslatableResponse {
4423
4565
  /**
4424
4566
  * Draft post ID.
4425
- * @maxLength 38
4567
+ * @format GUID
4426
4568
  */
4427
4569
  draftPostId?: string;
4570
+ /** Whether enough machine translation word credits are available to translate the draft post. */
4571
+ translatable?: boolean;
4572
+ /** Number of words in the draft post's title. */
4573
+ titleWordCount?: number;
4574
+ /** Number of words in the draft post's content. */
4575
+ contentWordCount?: number;
4576
+ /** Number of machine translation word credits currently available. `-1` if the site's quota is unlimited. */
4577
+ availableAutoTranslateWords?: number;
4578
+ /** Number of machine translation word credits that remain after translating the draft post. `-1` if the site's quota is unlimited. */
4579
+ availableAutoTranslateWordsAfter?: number;
4580
+ /** Number of characters in the draft post's plain text content. */
4581
+ contentTextCharacterCount?: number;
4428
4582
  }
4429
- interface UnpublishPostResponse {
4430
- }
4431
- interface GetDraftPostCountsRequest {
4583
+ interface UpdateDraftPostLanguageRequest {
4432
4584
  /**
4433
- * Tag IDs to count draft posts for.
4434
- * @maxSize 50
4585
+ * ID of the draft post to update.
4435
4586
  * @format GUID
4436
4587
  */
4437
- tagIds?: string[];
4588
+ postId: string;
4438
4589
  /**
4439
- * Category IDs to count draft posts for.
4440
- * @maxSize 50
4441
- * @format GUID
4590
+ * New language of the draft post, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
4591
+ * For example, `de` for German, or `pt-br` for Brazilian Portuguese.
4592
+ * @minLength 2
4593
+ * @format LANGUAGE_TAG
4442
4594
  */
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 {
4595
+ language: string;
4452
4596
  /**
4453
- * Tag or Category ID.
4454
- * @format GUID
4597
+ * Predefined sets of fields to return in the updated draft post, in addition to the core draft post fields.
4598
+ *
4599
+ * - `URL`: Returns the draft post's preview URL.
4600
+ * - `CONTENT`: Returns the draft post's content.
4601
+ * - `RICH_CONTENT`: Returns the draft post's rich content.
4602
+ * - `GENERATED_EXCERPT`: Returns an excerpt generated from the content if a custom excerpt isn't set.
4603
+ *
4604
+ * Default: Core draft post fields only.
4605
+ * @maxSize 10
4455
4606
  */
4456
- id?: string;
4457
- /** Number of posts. */
4458
- postCount?: number;
4607
+ fieldsets?: FieldWithLiterals[];
4608
+ }
4609
+ interface UpdateDraftPostLanguageResponse {
4610
+ /** Updated draft post. */
4611
+ draftPost?: DraftPost;
4459
4612
  }
4460
4613
  interface BulkRevertToUnpublishedRequest {
4461
4614
  /**
@@ -4604,98 +4757,6 @@ interface MarkPostAsInModerationResponse {
4604
4757
  /** Updated post draft. */
4605
4758
  draftPost?: DraftPost;
4606
4759
  }
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
- }
4699
4760
 
4700
4761
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4701
4762
  getUrl: (context: any) => string;