@datocms/cma-client 5.1.18 → 5.2.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.
@@ -106,6 +106,16 @@ export type WorkflowIdentity = string;
106
106
  * via the `definition` "id".
107
107
  */
108
108
  export type EnvironmentIdentity = string;
109
+ /**
110
+ * RFC 4122 UUID of upload collection expressed in URL-safe base64 format
111
+ *
112
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
113
+ * via the `definition` "identity".
114
+ *
115
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
116
+ * via the `definition` "id".
117
+ */
118
+ export type UploadCollectionIdentity = string;
109
119
  /**
110
120
  * ID of build_trigger
111
121
  *
@@ -475,16 +485,6 @@ export type SchemaMenuItemReorderSchema = {
475
485
  * via the `reorder.jobSchema` link.
476
486
  */
477
487
  export type SchemaMenuItemReorderJobSchema = SchemaMenuItem[];
478
- /**
479
- * RFC 4122 UUID of upload collection expressed in URL-safe base64 format
480
- *
481
- * This interface was referenced by `UploadCollection`'s JSON-Schema
482
- * via the `definition` "identity".
483
- *
484
- * This interface was referenced by `UploadCollection`'s JSON-Schema
485
- * via the `definition` "id".
486
- */
487
- export type UploadCollectionIdentity = string;
488
488
  /**
489
489
  * JSON API type field
490
490
  *
@@ -2097,7 +2097,8 @@ export type Role = {
2097
2097
  | 'create'
2098
2098
  | 'delete'
2099
2099
  | 'edit_creator'
2100
- | 'replace_asset';
2100
+ | 'replace_asset'
2101
+ | 'move';
2101
2102
  /**
2102
2103
  * Permitted creator
2103
2104
  */
@@ -2110,6 +2111,8 @@ export type Role = {
2110
2111
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2111
2112
  */
2112
2113
  locale?: string | null;
2114
+ upload_collection?: UploadCollectionIdentity | null;
2115
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2113
2116
  }[];
2114
2117
  /**
2115
2118
  * Prohibited actions on a model (or all) for a role
@@ -2126,7 +2129,8 @@ export type Role = {
2126
2129
  | 'create'
2127
2130
  | 'delete'
2128
2131
  | 'edit_creator'
2129
- | 'replace_asset';
2132
+ | 'replace_asset'
2133
+ | 'move';
2130
2134
  /**
2131
2135
  * Permitted creator
2132
2136
  */
@@ -2139,6 +2143,8 @@ export type Role = {
2139
2143
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2140
2144
  */
2141
2145
  locale?: string | null;
2146
+ upload_collection?: UploadCollectionIdentity | null;
2147
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2142
2148
  }[];
2143
2149
  /**
2144
2150
  * Allowed build triggers for a role
@@ -2344,7 +2350,8 @@ export type RoleMeta = {
2344
2350
  | 'create'
2345
2351
  | 'delete'
2346
2352
  | 'edit_creator'
2347
- | 'replace_asset';
2353
+ | 'replace_asset'
2354
+ | 'move';
2348
2355
  /**
2349
2356
  * Permitted creator
2350
2357
  */
@@ -2357,6 +2364,8 @@ export type RoleMeta = {
2357
2364
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2358
2365
  */
2359
2366
  locale?: string | null;
2367
+ upload_collection?: UploadCollectionIdentity | null;
2368
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2360
2369
  }[];
2361
2370
  /**
2362
2371
  * Prohibited actions on a model (or all) for a role
@@ -2373,7 +2382,8 @@ export type RoleMeta = {
2373
2382
  | 'create'
2374
2383
  | 'delete'
2375
2384
  | 'edit_creator'
2376
- | 'replace_asset';
2385
+ | 'replace_asset'
2386
+ | 'move';
2377
2387
  /**
2378
2388
  * Permitted creator
2379
2389
  */
@@ -2386,6 +2396,8 @@ export type RoleMeta = {
2386
2396
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2387
2397
  */
2388
2398
  locale?: string | null;
2399
+ upload_collection?: UploadCollectionIdentity | null;
2400
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2389
2401
  }[];
2390
2402
  /**
2391
2403
  * Allowed build triggers for a role
@@ -2575,7 +2587,8 @@ export type RoleAttributes = {
2575
2587
  | 'create'
2576
2588
  | 'delete'
2577
2589
  | 'edit_creator'
2578
- | 'replace_asset';
2590
+ | 'replace_asset'
2591
+ | 'move';
2579
2592
  /**
2580
2593
  * Permitted creator
2581
2594
  */
@@ -2588,6 +2601,8 @@ export type RoleAttributes = {
2588
2601
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2589
2602
  */
2590
2603
  locale?: string | null;
2604
+ upload_collection?: UploadCollectionIdentity | null;
2605
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2591
2606
  }[];
2592
2607
  /**
2593
2608
  * Prohibited actions on a model (or all) for a role
@@ -2604,7 +2619,8 @@ export type RoleAttributes = {
2604
2619
  | 'create'
2605
2620
  | 'delete'
2606
2621
  | 'edit_creator'
2607
- | 'replace_asset';
2622
+ | 'replace_asset'
2623
+ | 'move';
2608
2624
  /**
2609
2625
  * Permitted creator
2610
2626
  */
@@ -2617,6 +2633,8 @@ export type RoleAttributes = {
2617
2633
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2618
2634
  */
2619
2635
  locale?: string | null;
2636
+ upload_collection?: UploadCollectionIdentity | null;
2637
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2620
2638
  }[];
2621
2639
  /**
2622
2640
  * Allowed build triggers for a role
@@ -2813,7 +2831,8 @@ export type RoleCreateSchema = {
2813
2831
  | 'create'
2814
2832
  | 'delete'
2815
2833
  | 'edit_creator'
2816
- | 'replace_asset';
2834
+ | 'replace_asset'
2835
+ | 'move';
2817
2836
  /**
2818
2837
  * Permitted creator
2819
2838
  */
@@ -2826,6 +2845,8 @@ export type RoleCreateSchema = {
2826
2845
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2827
2846
  */
2828
2847
  locale?: string | null;
2848
+ upload_collection?: UploadCollectionIdentity | null;
2849
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2829
2850
  }[];
2830
2851
  /**
2831
2852
  * Prohibited actions on a model (or all) for a role
@@ -2842,7 +2863,8 @@ export type RoleCreateSchema = {
2842
2863
  | 'create'
2843
2864
  | 'delete'
2844
2865
  | 'edit_creator'
2845
- | 'replace_asset';
2866
+ | 'replace_asset'
2867
+ | 'move';
2846
2868
  /**
2847
2869
  * Permitted creator
2848
2870
  */
@@ -2855,6 +2877,8 @@ export type RoleCreateSchema = {
2855
2877
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2856
2878
  */
2857
2879
  locale?: string | null;
2880
+ upload_collection?: UploadCollectionIdentity | null;
2881
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2858
2882
  }[];
2859
2883
  /**
2860
2884
  * Allowed build triggers for a role
@@ -3045,7 +3069,8 @@ export type RoleUpdateSchema = {
3045
3069
  | 'create'
3046
3070
  | 'delete'
3047
3071
  | 'edit_creator'
3048
- | 'replace_asset';
3072
+ | 'replace_asset'
3073
+ | 'move';
3049
3074
  /**
3050
3075
  * Permitted creator
3051
3076
  */
@@ -3058,6 +3083,8 @@ export type RoleUpdateSchema = {
3058
3083
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
3059
3084
  */
3060
3085
  locale?: string | null;
3086
+ upload_collection?: UploadCollectionIdentity | null;
3087
+ move_to_upload_collection?: UploadCollectionIdentity | null;
3061
3088
  }[];
3062
3089
  /**
3063
3090
  * Prohibited actions on a model (or all) for a role
@@ -3074,7 +3101,8 @@ export type RoleUpdateSchema = {
3074
3101
  | 'create'
3075
3102
  | 'delete'
3076
3103
  | 'edit_creator'
3077
- | 'replace_asset';
3104
+ | 'replace_asset'
3105
+ | 'move';
3078
3106
  /**
3079
3107
  * Permitted creator
3080
3108
  */
@@ -3087,6 +3115,8 @@ export type RoleUpdateSchema = {
3087
3115
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
3088
3116
  */
3089
3117
  locale?: string | null;
3118
+ upload_collection?: UploadCollectionIdentity | null;
3119
+ move_to_upload_collection?: UploadCollectionIdentity | null;
3090
3120
  }[];
3091
3121
  /**
3092
3122
  * Allowed build triggers for a role
@@ -8373,6 +8403,7 @@ export type UploadRequestCreateSchema = {
8373
8403
  * The original file name
8374
8404
  */
8375
8405
  filename?: string;
8406
+ upload_collection?: UploadCollectionData | null;
8376
8407
  };
8377
8408
  /**
8378
8409
  * If the asset linked to an Upload entity is a video file, you have the option to include additional audio tracks and subtitle tracks to it.
@@ -147,7 +147,7 @@ export class Client {
147
147
  ...this.config,
148
148
  ...options,
149
149
  logFn: this.config.logFn || console.log,
150
- userAgent: '@datocms/cma-client v5.1.18',
150
+ userAgent: '@datocms/cma-client v5.2.0-alpha.0',
151
151
  baseUrl: this.baseUrl,
152
152
  preCallStack: new Error().stack,
153
153
  extraHeaders: {
@@ -108,6 +108,16 @@ export type WorkflowIdentity = string;
108
108
  * via the `definition` "id".
109
109
  */
110
110
  export type EnvironmentIdentity = string;
111
+ /**
112
+ * RFC 4122 UUID of upload collection expressed in URL-safe base64 format
113
+ *
114
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
115
+ * via the `definition` "identity".
116
+ *
117
+ * This interface was referenced by `UploadCollection`'s JSON-Schema
118
+ * via the `definition` "id".
119
+ */
120
+ export type UploadCollectionIdentity = string;
111
121
  /**
112
122
  * ID of build_trigger
113
123
  *
@@ -403,16 +413,6 @@ export type SchemaMenuItemInstancesHrefSchema = {
403
413
  * via the `definition` "type".
404
414
  */
405
415
  export type UploadCollectionType = 'upload_collection';
406
- /**
407
- * RFC 4122 UUID of upload collection expressed in URL-safe base64 format
408
- *
409
- * This interface was referenced by `UploadCollection`'s JSON-Schema
410
- * via the `definition` "identity".
411
- *
412
- * This interface was referenced by `UploadCollection`'s JSON-Schema
413
- * via the `definition` "id".
414
- */
415
- export type UploadCollectionIdentity = string;
416
416
  /**
417
417
  * This interface was referenced by `UploadCollection`'s JSON-Schema
418
418
  * via the `instances.hrefSchema` link.
@@ -1733,7 +1733,8 @@ export type RoleAttributes = {
1733
1733
  | 'create'
1734
1734
  | 'delete'
1735
1735
  | 'edit_creator'
1736
- | 'replace_asset';
1736
+ | 'replace_asset'
1737
+ | 'move';
1737
1738
  /**
1738
1739
  * Permitted creator
1739
1740
  */
@@ -1746,6 +1747,8 @@ export type RoleAttributes = {
1746
1747
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
1747
1748
  */
1748
1749
  locale?: string | null;
1750
+ upload_collection?: UploadCollectionIdentity | null;
1751
+ move_to_upload_collection?: UploadCollectionIdentity | null;
1749
1752
  }[];
1750
1753
  /**
1751
1754
  * Prohibited actions on a model (or all) for a role
@@ -1762,7 +1765,8 @@ export type RoleAttributes = {
1762
1765
  | 'create'
1763
1766
  | 'delete'
1764
1767
  | 'edit_creator'
1765
- | 'replace_asset';
1768
+ | 'replace_asset'
1769
+ | 'move';
1766
1770
  /**
1767
1771
  * Permitted creator
1768
1772
  */
@@ -1775,6 +1779,8 @@ export type RoleAttributes = {
1775
1779
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
1776
1780
  */
1777
1781
  locale?: string | null;
1782
+ upload_collection?: UploadCollectionIdentity | null;
1783
+ move_to_upload_collection?: UploadCollectionIdentity | null;
1778
1784
  }[];
1779
1785
  /**
1780
1786
  * Allowed build triggers for a role
@@ -1987,7 +1993,8 @@ export type RoleMeta = {
1987
1993
  | 'create'
1988
1994
  | 'delete'
1989
1995
  | 'edit_creator'
1990
- | 'replace_asset';
1996
+ | 'replace_asset'
1997
+ | 'move';
1991
1998
  /**
1992
1999
  * Permitted creator
1993
2000
  */
@@ -2000,6 +2007,8 @@ export type RoleMeta = {
2000
2007
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2001
2008
  */
2002
2009
  locale?: string | null;
2010
+ upload_collection?: UploadCollectionIdentity | null;
2011
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2003
2012
  }[];
2004
2013
  /**
2005
2014
  * Prohibited actions on a model (or all) for a role
@@ -2016,7 +2025,8 @@ export type RoleMeta = {
2016
2025
  | 'create'
2017
2026
  | 'delete'
2018
2027
  | 'edit_creator'
2019
- | 'replace_asset';
2028
+ | 'replace_asset'
2029
+ | 'move';
2020
2030
  /**
2021
2031
  * Permitted creator
2022
2032
  */
@@ -2029,6 +2039,8 @@ export type RoleMeta = {
2029
2039
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2030
2040
  */
2031
2041
  locale?: string | null;
2042
+ upload_collection?: UploadCollectionIdentity | null;
2043
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2032
2044
  }[];
2033
2045
  /**
2034
2046
  * Allowed build triggers for a role
@@ -2222,7 +2234,8 @@ export type RoleCreateSchema = {
2222
2234
  | 'create'
2223
2235
  | 'delete'
2224
2236
  | 'edit_creator'
2225
- | 'replace_asset';
2237
+ | 'replace_asset'
2238
+ | 'move';
2226
2239
  /**
2227
2240
  * Permitted creator
2228
2241
  */
@@ -2235,6 +2248,8 @@ export type RoleCreateSchema = {
2235
2248
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2236
2249
  */
2237
2250
  locale?: string | null;
2251
+ upload_collection?: UploadCollectionIdentity | null;
2252
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2238
2253
  }[];
2239
2254
  /**
2240
2255
  * Prohibited actions on a model (or all) for a role
@@ -2251,7 +2266,8 @@ export type RoleCreateSchema = {
2251
2266
  | 'create'
2252
2267
  | 'delete'
2253
2268
  | 'edit_creator'
2254
- | 'replace_asset';
2269
+ | 'replace_asset'
2270
+ | 'move';
2255
2271
  /**
2256
2272
  * Permitted creator
2257
2273
  */
@@ -2264,6 +2280,8 @@ export type RoleCreateSchema = {
2264
2280
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2265
2281
  */
2266
2282
  locale?: string | null;
2283
+ upload_collection?: UploadCollectionIdentity | null;
2284
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2267
2285
  }[];
2268
2286
  /**
2269
2287
  * Allowed build triggers for a role
@@ -2478,7 +2496,8 @@ export type RoleUpdateSchema = {
2478
2496
  | 'create'
2479
2497
  | 'delete'
2480
2498
  | 'edit_creator'
2481
- | 'replace_asset';
2499
+ | 'replace_asset'
2500
+ | 'move';
2482
2501
  /**
2483
2502
  * Permitted creator
2484
2503
  */
@@ -2491,6 +2510,8 @@ export type RoleUpdateSchema = {
2491
2510
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2492
2511
  */
2493
2512
  locale?: string | null;
2513
+ upload_collection?: UploadCollectionIdentity | null;
2514
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2494
2515
  }[];
2495
2516
  /**
2496
2517
  * Prohibited actions on a model (or all) for a role
@@ -2507,7 +2528,8 @@ export type RoleUpdateSchema = {
2507
2528
  | 'create'
2508
2529
  | 'delete'
2509
2530
  | 'edit_creator'
2510
- | 'replace_asset';
2531
+ | 'replace_asset'
2532
+ | 'move';
2511
2533
  /**
2512
2534
  * Permitted creator
2513
2535
  */
@@ -2520,6 +2542,8 @@ export type RoleUpdateSchema = {
2520
2542
  * Permitted localized content in this locale. Required when `localization_scope` is `localized`
2521
2543
  */
2522
2544
  locale?: string | null;
2545
+ upload_collection?: UploadCollectionIdentity | null;
2546
+ move_to_upload_collection?: UploadCollectionIdentity | null;
2523
2547
  }[];
2524
2548
  /**
2525
2549
  * Allowed build triggers for a role
@@ -8662,6 +8686,14 @@ export type UploadRequestCreateSchema = {
8662
8686
  filename?: string;
8663
8687
  [k: string]: unknown;
8664
8688
  };
8689
+ relationships?: {
8690
+ /**
8691
+ * Upload collection to which the asset belongs
8692
+ */
8693
+ upload_collection?: {
8694
+ data: UploadCollectionData | null;
8695
+ };
8696
+ };
8665
8697
  };
8666
8698
  };
8667
8699
  /**
@@ -90,6 +90,20 @@ export default class Item extends BaseResource {
90
90
  * @throws {ApiError}
91
91
  * @throws {TimeoutError}
92
92
  */
93
+ listPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
94
+ queryParams: Utils.OmitFromKnownKeys<
95
+ ApiTypes.ItemInstancesHrefSchema<D> & { nested: true },
96
+ 'page'
97
+ >,
98
+ iteratorOptions?: Utils.IteratorOptions,
99
+ ): AsyncGenerator<ApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>[0]>;
100
+ listPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
101
+ queryParams?: Utils.OmitFromKnownKeys<
102
+ ApiTypes.ItemInstancesHrefSchema<D> & { nested?: false | undefined },
103
+ 'page'
104
+ >,
105
+ iteratorOptions?: Utils.IteratorOptions,
106
+ ): AsyncGenerator<ApiTypes.ItemInstancesTargetSchema<NoInfer<D>, false>[0]>;
93
107
  async *listPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
94
108
  queryParams?: Utils.OmitFromKnownKeys<
95
109
  ApiTypes.ItemInstancesHrefSchema<D>,
@@ -115,6 +129,33 @@ export default class Item extends BaseResource {
115
129
  * @throws {ApiError}
116
130
  * @throws {TimeoutError}
117
131
  */
132
+ rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
133
+ queryParams: Utils.OmitFromKnownKeys<
134
+ RawApiTypes.ItemInstancesHrefSchema<D> & { nested: true },
135
+ 'page'
136
+ >,
137
+ iteratorOptions?: Utils.IteratorOptions,
138
+ ): AsyncGenerator<
139
+ RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>['data'][0]
140
+ >;
141
+ rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
142
+ queryParams?: Utils.OmitFromKnownKeys<
143
+ RawApiTypes.ItemInstancesHrefSchema<D> & { nested?: false | undefined },
144
+ 'page'
145
+ >,
146
+ iteratorOptions?: Utils.IteratorOptions,
147
+ ): AsyncGenerator<
148
+ RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, false>['data'][0]
149
+ >;
150
+ rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
151
+ queryParams?: Utils.OmitFromKnownKeys<
152
+ RawApiTypes.ItemInstancesHrefSchema<D>,
153
+ 'page'
154
+ >,
155
+ iteratorOptions?: Utils.IteratorOptions,
156
+ ): AsyncGenerator<
157
+ RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>['data'][0]
158
+ >;
118
159
  rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(
119
160
  queryParams?: Utils.OmitFromKnownKeys<
120
161
  RawApiTypes.ItemInstancesHrefSchema<D>,
@@ -19,7 +19,7 @@ export default class UploadRequest extends BaseResource {
19
19
  Utils.serializeRequestBody<RawApiTypes.UploadRequestCreateSchema>(body, {
20
20
  type: 'upload_request',
21
21
  attributes: ['filename'],
22
- relationships: [],
22
+ relationships: ['upload_collection'],
23
23
  }),
24
24
  ).then((body) =>
25
25
  Utils.deserializeResponseBody<ApiTypes.UploadRequestCreateTargetSchema>(