From fb4834d893b53d7a93d90bdf744b73ff66f6da88 Mon Sep 17 00:00:00 2001 From: Stefano Verna Date: Mon, 20 Jan 2025 11:29:38 +0100 Subject: [PATCH] Update schema --- packages/cma-client/resources.json | 55 ++++++++++++++ .../cma-client/src/generated/SchemaTypes.ts | 76 ++++++++++++++----- .../src/generated/SimpleSchemaTypes.ts | 57 +++++++++----- .../src/generated/resources/Role.ts | 31 ++++++++ .../src/generated/resources/Site.ts | 74 ++++++++++++++++++ 5 files changed, 256 insertions(+), 37 deletions(-) diff --git a/packages/cma-client/resources.json b/packages/cma-client/resources.json index 5ad67e8c..5525cc9d 100644 --- a/packages/cma-client/resources.json +++ b/packages/cma-client/resources.json @@ -171,6 +171,31 @@ "responseType": "RoleDestroyTargetSchema", "name": "destroy", "rawName": "rawDestroy" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/role/duplicate", + "rel": "duplicate", + "urlTemplate": "/roles/${roleId}/duplicate", + "method": "POST", + "comment": "Duplicate a role", + "urlPlaceholders": [ + { + "variableName": "roleId", + "isEntityId": true, + "relType": "RoleData" + } + ], + "entityIdPlaceholder": { + "variableName": "roleId", + "isEntityId": true, + "relType": "RoleData" + }, + "optionalRequestBody": false, + "queryParamsRequired": false, + "responseType": "RoleDuplicateTargetSchema", + "name": "duplicate", + "rawName": "rawDuplicate" } ], "namespace": "roles", @@ -4651,6 +4676,36 @@ "name": "activateImprovedBooleanFields", "rawName": "rawActivateImprovedBooleanFields" }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/site/activate_draft_mode_as_default", + "rel": "activate_draft_mode_as_default", + "urlTemplate": "/site/activate-draft-mode-as-default", + "method": "PUT", + "comment": "Set draft mode default to true for all environment's models", + "urlPlaceholders": [], + "optionalRequestBody": false, + "queryParamsRequired": false, + "responseType": "SiteActivateDraftModeAsDefaultTargetSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "activateDraftModeAsDefault", + "rawName": "rawActivateDraftModeAsDefault" + }, + { + "returnsCollection": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_validation_at_publishing", + "rel": "activate_improved_validation_at_publishing", + "urlTemplate": "/site/activate-improved-validation-at-publishing", + "method": "PUT", + "comment": "Activate improved validation at publishing option", + "urlPlaceholders": [], + "optionalRequestBody": false, + "queryParamsRequired": false, + "responseType": "SiteActivateImprovedValidationAtPublishingTargetSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "activateImprovedValidationAtPublishing", + "rawName": "rawActivateImprovedValidationAtPublishing" + }, { "returnsCollection": false, "docUrl": "https://www.datocms.com/docs/content-management-api/resources/site/update_assets_cdn_default_settings", diff --git a/packages/cma-client/src/generated/SchemaTypes.ts b/packages/cma-client/src/generated/SchemaTypes.ts index 7fd90b33..816b6fe8 100644 --- a/packages/cma-client/src/generated/SchemaTypes.ts +++ b/packages/cma-client/src/generated/SchemaTypes.ts @@ -1583,7 +1583,7 @@ export type RoleAttributes = { /** * Specifies the environments the user can access */ - environments_access: 'all' | 'primary_only' | 'sandbox_only'; + environments_access: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -1840,7 +1840,7 @@ export type RoleMeta = { /** * Specifies the environments the user can access */ - environments_access: 'all' | 'primary_only' | 'sandbox_only'; + environments_access: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2076,7 +2076,7 @@ export type RoleCreateSchema = { /** * Specifies the environments the user can access */ - environments_access?: 'all' | 'primary_only' | 'sandbox_only'; + environments_access?: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2334,7 +2334,7 @@ export type RoleUpdateSchema = { /** * Specifies the environments the user can access */ - environments_access?: 'all' | 'primary_only' | 'sandbox_only'; + environments_access?: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2573,6 +2573,14 @@ export type RoleDestroyTargetSchema = { data: Role; }; +/** + * This interface was referenced by `Role`'s JSON-Schema + * via the `duplicate.targetSchema` link. + */ +export type RoleDuplicateTargetSchema = { + data: Role; +}; + /** * A DatoCMS administrative area can be accessed by multiple people. Every collaborator is linked to a specific Role, which describes what actions it will be able to perform once logged in. * @@ -4999,11 +5007,11 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { *
* Multi-line text (text) * - * | Property | Value | - * | ------------------------------ | --------------------------------- | - * | Code | `text` | - * | Built-in editors for the field | `markdown`, `wysiwyg`, `textarea` | - * | Available validators | `required`, `length`, `format` | + * | Property | Value | + * | ------------------------------ | ---------------------------------------------- | + * | Code | `text` | + * | Built-in editors for the field | `markdown`, `wysiwyg`, `textarea` | + * | Available validators | `required`, `length`, `format`, `sanitization` | * *
* @@ -5288,10 +5296,10 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { * * Accepts only strings that match a specified format. * - * | Parameter | Type | Required | Description | - * | -------------------- | ------------------------- | -------- | ----------------------------------------------- | - * | `custom_pattern` | `Regexp` | Optional | Custom regular expression for validation | - * | `predefined_pattern` | `"email"` or `"url"` | Optional | Specifies a pre-defined format (email or URL) | + * | Parameter | Type | Required | Description | + * | -------------------- | -------------------- | -------- | --------------------------------------------- | + * | `custom_pattern` | `Regexp` | Optional | Custom regular expression for validation | + * | `predefined_pattern` | `"email"` or `"url"` | Optional | Specifies a pre-defined format (email or URL) | * * **Note:** Only one of `custom_pattern` or `predefined_pattern` should be specified. * @@ -5504,7 +5512,7 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { * * Only accept references to block records of the specified block models. * - * | Parameter | Type | Required | Description | + * | Parameter | Type | Required | Description | * | ------------ | ----------------------- | -------- | ------------------------------ | * | `item_types` | `Array` | ✅ | Set of allowed Block Model IDs | * @@ -5671,9 +5679,9 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { * * Simple textual input for _Single-line string_ fields. * - * | Parameter | Type | Required | Description | + * | Parameter | Type | Required | Description | * | ------------- | --------- | -------- | ------------------------------------------------------------------------------------------ | - * | `heading` | `Boolean` | ✅ | Indicates if the field should be shown bigger, as a field representing a heading | + * | `heading` | `Boolean` | ✅ | Indicates if the field should be shown bigger, as a field representing a heading | * | `placeholder` | `String` | | A placeholder that will be shown in the editor's input to provide editors with an example. | * * @@ -5763,8 +5771,8 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = { * * Built-in editor for _Single block_ fields. * - * | Parameter | Type | Required | Description | - * | ----------------- | --------- | -------- | ---------------------------------------------------------- | + * | Parameter | Type | Required | Description | + * | ----------------- | --------- | -------- | --------------------------------------------------------- | * | `start_collapsed` | `Boolean` | | Whether you want block record collapsed by default or not | * * @@ -11765,6 +11773,14 @@ export type SiteMeta = { * Whether the Improved boolean fields option is active or not */ improved_boolean_fields: boolean; + /** + * The default value for the draft mode option in all the environment's models + */ + draft_mode_default: boolean; + /** + * Whether the Improved validation at publishing option is active or not + */ + improved_validation_at_publishing: boolean; /** * Whether the site has custom upload storage settings */ @@ -11940,6 +11956,14 @@ export type SiteUpdateSchema = { * Whether the Improved boolean fields option is active or not */ improved_boolean_fields?: boolean; + /** + * The default value for the draft mode option in all the environment's models + */ + draft_mode_default?: boolean; + /** + * Whether the Improved validation at publishing option is active or not + */ + improved_validation_at_publishing?: boolean; /** * Whether the site has custom upload storage settings */ @@ -12017,6 +12041,22 @@ export type SiteActivateImprovedBooleanFieldsTargetSchema = { data: Site; }; +/** + * This interface was referenced by `Site`'s JSON-Schema + * via the `activate_draft_mode_as_default.targetSchema` link. + */ +export type SiteActivateDraftModeAsDefaultTargetSchema = { + data: Site; +}; + +/** + * This interface was referenced by `Site`'s JSON-Schema + * via the `activate_improved_validation_at_publishing.targetSchema` link. + */ +export type SiteActivateImprovedValidationAtPublishingTargetSchema = { + data: Site; +}; + /** * This interface was referenced by `Site`'s JSON-Schema * via the `update_assets_cdn_default_settings.schema` link. diff --git a/packages/cma-client/src/generated/SimpleSchemaTypes.ts b/packages/cma-client/src/generated/SimpleSchemaTypes.ts index a4ec8b8c..1040c89c 100644 --- a/packages/cma-client/src/generated/SimpleSchemaTypes.ts +++ b/packages/cma-client/src/generated/SimpleSchemaTypes.ts @@ -1959,7 +1959,7 @@ export type Role = { /** * Specifies the environments the user can access */ - environments_access: 'all' | 'primary_only' | 'sandbox_only'; + environments_access: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2157,6 +2157,7 @@ export type RoleCreateTargetSchema = Role; export type RoleUpdateTargetSchema = Role; export type RoleSelfTargetSchema = Role; export type RoleDestroyTargetSchema = Role; +export type RoleDuplicateTargetSchema = Role; /** * JSON API data * @@ -2206,7 +2207,7 @@ export type RoleMeta = { /** * Specifies the environments the user can access */ - environments_access: 'all' | 'primary_only' | 'sandbox_only'; + environments_access: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2438,7 +2439,7 @@ export type RoleAttributes = { /** * Specifies the environments the user can access */ - environments_access: 'all' | 'primary_only' | 'sandbox_only'; + environments_access: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2678,7 +2679,7 @@ export type RoleCreateSchema = { /** * Specifies the environments the user can access */ - environments_access?: 'all' | 'primary_only' | 'sandbox_only'; + environments_access?: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -2911,7 +2912,7 @@ export type RoleUpdateSchema = { /** * Specifies the environments the user can access */ - environments_access?: 'all' | 'primary_only' | 'sandbox_only'; + environments_access?: 'all' | 'primary_only' | 'sandbox_only' | 'none'; /** * Can create/edit roles and invite/remove collaborators */ @@ -5321,11 +5322,11 @@ export type ItemTypeUpdateSchema = { *
* Multi-line text (text) * - * | Property | Value | - * | ------------------------------ | --------------------------------- | - * | Code | `text` | - * | Built-in editors for the field | `markdown`, `wysiwyg`, `textarea` | - * | Available validators | `required`, `length`, `format` | + * | Property | Value | + * | ------------------------------ | ---------------------------------------------- | + * | Code | `text` | + * | Built-in editors for the field | `markdown`, `wysiwyg`, `textarea` | + * | Available validators | `required`, `length`, `format`, `sanitization` | * *
* @@ -5610,10 +5611,10 @@ export type ItemTypeUpdateSchema = { * * Accepts only strings that match a specified format. * - * | Parameter | Type | Required | Description | - * | -------------------- | ------------------------- | -------- | ----------------------------------------------- | - * | `custom_pattern` | `Regexp` | Optional | Custom regular expression for validation | - * | `predefined_pattern` | `"email"` or `"url"` | Optional | Specifies a pre-defined format (email or URL) | + * | Parameter | Type | Required | Description | + * | -------------------- | -------------------- | -------- | --------------------------------------------- | + * | `custom_pattern` | `Regexp` | Optional | Custom regular expression for validation | + * | `predefined_pattern` | `"email"` or `"url"` | Optional | Specifies a pre-defined format (email or URL) | * * **Note:** Only one of `custom_pattern` or `predefined_pattern` should be specified. * @@ -5826,7 +5827,7 @@ export type ItemTypeUpdateSchema = { * * Only accept references to block records of the specified block models. * - * | Parameter | Type | Required | Description | + * | Parameter | Type | Required | Description | * | ------------ | ----------------------- | -------- | ------------------------------ | * | `item_types` | `Array` | ✅ | Set of allowed Block Model IDs | * @@ -5993,9 +5994,9 @@ export type ItemTypeUpdateSchema = { * * Simple textual input for _Single-line string_ fields. * - * | Parameter | Type | Required | Description | + * | Parameter | Type | Required | Description | * | ------------- | --------- | -------- | ------------------------------------------------------------------------------------------ | - * | `heading` | `Boolean` | ✅ | Indicates if the field should be shown bigger, as a field representing a heading | + * | `heading` | `Boolean` | ✅ | Indicates if the field should be shown bigger, as a field representing a heading | * | `placeholder` | `String` | | A placeholder that will be shown in the editor's input to provide editors with an example. | * * @@ -6085,8 +6086,8 @@ export type ItemTypeUpdateSchema = { * * Built-in editor for _Single block_ fields. * - * | Parameter | Type | Required | Description | - * | ----------------- | --------- | -------- | ---------------------------------------------------------- | + * | Parameter | Type | Required | Description | + * | ----------------- | --------- | -------- | --------------------------------------------------------- | * | `start_collapsed` | `Boolean` | | Whether you want block record collapsed by default or not | * * @@ -11170,6 +11171,8 @@ export type SiteActivateImprovedHexManagementTargetSchema = Site; export type SiteActivateImprovedGqlMultilocaleFieldsTargetSchema = Site; export type SiteActivateImprovedGqlVisibilityControlTargetSchema = Site; export type SiteActivateImprovedBooleanFieldsTargetSchema = Site; +export type SiteActivateDraftModeAsDefaultTargetSchema = Site; +export type SiteActivateImprovedValidationAtPublishingTargetSchema = Site; export type SiteUpdateAssetsCdnDefaultSettingsTargetSchema = Site; /** * Meta attributes @@ -11202,6 +11205,14 @@ export type SiteMeta = { * Whether the Improved boolean fields option is active or not */ improved_boolean_fields: boolean; + /** + * The default value for the draft mode option in all the environment's models + */ + draft_mode_default: boolean; + /** + * Whether the Improved validation at publishing option is active or not + */ + improved_validation_at_publishing: boolean; /** * Whether the site has custom upload storage settings */ @@ -11549,6 +11560,14 @@ export type SiteUpdateSchema = { * Whether the Improved boolean fields option is active or not */ improved_boolean_fields?: boolean; + /** + * The default value for the draft mode option in all the environment's models + */ + draft_mode_default?: boolean; + /** + * Whether the Improved validation at publishing option is active or not + */ + improved_validation_at_publishing?: boolean; /** * Whether the site has custom upload storage settings */ diff --git a/packages/cma-client/src/generated/resources/Role.ts b/packages/cma-client/src/generated/resources/Role.ts index 098c1a82..85a4fdd2 100644 --- a/packages/cma-client/src/generated/resources/Role.ts +++ b/packages/cma-client/src/generated/resources/Role.ts @@ -238,4 +238,35 @@ export default class Role extends BaseResource { url: `/roles/${roleId}`, }); } + + /** + * Duplicate a role + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/role/duplicate + * + * @throws {ApiError} + * @throws {TimeoutError} + */ + duplicate(roleId: string | SimpleSchemaTypes.RoleData) { + return this.rawDuplicate(Utils.toId(roleId)).then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Duplicate a role + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/role/duplicate + * + * @throws {ApiError} + * @throws {TimeoutError} + */ + rawDuplicate(roleId: string): Promise { + return this.client.request({ + method: 'POST', + url: `/roles/${roleId}/duplicate`, + }); + } } diff --git a/packages/cma-client/src/generated/resources/Site.ts b/packages/cma-client/src/generated/resources/Site.ts index 3e1b9fb5..2ed5e271 100644 --- a/packages/cma-client/src/generated/resources/Site.ts +++ b/packages/cma-client/src/generated/resources/Site.ts @@ -276,6 +276,80 @@ export default class Site extends BaseResource { ); } + /** + * Set draft mode default to true for all environment's models + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_draft_mode_as_default + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + activateDraftModeAsDefault() { + return this.rawActivateDraftModeAsDefault().then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Set draft mode default to true for all environment's models + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_draft_mode_as_default + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawActivateDraftModeAsDefault(): Promise { + return this.client.request( + { + method: 'PUT', + url: '/site/activate-draft-mode-as-default', + }, + ); + } + + /** + * Activate improved validation at publishing option + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_validation_at_publishing + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + activateImprovedValidationAtPublishing() { + return this.rawActivateImprovedValidationAtPublishing().then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Activate improved validation at publishing option + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_validation_at_publishing + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawActivateImprovedValidationAtPublishing(): Promise { + return this.client.request( + { + method: 'PUT', + url: '/site/activate-improved-validation-at-publishing', + }, + ); + } + /** * Update CDN settings default assets *