@datocms/cma-client 5.4.18 → 5.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ import BaseUpload from '../generated/resources/Upload.js';
2
+ /**
3
+ * Legacy locale-keyed shape of an upload's `default_field_metadata`, as
4
+ * returned and accepted by environments where the `non_localized_focal_points`
5
+ * opt-in is inactive.
6
+ *
7
+ * The generated `Upload.default_field_metadata` type reflects the new
8
+ * field-keyed shape (the path forward). This type is provided so consumers
9
+ * targeting opted-out environments during the transition can cast the
10
+ * response value to a structurally accurate shape.
11
+ */
12
+ export type UploadLocaleKeyedDefaultFieldMetadata = {
13
+ [localeCode: string]: {
14
+ alt: string | null;
15
+ title: string | null;
16
+ custom_data: {
17
+ [k: string]: unknown;
18
+ };
19
+ focal_point: {
20
+ x: number;
21
+ y: number;
22
+ } | null;
23
+ };
24
+ };
25
+ /**
26
+ * Legacy locale-keyed shape accepted on `create` / `update` request bodies
27
+ * by environments where the `non_localized_focal_points` opt-in is inactive.
28
+ * All fields are optional, matching the partial-write contract.
29
+ */
30
+ export type UploadLocaleKeyedDefaultFieldMetadataInRequest = {
31
+ [localeCode: string]: {
32
+ alt?: string | null;
33
+ title?: string | null;
34
+ custom_data?: {
35
+ [k: string]: unknown;
36
+ };
37
+ focal_point?: {
38
+ x: number;
39
+ y: number;
40
+ } | null;
41
+ };
42
+ };
43
+ export default class UploadResource extends BaseUpload {
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "5.4.18",
3
+ "version": "5.5.0-alpha.0",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
@@ -45,5 +45,5 @@
45
45
  "@datocms/dashboard-client": "^5.4.9",
46
46
  "@types/uuid": "^9.0.7"
47
47
  },
48
- "gitHead": "4f7d64737c1abd7cb2568604a99f2dd0eda6020b"
48
+ "gitHead": "9871ebb724c5acdf1c84a407938e78b77d3c99e2"
49
49
  }
@@ -8341,42 +8341,28 @@ export type Upload = {
8341
8341
  */
8342
8342
  mux_mp4_highest_res: null | 'high' | 'medium' | 'low';
8343
8343
  /**
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.
8345
8348
  */
8346
8349
  default_field_metadata: {
8350
+ alt: LocalizedAlt;
8351
+ title: LocalizedTitle;
8352
+ custom_data: LocalizedCustomData;
8347
8353
  /**
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)
8350
8355
  */
8351
- [k: string]: {
8352
- /**
8353
- * Alternate text for the asset
8354
- */
8355
- alt: string | null;
8356
+ focal_point: {
8356
8357
  /**
8357
- * Title for the asset
8358
+ * Horizontal position expressed as float between 0 and 1
8358
8359
  */
8359
- title: string | null;
8360
+ x: number;
8360
8361
  /**
8361
- * Object with arbitrary metadata
8362
+ * Vertical position expressed as float between 0 and 1
8362
8363
  */
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;
8380
8366
  };
8381
8367
  /**
8382
8368
  * Is this upload an image?
@@ -8442,6 +8428,44 @@ export type UploadCreateJobSchema = Upload;
8442
8428
  export type UploadSelfTargetSchema = Upload;
8443
8429
  export type UploadDestroyTargetSchema = Upload;
8444
8430
  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
+ };
8445
8469
  /**
8446
8470
  * Meta attributes
8447
8471
  *
@@ -8557,42 +8581,28 @@ export type UploadAttributes = {
8557
8581
  */
8558
8582
  mux_mp4_highest_res: null | 'high' | 'medium' | 'low';
8559
8583
  /**
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.
8561
8588
  */
8562
8589
  default_field_metadata: {
8590
+ alt: LocalizedAlt;
8591
+ title: LocalizedTitle;
8592
+ custom_data: LocalizedCustomData;
8563
8593
  /**
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)
8566
8595
  */
8567
- [k: string]: {
8568
- /**
8569
- * Alternate text for the asset
8570
- */
8571
- alt: string | null;
8596
+ focal_point: {
8572
8597
  /**
8573
- * Title for the asset
8598
+ * Horizontal position expressed as float between 0 and 1
8574
8599
  */
8575
- title: string | null;
8600
+ x: number;
8576
8601
  /**
8577
- * Object with arbitrary metadata
8602
+ * Vertical position expressed as float between 0 and 1
8578
8603
  */
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;
8596
8606
  };
8597
8607
  /**
8598
8608
  * Is this upload an image?
@@ -8685,42 +8695,25 @@ export type UploadCreateSchema = {
8685
8695
  */
8686
8696
  notes?: string | null;
8687
8697
  /**
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.
8689
8699
  */
8690
8700
  default_field_metadata?: {
8701
+ alt?: LocalizedAlt;
8702
+ title?: LocalizedTitle;
8703
+ custom_data?: LocalizedCustomData;
8691
8704
  /**
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)
8694
8706
  */
8695
- [k: string]: {
8707
+ focal_point?: {
8696
8708
  /**
8697
- * Alternate text for the asset
8709
+ * Horizontal position expressed as float between 0 and 1
8698
8710
  */
8699
- alt?: string | null;
8711
+ x: number;
8700
8712
  /**
8701
- * Title for the asset
8713
+ * Vertical position expressed as float between 0 and 1
8702
8714
  */
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;
8724
8717
  };
8725
8718
  /**
8726
8719
  * Tags
@@ -8760,42 +8753,25 @@ export type UploadUpdateSchema = {
8760
8753
  */
8761
8754
  tags?: string[];
8762
8755
  /**
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.
8764
8757
  */
8765
8758
  default_field_metadata?: {
8759
+ alt?: LocalizedAlt;
8760
+ title?: LocalizedTitle;
8761
+ custom_data?: LocalizedCustomData;
8766
8762
  /**
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)
8769
8764
  */
8770
- [k: string]: {
8765
+ focal_point?: {
8771
8766
  /**
8772
- * Alternate text for the asset
8767
+ * Horizontal position expressed as float between 0 and 1
8773
8768
  */
8774
- alt?: string | null;
8769
+ x: number;
8775
8770
  /**
8776
- * Title for the asset
8771
+ * Vertical position expressed as float between 0 and 1
8777
8772
  */
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;
8799
8775
  };
8800
8776
  creator?:
8801
8777
  | AccountData
@@ -11710,6 +11686,10 @@ export type SiteMeta = {
11710
11686
  * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
11711
11687
  */
11712
11688
  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;
11713
11693
  };
11714
11694
  /**
11715
11695
  * JSON API data
@@ -12073,6 +12053,10 @@ export type SiteUpdateSchema = {
12073
12053
  * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
12074
12054
  */
12075
12055
  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;
12076
12060
  };
12077
12061
  };
12078
12062
  /**
@@ -151,7 +151,7 @@ export class Client {
151
151
  ...this.config,
152
152
  ...options,
153
153
  logFn: this.config.logFn || console.log,
154
- userAgent: '@datocms/cma-client v5.4.18',
154
+ userAgent: '@datocms/cma-client v5.5.0-alpha.0',
155
155
  baseUrl: this.baseUrl,
156
156
  preCallStack: new Error().stack,
157
157
  extraHeaders: {
@@ -8616,42 +8616,28 @@ export type UploadAttributes = {
8616
8616
  */
8617
8617
  mux_mp4_highest_res: null | 'high' | 'medium' | 'low';
8618
8618
  /**
8619
- * For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8619
+ * 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).
8620
+ *
8621
+ * > [!PROTIP] 📘 Requires the `non_localized_focal_points` environment opt-in
8622
+ * > 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.
8620
8623
  */
8621
8624
  default_field_metadata: {
8625
+ alt: LocalizedAlt;
8626
+ title: LocalizedTitle;
8627
+ custom_data: LocalizedCustomData;
8622
8628
  /**
8623
- * This interface was referenced by `undefined`'s JSON-Schema definition
8624
- * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8629
+ * Focal point non-localized; a single value applies across every locale (only meaningful for image assets)
8625
8630
  */
8626
- [k: string]: {
8627
- /**
8628
- * Alternate text for the asset
8629
- */
8630
- alt: string | null;
8631
- /**
8632
- * Title for the asset
8633
- */
8634
- title: string | null;
8631
+ focal_point: {
8635
8632
  /**
8636
- * Object with arbitrary metadata
8633
+ * Horizontal position expressed as float between 0 and 1
8637
8634
  */
8638
- custom_data: {
8639
- [k: string]: unknown;
8640
- };
8635
+ x: number;
8641
8636
  /**
8642
- * Focal point (only for image assets)
8637
+ * Vertical position expressed as float between 0 and 1
8643
8638
  */
8644
- focal_point: {
8645
- /**
8646
- * Horizontal position expressed as float between 0 and 1
8647
- */
8648
- x: number;
8649
- /**
8650
- * Vertical position expressed as float between 0 and 1
8651
- */
8652
- y: number;
8653
- } | null;
8654
- };
8639
+ y: number;
8640
+ } | null;
8655
8641
  };
8656
8642
  /**
8657
8643
  * Is this upload an image?
@@ -8705,6 +8691,44 @@ export type UploadAttributes = {
8705
8691
  alpha: number;
8706
8692
  }[];
8707
8693
  };
8694
+ /**
8695
+ * Alternate text per locale
8696
+ */
8697
+ export type LocalizedAlt = {
8698
+ /**
8699
+ * Alternate text for the asset in this locale
8700
+ *
8701
+ * This interface was referenced by `LocalizedAlt`'s JSON-Schema definition
8702
+ * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8703
+ */
8704
+ [k: string]: string | null;
8705
+ };
8706
+ /**
8707
+ * Title per locale
8708
+ */
8709
+ export type LocalizedTitle = {
8710
+ /**
8711
+ * Title for the asset in this locale
8712
+ *
8713
+ * This interface was referenced by `LocalizedTitle`'s JSON-Schema definition
8714
+ * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8715
+ */
8716
+ [k: string]: string | null;
8717
+ };
8718
+ /**
8719
+ * Object with arbitrary metadata, per locale
8720
+ */
8721
+ export type LocalizedCustomData = {
8722
+ /**
8723
+ * Arbitrary metadata for the asset in this locale
8724
+ *
8725
+ * This interface was referenced by `LocalizedCustomData`'s JSON-Schema definition
8726
+ * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8727
+ */
8728
+ [k: string]: {
8729
+ [k: string]: unknown;
8730
+ };
8731
+ };
8708
8732
  /**
8709
8733
  * JSON API links
8710
8734
  *
@@ -8791,42 +8815,25 @@ export type UploadCreateSchema = {
8791
8815
  */
8792
8816
  notes?: string | null;
8793
8817
  /**
8794
- * For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8818
+ * 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.
8795
8819
  */
8796
8820
  default_field_metadata?: {
8821
+ alt?: LocalizedAlt;
8822
+ title?: LocalizedTitle;
8823
+ custom_data?: LocalizedCustomData;
8797
8824
  /**
8798
- * This interface was referenced by `undefined`'s JSON-Schema definition
8799
- * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8825
+ * Focal point non-localized; a single value applies across every locale (only meaningful for image assets)
8800
8826
  */
8801
- [k: string]: {
8802
- /**
8803
- * Alternate text for the asset
8804
- */
8805
- alt?: string | null;
8827
+ focal_point?: {
8806
8828
  /**
8807
- * Title for the asset
8829
+ * Horizontal position expressed as float between 0 and 1
8808
8830
  */
8809
- title?: string | null;
8831
+ x: number;
8810
8832
  /**
8811
- * Object with arbitrary metadata
8833
+ * Vertical position expressed as float between 0 and 1
8812
8834
  */
8813
- custom_data?: {
8814
- [k: string]: unknown;
8815
- };
8816
- /**
8817
- * Focal point (only for image assets)
8818
- */
8819
- focal_point?: {
8820
- /**
8821
- * Horizontal position expressed as float between 0 and 1
8822
- */
8823
- x: number;
8824
- /**
8825
- * Vertical position expressed as float between 0 and 1
8826
- */
8827
- y: number;
8828
- } | null;
8829
- };
8835
+ y: number;
8836
+ } | null;
8830
8837
  };
8831
8838
  /**
8832
8839
  * Tags
@@ -8916,42 +8923,25 @@ export type UploadUpdateSchema = {
8916
8923
  */
8917
8924
  tags?: string[];
8918
8925
  /**
8919
- * For each of the project's locales, the default metadata to apply if nothing is specified at record's level.
8926
+ * 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.
8920
8927
  */
8921
8928
  default_field_metadata?: {
8929
+ alt?: LocalizedAlt;
8930
+ title?: LocalizedTitle;
8931
+ custom_data?: LocalizedCustomData;
8922
8932
  /**
8923
- * This interface was referenced by `undefined`'s JSON-Schema definition
8924
- * via the `patternProperty` "^(?<languagecode>[a-z]{0,3}(-[A-Za-z]+)?(-[A-Z]{0,3})?)$".
8933
+ * Focal point non-localized; a single value applies across every locale (only meaningful for image assets)
8925
8934
  */
8926
- [k: string]: {
8935
+ focal_point?: {
8927
8936
  /**
8928
- * Alternate text for the asset
8937
+ * Horizontal position expressed as float between 0 and 1
8929
8938
  */
8930
- alt?: string | null;
8939
+ x: number;
8931
8940
  /**
8932
- * Title for the asset
8941
+ * Vertical position expressed as float between 0 and 1
8933
8942
  */
8934
- title?: string | null;
8935
- /**
8936
- * Object with arbitrary metadata
8937
- */
8938
- custom_data?: {
8939
- [k: string]: unknown;
8940
- };
8941
- /**
8942
- * Focal point (only for image assets)
8943
- */
8944
- focal_point?: {
8945
- /**
8946
- * Horizontal position expressed as float between 0 and 1
8947
- */
8948
- x: number;
8949
- /**
8950
- * Vertical position expressed as float between 0 and 1
8951
- */
8952
- y: number;
8953
- } | null;
8954
- };
8943
+ y: number;
8944
+ } | null;
8955
8945
  };
8956
8946
  [k: string]: unknown;
8957
8947
  };
@@ -12098,6 +12088,10 @@ export type SiteMeta = {
12098
12088
  * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
12099
12089
  */
12100
12090
  milliseconds_in_datetime: boolean;
12091
+ /**
12092
+ * 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.
12093
+ */
12094
+ non_localized_focal_points: boolean;
12101
12095
  };
12102
12096
  /**
12103
12097
  * JSON API data
@@ -12290,6 +12284,10 @@ export type SiteUpdateSchema = {
12290
12284
  * Whether the [Milliseconds in datetime](https://www.datocms.com/product-updates/milliseconds-in-datetime) opt-in product update is active or not
12291
12285
  */
12292
12286
  milliseconds_in_datetime?: boolean;
12287
+ /**
12288
+ * 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.
12289
+ */
12290
+ non_localized_focal_points?: boolean;
12293
12291
  };
12294
12292
  relationships?: {
12295
12293
  sso_default_role?: {
@@ -18,7 +18,7 @@ export { default as BuildEvent } from './BuildEvent.js';
18
18
  export { default as SearchIndexEvent } from './SearchIndexEvent.js';
19
19
  export { default as Item } from './Item.js';
20
20
  export { default as ItemVersion } from './ItemVersion.js';
21
- export { default as Upload } from './Upload.js';
21
+ export { default as Upload } from '../../resources/Upload.js';
22
22
  export { default as UploadRequest } from './UploadRequest.js';
23
23
  export { default as UploadTrack } from './UploadTrack.js';
24
24
  export { default as ScheduledPublication } from './ScheduledPublication.js';
package/src/index.ts CHANGED
@@ -4,6 +4,10 @@ export * from './fieldTypes/index.js';
4
4
  export { Client } from './generated/Client.js';
5
5
  export type { ClientConfigOptions } from './generated/Client.js';
6
6
  export * as Resources from './generated/resources/index.js';
7
+ export type {
8
+ UploadLocaleKeyedDefaultFieldMetadata,
9
+ UploadLocaleKeyedDefaultFieldMetadataInRequest,
10
+ } from './resources/Upload.js';
7
11
  export * from './utilities/buildBlockRecord.js';
8
12
  export * from './utilities/duplicateBlockRecord.js';
9
13
  export * from './utilities/fieldsContainingReferences.js';
@@ -0,0 +1,36 @@
1
+ import BaseUpload from '../generated/resources/Upload.js';
2
+
3
+ /**
4
+ * Legacy locale-keyed shape of an upload's `default_field_metadata`, as
5
+ * returned and accepted by environments where the `non_localized_focal_points`
6
+ * opt-in is inactive.
7
+ *
8
+ * The generated `Upload.default_field_metadata` type reflects the new
9
+ * field-keyed shape (the path forward). This type is provided so consumers
10
+ * targeting opted-out environments during the transition can cast the
11
+ * response value to a structurally accurate shape.
12
+ */
13
+ export type UploadLocaleKeyedDefaultFieldMetadata = {
14
+ [localeCode: string]: {
15
+ alt: string | null;
16
+ title: string | null;
17
+ custom_data: { [k: string]: unknown };
18
+ focal_point: { x: number; y: number } | null;
19
+ };
20
+ };
21
+
22
+ /**
23
+ * Legacy locale-keyed shape accepted on `create` / `update` request bodies
24
+ * by environments where the `non_localized_focal_points` opt-in is inactive.
25
+ * All fields are optional, matching the partial-write contract.
26
+ */
27
+ export type UploadLocaleKeyedDefaultFieldMetadataInRequest = {
28
+ [localeCode: string]: {
29
+ alt?: string | null;
30
+ title?: string | null;
31
+ custom_data?: { [k: string]: unknown };
32
+ focal_point?: { x: number; y: number } | null;
33
+ };
34
+ };
35
+
36
+ export default class UploadResource extends BaseUpload {}