@datocms/cma-client 5.1.27 → 5.1.28
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/resources/ItemType.js +12 -12
- package/dist/esm/generated/ApiTypes.d.ts +78 -59
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/RawApiTypes.d.ts +79 -60
- package/dist/esm/generated/resources/ItemType.d.ts +12 -12
- package/dist/esm/generated/resources/ItemType.js +12 -12
- package/dist/types/generated/ApiTypes.d.ts +78 -59
- package/dist/types/generated/RawApiTypes.d.ts +79 -60
- package/dist/types/generated/resources/ItemType.d.ts +12 -12
- package/package.json +2 -2
- package/resources.json +6 -6
- package/src/generated/ApiTypes.ts +78 -59
- package/src/generated/Client.ts +1 -1
- package/src/generated/RawApiTypes.ts +79 -60
- package/src/generated/resources/ItemType.ts +12 -12
|
@@ -88,7 +88,7 @@ class Client {
|
|
|
88
88
|
return this.config.baseUrl || Client.defaultBaseUrl;
|
|
89
89
|
}
|
|
90
90
|
request(options) {
|
|
91
|
-
return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.
|
|
91
|
+
return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.28', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
92
92
|
? { 'X-Environment': this.config.environment }
|
|
93
93
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
|
|
94
94
|
return this.jobResultsFetcher
|
|
@@ -30,7 +30,7 @@ const Utils = __importStar(require("@datocms/rest-client-utils"));
|
|
|
30
30
|
const BaseResource_1 = __importDefault(require("../../BaseResource"));
|
|
31
31
|
class ItemType extends BaseResource_1.default {
|
|
32
32
|
/**
|
|
33
|
-
* Create a new model
|
|
33
|
+
* Create a new model/block model
|
|
34
34
|
*
|
|
35
35
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
36
36
|
*
|
|
@@ -69,7 +69,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
69
69
|
}), queryParams).then((body) => Utils.deserializeResponseBody(body));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Create a new model
|
|
72
|
+
* Create a new model/block model
|
|
73
73
|
*
|
|
74
74
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
75
75
|
*
|
|
@@ -85,7 +85,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* Update a model
|
|
88
|
+
* Update a model/block model
|
|
89
89
|
*
|
|
90
90
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
91
91
|
*
|
|
@@ -126,7 +126,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
126
126
|
})).then((body) => Utils.deserializeResponseBody(body));
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
* Update a model
|
|
129
|
+
* Update a model/block model
|
|
130
130
|
*
|
|
131
131
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
132
132
|
*
|
|
@@ -141,7 +141,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
* List all models
|
|
144
|
+
* List all models/block models
|
|
145
145
|
*
|
|
146
146
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
147
147
|
*
|
|
@@ -152,7 +152,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
152
152
|
return this.rawList().then((body) => Utils.deserializeResponseBody(body));
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
|
-
* List all models
|
|
155
|
+
* List all models/block models
|
|
156
156
|
*
|
|
157
157
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
158
158
|
*
|
|
@@ -166,7 +166,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* Retrieve a model
|
|
169
|
+
* Retrieve a model/block model
|
|
170
170
|
*
|
|
171
171
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
172
172
|
*
|
|
@@ -177,7 +177,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
177
177
|
return this.rawFind(Utils.toId(itemTypeId)).then((body) => Utils.deserializeResponseBody(body));
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
* Retrieve a model
|
|
180
|
+
* Retrieve a model/block model
|
|
181
181
|
*
|
|
182
182
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
183
183
|
*
|
|
@@ -191,7 +191,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
* Duplicate model
|
|
194
|
+
* Duplicate model/block model
|
|
195
195
|
*
|
|
196
196
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
197
197
|
*
|
|
@@ -202,7 +202,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
202
202
|
return this.rawDuplicate(Utils.toId(itemTypeId)).then((body) => Utils.deserializeResponseBody(body));
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
|
-
* Duplicate model
|
|
205
|
+
* Duplicate model/block model
|
|
206
206
|
*
|
|
207
207
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
208
208
|
*
|
|
@@ -216,7 +216,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* Delete a model
|
|
219
|
+
* Delete a model/block model
|
|
220
220
|
*
|
|
221
221
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
222
222
|
*
|
|
@@ -227,7 +227,7 @@ class ItemType extends BaseResource_1.default {
|
|
|
227
227
|
return this.rawDestroy(Utils.toId(itemTypeId), queryParams).then((body) => Utils.deserializeResponseBody(body));
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
* Delete a model
|
|
230
|
+
* Delete a model/block model
|
|
231
231
|
*
|
|
232
232
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
233
233
|
*
|
|
@@ -4438,7 +4438,26 @@ export type UploadCollectionUpdateSchema = {
|
|
|
4438
4438
|
children?: UploadCollectionData[];
|
|
4439
4439
|
};
|
|
4440
4440
|
/**
|
|
4441
|
-
* The way you define the kind of content you can edit inside
|
|
4441
|
+
* The way you define the kind of content you can edit inside a DatoCMS project passes through the concept of **models** and **block models**. For backward-compatibility reasons, the API refers to both as "item types".
|
|
4442
|
+
*
|
|
4443
|
+
* ## Models
|
|
4444
|
+
*
|
|
4445
|
+
* Models are much like database tables — they define the structure of your main content types (e.g., blog posts, products, landing pages). Each model is composed of fields with custom validations. Records created from models exist independently and can be referenced by other records through link fields.
|
|
4446
|
+
*
|
|
4447
|
+
* ## Block Models
|
|
4448
|
+
*
|
|
4449
|
+
* Block models define complex and repeatable structures that can be embedded inside records. They are the foundation behind features like [Modular Content](/docs/content-modelling/modular-content.md) and [Structured Text](/docs/content-modelling/structured-text.md).
|
|
4450
|
+
*
|
|
4451
|
+
* ### Key differences:
|
|
4452
|
+
*
|
|
4453
|
+
* - **Models** create standalone records that can be referenced and have independent value
|
|
4454
|
+
* - **Block models** create blocks that only exist within parent records and cannot be referenced via link fields
|
|
4455
|
+
* - Block models defined in the library can be reused across different models
|
|
4456
|
+
* - When a record gets deleted, all the blocks it contains are deleted with it
|
|
4457
|
+
* - Blocks do not count towards your plan's records limit
|
|
4458
|
+
*
|
|
4459
|
+
* You can distinguish between models and block models using the `modular_block` attribute: `true` indicates a block model, `false` indicates a regular model.
|
|
4460
|
+
*
|
|
4442
4461
|
*
|
|
4443
4462
|
* This interface was referenced by `DatoApi`'s JSON-Schema
|
|
4444
4463
|
* via the `definition` "item_type".
|
|
@@ -4447,11 +4466,11 @@ export type ItemType = {
|
|
|
4447
4466
|
id: ItemTypeIdentity;
|
|
4448
4467
|
type: ItemTypeType;
|
|
4449
4468
|
/**
|
|
4450
|
-
* Name of the model
|
|
4469
|
+
* Name of the model/block model
|
|
4451
4470
|
*/
|
|
4452
4471
|
name: string;
|
|
4453
4472
|
/**
|
|
4454
|
-
* API key of the model
|
|
4473
|
+
* API key of the model/block model
|
|
4455
4474
|
*/
|
|
4456
4475
|
api_key: string;
|
|
4457
4476
|
/**
|
|
@@ -4459,11 +4478,11 @@ export type ItemType = {
|
|
|
4459
4478
|
*/
|
|
4460
4479
|
collection_appeareance?: 'compact' | 'table';
|
|
4461
4480
|
/**
|
|
4462
|
-
* The way the model collection should be presented to the editors
|
|
4481
|
+
* The way the model/block model collection should be presented to the editors
|
|
4463
4482
|
*/
|
|
4464
4483
|
collection_appearance: 'compact' | 'table';
|
|
4465
4484
|
/**
|
|
4466
|
-
* Whether the model is single-instance or not
|
|
4485
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4467
4486
|
*/
|
|
4468
4487
|
singleton: boolean;
|
|
4469
4488
|
/**
|
|
@@ -4471,43 +4490,43 @@ export type ItemType = {
|
|
|
4471
4490
|
*/
|
|
4472
4491
|
all_locales_required: boolean;
|
|
4473
4492
|
/**
|
|
4474
|
-
* Whether editors can sort records via drag & drop or not
|
|
4493
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4475
4494
|
*/
|
|
4476
4495
|
sortable: boolean;
|
|
4477
4496
|
/**
|
|
4478
|
-
* Whether this
|
|
4497
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4479
4498
|
*/
|
|
4480
4499
|
modular_block: boolean;
|
|
4481
4500
|
/**
|
|
4482
|
-
* Whether draft/published mode is active or not
|
|
4501
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4483
4502
|
*/
|
|
4484
4503
|
draft_mode_active: boolean;
|
|
4485
4504
|
/**
|
|
4486
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4505
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4487
4506
|
*/
|
|
4488
4507
|
draft_saving_active: boolean;
|
|
4489
4508
|
/**
|
|
4490
|
-
* Whether editors can organize records in a tree or not
|
|
4509
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4491
4510
|
*/
|
|
4492
4511
|
tree: boolean;
|
|
4493
4512
|
/**
|
|
4494
|
-
* If an ordering field is set, this
|
|
4513
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4495
4514
|
*/
|
|
4496
4515
|
ordering_direction: null | 'asc' | 'desc';
|
|
4497
4516
|
/**
|
|
4498
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4517
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4499
4518
|
*/
|
|
4500
4519
|
ordering_meta: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4501
4520
|
/**
|
|
4502
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4521
|
+
* If this model is single-instance, this tells whether the single-instance record has already been created or not. This property only applies to models, not block models
|
|
4503
4522
|
*/
|
|
4504
4523
|
has_singleton_item: boolean;
|
|
4505
4524
|
/**
|
|
4506
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4525
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4507
4526
|
*/
|
|
4508
4527
|
hint: string | null;
|
|
4509
4528
|
/**
|
|
4510
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4529
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4511
4530
|
*/
|
|
4512
4531
|
inverse_relationships_enabled: boolean;
|
|
4513
4532
|
singleton_item: ItemData | null;
|
|
@@ -4568,14 +4587,14 @@ export type WorkflowData = {
|
|
|
4568
4587
|
id: WorkflowIdentity;
|
|
4569
4588
|
};
|
|
4570
4589
|
/**
|
|
4571
|
-
* Meta information regarding the
|
|
4590
|
+
* Meta information regarding the model/block model
|
|
4572
4591
|
*
|
|
4573
4592
|
* This interface was referenced by `ItemType`'s JSON-Schema
|
|
4574
4593
|
* via the `definition` "meta".
|
|
4575
4594
|
*/
|
|
4576
4595
|
export type ItemTypeMeta = {
|
|
4577
4596
|
/**
|
|
4578
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4597
|
+
* If this model is single-instance, this tells whether the single-instance record has already been created or not. This property only applies to models, not block models
|
|
4579
4598
|
*/
|
|
4580
4599
|
has_singleton_item: boolean;
|
|
4581
4600
|
};
|
|
@@ -4587,11 +4606,11 @@ export type ItemTypeMeta = {
|
|
|
4587
4606
|
*/
|
|
4588
4607
|
export type ItemTypeAttributes = {
|
|
4589
4608
|
/**
|
|
4590
|
-
* Name of the model
|
|
4609
|
+
* Name of the model/block model
|
|
4591
4610
|
*/
|
|
4592
4611
|
name: string;
|
|
4593
4612
|
/**
|
|
4594
|
-
* API key of the model
|
|
4613
|
+
* API key of the model/block model
|
|
4595
4614
|
*/
|
|
4596
4615
|
api_key: string;
|
|
4597
4616
|
/**
|
|
@@ -4599,11 +4618,11 @@ export type ItemTypeAttributes = {
|
|
|
4599
4618
|
*/
|
|
4600
4619
|
collection_appeareance?: 'compact' | 'table';
|
|
4601
4620
|
/**
|
|
4602
|
-
* The way the model collection should be presented to the editors
|
|
4621
|
+
* The way the model/block model collection should be presented to the editors
|
|
4603
4622
|
*/
|
|
4604
4623
|
collection_appearance: 'compact' | 'table';
|
|
4605
4624
|
/**
|
|
4606
|
-
* Whether the model is single-instance or not
|
|
4625
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4607
4626
|
*/
|
|
4608
4627
|
singleton: boolean;
|
|
4609
4628
|
/**
|
|
@@ -4611,43 +4630,43 @@ export type ItemTypeAttributes = {
|
|
|
4611
4630
|
*/
|
|
4612
4631
|
all_locales_required: boolean;
|
|
4613
4632
|
/**
|
|
4614
|
-
* Whether editors can sort records via drag & drop or not
|
|
4633
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4615
4634
|
*/
|
|
4616
4635
|
sortable: boolean;
|
|
4617
4636
|
/**
|
|
4618
|
-
* Whether this
|
|
4637
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4619
4638
|
*/
|
|
4620
4639
|
modular_block: boolean;
|
|
4621
4640
|
/**
|
|
4622
|
-
* Whether draft/published mode is active or not
|
|
4641
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4623
4642
|
*/
|
|
4624
4643
|
draft_mode_active: boolean;
|
|
4625
4644
|
/**
|
|
4626
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4645
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4627
4646
|
*/
|
|
4628
4647
|
draft_saving_active: boolean;
|
|
4629
4648
|
/**
|
|
4630
|
-
* Whether editors can organize records in a tree or not
|
|
4649
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4631
4650
|
*/
|
|
4632
4651
|
tree: boolean;
|
|
4633
4652
|
/**
|
|
4634
|
-
* If an ordering field is set, this
|
|
4653
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4635
4654
|
*/
|
|
4636
4655
|
ordering_direction: null | 'asc' | 'desc';
|
|
4637
4656
|
/**
|
|
4638
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4657
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4639
4658
|
*/
|
|
4640
4659
|
ordering_meta: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4641
4660
|
/**
|
|
4642
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4661
|
+
* If this model is single-instance, this tells whether the single-instance record has already been created or not. This property only applies to models, not block models
|
|
4643
4662
|
*/
|
|
4644
4663
|
has_singleton_item: boolean;
|
|
4645
4664
|
/**
|
|
4646
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4665
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4647
4666
|
*/
|
|
4648
4667
|
hint: string | null;
|
|
4649
4668
|
/**
|
|
4650
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4669
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4651
4670
|
*/
|
|
4652
4671
|
inverse_relationships_enabled: boolean;
|
|
4653
4672
|
};
|
|
@@ -4677,15 +4696,15 @@ export type ItemTypeCreateSchema = {
|
|
|
4677
4696
|
id?: ItemTypeIdentity;
|
|
4678
4697
|
type?: ItemTypeType;
|
|
4679
4698
|
/**
|
|
4680
|
-
* Name of the model
|
|
4699
|
+
* Name of the model/block model
|
|
4681
4700
|
*/
|
|
4682
4701
|
name: string;
|
|
4683
4702
|
/**
|
|
4684
|
-
* API key of the model
|
|
4703
|
+
* API key of the model/block model
|
|
4685
4704
|
*/
|
|
4686
4705
|
api_key: string;
|
|
4687
4706
|
/**
|
|
4688
|
-
* Whether the model is single-instance or not
|
|
4707
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4689
4708
|
*/
|
|
4690
4709
|
singleton?: boolean;
|
|
4691
4710
|
/**
|
|
@@ -4693,31 +4712,31 @@ export type ItemTypeCreateSchema = {
|
|
|
4693
4712
|
*/
|
|
4694
4713
|
all_locales_required?: boolean;
|
|
4695
4714
|
/**
|
|
4696
|
-
* Whether editors can sort records via drag & drop or not
|
|
4715
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4697
4716
|
*/
|
|
4698
4717
|
sortable?: boolean;
|
|
4699
4718
|
/**
|
|
4700
|
-
* Whether this
|
|
4719
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4701
4720
|
*/
|
|
4702
4721
|
modular_block?: boolean;
|
|
4703
4722
|
/**
|
|
4704
|
-
* Whether draft/published mode is active or not
|
|
4723
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4705
4724
|
*/
|
|
4706
4725
|
draft_mode_active?: boolean;
|
|
4707
4726
|
/**
|
|
4708
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4727
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4709
4728
|
*/
|
|
4710
4729
|
draft_saving_active?: boolean;
|
|
4711
4730
|
/**
|
|
4712
|
-
* Whether editors can organize records in a tree or not
|
|
4731
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4713
4732
|
*/
|
|
4714
4733
|
tree?: boolean;
|
|
4715
4734
|
/**
|
|
4716
|
-
* If an ordering field is set, this
|
|
4735
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4717
4736
|
*/
|
|
4718
4737
|
ordering_direction?: null | 'asc' | 'desc';
|
|
4719
4738
|
/**
|
|
4720
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4739
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4721
4740
|
*/
|
|
4722
4741
|
ordering_meta?: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4723
4742
|
/**
|
|
@@ -4725,15 +4744,15 @@ export type ItemTypeCreateSchema = {
|
|
|
4725
4744
|
*/
|
|
4726
4745
|
collection_appeareance?: 'compact' | 'table';
|
|
4727
4746
|
/**
|
|
4728
|
-
* The way the model collection should be presented to the editors
|
|
4747
|
+
* The way the model/block model collection should be presented to the editors
|
|
4729
4748
|
*/
|
|
4730
4749
|
collection_appearance?: 'compact' | 'table';
|
|
4731
4750
|
/**
|
|
4732
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4751
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4733
4752
|
*/
|
|
4734
4753
|
hint?: string | null;
|
|
4735
4754
|
/**
|
|
4736
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4755
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4737
4756
|
*/
|
|
4738
4757
|
inverse_relationships_enabled?: boolean;
|
|
4739
4758
|
ordering_field?: FieldData | null;
|
|
@@ -4752,11 +4771,11 @@ export type ItemTypeUpdateSchema = {
|
|
|
4752
4771
|
id?: ItemTypeIdentity;
|
|
4753
4772
|
type?: ItemTypeType;
|
|
4754
4773
|
/**
|
|
4755
|
-
* Name of the model
|
|
4774
|
+
* Name of the model/block model
|
|
4756
4775
|
*/
|
|
4757
4776
|
name?: string;
|
|
4758
4777
|
/**
|
|
4759
|
-
* API key of the model
|
|
4778
|
+
* API key of the model/block model
|
|
4760
4779
|
*/
|
|
4761
4780
|
api_key?: string;
|
|
4762
4781
|
/**
|
|
@@ -4764,11 +4783,11 @@ export type ItemTypeUpdateSchema = {
|
|
|
4764
4783
|
*/
|
|
4765
4784
|
collection_appeareance?: 'compact' | 'table';
|
|
4766
4785
|
/**
|
|
4767
|
-
* The way the model collection should be presented to the editors
|
|
4786
|
+
* The way the model/block model collection should be presented to the editors
|
|
4768
4787
|
*/
|
|
4769
4788
|
collection_appearance?: 'compact' | 'table';
|
|
4770
4789
|
/**
|
|
4771
|
-
* Whether the model is single-instance or not
|
|
4790
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4772
4791
|
*/
|
|
4773
4792
|
singleton?: boolean;
|
|
4774
4793
|
/**
|
|
@@ -4776,43 +4795,43 @@ export type ItemTypeUpdateSchema = {
|
|
|
4776
4795
|
*/
|
|
4777
4796
|
all_locales_required?: boolean;
|
|
4778
4797
|
/**
|
|
4779
|
-
* Whether editors can sort records via drag & drop or not
|
|
4798
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4780
4799
|
*/
|
|
4781
4800
|
sortable?: boolean;
|
|
4782
4801
|
/**
|
|
4783
|
-
* Whether this
|
|
4802
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4784
4803
|
*/
|
|
4785
4804
|
modular_block?: boolean;
|
|
4786
4805
|
/**
|
|
4787
|
-
* Whether draft/published mode is active or not
|
|
4806
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4788
4807
|
*/
|
|
4789
4808
|
draft_mode_active?: boolean;
|
|
4790
4809
|
/**
|
|
4791
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4810
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4792
4811
|
*/
|
|
4793
4812
|
draft_saving_active?: boolean;
|
|
4794
4813
|
/**
|
|
4795
|
-
* Whether editors can organize records in a tree or not
|
|
4814
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4796
4815
|
*/
|
|
4797
4816
|
tree?: boolean;
|
|
4798
4817
|
/**
|
|
4799
|
-
* If an ordering field is set, this
|
|
4818
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4800
4819
|
*/
|
|
4801
4820
|
ordering_direction?: null | 'asc' | 'desc';
|
|
4802
4821
|
/**
|
|
4803
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4822
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4804
4823
|
*/
|
|
4805
4824
|
ordering_meta?: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4806
4825
|
/**
|
|
4807
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4826
|
+
* If this model is single-instance, this tells whether the single-instance record has already been created or not. This property only applies to models, not block models
|
|
4808
4827
|
*/
|
|
4809
4828
|
has_singleton_item?: boolean;
|
|
4810
4829
|
/**
|
|
4811
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4830
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4812
4831
|
*/
|
|
4813
4832
|
hint?: string | null;
|
|
4814
4833
|
/**
|
|
4815
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4834
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4816
4835
|
*/
|
|
4817
4836
|
inverse_relationships_enabled?: boolean;
|
|
4818
4837
|
ordering_field?: FieldData | null;
|
|
@@ -4824,7 +4843,7 @@ export type ItemTypeUpdateSchema = {
|
|
|
4824
4843
|
workflow?: WorkflowData | null;
|
|
4825
4844
|
meta?: {
|
|
4826
4845
|
/**
|
|
4827
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4846
|
+
* If this model is single-instance, this tells whether the single-instance record has already been created or not. This property only applies to models, not block models
|
|
4828
4847
|
*/
|
|
4829
4848
|
has_singleton_item?: boolean;
|
|
4830
4849
|
};
|
|
@@ -62,7 +62,7 @@ export class Client {
|
|
|
62
62
|
return this.config.baseUrl || Client.defaultBaseUrl;
|
|
63
63
|
}
|
|
64
64
|
request(options) {
|
|
65
|
-
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.
|
|
65
|
+
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.28', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
66
66
|
? { 'X-Environment': this.config.environment }
|
|
67
67
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
|
|
68
68
|
return this.jobResultsFetcher
|