Skip to content

Commit 43a23c0

Browse files
committed
Update generated types and expose legacy locale-keyed upload metadata types
1 parent 8c21d02 commit 43a23c0

7 files changed

Lines changed: 223 additions & 197 deletions

File tree

packages/cma-client-browser/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ export type {
257257
UnchangedBlockInRequest,
258258
UniqueValidator,
259259
UpdatedBlockInRequest,
260+
UploadLocaleKeyedDefaultFieldMetadata,
261+
UploadLocaleKeyedDefaultFieldMetadataInRequest,
260262
VideoEditorConfiguration,
261263
VideoFieldAppearance,
262264
VideoFieldValidators,

packages/cma-client-node/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ export type {
257257
UnchangedBlockInRequest,
258258
UniqueValidator,
259259
UpdatedBlockInRequest,
260+
UploadLocaleKeyedDefaultFieldMetadata,
261+
UploadLocaleKeyedDefaultFieldMetadataInRequest,
260262
VideoEditorConfiguration,
261263
VideoFieldAppearance,
262264
VideoFieldValidators,

packages/cma-client/src/generated/ApiTypes.ts

Lines changed: 96 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -8341,42 +8341,28 @@ export type Upload = {
83418341
*/
83428342
mux_mp4_highest_res: null | 'high' | 'medium' | 'low';
83438343
/**
8344-
* For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8344+
* 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 non-localized — a single value per asset, applied across every locale (only meaningful for image assets).
8345+
*
8346+
* > [!PROTIP] 📘 Requires the `non_localized_focal_points` environment opt-in
8347+
* > This shape is returned and accepted in environments where the opt-in is active. The opt-in is the path forward and will become the default for all projects. Environments where it is still inactive use a legacy locale-keyed shape under the hood (kept working for compatibility) — opt in to align with this documentation.
83458348
*/
83468349
default_field_metadata: {
8350+
alt: LocalizedAlt;
8351+
title: LocalizedTitle;
8352+
custom_data: LocalizedCustomData;
83478353
/**
8348-
* This interface was referenced by `undefined`'s JSON-Schema definition
8349-
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8354+
* Focal point — non-localized; a single value applies across every locale (only meaningful for image assets)
83508355
*/
8351-
[k: string]: {
8352-
/**
8353-
* Alternate text for the asset
8354-
*/
8355-
alt: string | null;
8356+
focal_point: {
83568357
/**
8357-
* Title for the asset
8358+
* Horizontal position expressed as float between 0 and 1
83588359
*/
8359-
title: string | null;
8360+
x: number;
83608361
/**
8361-
* Object with arbitrary metadata
8362+
* Vertical position expressed as float between 0 and 1
83628363
*/
8363-
custom_data: {
8364-
[k: string]: unknown;
8365-
};
8366-
/**
8367-
* Focal point (only for image assets)
8368-
*/
8369-
focal_point: {
8370-
/**
8371-
* Horizontal position expressed as float between 0 and 1
8372-
*/
8373-
x: number;
8374-
/**
8375-
* Vertical position expressed as float between 0 and 1
8376-
*/
8377-
y: number;
8378-
} | null;
8379-
};
8364+
y: number;
8365+
} | null;
83808366
};
83818367
/**
83828368
* Is this upload an image?
@@ -8442,6 +8428,44 @@ export type UploadCreateJobSchema = Upload;
84428428
export type UploadSelfTargetSchema = Upload;
84438429
export type UploadDestroyTargetSchema = Upload;
84448430
export type UploadUpdateJobSchema = Upload;
8431+
/**
8432+
* Alternate text per locale
8433+
*/
8434+
export type LocalizedAlt = {
8435+
/**
8436+
* Alternate text for the asset in this locale
8437+
*
8438+
* This interface was referenced by `LocalizedAlt`'s JSON-Schema definition
8439+
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8440+
*/
8441+
[k: string]: string | null;
8442+
};
8443+
/**
8444+
* Title per locale
8445+
*/
8446+
export type LocalizedTitle = {
8447+
/**
8448+
* Title for the asset in this locale
8449+
*
8450+
* This interface was referenced by `LocalizedTitle`'s JSON-Schema definition
8451+
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8452+
*/
8453+
[k: string]: string | null;
8454+
};
8455+
/**
8456+
* Object with arbitrary metadata, per locale
8457+
*/
8458+
export type LocalizedCustomData = {
8459+
/**
8460+
* Arbitrary metadata for the asset in this locale
8461+
*
8462+
* This interface was referenced by `LocalizedCustomData`'s JSON-Schema definition
8463+
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8464+
*/
8465+
[k: string]: {
8466+
[k: string]: unknown;
8467+
};
8468+
};
84458469
/**
84468470
* Meta attributes
84478471
*
@@ -8557,42 +8581,28 @@ export type UploadAttributes = {
85578581
*/
85588582
mux_mp4_highest_res: null | 'high' | 'medium' | 'low';
85598583
/**
8560-
* For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8584+
* 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 non-localized — a single value per asset, applied across every locale (only meaningful for image assets).
8585+
*
8586+
* > [!PROTIP] 📘 Requires the `non_localized_focal_points` environment opt-in
8587+
* > This shape is returned and accepted in environments where the opt-in is active. The opt-in is the path forward and will become the default for all projects. Environments where it is still inactive use a legacy locale-keyed shape under the hood (kept working for compatibility) — opt in to align with this documentation.
85618588
*/
85628589
default_field_metadata: {
8590+
alt: LocalizedAlt;
8591+
title: LocalizedTitle;
8592+
custom_data: LocalizedCustomData;
85638593
/**
8564-
* This interface was referenced by `undefined`'s JSON-Schema definition
8565-
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8594+
* Focal point — non-localized; a single value applies across every locale (only meaningful for image assets)
85668595
*/
8567-
[k: string]: {
8568-
/**
8569-
* Alternate text for the asset
8570-
*/
8571-
alt: string | null;
8596+
focal_point: {
85728597
/**
8573-
* Title for the asset
8598+
* Horizontal position expressed as float between 0 and 1
85748599
*/
8575-
title: string | null;
8600+
x: number;
85768601
/**
8577-
* Object with arbitrary metadata
8602+
* Vertical position expressed as float between 0 and 1
85788603
*/
8579-
custom_data: {
8580-
[k: string]: unknown;
8581-
};
8582-
/**
8583-
* Focal point (only for image assets)
8584-
*/
8585-
focal_point: {
8586-
/**
8587-
* Horizontal position expressed as float between 0 and 1
8588-
*/
8589-
x: number;
8590-
/**
8591-
* Vertical position expressed as float between 0 and 1
8592-
*/
8593-
y: number;
8594-
} | null;
8595-
};
8604+
y: number;
8605+
} | null;
85968606
};
85978607
/**
85988608
* Is this upload an image?
@@ -8685,42 +8695,25 @@ export type UploadCreateSchema = {
86858695
*/
86868696
notes?: string | null;
86878697
/**
8688-
* For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8698+
* 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.
86898699
*/
86908700
default_field_metadata?: {
8701+
alt?: LocalizedAlt;
8702+
title?: LocalizedTitle;
8703+
custom_data?: LocalizedCustomData;
86918704
/**
8692-
* This interface was referenced by `undefined`'s JSON-Schema definition
8693-
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8705+
* Focal point — non-localized; a single value applies across every locale (only meaningful for image assets)
86948706
*/
8695-
[k: string]: {
8707+
focal_point?: {
86968708
/**
8697-
* Alternate text for the asset
8709+
* Horizontal position expressed as float between 0 and 1
86988710
*/
8699-
alt?: string | null;
8711+
x: number;
87008712
/**
8701-
* Title for the asset
8713+
* Vertical position expressed as float between 0 and 1
87028714
*/
8703-
title?: string | null;
8704-
/**
8705-
* Object with arbitrary metadata
8706-
*/
8707-
custom_data?: {
8708-
[k: string]: unknown;
8709-
};
8710-
/**
8711-
* Focal point (only for image assets)
8712-
*/
8713-
focal_point?: {
8714-
/**
8715-
* Horizontal position expressed as float between 0 and 1
8716-
*/
8717-
x: number;
8718-
/**
8719-
* Vertical position expressed as float between 0 and 1
8720-
*/
8721-
y: number;
8722-
} | null;
8723-
};
8715+
y: number;
8716+
} | null;
87248717
};
87258718
/**
87268719
* Tags
@@ -8760,42 +8753,25 @@ export type UploadUpdateSchema = {
87608753
*/
87618754
tags?: string[];
87628755
/**
8763-
* For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8756+
* 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.
87648757
*/
87658758
default_field_metadata?: {
8759+
alt?: LocalizedAlt;
8760+
title?: LocalizedTitle;
8761+
custom_data?: LocalizedCustomData;
87668762
/**
8767-
* This interface was referenced by `undefined`'s JSON-Schema definition
8768-
* via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8763+
* Focal point — non-localized; a single value applies across every locale (only meaningful for image assets)
87698764
*/
8770-
[k: string]: {
8765+
focal_point?: {
87718766
/**
8772-
* Alternate text for the asset
8767+
* Horizontal position expressed as float between 0 and 1
87738768
*/
8774-
alt?: string | null;
8769+
x: number;
87758770
/**
8776-
* Title for the asset
8771+
* Vertical position expressed as float between 0 and 1
87778772
*/
8778-
title?: string | null;
8779-
/**
8780-
* Object with arbitrary metadata
8781-
*/
8782-
custom_data?: {
8783-
[k: string]: unknown;
8784-
};
8785-
/**
8786-
* Focal point (only for image assets)
8787-
*/
8788-
focal_point?: {
8789-
/**
8790-
* Horizontal position expressed as float between 0 and 1
8791-
*/
8792-
x: number;
8793-
/**
8794-
* Vertical position expressed as float between 0 and 1
8795-
*/
8796-
y: number;
8797-
} | null;
8798-
};
8773+
y: number;
8774+
} | null;
87998775
};
88008776
creator?:
88018777
| AccountData
@@ -11710,6 +11686,10 @@ export type SiteMeta = {
1171011686
* Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
1171111687
*/
1171211688
milliseconds_in_datetime: boolean;
11689+
/**
11690+
* Whether the non-localized focal points opt-in is active for the environment. When active, an upload's `focal_point` is stored once per asset rather than once per locale, and the CMA `default_field_metadata` attribute is exposed in its field-keyed shape (with `alt`/`title`/`custom_data` keyed by locale and a single top-level `focal_point`). When inactive, the CMA continues to accept and return the legacy locale-keyed shape — the single stored focal_point is replicated into every locale entry on read. The CDA's behavior is unaffected: it already returns a single `focalPoint` value.
11691+
*/
11692+
non_localized_focal_points: boolean;
1171311693
};
1171411694
/**
1171511695
* JSON API data
@@ -12073,6 +12053,10 @@ export type SiteUpdateSchema = {
1207312053
* Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
1207412054
*/
1207512055
milliseconds_in_datetime?: boolean;
12056+
/**
12057+
* Whether the non-localized focal points opt-in is active for the environment. When active, an upload's `focal_point` is stored once per asset rather than once per locale, and the CMA `default_field_metadata` attribute is exposed in its field-keyed shape (with `alt`/`title`/`custom_data` keyed by locale and a single top-level `focal_point`). When inactive, the CMA continues to accept and return the legacy locale-keyed shape — the single stored focal_point is replicated into every locale entry on read. The CDA's behavior is unaffected: it already returns a single `focalPoint` value.
12058+
*/
12059+
non_localized_focal_points?: boolean;
1207612060
};
1207712061
};
1207812062
/**

0 commit comments

Comments
 (0)