diff --git a/lerna.json b/lerna.json index a6b48f35..e1628ab4 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "5.4.22" + "version": "5.5.0-alpha.2" } diff --git a/packages/cma-client-analysis/__tests__/__snapshots__/code-analysis.test.ts.snap b/packages/cma-client-analysis/__tests__/__snapshots__/code-analysis.test.ts.snap index e77393f3..14ac5b74 100644 --- a/packages/cma-client-analysis/__tests__/__snapshots__/code-analysis.test.ts.snap +++ b/packages/cma-client-analysis/__tests__/__snapshots__/code-analysis.test.ts.snap @@ -1098,42 +1098,25 @@ exports[`TypeScript Compiler API - Unit Tests extractTypeDependencies uploads.cr */ notes?: string | null; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Patch the asset's default metadata. Send any subset of \`alt\`/\`title\`/\`custom_data\`/\`focal_point\` — missing keys preserve their stored values. See the response shape for the full structure and per-key semantics. */ default_field_metadata?: { + alt?: LocalizedAlt; + title?: LocalizedTitle; + custom_data?: LocalizedCustomData; /** - * This interface was referenced by \`undefined\`'s JSON-Schema definition - * via the \`patternProperty\` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point?: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt?: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title?: string | null; - /** - * Object with arbitrary metadata - */ - custom_data?: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point?: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Tags @@ -1146,6 +1129,38 @@ export type UploadIdentity = string; export type UploadType = 'upload'; +export type LocalizedAlt = { + /** + * Alternate text for the asset in this locale + * + * This interface was referenced by \`LocalizedAlt\`'s JSON-Schema definition + * via the \`patternProperty\` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; + +export type LocalizedTitle = { + /** + * Title for the asset in this locale + * + * This interface was referenced by \`LocalizedTitle\`'s JSON-Schema definition + * via the \`patternProperty\` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; + +export type LocalizedCustomData = { + /** + * Arbitrary metadata for the asset in this locale + * + * This interface was referenced by \`LocalizedCustomData\`'s JSON-Schema definition + * via the \`patternProperty\` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: { + [k: string]: unknown; + }; +}; + export type UploadCollectionData = { type: UploadCollectionType; id: UploadCollectionIdentity; @@ -1227,42 +1242,25 @@ export type Upload = { */ mux_mp4_highest_res: null | 'high' | 'medium' | 'low'; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Per-asset default metadata applied when no record-level overrides are present. \`alt\`, \`title\`, and \`custom_data\` are objects keyed by locale; \`focal_point\` is a single value per asset (only meaningful for image assets). See [non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) for more info. */ default_field_metadata: { + alt: LocalizedAlt; + title: LocalizedTitle; + custom_data: LocalizedCustomData; /** - * This interface was referenced by \`undefined\`'s JSON-Schema definition - * via the \`patternProperty\` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { - /** - * Alternate text for the asset - */ - alt: string | null; - /** - * Title for the asset - */ - title: string | null; + focal_point: { /** - * Object with arbitrary metadata + * Horizontal position expressed as float between 0 and 1 */ - custom_data: { - [k: string]: unknown; - }; + x: number; /** - * Focal point (only for image assets) + * Vertical position expressed as float between 0 and 1 */ - focal_point: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Is this upload an image? diff --git a/packages/cma-client-analysis/package.json b/packages/cma-client-analysis/package.json index 8f6713cf..dd126c4d 100644 --- a/packages/cma-client-analysis/package.json +++ b/packages/cma-client-analysis/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client-analysis", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "TypeScript-based static analysis utilities for the @datocms/cma-client-node Client class. Extracts method signatures, referenced types, and endpoint mappings.", "keywords": [ "datocms", @@ -49,7 +49,7 @@ "typescript": ">=5.0.0" }, "devDependencies": { - "@datocms/cma-client-node": "^5.4.22", + "@datocms/cma-client-node": "^5.5.0-alpha.2", "@datocms/rest-api-reference": "^5.4.19", "typescript": "^5.0.0" } diff --git a/packages/cma-client-browser/package.json b/packages/cma-client-browser/package.json index 544a1052..c083fb00 100644 --- a/packages/cma-client-browser/package.json +++ b/packages/cma-client-browser/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client-browser", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "Browser client for DatoCMS REST Content Management API", "keywords": [ "datocms", @@ -28,7 +28,7 @@ "url": "git+https://github.com/datocms/js-rest-api-clients.git" }, "dependencies": { - "@datocms/cma-client": "^5.4.22", + "@datocms/cma-client": "^5.5.0-alpha.2", "@datocms/rest-client-utils": "^5.4.9" }, "scripts": { diff --git a/packages/cma-client-browser/src/index.ts b/packages/cma-client-browser/src/index.ts index 9630de9e..a85cbc1b 100644 --- a/packages/cma-client-browser/src/index.ts +++ b/packages/cma-client-browser/src/index.ts @@ -257,6 +257,8 @@ export type { UnchangedBlockInRequest, UniqueValidator, UpdatedBlockInRequest, + UploadLocaleKeyedDefaultFieldMetadata, + UploadLocaleKeyedDefaultFieldMetadataInRequest, VideoEditorConfiguration, VideoFieldAppearance, VideoFieldValidators, diff --git a/packages/cma-client-node/package-lock.json b/packages/cma-client-node/package-lock.json index d279730f..5f0f225c 100644 --- a/packages/cma-client-node/package-lock.json +++ b/packages/cma-client-node/package-lock.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client-node", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/packages/cma-client-node/package.json b/packages/cma-client-node/package.json index 6b6686c6..bbea0500 100644 --- a/packages/cma-client-node/package.json +++ b/packages/cma-client-node/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client-node", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "NodeJS client for DatoCMS REST Content Management API", "keywords": [ "datocms", @@ -37,7 +37,7 @@ "url": "git+https://github.com/datocms/js-rest-api-clients.git" }, "dependencies": { - "@datocms/cma-client": "^5.4.22", + "@datocms/cma-client": "^5.5.0-alpha.2", "@datocms/rest-client-utils": "^5.4.9", "mime-types": "^2.1.35", "tmp-promise": "^3.0.3" diff --git a/packages/cma-client-node/src/index.ts b/packages/cma-client-node/src/index.ts index 6e212481..2b930c2e 100644 --- a/packages/cma-client-node/src/index.ts +++ b/packages/cma-client-node/src/index.ts @@ -257,6 +257,8 @@ export type { UnchangedBlockInRequest, UniqueValidator, UpdatedBlockInRequest, + UploadLocaleKeyedDefaultFieldMetadata, + UploadLocaleKeyedDefaultFieldMetadataInRequest, VideoEditorConfiguration, VideoFieldAppearance, VideoFieldValidators, diff --git a/packages/cma-client/package-lock.json b/packages/cma-client/package-lock.json index 1e713837..f569372b 100644 --- a/packages/cma-client/package-lock.json +++ b/packages/cma-client/package-lock.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/packages/cma-client/package.json b/packages/cma-client/package.json index a91552ec..84dc44c3 100644 --- a/packages/cma-client/package.json +++ b/packages/cma-client/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-client", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "JS client for DatoCMS REST Content Management API", "keywords": [ "datocms", diff --git a/packages/cma-client/resources.json b/packages/cma-client/resources.json index 81cfb4ac..65e9c5cc 100644 --- a/packages/cma-client/resources.json +++ b/packages/cma-client/resources.json @@ -5352,6 +5352,23 @@ "name": "activateMillisecondsInDatetime", "rawName": "rawActivateMillisecondsInDatetime" }, + { + "returnsItem": false, + "requestBodyRequiresItem": false, + "offersNestedItemsOptionInQueryParams": false, + "docUrl": "https://www.datocms.com/docs/content-management-api/resources/site/activate_non_localized_focal_points", + "rel": "activate_non_localized_focal_points", + "urlTemplate": "/site/activate-non-localized-focal-points", + "method": "PUT", + "comment": "Activate non-localized focal points", + "urlPlaceholders": [], + "optionalRequestBody": false, + "queryParamsRequired": false, + "responseType": "SiteActivateNonLocalizedFocalPointsTargetSchema", + "deprecated": "This API call is to be considered private and might change without notice", + "name": "activateNonLocalizedFocalPoints", + "rawName": "rawActivateNonLocalizedFocalPoints" + }, { "returnsItem": false, "requestBodyRequiresItem": false, diff --git a/packages/cma-client/src/generated/ApiTypes.ts b/packages/cma-client/src/generated/ApiTypes.ts index f3793404..dc08df87 100644 --- a/packages/cma-client/src/generated/ApiTypes.ts +++ b/packages/cma-client/src/generated/ApiTypes.ts @@ -8341,42 +8341,25 @@ export type Upload = { */ mux_mp4_highest_res: null | 'high' | 'medium' | 'low'; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Per-asset default metadata applied when no record-level overrides are present. `alt`, `title`, and `custom_data` are objects keyed by locale; `focal_point` is a single value per asset (only meaningful for image assets). See [non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) for more info. */ default_field_metadata: { + alt: LocalizedAlt; + title: LocalizedTitle; + custom_data: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title: string | null; - /** - * Object with arbitrary metadata - */ - custom_data: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Is this upload an image? @@ -8442,6 +8425,44 @@ export type UploadCreateJobSchema = Upload; export type UploadSelfTargetSchema = Upload; export type UploadDestroyTargetSchema = Upload; export type UploadUpdateJobSchema = Upload; +/** + * Alternate text per locale + */ +export type LocalizedAlt = { + /** + * Alternate text for the asset in this locale + * + * This interface was referenced by `LocalizedAlt`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; +/** + * Title per locale + */ +export type LocalizedTitle = { + /** + * Title for the asset in this locale + * + * This interface was referenced by `LocalizedTitle`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; +/** + * Object with arbitrary metadata, per locale + */ +export type LocalizedCustomData = { + /** + * Arbitrary metadata for the asset in this locale + * + * This interface was referenced by `LocalizedCustomData`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: { + [k: string]: unknown; + }; +}; /** * Meta attributes * @@ -8557,42 +8578,25 @@ export type UploadAttributes = { */ mux_mp4_highest_res: null | 'high' | 'medium' | 'low'; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Per-asset default metadata applied when no record-level overrides are present. `alt`, `title`, and `custom_data` are objects keyed by locale; `focal_point` is a single value per asset (only meaningful for image assets). See [non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) for more info. */ default_field_metadata: { + alt: LocalizedAlt; + title: LocalizedTitle; + custom_data: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { - /** - * Alternate text for the asset - */ - alt: string | null; - /** - * Title for the asset - */ - title: string | null; + focal_point: { /** - * Object with arbitrary metadata + * Horizontal position expressed as float between 0 and 1 */ - custom_data: { - [k: string]: unknown; - }; + x: number; /** - * Focal point (only for image assets) + * Vertical position expressed as float between 0 and 1 */ - focal_point: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Is this upload an image? @@ -8685,42 +8689,25 @@ export type UploadCreateSchema = { */ notes?: string | null; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Patch the asset's default metadata. Send any subset of `alt`/`title`/`custom_data`/`focal_point` — missing keys preserve their stored values. See the response shape for the full structure and per-key semantics. */ default_field_metadata?: { + alt?: LocalizedAlt; + title?: LocalizedTitle; + custom_data?: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point?: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt?: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title?: string | null; - /** - * Object with arbitrary metadata - */ - custom_data?: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point?: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Tags @@ -8760,42 +8747,25 @@ export type UploadUpdateSchema = { */ tags?: string[]; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Patch the asset's default metadata. Send any subset of `alt`/`title`/`custom_data`/`focal_point` — missing keys preserve their stored values. See the response shape for the full structure and per-key semantics. */ default_field_metadata?: { + alt?: LocalizedAlt; + title?: LocalizedTitle; + custom_data?: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point?: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt?: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title?: string | null; - /** - * Object with arbitrary metadata - */ - custom_data?: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point?: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; creator?: | AccountData @@ -11654,6 +11624,7 @@ export type SiteActivateImprovedValidationAtPublishingTargetSchema = Site; export type SiteActivateImprovedExposureOfInlineBlocksInCdaTargetSchema = Site; export type SiteActivateImprovedItemsListingTargetSchema = Site; export type SiteActivateMillisecondsInDatetimeTargetSchema = Site; +export type SiteActivateNonLocalizedFocalPointsTargetSchema = Site; export type SiteUpdateAssetsCdnDefaultSettingsTargetSchema = Site; /** * Meta attributes @@ -11710,6 +11681,10 @@ export type SiteMeta = { * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not */ milliseconds_in_datetime: boolean; + /** + * Whether the [Non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) opt-in product update is active or not + */ + non_localized_focal_points: boolean; }; /** * JSON API data @@ -12073,6 +12048,10 @@ export type SiteUpdateSchema = { * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not */ milliseconds_in_datetime?: boolean; + /** + * Whether the [Non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) opt-in product update is active or not + */ + non_localized_focal_points?: boolean; }; }; /** diff --git a/packages/cma-client/src/generated/RawApiTypes.ts b/packages/cma-client/src/generated/RawApiTypes.ts index 7c0ca632..d0d4bfe2 100644 --- a/packages/cma-client/src/generated/RawApiTypes.ts +++ b/packages/cma-client/src/generated/RawApiTypes.ts @@ -8616,42 +8616,25 @@ export type UploadAttributes = { */ mux_mp4_highest_res: null | 'high' | 'medium' | 'low'; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Per-asset default metadata applied when no record-level overrides are present. `alt`, `title`, and `custom_data` are objects keyed by locale; `focal_point` is a single value per asset (only meaningful for image assets). See [non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) for more info. */ default_field_metadata: { + alt: LocalizedAlt; + title: LocalizedTitle; + custom_data: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title: string | null; - /** - * Object with arbitrary metadata - */ - custom_data: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Is this upload an image? @@ -8705,6 +8688,44 @@ export type UploadAttributes = { alpha: number; }[]; }; +/** + * Alternate text per locale + */ +export type LocalizedAlt = { + /** + * Alternate text for the asset in this locale + * + * This interface was referenced by `LocalizedAlt`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; +/** + * Title per locale + */ +export type LocalizedTitle = { + /** + * Title for the asset in this locale + * + * This interface was referenced by `LocalizedTitle`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: string | null; +}; +/** + * Object with arbitrary metadata, per locale + */ +export type LocalizedCustomData = { + /** + * Arbitrary metadata for the asset in this locale + * + * This interface was referenced by `LocalizedCustomData`'s JSON-Schema definition + * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + */ + [k: string]: { + [k: string]: unknown; + }; +}; /** * JSON API links * @@ -8791,42 +8812,25 @@ export type UploadCreateSchema = { */ notes?: string | null; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Patch the asset's default metadata. Send any subset of `alt`/`title`/`custom_data`/`focal_point` — missing keys preserve their stored values. See the response shape for the full structure and per-key semantics. */ default_field_metadata?: { + alt?: LocalizedAlt; + title?: LocalizedTitle; + custom_data?: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { + focal_point?: { /** - * Alternate text for the asset + * Horizontal position expressed as float between 0 and 1 */ - alt?: string | null; + x: number; /** - * Title for the asset + * Vertical position expressed as float between 0 and 1 */ - title?: string | null; - /** - * Object with arbitrary metadata - */ - custom_data?: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point?: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; /** * Tags @@ -8916,42 +8920,25 @@ export type UploadUpdateSchema = { */ tags?: string[]; /** - * For each of the project's locales, the default metadata to apply if nothing is specified at record's level. + * Patch the asset's default metadata. Send any subset of `alt`/`title`/`custom_data`/`focal_point` — missing keys preserve their stored values. See the response shape for the full structure and per-key semantics. */ default_field_metadata?: { + alt?: LocalizedAlt; + title?: LocalizedTitle; + custom_data?: LocalizedCustomData; /** - * This interface was referenced by `undefined`'s JSON-Schema definition - * via the `patternProperty` "^(?[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$". + * Focal point (only for image assets) */ - [k: string]: { - /** - * Alternate text for the asset - */ - alt?: string | null; + focal_point?: { /** - * Title for the asset + * Horizontal position expressed as float between 0 and 1 */ - title?: string | null; + x: number; /** - * Object with arbitrary metadata + * Vertical position expressed as float between 0 and 1 */ - custom_data?: { - [k: string]: unknown; - }; - /** - * Focal point (only for image assets) - */ - focal_point?: { - /** - * Horizontal position expressed as float between 0 and 1 - */ - x: number; - /** - * Vertical position expressed as float between 0 and 1 - */ - y: number; - } | null; - }; + y: number; + } | null; }; [k: string]: unknown; }; @@ -12098,6 +12085,10 @@ export type SiteMeta = { * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not */ milliseconds_in_datetime: boolean; + /** + * Whether the [Non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) opt-in product update is active or not + */ + non_localized_focal_points: boolean; }; /** * JSON API data @@ -12290,6 +12281,10 @@ export type SiteUpdateSchema = { * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not */ milliseconds_in_datetime?: boolean; + /** + * Whether the [Non-localized focal points](https://www.datocms.com/product-updates/non-localized-focal-points) opt-in product update is active or not + */ + non_localized_focal_points?: boolean; }; relationships?: { sso_default_role?: { @@ -12389,6 +12384,13 @@ export type SiteActivateImprovedItemsListingTargetSchema = { export type SiteActivateMillisecondsInDatetimeTargetSchema = { data: Site; }; +/** + * This interface was referenced by `Site`'s JSON-Schema + * via the `activate_non_localized_focal_points.targetSchema` link. + */ +export type SiteActivateNonLocalizedFocalPointsTargetSchema = { + 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/resources/Site.ts b/packages/cma-client/src/generated/resources/Site.ts index 44b7186a..b118f750 100644 --- a/packages/cma-client/src/generated/resources/Site.ts +++ b/packages/cma-client/src/generated/resources/Site.ts @@ -457,6 +457,43 @@ export default class Site extends BaseResource { ); } + /** + * Activate non-localized focal points + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_non_localized_focal_points + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + activateNonLocalizedFocalPoints() { + return this.rawActivateNonLocalizedFocalPoints().then((body) => + Utils.deserializeResponseBody( + body, + ), + ); + } + + /** + * Activate non-localized focal points + * + * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_non_localized_focal_points + * + * @throws {ApiError} + * @throws {TimeoutError} + * + * @deprecated This API call is to be considered private and might change without notice + */ + rawActivateNonLocalizedFocalPoints(): Promise { + return this.client.request( + { + method: 'PUT', + url: '/site/activate-non-localized-focal-points', + }, + ); + } + /** * Update CDN settings default assets * diff --git a/packages/cma-client/src/generated/resources/index.ts b/packages/cma-client/src/generated/resources/index.ts index bfd71005..68468eec 100644 --- a/packages/cma-client/src/generated/resources/index.ts +++ b/packages/cma-client/src/generated/resources/index.ts @@ -18,7 +18,7 @@ export { default as BuildEvent } from './BuildEvent.js'; export { default as SearchIndexEvent } from './SearchIndexEvent.js'; export { default as Item } from './Item.js'; export { default as ItemVersion } from './ItemVersion.js'; -export { default as Upload } from './Upload.js'; +export { default as Upload } from '../../resources/Upload.js'; export { default as UploadRequest } from './UploadRequest.js'; export { default as UploadTrack } from './UploadTrack.js'; export { default as ScheduledPublication } from './ScheduledPublication.js'; diff --git a/packages/cma-client/src/index.ts b/packages/cma-client/src/index.ts index 4b444bba..435a363a 100644 --- a/packages/cma-client/src/index.ts +++ b/packages/cma-client/src/index.ts @@ -4,6 +4,10 @@ export * from './fieldTypes/index.js'; export { Client } from './generated/Client.js'; export type { ClientConfigOptions } from './generated/Client.js'; export * as Resources from './generated/resources/index.js'; +export type { + UploadLocaleKeyedDefaultFieldMetadata, + UploadLocaleKeyedDefaultFieldMetadataInRequest, +} from './resources/Upload.js'; export * from './utilities/buildBlockRecord.js'; export * from './utilities/duplicateBlockRecord.js'; export * from './utilities/fieldsContainingReferences.js'; diff --git a/packages/cma-client/src/resources/Upload.ts b/packages/cma-client/src/resources/Upload.ts new file mode 100644 index 00000000..fac74e84 --- /dev/null +++ b/packages/cma-client/src/resources/Upload.ts @@ -0,0 +1,36 @@ +import BaseUpload from '../generated/resources/Upload.js'; + +/** + * Legacy locale-keyed shape of an upload's `default_field_metadata`, as + * returned and accepted by environments where the `non_localized_focal_points` + * opt-in is inactive. + * + * The generated `Upload.default_field_metadata` type reflects the new + * field-keyed shape (the path forward). This type is provided so consumers + * targeting opted-out environments during the transition can cast the + * response value to a structurally accurate shape. + */ +export type UploadLocaleKeyedDefaultFieldMetadata = { + [localeCode: string]: { + alt: string | null; + title: string | null; + custom_data: { [k: string]: unknown }; + focal_point: { x: number; y: number } | null; + }; +}; + +/** + * Legacy locale-keyed shape accepted on `create` / `update` request bodies + * by environments where the `non_localized_focal_points` opt-in is inactive. + * All fields are optional, matching the partial-write contract. + */ +export type UploadLocaleKeyedDefaultFieldMetadataInRequest = { + [localeCode: string]: { + alt?: string | null; + title?: string | null; + custom_data?: { [k: string]: unknown }; + focal_point?: { x: number; y: number } | null; + }; +}; + +export default class UploadResource extends BaseUpload {} diff --git a/packages/cma-schema-types-generator/package-lock.json b/packages/cma-schema-types-generator/package-lock.json index 9d8a2149..c19b7fe4 100644 --- a/packages/cma-schema-types-generator/package-lock.json +++ b/packages/cma-schema-types-generator/package-lock.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-schema-types-generator", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/packages/cma-schema-types-generator/package.json b/packages/cma-schema-types-generator/package.json index 9f4d76aa..6cb79e9e 100644 --- a/packages/cma-schema-types-generator/package.json +++ b/packages/cma-schema-types-generator/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/cma-schema-types-generator", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "Generate TypeScript type definitions from a DatoCMS project schema", "keywords": [ "datocms", @@ -46,6 +46,6 @@ "typescript": "5.7.2" }, "devDependencies": { - "@datocms/cma-client": "^5.4.22" + "@datocms/cma-client": "^5.5.0-alpha.2" } } diff --git a/packages/rest-api-events/package-lock.json b/packages/rest-api-events/package-lock.json index be4bfdb7..0f94b9c2 100644 --- a/packages/rest-api-events/package-lock.json +++ b/packages/rest-api-events/package-lock.json @@ -1,6 +1,6 @@ { "name": "@datocms/rest-api-events", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/packages/rest-api-events/package.json b/packages/rest-api-events/package.json index 71f23a74..cb43bbca 100644 --- a/packages/rest-api-events/package.json +++ b/packages/rest-api-events/package.json @@ -1,6 +1,6 @@ { "name": "@datocms/rest-api-events", - "version": "5.4.22", + "version": "5.5.0-alpha.2", "description": "Utilities to receive real-time events from DatoCMS REST APIs", "keywords": [ "datocms", @@ -39,7 +39,7 @@ "pusher-js": "^7.0.6" }, "devDependencies": { - "@datocms/cma-client": "^5.4.22", + "@datocms/cma-client": "^5.5.0-alpha.2", "@datocms/dashboard-client": "^5.4.21" }, "gitHead": "ac4164968026ba62a2841d31d2b60c31eadb2cc8"