From 8ce09d9d2395cf26f3e947fbf97027cabe0aeccf Mon Sep 17 00:00:00 2001 From: Stefano Verna Date: Thu, 29 Aug 2024 11:18:45 +0200 Subject: [PATCH] Reorder endpoints --- packages/cma-client/resources.json | 96 ++++- .../cma-client/src/generated/SchemaTypes.ts | 267 ++++++++++-- .../src/generated/SimpleSchemaTypes.ts | 396 +++++++++++------- .../src/generated/resources/ItemType.ts | 22 + .../src/generated/resources/MenuItem.ts | 44 ++ .../src/generated/resources/SchemaMenuItem.ts | 47 +++ .../generated/resources/UploadCollection.ts | 47 +++ .../src/generated/resources/WebhookCall.ts | 8 +- 8 files changed, 732 insertions(+), 195 deletions(-) diff --git a/packages/cma-client/resources.json b/packages/cma-client/resources.json index 89ec0ae..0e7b0bd 100644 --- a/packages/cma-client/resources.json +++ b/packages/cma-client/resources.json @@ -528,6 +528,27 @@ "responseType": "MenuItemDestroyTargetSchema", "name": "destroy", "rawName": "rawDestroy" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder", + "rel": "reorder", + "urlTemplate": "/menu-items/reorder", + "method": "POST", + "comment": "Reorders a set of menu items", + "urlPlaceholders": [], + "requestBodyType": "MenuItemReorderSchema", + "optionalRequestBody": false, + "requestStructure": { + "type": "menu_item", + "attributes": [], + "relationships": [] + }, + "queryParamsRequired": false, + "responseType": "MenuItemReorderJobSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "reorder", + "rawName": "rawReorder" } ], "namespace": "menuItems", @@ -652,6 +673,27 @@ "responseType": "SchemaMenuItemDestroyTargetSchema", "name": "destroy", "rawName": "rawDestroy" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder", + "rel": "reorder", + "urlTemplate": "/schema-menu-items/reorder", + "method": "POST", + "comment": "Reorders a set of schema menu items", + "urlPlaceholders": [], + "requestBodyType": "SchemaMenuItemReorderSchema", + "optionalRequestBody": false, + "requestStructure": { + "type": "schema_menu_item", + "attributes": [], + "relationships": [] + }, + "queryParamsRequired": false, + "responseType": "SchemaMenuItemReorderJobSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "reorder", + "rawName": "rawReorder" } ], "namespace": "schemaMenuItems", @@ -776,6 +818,27 @@ "responseType": "UploadCollectionDestroyTargetSchema", "name": "destroy", "rawName": "rawDestroy" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder", + "rel": "reorder", + "urlTemplate": "/upload-collections/reorder", + "method": "POST", + "comment": "Reorders a set of upload collections", + "urlPlaceholders": [], + "requestBodyType": "UploadCollectionReorderSchema", + "optionalRequestBody": false, + "requestStructure": { + "type": "upload_collection", + "attributes": [], + "relationships": [] + }, + "queryParamsRequired": false, + "responseType": "UploadCollectionReorderJobSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "reorder", + "rawName": "rawReorder" } ], "namespace": "uploadCollections", @@ -969,6 +1032,26 @@ "responseType": "ItemTypeDestroyJobSchema", "name": "destroy", "rawName": "rawDestroy" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/item-type/reorder_fields_and_fieldsets", + "rel": "reorder_fields_and_fieldsets", + "urlTemplate": "/item-types/reorder-fields-and-fieldsets", + "method": "POST", + "comment": "Reorders a set of fields and fieldsets within the model", + "urlPlaceholders": [], + "requestBodyType": "ItemTypeReorderFieldsAndFieldsetsSchema", + "optionalRequestBody": false, + "requestStructure": { + "type": "*", + "attributes": [], + "relationships": [] + }, + "queryParamsRequired": false, + "responseType": "ItemTypeReorderFieldsAndFieldsetsJobSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "rawName": "rawReorderFieldsAndFieldsets" } ], "namespace": "itemTypes", @@ -3327,16 +3410,21 @@ "returnsCollection": false, "docUrl": "https://www.datocms.com/docs/content-management-api/resources/webhook-call/resend_webhook", "rel": "resend_webhook", - "urlTemplate": "/webhook_calls/${userId}/resend_webhook", + "urlTemplate": "/webhook_calls/${webhookCallId}/resend_webhook", "method": "POST", "comment": "Re-send the webhook call", "urlPlaceholders": [ { - "variableName": "userId", - "isEntityId": false, - "relType": "UserData" + "variableName": "webhookCallId", + "isEntityId": true, + "relType": "WebhookCallData" } ], + "entityIdPlaceholder": { + "variableName": "webhookCallId", + "isEntityId": true, + "relType": "WebhookCallData" + }, "optionalRequestBody": false, "queryParamsRequired": false, "name": "resendWebhook", diff --git a/packages/cma-client/src/generated/SchemaTypes.ts b/packages/cma-client/src/generated/SchemaTypes.ts index 8bb965c..1e1687c 100644 --- a/packages/cma-client/src/generated/SchemaTypes.ts +++ b/packages/cma-client/src/generated/SchemaTypes.ts @@ -292,6 +292,21 @@ export type MenuItemInstancesHrefSchema = { ids: string; }; }; +/** + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "type". + */ +export type JobType = 'job'; +/** + * ID of job + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "identity". + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "id". + */ +export type JobIdentity = string; /** * JSON API type field * @@ -419,21 +434,6 @@ export type ItemTypeCreateHrefSchema = { schema_menu_item_id?: string; [k: string]: unknown; }; -/** - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "type". - */ -export type JobType = 'job'; -/** - * ID of job - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "identity". - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "id". - */ -export type JobIdentity = string; /** * This interface was referenced by `ItemType`'s JSON-Schema * via the `destroy.hrefSchema` link. @@ -3790,6 +3790,70 @@ export type MenuItemDestroyTargetSchema = { data: MenuItem; }; +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type MenuItemReorderSchema = { + data: { + id: MenuItemIdentity; + type: MenuItemType; + /** + * JSON API attributes + */ + attributes: { + /** + * Ordering index + */ + position: number; + }; + relationships: { + /** + * Parent menu item + */ + parent: { + data: null | MenuItemData; + }; + }; + }[]; +}; + +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.targetSchema` link. + */ +export type MenuItemReorderTargetSchema = { + data: Job; +}; + +/** + * This interface was referenced by `DatoApi`'s JSON-Schema + * via the `definition` "job". + */ +export type Job = { + type: JobType; + id: JobIdentity; +}; + +/** + * JSON API data + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "data". + */ +export type JobData = { + type: JobType; + id: JobIdentity; +}; + +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type MenuItemReorderJobSchema = { + data: MenuItem[]; +}; + /** * In DatoCMS you can organize the different models and blocks present in your administrative area reordering and grouping them, so that their purpose will be more clear to the final editor. * @@ -3992,6 +4056,50 @@ export type SchemaMenuItemDestroyTargetSchema = { data: SchemaMenuItem; }; +/** + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type SchemaMenuItemReorderSchema = { + data: { + id: SchemaMenuItemIdentity; + type: SchemaMenuItemType; + /** + * JSON API attributes + */ + attributes: { + /** + * Ordering index + */ + position: number; + }; + relationships: { + /** + * Parent schema menu item + */ + parent: { + data: null | SchemaMenuItemData; + }; + }; + }[]; +}; + +/** + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.targetSchema` link. + */ +export type SchemaMenuItemReorderTargetSchema = { + data: Job; +}; + +/** + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type SchemaMenuItemReorderJobSchema = { + data: SchemaMenuItem[]; +}; + /** * In DatoCMS you can organize the uploads present in your administrative area in collection, so that the final editors can easily navigate uploads. * @@ -4164,6 +4272,50 @@ export type UploadCollectionDestroyTargetSchema = { data: UploadCollection; }; +/** + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type UploadCollectionReorderSchema = { + data: { + id: UploadCollectionIdentity; + type: UploadCollectionType; + /** + * JSON API attributes + */ + attributes: { + /** + * Ordering index + */ + position: number; + }; + relationships: { + /** + * Parent upload collection + */ + parent: { + data: null | UploadCollectionData; + }; + }; + }[]; +}; + +/** + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.targetSchema` link. + */ +export type UploadCollectionReorderTargetSchema = { + data: Job; +}; + +/** + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type UploadCollectionReorderJobSchema = { + data: UploadCollection[]; +}; + /** * The way you define the kind of content you can edit inside your administrative area passes through the concept of Models, which are much like database tables. For backward-compatibility reasons, the API refers to models as "item types". * @@ -4611,26 +4763,6 @@ export type ItemTypeUpdateTargetSchema = { data: Job; }; -/** - * This interface was referenced by `DatoApi`'s JSON-Schema - * via the `definition` "job". - */ -export type Job = { - type: JobType; - id: JobIdentity; -}; - -/** - * JSON API data - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "data". - */ -export type JobData = { - type: JobType; - id: JobIdentity; -}; - /** * This interface was referenced by `ItemType`'s JSON-Schema * via the `update.jobSchema` link. @@ -4679,6 +4811,65 @@ export type ItemTypeDestroyJobSchema = { data: ItemType; }; +/** + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.schema` link. + */ +export type ItemTypeReorderFieldsAndFieldsetsSchema = { + data: ( + | { + id: FieldIdentity; + type: FieldType; + /** + * JSON API attributes + */ + attributes: { + /** + * Ordering index + */ + position: number; + }; + relationships: { + /** + * Fieldset linkage + */ + fieldset: { + data: null | FieldsetData; + }; + }; + } + | { + id: FieldsetIdentity; + type: FieldsetType; + /** + * JSON API attributes + */ + attributes: { + /** + * Ordering index + */ + position: number; + }; + } + )[]; +}; + +/** + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.targetSchema` link. + */ +export type ItemTypeReorderFieldsAndFieldsetsTargetSchema = { + data: Job; +}; + +/** + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.jobSchema` link. + */ +export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { + data: (Field | Fieldset)[]; +}; + /** * DatoCMS offers a number of different fields that you can combine together to create a [Model](/docs/content-management-api/resources/item-type). Using the database metaphore, fields are like table columns, and when creating them you need to specify their type (`string`, `float`, etc.) and any required validation. * @@ -4735,12 +4926,12 @@ export type ItemTypeDestroyJobSchema = { * * #### Setting the appearance to a field editor provided by a plugin * - * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the build-in editors. + * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the built-in editors. * * In this case: * - * - the `editor` property must be the ID of the plugin; - * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes; + * - the `editor` property is the plugin's project-specific autogenerated UUID. You can get it from the last part of the plugin's URL within your project's Configuration screen (e.g. `https://your-project.admin.datocms.com/configuration/plugins/PLUGIN_UUID/`), or via API with a [List all plugins](/docs/content-management-api/resources/plugin/instances) call. + * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes. This is set in the plugin's own source code, within a `manualFieldExtension()` call in its entry point (usually something like `index.tsx`). * - the `parameters` property must provide a configuration object compatible with the [config screen of the manual field extension](/docs/plugin-sdk/manual-field-extensions#add-per-field-config-screens-to-manual-field-extensions), or an empty object if it doesn't require any configuration. * * ```js diff --git a/packages/cma-client/src/generated/SimpleSchemaTypes.ts b/packages/cma-client/src/generated/SimpleSchemaTypes.ts index 9bc77ea..392b61f 100644 --- a/packages/cma-client/src/generated/SimpleSchemaTypes.ts +++ b/packages/cma-client/src/generated/SimpleSchemaTypes.ts @@ -332,6 +332,39 @@ export type MenuItemInstancesHrefSchema = { ids: string; }; }; +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type MenuItemReorderSchema = { + id: MenuItemIdentity; + type?: MenuItemType; + /** + * Ordering index + */ + position: number; + parent: null | MenuItemData; +}[]; +/** + * ID of job + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "identity". + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "id". + */ +export type JobIdentity = string; +/** + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "type". + */ +export type JobType = 'job'; +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type MenuItemReorderJobSchema = MenuItem[]; /** * RFC 4122 UUID of schema menu item expressed in URL-safe base64 format * @@ -366,6 +399,24 @@ export type SchemaMenuItemInstancesHrefSchema = { ids: string; }; }; +/** + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type SchemaMenuItemReorderSchema = { + id: SchemaMenuItemIdentity; + type?: SchemaMenuItemType; + /** + * Ordering index + */ + position: number; + parent: null | SchemaMenuItemData; +}[]; +/** + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type SchemaMenuItemReorderJobSchema = SchemaMenuItem[]; /** * RFC 4122 UUID of upload collection expressed in URL-safe base64 format * @@ -400,6 +451,24 @@ export type UploadCollectionInstancesHrefSchema = { ids: string; }; }; +/** + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.schema` link. + */ +export type UploadCollectionReorderSchema = { + id: UploadCollectionIdentity; + type?: UploadCollectionType; + /** + * Ordering index + */ + position: number; + parent: null | UploadCollectionData; +}[]; +/** + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.jobSchema` link. + */ +export type UploadCollectionReorderJobSchema = UploadCollection[]; /** * This interface was referenced by `Item`'s JSON-Schema * via the `definition` "type". @@ -469,21 +538,6 @@ export type ItemTypeCreateHrefSchema = { schema_menu_item_id?: string; [k: string]: unknown; }; -/** - * ID of job - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "identity". - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "id". - */ -export type JobIdentity = string; -/** - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "type". - */ -export type JobType = 'job'; /** * This interface was referenced by `ItemType`'s JSON-Schema * via the `instances.targetSchema` link. @@ -500,6 +554,29 @@ export type ItemTypeDestroyHrefSchema = { skip_menu_items_deletion?: boolean; [k: string]: unknown; }; +/** + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.schema` link. + */ +export type ItemTypeReorderFieldsAndFieldsetsSchema = ( + | { + id: FieldIdentity; + type?: FieldType; + /** + * Ordering index + */ + position: number; + fieldset: null | FieldsetData; + } + | { + id: FieldsetIdentity; + type?: FieldsetType; + /** + * Ordering index + */ + position: number; + } +)[]; /** * This interface was referenced by `Field`'s JSON-Schema * via the `instances.targetSchema` link. @@ -520,6 +597,11 @@ export type FieldRelatedTargetSchema = Field[]; * via the `instances.targetSchema` link. */ export type FieldsetInstancesTargetSchema = Fieldset[]; +/** + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.jobSchema` link. + */ +export type ItemTypeReorderFieldsAndFieldsetsJobSchema = (Field | Fieldset)[]; /** * JSON web token for the session * @@ -4342,6 +4424,153 @@ export type MenuItemUpdateSchema = { parent?: null | MenuItemData; }; +/** + * This interface was referenced by `MenuItem`'s JSON-Schema + * via the `reorder.targetSchema` link. + * + * This interface was referenced by `SchemaMenuItem`'s JSON-Schema + * via the `reorder.targetSchema` link. + * + * This interface was referenced by `UploadCollection`'s JSON-Schema + * via the `reorder.targetSchema` link. + * + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `update.targetSchema` link. + * + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `destroy.targetSchema` link. + * + * This interface was referenced by `ItemType`'s JSON-Schema + * via the `reorder_fields_and_fieldsets.targetSchema` link. + * + * This interface was referenced by `Field`'s JSON-Schema + * via the `create.targetSchema` link. + * + * This interface was referenced by `Field`'s JSON-Schema + * via the `update.targetSchema` link. + * + * This interface was referenced by `Field`'s JSON-Schema + * via the `destroy.targetSchema` link. + * + * This interface was referenced by `Field`'s JSON-Schema + * via the `duplicate.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `duplicate.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `destroy.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `batch_destroy.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `batch_publish.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `batch_unpublish.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `bulk_publish.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `bulk_unpublish.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `bulk_destroy.targetSchema` link. + * + * This interface was referenced by `Item`'s JSON-Schema + * via the `bulk_move_to_stage.targetSchema` link. + * + * This interface was referenced by `ItemVersion`'s JSON-Schema + * via the `restore.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `create.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `update.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `batch_add_tags.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `batch_destroy.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `bulk_tag.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `bulk_set_upload_collection.targetSchema` link. + * + * This interface was referenced by `Upload`'s JSON-Schema + * via the `bulk_destroy.targetSchema` link. + * + * This interface was referenced by `UploadTrack`'s JSON-Schema + * via the `create.targetSchema` link. + * + * This interface was referenced by `UploadTrack`'s JSON-Schema + * via the `destroy.targetSchema` link. + * + * This interface was referenced by `UploadTrack`'s JSON-Schema + * via the `generate_subtitles.targetSchema` link. + * + * This interface was referenced by `Site`'s JSON-Schema + * via the `update.targetSchema` link. + * + * This interface was referenced by `Site`'s JSON-Schema + * via the `activate_improved_timezone_management.targetSchema` link. + * + * This interface was referenced by `DatoApi`'s JSON-Schema + * via the `definition` "job". + */ +export type Job = { + id: JobIdentity; + type: JobType; +}; +export type MenuItemReorderTargetSchema = Job; +export type SchemaMenuItemReorderTargetSchema = Job; +export type UploadCollectionReorderTargetSchema = Job; +export type ItemTypeUpdateTargetSchema = Job; +export type ItemTypeDestroyTargetSchema = Job; +export type ItemTypeReorderFieldsAndFieldsetsTargetSchema = Job; +export type FieldCreateTargetSchema = Job; +export type FieldUpdateTargetSchema = Job; +export type FieldDestroyTargetSchema = Job; +export type FieldDuplicateTargetSchema = Job; +export type ItemDuplicateTargetSchema = Job; +export type ItemDestroyTargetSchema = Job; +export type ItemBatchDestroyTargetSchema = Job; +export type ItemBatchPublishTargetSchema = Job; +export type ItemBatchUnpublishTargetSchema = Job; +export type ItemBulkPublishTargetSchema = Job; +export type ItemBulkUnpublishTargetSchema = Job; +export type ItemBulkDestroyTargetSchema = Job; +export type ItemBulkMoveToStageTargetSchema = Job; +export type ItemVersionRestoreTargetSchema = Job; +export type UploadCreateTargetSchema = Job; +export type UploadUpdateTargetSchema = Job; +export type UploadBatchAddTagsTargetSchema = Job; +export type UploadBatchDestroyTargetSchema = Job; +export type UploadBulkTagTargetSchema = Job; +export type UploadBulkSetUploadCollectionTargetSchema = Job; +export type UploadBulkDestroyTargetSchema = Job; +export type UploadTrackCreateTargetSchema = Job; +export type UploadTrackDestroyTargetSchema = Job; +export type UploadTrackGenerateSubtitlesTargetSchema = Job; +export type SiteUpdateTargetSchema = Job; +export type SiteActivateImprovedTimezoneManagementTargetSchema = Job; +/** + * JSON API data + * + * This interface was referenced by `Job`'s JSON-Schema + * via the `definition` "data". + */ +export type JobData = { + type: JobType; + id: JobIdentity; +}; + /** * In DatoCMS you can organize the different models and blocks present in your administrative area reordering and grouping them, so that their purpose will be more clear to the final editor. * @@ -4959,137 +5188,6 @@ export type ItemTypeUpdateSchema = { }; }; -/** - * This interface was referenced by `ItemType`'s JSON-Schema - * via the `update.targetSchema` link. - * - * This interface was referenced by `ItemType`'s JSON-Schema - * via the `destroy.targetSchema` link. - * - * This interface was referenced by `Field`'s JSON-Schema - * via the `create.targetSchema` link. - * - * This interface was referenced by `Field`'s JSON-Schema - * via the `update.targetSchema` link. - * - * This interface was referenced by `Field`'s JSON-Schema - * via the `destroy.targetSchema` link. - * - * This interface was referenced by `Field`'s JSON-Schema - * via the `duplicate.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `duplicate.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `destroy.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `batch_destroy.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `batch_publish.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `batch_unpublish.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `bulk_publish.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `bulk_unpublish.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `bulk_destroy.targetSchema` link. - * - * This interface was referenced by `Item`'s JSON-Schema - * via the `bulk_move_to_stage.targetSchema` link. - * - * This interface was referenced by `ItemVersion`'s JSON-Schema - * via the `restore.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `create.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `update.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `batch_add_tags.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `batch_destroy.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `bulk_tag.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `bulk_set_upload_collection.targetSchema` link. - * - * This interface was referenced by `Upload`'s JSON-Schema - * via the `bulk_destroy.targetSchema` link. - * - * This interface was referenced by `UploadTrack`'s JSON-Schema - * via the `create.targetSchema` link. - * - * This interface was referenced by `UploadTrack`'s JSON-Schema - * via the `destroy.targetSchema` link. - * - * This interface was referenced by `UploadTrack`'s JSON-Schema - * via the `generate_subtitles.targetSchema` link. - * - * This interface was referenced by `Site`'s JSON-Schema - * via the `update.targetSchema` link. - * - * This interface was referenced by `Site`'s JSON-Schema - * via the `activate_improved_timezone_management.targetSchema` link. - * - * This interface was referenced by `DatoApi`'s JSON-Schema - * via the `definition` "job". - */ -export type Job = { - id: JobIdentity; - type: JobType; -}; -export type ItemTypeUpdateTargetSchema = Job; -export type ItemTypeDestroyTargetSchema = Job; -export type FieldCreateTargetSchema = Job; -export type FieldUpdateTargetSchema = Job; -export type FieldDestroyTargetSchema = Job; -export type FieldDuplicateTargetSchema = Job; -export type ItemDuplicateTargetSchema = Job; -export type ItemDestroyTargetSchema = Job; -export type ItemBatchDestroyTargetSchema = Job; -export type ItemBatchPublishTargetSchema = Job; -export type ItemBatchUnpublishTargetSchema = Job; -export type ItemBulkPublishTargetSchema = Job; -export type ItemBulkUnpublishTargetSchema = Job; -export type ItemBulkDestroyTargetSchema = Job; -export type ItemBulkMoveToStageTargetSchema = Job; -export type ItemVersionRestoreTargetSchema = Job; -export type UploadCreateTargetSchema = Job; -export type UploadUpdateTargetSchema = Job; -export type UploadBatchAddTagsTargetSchema = Job; -export type UploadBatchDestroyTargetSchema = Job; -export type UploadBulkTagTargetSchema = Job; -export type UploadBulkSetUploadCollectionTargetSchema = Job; -export type UploadBulkDestroyTargetSchema = Job; -export type UploadTrackCreateTargetSchema = Job; -export type UploadTrackDestroyTargetSchema = Job; -export type UploadTrackGenerateSubtitlesTargetSchema = Job; -export type SiteUpdateTargetSchema = Job; -export type SiteActivateImprovedTimezoneManagementTargetSchema = Job; -/** - * JSON API data - * - * This interface was referenced by `Job`'s JSON-Schema - * via the `definition` "data". - */ -export type JobData = { - type: JobType; - id: JobIdentity; -}; - /** * DatoCMS offers a number of different fields that you can combine together to create a [Model](/docs/content-management-api/resources/item-type). Using the database metaphore, fields are like table columns, and when creating them you need to specify their type (`string`, `float`, etc.) and any required validation. * @@ -5146,12 +5244,12 @@ export type JobData = { * * #### Setting the appearance to a field editor provided by a plugin * - * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the build-in editors. + * If the project contains a plugin that exposes [manual field editors](/docs/plugin-sdk/manual-field-extensions), you can also configure the field to be presented with it instead of using one of the built-in editors. * * In this case: * - * - the `editor` property must be the ID of the plugin; - * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes; + * - the `editor` property is the plugin's project-specific autogenerated UUID. You can get it from the last part of the plugin's URL within your project's Configuration screen (e.g. `https://your-project.admin.datocms.com/configuration/plugins/PLUGIN_UUID/`), or via API with a [List all plugins](/docs/content-management-api/resources/plugin/instances) call. + * - the `field_extension` property must be the ID of the specific manual field editor that the plugin exposes. This is set in the plugin's own source code, within a `manualFieldExtension()` call in its entry point (usually something like `index.tsx`). * - the `parameters` property must provide a configuration object compatible with the [config screen of the manual field extension](/docs/plugin-sdk/manual-field-extensions#add-per-field-config-screens-to-manual-field-extensions), or an empty object if it doesn't require any configuration. * * ```js diff --git a/packages/cma-client/src/generated/resources/ItemType.ts b/packages/cma-client/src/generated/resources/ItemType.ts index a69dc14..de43cca 100644 --- a/packages/cma-client/src/generated/resources/ItemType.ts +++ b/packages/cma-client/src/generated/resources/ItemType.ts @@ -273,4 +273,26 @@ export default class ItemType extends BaseResource { queryParams, }); } + + /** + * Reorders a set of fields and fieldsets within the model + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/reorder_fields_and_fieldsets + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawReorderFieldsAndFieldsets( + body: SchemaTypes.ItemTypeReorderFieldsAndFieldsetsSchema, + ): Promise { + return this.client.request( + { + method: 'POST', + url: '/item-types/reorder-fields-and-fieldsets', + body, + }, + ); + } } diff --git a/packages/cma-client/src/generated/resources/MenuItem.ts b/packages/cma-client/src/generated/resources/MenuItem.ts index 8ab01a6..14c10a7 100644 --- a/packages/cma-client/src/generated/resources/MenuItem.ts +++ b/packages/cma-client/src/generated/resources/MenuItem.ts @@ -189,4 +189,48 @@ export default class MenuItem extends BaseResource { url: `/menu-items/${menuItemId}`, }); } + + /** + * Reorders a set of menu items + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + reorder(body: SimpleSchemaTypes.MenuItemReorderSchema) { + return this.rawReorder( + Utils.serializeRequestBody(body, { + type: 'menu_item', + attributes: [], + relationships: [], + }), + ).then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Reorders a set of menu items + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawReorder( + body: SchemaTypes.MenuItemReorderSchema, + ): Promise { + return this.client.request({ + method: 'POST', + url: '/menu-items/reorder', + body, + }); + } } diff --git a/packages/cma-client/src/generated/resources/SchemaMenuItem.ts b/packages/cma-client/src/generated/resources/SchemaMenuItem.ts index 993e8d4..5025b76 100644 --- a/packages/cma-client/src/generated/resources/SchemaMenuItem.ts +++ b/packages/cma-client/src/generated/resources/SchemaMenuItem.ts @@ -193,4 +193,51 @@ export default class SchemaMenuItem extends BaseResource { url: `/schema-menu-items/${schemaMenuItemId}`, }); } + + /** + * Reorders a set of schema menu items + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + reorder(body: SimpleSchemaTypes.SchemaMenuItemReorderSchema) { + return this.rawReorder( + Utils.serializeRequestBody( + body, + { + type: 'schema_menu_item', + attributes: [], + relationships: [], + }, + ), + ).then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Reorders a set of schema menu items + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawReorder( + body: SchemaTypes.SchemaMenuItemReorderSchema, + ): Promise { + return this.client.request({ + method: 'POST', + url: '/schema-menu-items/reorder', + body, + }); + } } diff --git a/packages/cma-client/src/generated/resources/UploadCollection.ts b/packages/cma-client/src/generated/resources/UploadCollection.ts index 02a46b5..32e00d8 100644 --- a/packages/cma-client/src/generated/resources/UploadCollection.ts +++ b/packages/cma-client/src/generated/resources/UploadCollection.ts @@ -201,4 +201,51 @@ export default class UploadCollection extends BaseResource { }, ); } + + /** + * Reorders a set of upload collections + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + reorder(body: SimpleSchemaTypes.UploadCollectionReorderSchema) { + return this.rawReorder( + Utils.serializeRequestBody( + body, + { + type: 'upload_collection', + attributes: [], + relationships: [], + }, + ), + ).then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Reorders a set of upload collections + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawReorder( + body: SchemaTypes.UploadCollectionReorderSchema, + ): Promise { + return this.client.request({ + method: 'POST', + url: '/upload-collections/reorder', + body, + }); + } } diff --git a/packages/cma-client/src/generated/resources/WebhookCall.ts b/packages/cma-client/src/generated/resources/WebhookCall.ts index 240baf7..2968420 100644 --- a/packages/cma-client/src/generated/resources/WebhookCall.ts +++ b/packages/cma-client/src/generated/resources/WebhookCall.ts @@ -136,8 +136,8 @@ export default class WebhookCall extends BaseResource { * @throws {ApiError} * @throws {TimeoutError} */ - resendWebhook(userId: string | SimpleSchemaTypes.UserData) { - return this.rawResendWebhook(Utils.toId(userId)); + resendWebhook(webhookCallId: string | SimpleSchemaTypes.WebhookCallData) { + return this.rawResendWebhook(Utils.toId(webhookCallId)); } /** @@ -148,10 +148,10 @@ export default class WebhookCall extends BaseResource { * @throws {ApiError} * @throws {TimeoutError} */ - rawResendWebhook(userId: string): Promise { + rawResendWebhook(webhookCallId: string): Promise { return this.client.request({ method: 'POST', - url: `/webhook_calls/${userId}/resend_webhook`, + url: `/webhook_calls/${webhookCallId}/resend_webhook`, }); } }