@datocms/cma-client 3.3.7 → 3.3.9
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 +2 -1
- package/dist/cjs/generated/Client.js.map +1 -1
- package/dist/cjs/generated/resources/ItemType.js +17 -0
- package/dist/cjs/generated/resources/ItemType.js.map +1 -1
- package/dist/cjs/generated/resources/MenuItem.js +36 -0
- package/dist/cjs/generated/resources/MenuItem.js.map +1 -1
- package/dist/cjs/generated/resources/Role.js +2 -0
- package/dist/cjs/generated/resources/Role.js.map +1 -1
- package/dist/cjs/generated/resources/SchemaMenuItem.js +36 -0
- package/dist/cjs/generated/resources/SchemaMenuItem.js.map +1 -1
- package/dist/cjs/generated/resources/Upload.js +34 -2
- package/dist/cjs/generated/resources/Upload.js.map +1 -1
- package/dist/cjs/generated/resources/UploadCollection.js +238 -0
- package/dist/cjs/generated/resources/UploadCollection.js.map +1 -0
- package/dist/cjs/generated/resources/WebhookCall.js +4 -4
- package/dist/cjs/generated/resources/WebhookCall.js.map +1 -1
- package/dist/cjs/generated/resources/index.js +3 -1
- package/dist/cjs/generated/resources/index.js.map +1 -1
- package/dist/esm/generated/Client.d.ts +1 -0
- package/dist/esm/generated/Client.js +2 -1
- package/dist/esm/generated/Client.js.map +1 -1
- package/dist/esm/generated/SchemaTypes.d.ts +484 -40
- package/dist/esm/generated/SimpleSchemaTypes.d.ts +415 -148
- package/dist/esm/generated/resources/ItemType.d.ts +11 -0
- package/dist/esm/generated/resources/ItemType.js +17 -0
- package/dist/esm/generated/resources/ItemType.js.map +1 -1
- package/dist/esm/generated/resources/MenuItem.d.ts +22 -0
- package/dist/esm/generated/resources/MenuItem.js +36 -0
- package/dist/esm/generated/resources/MenuItem.js.map +1 -1
- package/dist/esm/generated/resources/Role.js +2 -0
- package/dist/esm/generated/resources/Role.js.map +1 -1
- package/dist/esm/generated/resources/SchemaMenuItem.d.ts +22 -0
- package/dist/esm/generated/resources/SchemaMenuItem.js +36 -0
- package/dist/esm/generated/resources/SchemaMenuItem.js.map +1 -1
- package/dist/esm/generated/resources/Upload.d.ts +18 -0
- package/dist/esm/generated/resources/Upload.js +34 -2
- package/dist/esm/generated/resources/Upload.js.map +1 -1
- package/dist/esm/generated/resources/UploadCollection.d.ts +118 -0
- package/dist/esm/generated/resources/UploadCollection.js +210 -0
- package/dist/esm/generated/resources/UploadCollection.js.map +1 -0
- package/dist/esm/generated/resources/WebhookCall.d.ts +2 -2
- package/dist/esm/generated/resources/WebhookCall.js +4 -4
- package/dist/esm/generated/resources/WebhookCall.js.map +1 -1
- package/dist/esm/generated/resources/index.d.ts +1 -0
- package/dist/esm/generated/resources/index.js +1 -0
- package/dist/esm/generated/resources/index.js.map +1 -1
- package/dist/types/generated/Client.d.ts +1 -0
- package/dist/types/generated/SchemaTypes.d.ts +484 -40
- package/dist/types/generated/SimpleSchemaTypes.d.ts +415 -148
- package/dist/types/generated/resources/ItemType.d.ts +11 -0
- package/dist/types/generated/resources/MenuItem.d.ts +22 -0
- package/dist/types/generated/resources/SchemaMenuItem.d.ts +22 -0
- package/dist/types/generated/resources/Upload.d.ts +18 -0
- package/dist/types/generated/resources/UploadCollection.d.ts +118 -0
- package/dist/types/generated/resources/WebhookCall.d.ts +2 -2
- package/dist/types/generated/resources/index.d.ts +1 -0
- package/package.json +2 -2
- package/resources.json +240 -6
- package/src/generated/Client.ts +3 -1
- package/src/generated/SchemaTypes.ts +515 -42
- package/src/generated/SimpleSchemaTypes.ts +425 -149
- package/src/generated/resources/ItemType.ts +22 -0
- package/src/generated/resources/MenuItem.ts +44 -0
- package/src/generated/resources/Role.ts +2 -0
- package/src/generated/resources/SchemaMenuItem.ts +47 -0
- package/src/generated/resources/Upload.ts +49 -2
- package/src/generated/resources/UploadCollection.ts +251 -0
- package/src/generated/resources/WebhookCall.ts +4 -4
- package/src/generated/resources/index.ts +1 -0
|
@@ -273,4 +273,26 @@ export default class ItemType extends BaseResource {
|
|
|
273
273
|
queryParams,
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Reorders a set of fields and fieldsets within the model
|
|
279
|
+
*
|
|
280
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/reorder_fields_and_fieldsets
|
|
281
|
+
*
|
|
282
|
+
* @throws {ApiError}
|
|
283
|
+
* @throws {TimeoutError}
|
|
284
|
+
*
|
|
285
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
286
|
+
*/
|
|
287
|
+
rawReorderFieldsAndFieldsets(
|
|
288
|
+
body: SchemaTypes.ItemTypeReorderFieldsAndFieldsetsSchema,
|
|
289
|
+
): Promise<SchemaTypes.ItemTypeReorderFieldsAndFieldsetsJobSchema> {
|
|
290
|
+
return this.client.request<SchemaTypes.ItemTypeReorderFieldsAndFieldsetsJobSchema>(
|
|
291
|
+
{
|
|
292
|
+
method: 'POST',
|
|
293
|
+
url: '/item-types/reorder-fields-and-fieldsets',
|
|
294
|
+
body,
|
|
295
|
+
},
|
|
296
|
+
);
|
|
297
|
+
}
|
|
276
298
|
}
|
|
@@ -189,4 +189,48 @@ export default class MenuItem extends BaseResource {
|
|
|
189
189
|
url: `/menu-items/${menuItemId}`,
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Reorders a set of menu items
|
|
195
|
+
*
|
|
196
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder
|
|
197
|
+
*
|
|
198
|
+
* @throws {ApiError}
|
|
199
|
+
* @throws {TimeoutError}
|
|
200
|
+
*
|
|
201
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
202
|
+
*/
|
|
203
|
+
reorder(body: SimpleSchemaTypes.MenuItemReorderSchema) {
|
|
204
|
+
return this.rawReorder(
|
|
205
|
+
Utils.serializeRequestBody<SchemaTypes.MenuItemReorderSchema>(body, {
|
|
206
|
+
type: 'menu_item',
|
|
207
|
+
attributes: [],
|
|
208
|
+
relationships: [],
|
|
209
|
+
}),
|
|
210
|
+
).then((body) =>
|
|
211
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.MenuItemReorderJobSchema>(
|
|
212
|
+
body,
|
|
213
|
+
),
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Reorders a set of menu items
|
|
219
|
+
*
|
|
220
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/menu-item/reorder
|
|
221
|
+
*
|
|
222
|
+
* @throws {ApiError}
|
|
223
|
+
* @throws {TimeoutError}
|
|
224
|
+
*
|
|
225
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
226
|
+
*/
|
|
227
|
+
rawReorder(
|
|
228
|
+
body: SchemaTypes.MenuItemReorderSchema,
|
|
229
|
+
): Promise<SchemaTypes.MenuItemReorderJobSchema> {
|
|
230
|
+
return this.client.request<SchemaTypes.MenuItemReorderJobSchema>({
|
|
231
|
+
method: 'POST',
|
|
232
|
+
url: '/menu-items/reorder',
|
|
233
|
+
body,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
192
236
|
}
|
|
@@ -29,6 +29,7 @@ export default class Role extends BaseResource {
|
|
|
29
29
|
'environments_access',
|
|
30
30
|
'can_manage_users',
|
|
31
31
|
'can_manage_shared_filters',
|
|
32
|
+
'can_manage_upload_collections',
|
|
32
33
|
'can_manage_build_triggers',
|
|
33
34
|
'can_manage_webhooks',
|
|
34
35
|
'can_manage_environments',
|
|
@@ -100,6 +101,7 @@ export default class Role extends BaseResource {
|
|
|
100
101
|
'environments_access',
|
|
101
102
|
'can_manage_users',
|
|
102
103
|
'can_manage_shared_filters',
|
|
104
|
+
'can_manage_upload_collections',
|
|
103
105
|
'can_manage_build_triggers',
|
|
104
106
|
'can_manage_webhooks',
|
|
105
107
|
'can_manage_environments',
|
|
@@ -193,4 +193,51 @@ export default class SchemaMenuItem extends BaseResource {
|
|
|
193
193
|
url: `/schema-menu-items/${schemaMenuItemId}`,
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Reorders a set of schema menu items
|
|
199
|
+
*
|
|
200
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder
|
|
201
|
+
*
|
|
202
|
+
* @throws {ApiError}
|
|
203
|
+
* @throws {TimeoutError}
|
|
204
|
+
*
|
|
205
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
206
|
+
*/
|
|
207
|
+
reorder(body: SimpleSchemaTypes.SchemaMenuItemReorderSchema) {
|
|
208
|
+
return this.rawReorder(
|
|
209
|
+
Utils.serializeRequestBody<SchemaTypes.SchemaMenuItemReorderSchema>(
|
|
210
|
+
body,
|
|
211
|
+
{
|
|
212
|
+
type: 'schema_menu_item',
|
|
213
|
+
attributes: [],
|
|
214
|
+
relationships: [],
|
|
215
|
+
},
|
|
216
|
+
),
|
|
217
|
+
).then((body) =>
|
|
218
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.SchemaMenuItemReorderJobSchema>(
|
|
219
|
+
body,
|
|
220
|
+
),
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Reorders a set of schema menu items
|
|
226
|
+
*
|
|
227
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/schema-menu_item/reorder
|
|
228
|
+
*
|
|
229
|
+
* @throws {ApiError}
|
|
230
|
+
* @throws {TimeoutError}
|
|
231
|
+
*
|
|
232
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
233
|
+
*/
|
|
234
|
+
rawReorder(
|
|
235
|
+
body: SchemaTypes.SchemaMenuItemReorderSchema,
|
|
236
|
+
): Promise<SchemaTypes.SchemaMenuItemReorderJobSchema> {
|
|
237
|
+
return this.client.request<SchemaTypes.SchemaMenuItemReorderJobSchema>({
|
|
238
|
+
method: 'POST',
|
|
239
|
+
url: '/schema-menu-items/reorder',
|
|
240
|
+
body,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
196
243
|
}
|
|
@@ -26,7 +26,7 @@ export default class Upload extends BaseResource {
|
|
|
26
26
|
'default_field_metadata',
|
|
27
27
|
'tags',
|
|
28
28
|
],
|
|
29
|
-
relationships: [],
|
|
29
|
+
relationships: ['upload_collection'],
|
|
30
30
|
}),
|
|
31
31
|
).then((body) =>
|
|
32
32
|
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCreateJobSchema>(
|
|
@@ -230,7 +230,7 @@ export default class Upload extends BaseResource {
|
|
|
230
230
|
'tags',
|
|
231
231
|
'default_field_metadata',
|
|
232
232
|
],
|
|
233
|
-
relationships: ['creator'],
|
|
233
|
+
relationships: ['creator', 'upload_collection'],
|
|
234
234
|
}),
|
|
235
235
|
).then((body) =>
|
|
236
236
|
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadUpdateJobSchema>(
|
|
@@ -424,6 +424,53 @@ export default class Upload extends BaseResource {
|
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Put assets into a collection in bulk
|
|
429
|
+
*
|
|
430
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_set_upload_collection
|
|
431
|
+
*
|
|
432
|
+
* @throws {ApiError}
|
|
433
|
+
* @throws {TimeoutError}
|
|
434
|
+
*/
|
|
435
|
+
bulkSetUploadCollection(
|
|
436
|
+
body: SimpleSchemaTypes.UploadBulkSetUploadCollectionSchema,
|
|
437
|
+
) {
|
|
438
|
+
return this.rawBulkSetUploadCollection(
|
|
439
|
+
Utils.serializeRequestBody<SchemaTypes.UploadBulkSetUploadCollectionSchema>(
|
|
440
|
+
body,
|
|
441
|
+
{
|
|
442
|
+
type: 'upload_bulk_set_upload_collection_operation',
|
|
443
|
+
attributes: [],
|
|
444
|
+
relationships: ['upload_collection', 'uploads'],
|
|
445
|
+
},
|
|
446
|
+
),
|
|
447
|
+
).then((body) =>
|
|
448
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadBulkSetUploadCollectionJobSchema>(
|
|
449
|
+
body,
|
|
450
|
+
),
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Put assets into a collection in bulk
|
|
456
|
+
*
|
|
457
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_set_upload_collection
|
|
458
|
+
*
|
|
459
|
+
* @throws {ApiError}
|
|
460
|
+
* @throws {TimeoutError}
|
|
461
|
+
*/
|
|
462
|
+
rawBulkSetUploadCollection(
|
|
463
|
+
body: SchemaTypes.UploadBulkSetUploadCollectionSchema,
|
|
464
|
+
): Promise<SchemaTypes.UploadBulkSetUploadCollectionJobSchema> {
|
|
465
|
+
return this.client.request<SchemaTypes.UploadBulkSetUploadCollectionJobSchema>(
|
|
466
|
+
{
|
|
467
|
+
method: 'POST',
|
|
468
|
+
url: '/uploads/bulk/set-upload-collection',
|
|
469
|
+
body,
|
|
470
|
+
},
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
427
474
|
/**
|
|
428
475
|
* Destroy uploads
|
|
429
476
|
*
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import * as Utils from '@datocms/rest-client-utils';
|
|
2
|
+
import BaseResource from '../../BaseResource';
|
|
3
|
+
import type * as SchemaTypes from '../SchemaTypes';
|
|
4
|
+
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
|
|
5
|
+
|
|
6
|
+
export default class UploadCollection extends BaseResource {
|
|
7
|
+
static readonly TYPE = 'upload_collection' as const;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Create a new upload collection
|
|
11
|
+
*
|
|
12
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/create
|
|
13
|
+
*
|
|
14
|
+
* @throws {ApiError}
|
|
15
|
+
* @throws {TimeoutError}
|
|
16
|
+
*/
|
|
17
|
+
create(body: SimpleSchemaTypes.UploadCollectionCreateSchema) {
|
|
18
|
+
return this.rawCreate(
|
|
19
|
+
Utils.serializeRequestBody<SchemaTypes.UploadCollectionCreateSchema>(
|
|
20
|
+
body,
|
|
21
|
+
{
|
|
22
|
+
type: 'upload_collection',
|
|
23
|
+
attributes: ['label', 'position'],
|
|
24
|
+
relationships: ['parent'],
|
|
25
|
+
},
|
|
26
|
+
),
|
|
27
|
+
).then((body) =>
|
|
28
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionCreateTargetSchema>(
|
|
29
|
+
body,
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create a new upload collection
|
|
36
|
+
*
|
|
37
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/create
|
|
38
|
+
*
|
|
39
|
+
* @throws {ApiError}
|
|
40
|
+
* @throws {TimeoutError}
|
|
41
|
+
*/
|
|
42
|
+
rawCreate(
|
|
43
|
+
body: SchemaTypes.UploadCollectionCreateSchema,
|
|
44
|
+
): Promise<SchemaTypes.UploadCollectionCreateTargetSchema> {
|
|
45
|
+
return this.client.request<SchemaTypes.UploadCollectionCreateTargetSchema>({
|
|
46
|
+
method: 'POST',
|
|
47
|
+
url: '/upload-collections',
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Update a upload collection
|
|
54
|
+
*
|
|
55
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/update
|
|
56
|
+
*
|
|
57
|
+
* @throws {ApiError}
|
|
58
|
+
* @throws {TimeoutError}
|
|
59
|
+
*/
|
|
60
|
+
update(
|
|
61
|
+
uploadCollectionId: string | SimpleSchemaTypes.UploadCollectionData,
|
|
62
|
+
body: SimpleSchemaTypes.UploadCollectionUpdateSchema,
|
|
63
|
+
) {
|
|
64
|
+
return this.rawUpdate(
|
|
65
|
+
Utils.toId(uploadCollectionId),
|
|
66
|
+
Utils.serializeRequestBody<SchemaTypes.UploadCollectionUpdateSchema>(
|
|
67
|
+
body,
|
|
68
|
+
{
|
|
69
|
+
id: Utils.toId(uploadCollectionId),
|
|
70
|
+
type: 'upload_collection',
|
|
71
|
+
attributes: ['label', 'position'],
|
|
72
|
+
relationships: ['parent', 'children'],
|
|
73
|
+
},
|
|
74
|
+
),
|
|
75
|
+
).then((body) =>
|
|
76
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionUpdateTargetSchema>(
|
|
77
|
+
body,
|
|
78
|
+
),
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update a upload collection
|
|
84
|
+
*
|
|
85
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/update
|
|
86
|
+
*
|
|
87
|
+
* @throws {ApiError}
|
|
88
|
+
* @throws {TimeoutError}
|
|
89
|
+
*/
|
|
90
|
+
rawUpdate(
|
|
91
|
+
uploadCollectionId: string,
|
|
92
|
+
body: SchemaTypes.UploadCollectionUpdateSchema,
|
|
93
|
+
): Promise<SchemaTypes.UploadCollectionUpdateTargetSchema> {
|
|
94
|
+
return this.client.request<SchemaTypes.UploadCollectionUpdateTargetSchema>({
|
|
95
|
+
method: 'PUT',
|
|
96
|
+
url: `/upload-collections/${uploadCollectionId}`,
|
|
97
|
+
body,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* List all upload collections
|
|
103
|
+
*
|
|
104
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/instances
|
|
105
|
+
*
|
|
106
|
+
* @throws {ApiError}
|
|
107
|
+
* @throws {TimeoutError}
|
|
108
|
+
*/
|
|
109
|
+
list(queryParams?: SimpleSchemaTypes.UploadCollectionInstancesHrefSchema) {
|
|
110
|
+
return this.rawList(queryParams).then((body) =>
|
|
111
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionInstancesTargetSchema>(
|
|
112
|
+
body,
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* List all upload collections
|
|
119
|
+
*
|
|
120
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/instances
|
|
121
|
+
*
|
|
122
|
+
* @throws {ApiError}
|
|
123
|
+
* @throws {TimeoutError}
|
|
124
|
+
*/
|
|
125
|
+
rawList(
|
|
126
|
+
queryParams?: SchemaTypes.UploadCollectionInstancesHrefSchema,
|
|
127
|
+
): Promise<SchemaTypes.UploadCollectionInstancesTargetSchema> {
|
|
128
|
+
return this.client.request<SchemaTypes.UploadCollectionInstancesTargetSchema>(
|
|
129
|
+
{
|
|
130
|
+
method: 'GET',
|
|
131
|
+
url: '/upload-collections',
|
|
132
|
+
queryParams,
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Retrieve a upload collection
|
|
139
|
+
*
|
|
140
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/self
|
|
141
|
+
*
|
|
142
|
+
* @throws {ApiError}
|
|
143
|
+
* @throws {TimeoutError}
|
|
144
|
+
*/
|
|
145
|
+
find(uploadCollectionId: string | SimpleSchemaTypes.UploadCollectionData) {
|
|
146
|
+
return this.rawFind(Utils.toId(uploadCollectionId)).then((body) =>
|
|
147
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionSelfTargetSchema>(
|
|
148
|
+
body,
|
|
149
|
+
),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Retrieve a upload collection
|
|
155
|
+
*
|
|
156
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/self
|
|
157
|
+
*
|
|
158
|
+
* @throws {ApiError}
|
|
159
|
+
* @throws {TimeoutError}
|
|
160
|
+
*/
|
|
161
|
+
rawFind(
|
|
162
|
+
uploadCollectionId: string,
|
|
163
|
+
): Promise<SchemaTypes.UploadCollectionSelfTargetSchema> {
|
|
164
|
+
return this.client.request<SchemaTypes.UploadCollectionSelfTargetSchema>({
|
|
165
|
+
method: 'GET',
|
|
166
|
+
url: `/upload-collections/${uploadCollectionId}`,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Delete a upload collection
|
|
172
|
+
*
|
|
173
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/destroy
|
|
174
|
+
*
|
|
175
|
+
* @throws {ApiError}
|
|
176
|
+
* @throws {TimeoutError}
|
|
177
|
+
*/
|
|
178
|
+
destroy(uploadCollectionId: string | SimpleSchemaTypes.UploadCollectionData) {
|
|
179
|
+
return this.rawDestroy(Utils.toId(uploadCollectionId)).then((body) =>
|
|
180
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionDestroyTargetSchema>(
|
|
181
|
+
body,
|
|
182
|
+
),
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Delete a upload collection
|
|
188
|
+
*
|
|
189
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/destroy
|
|
190
|
+
*
|
|
191
|
+
* @throws {ApiError}
|
|
192
|
+
* @throws {TimeoutError}
|
|
193
|
+
*/
|
|
194
|
+
rawDestroy(
|
|
195
|
+
uploadCollectionId: string,
|
|
196
|
+
): Promise<SchemaTypes.UploadCollectionDestroyTargetSchema> {
|
|
197
|
+
return this.client.request<SchemaTypes.UploadCollectionDestroyTargetSchema>(
|
|
198
|
+
{
|
|
199
|
+
method: 'DELETE',
|
|
200
|
+
url: `/upload-collections/${uploadCollectionId}`,
|
|
201
|
+
},
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Reorders a set of upload collections
|
|
207
|
+
*
|
|
208
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder
|
|
209
|
+
*
|
|
210
|
+
* @throws {ApiError}
|
|
211
|
+
* @throws {TimeoutError}
|
|
212
|
+
*
|
|
213
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
214
|
+
*/
|
|
215
|
+
reorder(body: SimpleSchemaTypes.UploadCollectionReorderSchema) {
|
|
216
|
+
return this.rawReorder(
|
|
217
|
+
Utils.serializeRequestBody<SchemaTypes.UploadCollectionReorderSchema>(
|
|
218
|
+
body,
|
|
219
|
+
{
|
|
220
|
+
type: 'upload_collection',
|
|
221
|
+
attributes: [],
|
|
222
|
+
relationships: [],
|
|
223
|
+
},
|
|
224
|
+
),
|
|
225
|
+
).then((body) =>
|
|
226
|
+
Utils.deserializeResponseBody<SimpleSchemaTypes.UploadCollectionReorderJobSchema>(
|
|
227
|
+
body,
|
|
228
|
+
),
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Reorders a set of upload collections
|
|
234
|
+
*
|
|
235
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder
|
|
236
|
+
*
|
|
237
|
+
* @throws {ApiError}
|
|
238
|
+
* @throws {TimeoutError}
|
|
239
|
+
*
|
|
240
|
+
* @deprecated This API call is to be considered private and might change without notice
|
|
241
|
+
*/
|
|
242
|
+
rawReorder(
|
|
243
|
+
body: SchemaTypes.UploadCollectionReorderSchema,
|
|
244
|
+
): Promise<SchemaTypes.UploadCollectionReorderJobSchema> {
|
|
245
|
+
return this.client.request<SchemaTypes.UploadCollectionReorderJobSchema>({
|
|
246
|
+
method: 'POST',
|
|
247
|
+
url: '/upload-collections/reorder',
|
|
248
|
+
body,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
@@ -136,8 +136,8 @@ export default class WebhookCall extends BaseResource {
|
|
|
136
136
|
* @throws {ApiError}
|
|
137
137
|
* @throws {TimeoutError}
|
|
138
138
|
*/
|
|
139
|
-
resendWebhook(
|
|
140
|
-
return this.rawResendWebhook(Utils.toId(
|
|
139
|
+
resendWebhook(webhookCallId: string | SimpleSchemaTypes.WebhookCallData) {
|
|
140
|
+
return this.rawResendWebhook(Utils.toId(webhookCallId));
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/**
|
|
@@ -148,10 +148,10 @@ export default class WebhookCall extends BaseResource {
|
|
|
148
148
|
* @throws {ApiError}
|
|
149
149
|
* @throws {TimeoutError}
|
|
150
150
|
*/
|
|
151
|
-
rawResendWebhook(
|
|
151
|
+
rawResendWebhook(webhookCallId: string): Promise<void> {
|
|
152
152
|
return this.client.request<void>({
|
|
153
153
|
method: 'POST',
|
|
154
|
-
url: `/webhook_calls/${
|
|
154
|
+
url: `/webhook_calls/${webhookCallId}/resend_webhook`,
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -4,6 +4,7 @@ export { default as SsoUser } from './SsoUser';
|
|
|
4
4
|
export { default as AuditLogEvent } from './AuditLogEvent';
|
|
5
5
|
export { default as MenuItem } from './MenuItem';
|
|
6
6
|
export { default as SchemaMenuItem } from './SchemaMenuItem';
|
|
7
|
+
export { default as UploadCollection } from './UploadCollection';
|
|
7
8
|
export { default as ItemType } from './ItemType';
|
|
8
9
|
export { default as Field } from './Field';
|
|
9
10
|
export { default as Fieldset } from './Fieldset';
|