@datocms/cma-client 5.0.0-alpha.0 → 5.0.1
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.
- package/dist/cjs/generated/Client.js +1 -1
- package/dist/cjs/generated/Client.js.map +1 -1
- package/dist/cjs/generated/resources/Upload.js +0 -69
- package/dist/cjs/generated/resources/Upload.js.map +1 -1
- package/dist/cjs/generated/resources/UploadRequest.js +2 -2
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/Client.js.map +1 -1
- package/dist/esm/generated/SchemaTypes.d.ts +15 -77
- package/dist/esm/generated/SimpleSchemaTypes.d.ts +16 -56
- package/dist/esm/generated/resources/Upload.d.ts +0 -44
- package/dist/esm/generated/resources/Upload.js +0 -69
- package/dist/esm/generated/resources/Upload.js.map +1 -1
- package/dist/esm/generated/resources/UploadRequest.d.ts +2 -2
- package/dist/esm/generated/resources/UploadRequest.js +2 -2
- package/dist/types/generated/SchemaTypes.d.ts +15 -77
- package/dist/types/generated/SimpleSchemaTypes.d.ts +16 -56
- package/dist/types/generated/resources/Upload.d.ts +0 -44
- package/dist/types/generated/resources/UploadRequest.d.ts +2 -2
- package/package.json +4 -4
- package/resources.json +1 -39
- package/src/generated/Client.ts +1 -1
- package/src/generated/SchemaTypes.ts +15 -82
- package/src/generated/SimpleSchemaTypes.ts +16 -57
- package/src/generated/resources/Upload.ts +0 -88
- package/src/generated/resources/UploadRequest.ts +2 -2
|
@@ -1122,38 +1122,6 @@ export type UploadInstancesHrefSchema = {
|
|
|
1122
1122
|
};
|
|
1123
1123
|
[k: string]: unknown;
|
|
1124
1124
|
};
|
|
1125
|
-
/**
|
|
1126
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
1127
|
-
* via the `batch_add_tags.jobSchema` link.
|
|
1128
|
-
*/
|
|
1129
|
-
export type UploadBatchAddTagsJobSchema = unknown[];
|
|
1130
|
-
/**
|
|
1131
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
1132
|
-
* via the `batch_add_tags.hrefSchema` link.
|
|
1133
|
-
*/
|
|
1134
|
-
export type UploadBatchAddTagsHrefSchema = {
|
|
1135
|
-
/**
|
|
1136
|
-
* IDs to tag, comma separated
|
|
1137
|
-
*/
|
|
1138
|
-
'filter[ids]'?: string;
|
|
1139
|
-
[k: string]: unknown;
|
|
1140
|
-
};
|
|
1141
|
-
/**
|
|
1142
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
1143
|
-
* via the `batch_destroy.jobSchema` link.
|
|
1144
|
-
*/
|
|
1145
|
-
export type UploadBatchDestroyJobSchema = unknown[];
|
|
1146
|
-
/**
|
|
1147
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
1148
|
-
* via the `batch_destroy.hrefSchema` link.
|
|
1149
|
-
*/
|
|
1150
|
-
export type UploadBatchDestroyHrefSchema = {
|
|
1151
|
-
/**
|
|
1152
|
-
* IDs to destroy, comma separated
|
|
1153
|
-
*/
|
|
1154
|
-
'filter[ids]'?: string;
|
|
1155
|
-
[k: string]: unknown;
|
|
1156
|
-
};
|
|
1157
1125
|
/**
|
|
1158
1126
|
* This interface was referenced by `Upload`'s JSON-Schema
|
|
1159
1127
|
* via the `references.targetSchema` link.
|
|
@@ -4502,12 +4470,6 @@ export type MenuItemUpdateSchema = {
|
|
|
4502
4470
|
* via the `update.targetSchema` link.
|
|
4503
4471
|
*
|
|
4504
4472
|
* This interface was referenced by `Upload`'s JSON-Schema
|
|
4505
|
-
* via the `batch_add_tags.targetSchema` link.
|
|
4506
|
-
*
|
|
4507
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
4508
|
-
* via the `batch_destroy.targetSchema` link.
|
|
4509
|
-
*
|
|
4510
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
4511
4473
|
* via the `bulk_tag.targetSchema` link.
|
|
4512
4474
|
*
|
|
4513
4475
|
* This interface was referenced by `Upload`'s JSON-Schema
|
|
@@ -4557,8 +4519,6 @@ export type ItemBulkMoveToStageTargetSchema = Job;
|
|
|
4557
4519
|
export type ItemVersionRestoreTargetSchema = Job;
|
|
4558
4520
|
export type UploadCreateTargetSchema = Job;
|
|
4559
4521
|
export type UploadUpdateTargetSchema = Job;
|
|
4560
|
-
export type UploadBatchAddTagsTargetSchema = Job;
|
|
4561
|
-
export type UploadBatchDestroyTargetSchema = Job;
|
|
4562
4522
|
export type UploadBulkTagTargetSchema = Job;
|
|
4563
4523
|
export type UploadBulkSetUploadCollectionTargetSchema = Job;
|
|
4564
4524
|
export type UploadBulkDestroyTargetSchema = Job;
|
|
@@ -5545,7 +5505,7 @@ export type ItemTypeUpdateSchema = {
|
|
|
5545
5505
|
* | Code | `structured_text` |
|
|
5546
5506
|
* | Built-in editors for the field | `structured_text` |
|
|
5547
5507
|
* | Required validators | `structured_text_blocks`, `structured_text_links` |
|
|
5548
|
-
* | Other validators available | `length`
|
|
5508
|
+
* | Other validators available | `length`, `structured_text_inline_blocks` |
|
|
5549
5509
|
*
|
|
5550
5510
|
* </details>
|
|
5551
5511
|
*
|
|
@@ -5881,6 +5841,17 @@ export type ItemTypeUpdateSchema = {
|
|
|
5881
5841
|
* </details>
|
|
5882
5842
|
*
|
|
5883
5843
|
* <details>
|
|
5844
|
+
* <summary><code>structured_text_inline_blocks</code></summary>
|
|
5845
|
+
*
|
|
5846
|
+
* Only accept references to block records of the specified block models.
|
|
5847
|
+
*
|
|
5848
|
+
* | Parameter | Type | Required | Description |
|
|
5849
|
+
* | ------------ | ----------------------- | -------- | ------------------------------ |
|
|
5850
|
+
* | `item_types` | `Array<Block Model ID>` | ✅ | Set of allowed Block Model IDs |
|
|
5851
|
+
*
|
|
5852
|
+
* </details>
|
|
5853
|
+
*
|
|
5854
|
+
* <details>
|
|
5884
5855
|
* <summary><code>structured_text_links</code></summary>
|
|
5885
5856
|
*
|
|
5886
5857
|
* Only accept `itemLink` to `inlineItem` nodes for records of the specified models.
|
|
@@ -7911,7 +7882,7 @@ export type ItemVersionRelationships = {
|
|
|
7911
7882
|
};
|
|
7912
7883
|
|
|
7913
7884
|
/**
|
|
7914
|
-
*
|
|
7885
|
+
* Each media object you upload to the Media Area of your DatoCMS project is represented as an `upload` entity.
|
|
7915
7886
|
*
|
|
7916
7887
|
* This interface was referenced by `DatoApi`'s JSON-Schema
|
|
7917
7888
|
* via the `definition` "upload".
|
|
@@ -8435,18 +8406,6 @@ export type UploadUpdateSchema = {
|
|
|
8435
8406
|
upload_collection?: UploadCollectionData | null;
|
|
8436
8407
|
};
|
|
8437
8408
|
|
|
8438
|
-
/**
|
|
8439
|
-
* This interface was referenced by `Upload`'s JSON-Schema
|
|
8440
|
-
* via the `batch_add_tags.schema` link.
|
|
8441
|
-
*/
|
|
8442
|
-
export type UploadBatchAddTagsSchema = {
|
|
8443
|
-
type?: UploadType;
|
|
8444
|
-
/**
|
|
8445
|
-
* Tags
|
|
8446
|
-
*/
|
|
8447
|
-
tags: string[];
|
|
8448
|
-
};
|
|
8449
|
-
|
|
8450
8409
|
/**
|
|
8451
8410
|
* This interface was referenced by `Upload`'s JSON-Schema
|
|
8452
8411
|
* via the `bulk_tag.schema` link.
|
|
@@ -8480,7 +8439,7 @@ export type UploadBulkDestroySchema = {
|
|
|
8480
8439
|
};
|
|
8481
8440
|
|
|
8482
8441
|
/**
|
|
8483
|
-
* To upload a file
|
|
8442
|
+
* To upload a file with the Content Management API, first you need to obtain an upload permission. The `upload_request` entity contains the S3-like URL where you will be able to upload the file with a raw/binary PUT request.
|
|
8484
8443
|
*
|
|
8485
8444
|
* This interface was referenced by `DatoApi`'s JSON-Schema
|
|
8486
8445
|
* via the `definition` "upload_request".
|
|
@@ -8489,7 +8448,7 @@ export type UploadRequest = {
|
|
|
8489
8448
|
id: UploadRequestIdentity;
|
|
8490
8449
|
type: UploadRequestType;
|
|
8491
8450
|
/**
|
|
8492
|
-
* The URL to use to upload the file with a
|
|
8451
|
+
* The URL to use to upload the file with a raw/binary PUT request
|
|
8493
8452
|
*/
|
|
8494
8453
|
url: string;
|
|
8495
8454
|
/**
|
|
@@ -8508,7 +8467,7 @@ export type UploadRequestCreateTargetSchema = UploadRequest;
|
|
|
8508
8467
|
*/
|
|
8509
8468
|
export type UploadRequestAttributes = {
|
|
8510
8469
|
/**
|
|
8511
|
-
* The URL to use to upload the file with a
|
|
8470
|
+
* The URL to use to upload the file with a raw/binary PUT request
|
|
8512
8471
|
*/
|
|
8513
8472
|
url: string;
|
|
8514
8473
|
/**
|
|
@@ -258,94 +258,6 @@ export default class Upload extends BaseResource {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
/**
|
|
262
|
-
* Batch add tags to uploads
|
|
263
|
-
*
|
|
264
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_add_tags
|
|
265
|
-
*
|
|
266
|
-
* @throws {ApiError}
|
|
267
|
-
* @throws {TimeoutError}
|
|
268
|
-
*
|
|
269
|
-
* @deprecated This API call is to be considered private and might change without notice
|
|
270
|
-
*/
|
|
271
|
-
batchAddTags(
|
|
272
|
-
body: SimpleSchemaTypes.UploadBatchAddTagsSchema,
|
|
273
|
-
queryParams?: SimpleSchemaTypes.UploadBatchAddTagsHrefSchema,
|
|
274
|
-
) {
|
|
275
|
-
return this.rawBatchAddTags(
|
|
276
|
-
Utils.serializeRequestBody<SchemaTypes.UploadBatchAddTagsSchema>(body, {
|
|
277
|
-
type: 'upload',
|
|
278
|
-
attributes: ['tags'],
|
|
279
|
-
relationships: [],
|
|
280
|
-
}),
|
|
281
|
-
queryParams,
|
|
282
|
-
).then((body) =>
|
|
283
|
-
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadBatchAddTagsJobSchema>(
|
|
284
|
-
body,
|
|
285
|
-
),
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Batch add tags to uploads
|
|
291
|
-
*
|
|
292
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_add_tags
|
|
293
|
-
*
|
|
294
|
-
* @throws {ApiError}
|
|
295
|
-
* @throws {TimeoutError}
|
|
296
|
-
*
|
|
297
|
-
* @deprecated This API call is to be considered private and might change without notice
|
|
298
|
-
*/
|
|
299
|
-
rawBatchAddTags(
|
|
300
|
-
body: SchemaTypes.UploadBatchAddTagsSchema,
|
|
301
|
-
queryParams?: SchemaTypes.UploadBatchAddTagsHrefSchema,
|
|
302
|
-
): Promise<SchemaTypes.UploadBatchAddTagsJobSchema> {
|
|
303
|
-
return this.client.request<SchemaTypes.UploadBatchAddTagsJobSchema>({
|
|
304
|
-
method: 'PUT',
|
|
305
|
-
url: '/uploads/batch-add-tags',
|
|
306
|
-
body,
|
|
307
|
-
queryParams,
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Delete multiple uploads
|
|
313
|
-
*
|
|
314
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_destroy
|
|
315
|
-
*
|
|
316
|
-
* @throws {ApiError}
|
|
317
|
-
* @throws {TimeoutError}
|
|
318
|
-
*
|
|
319
|
-
* @deprecated This API call is to be considered private and might change without notice
|
|
320
|
-
*/
|
|
321
|
-
batchDestroy(queryParams?: SimpleSchemaTypes.UploadBatchDestroyHrefSchema) {
|
|
322
|
-
return this.rawBatchDestroy(queryParams).then((body) =>
|
|
323
|
-
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadBatchDestroyJobSchema>(
|
|
324
|
-
body,
|
|
325
|
-
),
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Delete multiple uploads
|
|
331
|
-
*
|
|
332
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_destroy
|
|
333
|
-
*
|
|
334
|
-
* @throws {ApiError}
|
|
335
|
-
* @throws {TimeoutError}
|
|
336
|
-
*
|
|
337
|
-
* @deprecated This API call is to be considered private and might change without notice
|
|
338
|
-
*/
|
|
339
|
-
rawBatchDestroy(
|
|
340
|
-
queryParams?: SchemaTypes.UploadBatchDestroyHrefSchema,
|
|
341
|
-
): Promise<SchemaTypes.UploadBatchDestroyJobSchema> {
|
|
342
|
-
return this.client.request<SchemaTypes.UploadBatchDestroyJobSchema>({
|
|
343
|
-
method: 'DELETE',
|
|
344
|
-
url: '/uploads/batch-destroy',
|
|
345
|
-
queryParams,
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
|
|
349
261
|
/**
|
|
350
262
|
* Referenced records
|
|
351
263
|
*
|
|
@@ -7,7 +7,7 @@ export default class UploadRequest extends BaseResource {
|
|
|
7
7
|
static readonly TYPE = 'upload_request' as const;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Request a new upload
|
|
10
|
+
* Request a new permission to upload a file
|
|
11
11
|
*
|
|
12
12
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-request/create
|
|
13
13
|
*
|
|
@@ -29,7 +29,7 @@ export default class UploadRequest extends BaseResource {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Request a new upload
|
|
32
|
+
* Request a new permission to upload a file
|
|
33
33
|
*
|
|
34
34
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-request/create
|
|
35
35
|
*
|