@datocms/cma-client 5.1.27 → 5.1.29
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/cjs/utilities/schemaRepository.js +1 -1
- package/dist/cjs/utilities/schemaRepository.js.map +1 -1
- 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/esm/utilities/schemaRepository.js +1 -1
- package/dist/esm/utilities/schemaRepository.js.map +1 -1
- 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
- package/src/utilities/schemaRepository.ts +1 -1
|
@@ -4007,7 +4007,26 @@ export type UploadCollectionReorderJobSchema = {
|
|
|
4007
4007
|
data: UploadCollection[];
|
|
4008
4008
|
};
|
|
4009
4009
|
/**
|
|
4010
|
-
* The way you define the kind of content you can edit inside
|
|
4010
|
+
* 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".
|
|
4011
|
+
*
|
|
4012
|
+
* ## Models
|
|
4013
|
+
*
|
|
4014
|
+
* 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.
|
|
4015
|
+
*
|
|
4016
|
+
* ## Block Models
|
|
4017
|
+
*
|
|
4018
|
+
* 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).
|
|
4019
|
+
*
|
|
4020
|
+
* ### Key differences:
|
|
4021
|
+
*
|
|
4022
|
+
* - **Models** create standalone records that can be referenced and have independent value
|
|
4023
|
+
* - **Block models** create blocks that only exist within parent records and cannot be referenced via link fields
|
|
4024
|
+
* - Block models defined in the library can be reused across different models
|
|
4025
|
+
* - When a record gets deleted, all the blocks it contains are deleted with it
|
|
4026
|
+
* - Blocks do not count towards your plan's records limit
|
|
4027
|
+
*
|
|
4028
|
+
* You can distinguish between models and block models using the `modular_block` attribute: `true` indicates a block model, `false` indicates a regular model.
|
|
4029
|
+
*
|
|
4011
4030
|
*
|
|
4012
4031
|
* This interface was referenced by `DatoApi`'s JSON-Schema
|
|
4013
4032
|
* via the `definition` "item_type".
|
|
@@ -4027,11 +4046,11 @@ export type ItemType = {
|
|
|
4027
4046
|
*/
|
|
4028
4047
|
export type ItemTypeAttributes = {
|
|
4029
4048
|
/**
|
|
4030
|
-
* Name of the model
|
|
4049
|
+
* Name of the model/block model
|
|
4031
4050
|
*/
|
|
4032
4051
|
name: string;
|
|
4033
4052
|
/**
|
|
4034
|
-
* API key of the model
|
|
4053
|
+
* API key of the model/block model
|
|
4035
4054
|
*/
|
|
4036
4055
|
api_key: string;
|
|
4037
4056
|
/**
|
|
@@ -4039,11 +4058,11 @@ export type ItemTypeAttributes = {
|
|
|
4039
4058
|
*/
|
|
4040
4059
|
collection_appeareance?: 'compact' | 'table';
|
|
4041
4060
|
/**
|
|
4042
|
-
* The way the model collection should be presented to the editors
|
|
4061
|
+
* The way the model/block model collection should be presented to the editors
|
|
4043
4062
|
*/
|
|
4044
4063
|
collection_appearance: 'compact' | 'table';
|
|
4045
4064
|
/**
|
|
4046
|
-
* Whether the model is single-instance or not
|
|
4065
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4047
4066
|
*/
|
|
4048
4067
|
singleton: boolean;
|
|
4049
4068
|
/**
|
|
@@ -4051,43 +4070,43 @@ export type ItemTypeAttributes = {
|
|
|
4051
4070
|
*/
|
|
4052
4071
|
all_locales_required: boolean;
|
|
4053
4072
|
/**
|
|
4054
|
-
* Whether editors can sort records via drag & drop or not
|
|
4073
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4055
4074
|
*/
|
|
4056
4075
|
sortable: boolean;
|
|
4057
4076
|
/**
|
|
4058
|
-
* Whether this
|
|
4077
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4059
4078
|
*/
|
|
4060
4079
|
modular_block: boolean;
|
|
4061
4080
|
/**
|
|
4062
|
-
* Whether draft/published mode is active or not
|
|
4081
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4063
4082
|
*/
|
|
4064
4083
|
draft_mode_active: boolean;
|
|
4065
4084
|
/**
|
|
4066
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4085
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4067
4086
|
*/
|
|
4068
4087
|
draft_saving_active: boolean;
|
|
4069
4088
|
/**
|
|
4070
|
-
* Whether editors can organize records in a tree or not
|
|
4089
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4071
4090
|
*/
|
|
4072
4091
|
tree: boolean;
|
|
4073
4092
|
/**
|
|
4074
|
-
* If an ordering field is set, this
|
|
4093
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4075
4094
|
*/
|
|
4076
4095
|
ordering_direction: null | 'asc' | 'desc';
|
|
4077
4096
|
/**
|
|
4078
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4097
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4079
4098
|
*/
|
|
4080
4099
|
ordering_meta: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4081
4100
|
/**
|
|
4082
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4101
|
+
* 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
|
|
4083
4102
|
*/
|
|
4084
4103
|
has_singleton_item: boolean;
|
|
4085
4104
|
/**
|
|
4086
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4105
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4087
4106
|
*/
|
|
4088
4107
|
hint: string | null;
|
|
4089
4108
|
/**
|
|
4090
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4109
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4091
4110
|
*/
|
|
4092
4111
|
inverse_relationships_enabled: boolean;
|
|
4093
4112
|
};
|
|
@@ -4099,19 +4118,19 @@ export type ItemTypeAttributes = {
|
|
|
4099
4118
|
*/
|
|
4100
4119
|
export type ItemTypeRelationships = {
|
|
4101
4120
|
/**
|
|
4102
|
-
* The
|
|
4121
|
+
* The record instance related to this model. This relationship only applies to single-instance models, not block models
|
|
4103
4122
|
*/
|
|
4104
4123
|
singleton_item: {
|
|
4105
4124
|
data: ItemData | null;
|
|
4106
4125
|
};
|
|
4107
4126
|
/**
|
|
4108
|
-
* The list of
|
|
4127
|
+
* The list of fields for this model/block model
|
|
4109
4128
|
*/
|
|
4110
4129
|
fields: {
|
|
4111
4130
|
data: FieldData[];
|
|
4112
4131
|
};
|
|
4113
4132
|
/**
|
|
4114
|
-
* The list of
|
|
4133
|
+
* The list of fieldsets for this model/block model
|
|
4115
4134
|
*/
|
|
4116
4135
|
fieldsets: {
|
|
4117
4136
|
data: FieldsetData[];
|
|
@@ -4129,25 +4148,25 @@ export type ItemTypeRelationships = {
|
|
|
4129
4148
|
data: FieldData | null;
|
|
4130
4149
|
};
|
|
4131
4150
|
/**
|
|
4132
|
-
* The field to use as fallback title for SEO purposes
|
|
4151
|
+
* The field to use as fallback title for SEO purposes. This relationship does not apply to block models
|
|
4133
4152
|
*/
|
|
4134
4153
|
title_field: {
|
|
4135
4154
|
data: FieldData | null;
|
|
4136
4155
|
};
|
|
4137
4156
|
/**
|
|
4138
|
-
* The field to use as fallback image for SEO purposes
|
|
4157
|
+
* The field to use as fallback image for SEO purposes. This relationship does not apply to block models
|
|
4139
4158
|
*/
|
|
4140
4159
|
image_preview_field: {
|
|
4141
4160
|
data: FieldData | null;
|
|
4142
4161
|
};
|
|
4143
4162
|
/**
|
|
4144
|
-
* The field to use as fallback description for SEO purposes
|
|
4163
|
+
* The field to use as fallback description for SEO purposes. This relationship does not apply to block models
|
|
4145
4164
|
*/
|
|
4146
4165
|
excerpt_field: {
|
|
4147
4166
|
data: FieldData | null;
|
|
4148
4167
|
};
|
|
4149
4168
|
/**
|
|
4150
|
-
* The field upon which the collection is sorted
|
|
4169
|
+
* The field upon which the collection is sorted. This relationship does not apply to block models
|
|
4151
4170
|
*/
|
|
4152
4171
|
ordering_field: {
|
|
4153
4172
|
data: FieldData | null;
|
|
@@ -4200,14 +4219,14 @@ export type WorkflowData = {
|
|
|
4200
4219
|
id: WorkflowIdentity;
|
|
4201
4220
|
};
|
|
4202
4221
|
/**
|
|
4203
|
-
* Meta information regarding the
|
|
4222
|
+
* Meta information regarding the model/block model
|
|
4204
4223
|
*
|
|
4205
4224
|
* This interface was referenced by `ItemType`'s JSON-Schema
|
|
4206
4225
|
* via the `definition` "meta".
|
|
4207
4226
|
*/
|
|
4208
4227
|
export type ItemTypeMeta = {
|
|
4209
4228
|
/**
|
|
4210
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4229
|
+
* 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
|
|
4211
4230
|
*/
|
|
4212
4231
|
has_singleton_item: boolean;
|
|
4213
4232
|
};
|
|
@@ -4224,15 +4243,15 @@ export type ItemTypeCreateSchema = {
|
|
|
4224
4243
|
*/
|
|
4225
4244
|
attributes: {
|
|
4226
4245
|
/**
|
|
4227
|
-
* Name of the model
|
|
4246
|
+
* Name of the model/block model
|
|
4228
4247
|
*/
|
|
4229
4248
|
name: string;
|
|
4230
4249
|
/**
|
|
4231
|
-
* API key of the model
|
|
4250
|
+
* API key of the model/block model
|
|
4232
4251
|
*/
|
|
4233
4252
|
api_key: string;
|
|
4234
4253
|
/**
|
|
4235
|
-
* Whether the model is single-instance or not
|
|
4254
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4236
4255
|
*/
|
|
4237
4256
|
singleton?: boolean;
|
|
4238
4257
|
/**
|
|
@@ -4240,31 +4259,31 @@ export type ItemTypeCreateSchema = {
|
|
|
4240
4259
|
*/
|
|
4241
4260
|
all_locales_required?: boolean;
|
|
4242
4261
|
/**
|
|
4243
|
-
* Whether editors can sort records via drag & drop or not
|
|
4262
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4244
4263
|
*/
|
|
4245
4264
|
sortable?: boolean;
|
|
4246
4265
|
/**
|
|
4247
|
-
* Whether this
|
|
4266
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4248
4267
|
*/
|
|
4249
4268
|
modular_block?: boolean;
|
|
4250
4269
|
/**
|
|
4251
|
-
* Whether draft/published mode is active or not
|
|
4270
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4252
4271
|
*/
|
|
4253
4272
|
draft_mode_active?: boolean;
|
|
4254
4273
|
/**
|
|
4255
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4274
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4256
4275
|
*/
|
|
4257
4276
|
draft_saving_active?: boolean;
|
|
4258
4277
|
/**
|
|
4259
|
-
* Whether editors can organize records in a tree or not
|
|
4278
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4260
4279
|
*/
|
|
4261
4280
|
tree?: boolean;
|
|
4262
4281
|
/**
|
|
4263
|
-
* If an ordering field is set, this
|
|
4282
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4264
4283
|
*/
|
|
4265
4284
|
ordering_direction?: null | 'asc' | 'desc';
|
|
4266
4285
|
/**
|
|
4267
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4286
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4268
4287
|
*/
|
|
4269
4288
|
ordering_meta?: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4270
4289
|
/**
|
|
@@ -4272,21 +4291,21 @@ export type ItemTypeCreateSchema = {
|
|
|
4272
4291
|
*/
|
|
4273
4292
|
collection_appeareance?: 'compact' | 'table';
|
|
4274
4293
|
/**
|
|
4275
|
-
* The way the model collection should be presented to the editors
|
|
4294
|
+
* The way the model/block model collection should be presented to the editors
|
|
4276
4295
|
*/
|
|
4277
4296
|
collection_appearance?: 'compact' | 'table';
|
|
4278
4297
|
/**
|
|
4279
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4298
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4280
4299
|
*/
|
|
4281
4300
|
hint?: string | null;
|
|
4282
4301
|
/**
|
|
4283
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4302
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4284
4303
|
*/
|
|
4285
4304
|
inverse_relationships_enabled?: boolean;
|
|
4286
4305
|
};
|
|
4287
4306
|
relationships?: {
|
|
4288
4307
|
/**
|
|
4289
|
-
* The field upon which the collection is sorted
|
|
4308
|
+
* The field upon which the collection is sorted. This relationship does not apply to block models
|
|
4290
4309
|
*/
|
|
4291
4310
|
ordering_field?: {
|
|
4292
4311
|
data: FieldData | null;
|
|
@@ -4304,19 +4323,19 @@ export type ItemTypeCreateSchema = {
|
|
|
4304
4323
|
data: FieldData | null;
|
|
4305
4324
|
};
|
|
4306
4325
|
/**
|
|
4307
|
-
* The field to use as fallback title for SEO purposes
|
|
4326
|
+
* The field to use as fallback title for SEO purposes. This relationship does not apply to block models
|
|
4308
4327
|
*/
|
|
4309
4328
|
title_field?: {
|
|
4310
4329
|
data: FieldData | null;
|
|
4311
4330
|
};
|
|
4312
4331
|
/**
|
|
4313
|
-
* The field to use as fallback image for SEO purposes
|
|
4332
|
+
* The field to use as fallback image for SEO purposes. This relationship does not apply to block models
|
|
4314
4333
|
*/
|
|
4315
4334
|
image_preview_field?: {
|
|
4316
4335
|
data: FieldData | null;
|
|
4317
4336
|
};
|
|
4318
4337
|
/**
|
|
4319
|
-
* The field to use as fallback description for SEO purposes
|
|
4338
|
+
* The field to use as fallback description for SEO purposes. This relationship does not apply to block models
|
|
4320
4339
|
*/
|
|
4321
4340
|
excerpt_field?: {
|
|
4322
4341
|
data: FieldData | null;
|
|
@@ -4351,11 +4370,11 @@ export type ItemTypeUpdateSchema = {
|
|
|
4351
4370
|
*/
|
|
4352
4371
|
attributes?: {
|
|
4353
4372
|
/**
|
|
4354
|
-
* Name of the model
|
|
4373
|
+
* Name of the model/block model
|
|
4355
4374
|
*/
|
|
4356
4375
|
name?: string;
|
|
4357
4376
|
/**
|
|
4358
|
-
* API key of the model
|
|
4377
|
+
* API key of the model/block model
|
|
4359
4378
|
*/
|
|
4360
4379
|
api_key?: string;
|
|
4361
4380
|
/**
|
|
@@ -4363,11 +4382,11 @@ export type ItemTypeUpdateSchema = {
|
|
|
4363
4382
|
*/
|
|
4364
4383
|
collection_appeareance?: 'compact' | 'table';
|
|
4365
4384
|
/**
|
|
4366
|
-
* The way the model collection should be presented to the editors
|
|
4385
|
+
* The way the model/block model collection should be presented to the editors
|
|
4367
4386
|
*/
|
|
4368
4387
|
collection_appearance?: 'compact' | 'table';
|
|
4369
4388
|
/**
|
|
4370
|
-
* Whether the model is single-instance or not
|
|
4389
|
+
* Whether the model is single-instance or not. This property only applies to models, not block models
|
|
4371
4390
|
*/
|
|
4372
4391
|
singleton?: boolean;
|
|
4373
4392
|
/**
|
|
@@ -4375,49 +4394,49 @@ export type ItemTypeUpdateSchema = {
|
|
|
4375
4394
|
*/
|
|
4376
4395
|
all_locales_required?: boolean;
|
|
4377
4396
|
/**
|
|
4378
|
-
* Whether editors can sort records via drag & drop or not
|
|
4397
|
+
* Whether editors can sort records via drag & drop or not. Must be false for block models
|
|
4379
4398
|
*/
|
|
4380
4399
|
sortable?: boolean;
|
|
4381
4400
|
/**
|
|
4382
|
-
* Whether this
|
|
4401
|
+
* Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
|
|
4383
4402
|
*/
|
|
4384
4403
|
modular_block?: boolean;
|
|
4385
4404
|
/**
|
|
4386
|
-
* Whether draft/published mode is active or not
|
|
4405
|
+
* Whether draft/published mode is active or not. Must be false for block models
|
|
4387
4406
|
*/
|
|
4388
4407
|
draft_mode_active?: boolean;
|
|
4389
4408
|
/**
|
|
4390
|
-
* Whether draft records can be saved without satisfying the validations or not
|
|
4409
|
+
* Whether draft records can be saved without satisfying the validations or not. Must be false for block models
|
|
4391
4410
|
*/
|
|
4392
4411
|
draft_saving_active?: boolean;
|
|
4393
4412
|
/**
|
|
4394
|
-
* Whether editors can organize records in a tree or not
|
|
4413
|
+
* Whether editors can organize records in a tree or not. Must be false for block models
|
|
4395
4414
|
*/
|
|
4396
4415
|
tree?: boolean;
|
|
4397
4416
|
/**
|
|
4398
|
-
* If an ordering field is set, this
|
|
4417
|
+
* If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
|
|
4399
4418
|
*/
|
|
4400
4419
|
ordering_direction?: null | 'asc' | 'desc';
|
|
4401
4420
|
/**
|
|
4402
|
-
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
|
|
4421
|
+
* Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
|
|
4403
4422
|
*/
|
|
4404
4423
|
ordering_meta?: null | 'created_at' | 'updated_at' | 'first_published_at' | 'published_at';
|
|
4405
4424
|
/**
|
|
4406
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4425
|
+
* 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
|
|
4407
4426
|
*/
|
|
4408
4427
|
has_singleton_item?: boolean;
|
|
4409
4428
|
/**
|
|
4410
|
-
* A hint shown to editors to help them understand the purpose of this model/block
|
|
4429
|
+
* A hint shown to editors to help them understand the purpose of this model/block model
|
|
4411
4430
|
*/
|
|
4412
4431
|
hint?: string | null;
|
|
4413
4432
|
/**
|
|
4414
|
-
* Whether inverse relationships fields are expressed in GraphQL or not
|
|
4433
|
+
* Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
|
|
4415
4434
|
*/
|
|
4416
4435
|
inverse_relationships_enabled?: boolean;
|
|
4417
4436
|
};
|
|
4418
4437
|
relationships?: {
|
|
4419
4438
|
/**
|
|
4420
|
-
* The field upon which the collection is sorted
|
|
4439
|
+
* The field upon which the collection is sorted. This relationship does not apply to block models
|
|
4421
4440
|
*/
|
|
4422
4441
|
ordering_field?: {
|
|
4423
4442
|
data: FieldData | null;
|
|
@@ -4435,19 +4454,19 @@ export type ItemTypeUpdateSchema = {
|
|
|
4435
4454
|
data: FieldData | null;
|
|
4436
4455
|
};
|
|
4437
4456
|
/**
|
|
4438
|
-
* The field to use as fallback title for SEO purposes
|
|
4457
|
+
* The field to use as fallback title for SEO purposes. This relationship does not apply to block models
|
|
4439
4458
|
*/
|
|
4440
4459
|
title_field?: {
|
|
4441
4460
|
data: FieldData | null;
|
|
4442
4461
|
};
|
|
4443
4462
|
/**
|
|
4444
|
-
* The field to use as fallback image for SEO purposes
|
|
4463
|
+
* The field to use as fallback image for SEO purposes. This relationship does not apply to block models
|
|
4445
4464
|
*/
|
|
4446
4465
|
image_preview_field?: {
|
|
4447
4466
|
data: FieldData | null;
|
|
4448
4467
|
};
|
|
4449
4468
|
/**
|
|
4450
|
-
* The field to use as fallback description for SEO purposes
|
|
4469
|
+
* The field to use as fallback description for SEO purposes. This relationship does not apply to block models
|
|
4451
4470
|
*/
|
|
4452
4471
|
excerpt_field?: {
|
|
4453
4472
|
data: FieldData | null;
|
|
@@ -4461,7 +4480,7 @@ export type ItemTypeUpdateSchema = {
|
|
|
4461
4480
|
};
|
|
4462
4481
|
meta?: {
|
|
4463
4482
|
/**
|
|
4464
|
-
* If this model is single-instance, this tells the single-instance record has already been created or not
|
|
4483
|
+
* 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
|
|
4465
4484
|
*/
|
|
4466
4485
|
has_singleton_item?: boolean;
|
|
4467
4486
|
};
|
|
@@ -4,7 +4,7 @@ import type * as RawApiTypes from '../RawApiTypes';
|
|
|
4
4
|
export default class ItemType extends BaseResource {
|
|
5
5
|
static readonly TYPE: "item_type";
|
|
6
6
|
/**
|
|
7
|
-
* Create a new model
|
|
7
|
+
* Create a new model/block model
|
|
8
8
|
*
|
|
9
9
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
10
10
|
*
|
|
@@ -13,7 +13,7 @@ export default class ItemType extends BaseResource {
|
|
|
13
13
|
*/
|
|
14
14
|
create(body: ApiTypes.ItemTypeCreateSchema, queryParams?: ApiTypes.ItemTypeCreateHrefSchema): Promise<ApiTypes.ItemType>;
|
|
15
15
|
/**
|
|
16
|
-
* Create a new model
|
|
16
|
+
* Create a new model/block model
|
|
17
17
|
*
|
|
18
18
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
19
19
|
*
|
|
@@ -22,7 +22,7 @@ export default class ItemType extends BaseResource {
|
|
|
22
22
|
*/
|
|
23
23
|
rawCreate(body: RawApiTypes.ItemTypeCreateSchema, queryParams?: RawApiTypes.ItemTypeCreateHrefSchema): Promise<RawApiTypes.ItemTypeCreateTargetSchema>;
|
|
24
24
|
/**
|
|
25
|
-
* Update a model
|
|
25
|
+
* Update a model/block model
|
|
26
26
|
*
|
|
27
27
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
28
28
|
*
|
|
@@ -31,7 +31,7 @@ export default class ItemType extends BaseResource {
|
|
|
31
31
|
*/
|
|
32
32
|
update(itemTypeId: string | ApiTypes.ItemTypeData, body: ApiTypes.ItemTypeUpdateSchema): Promise<ApiTypes.ItemType>;
|
|
33
33
|
/**
|
|
34
|
-
* Update a model
|
|
34
|
+
* Update a model/block model
|
|
35
35
|
*
|
|
36
36
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
37
37
|
*
|
|
@@ -40,7 +40,7 @@ export default class ItemType extends BaseResource {
|
|
|
40
40
|
*/
|
|
41
41
|
rawUpdate(itemTypeId: string, body: RawApiTypes.ItemTypeUpdateSchema): Promise<RawApiTypes.ItemTypeUpdateJobSchema>;
|
|
42
42
|
/**
|
|
43
|
-
* List all models
|
|
43
|
+
* List all models/block models
|
|
44
44
|
*
|
|
45
45
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
46
46
|
*
|
|
@@ -49,7 +49,7 @@ export default class ItemType extends BaseResource {
|
|
|
49
49
|
*/
|
|
50
50
|
list(): Promise<ApiTypes.ItemTypeInstancesTargetSchema>;
|
|
51
51
|
/**
|
|
52
|
-
* List all models
|
|
52
|
+
* List all models/block models
|
|
53
53
|
*
|
|
54
54
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
55
55
|
*
|
|
@@ -58,7 +58,7 @@ export default class ItemType extends BaseResource {
|
|
|
58
58
|
*/
|
|
59
59
|
rawList(): Promise<RawApiTypes.ItemTypeInstancesTargetSchema>;
|
|
60
60
|
/**
|
|
61
|
-
* Retrieve a model
|
|
61
|
+
* Retrieve a model/block model
|
|
62
62
|
*
|
|
63
63
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
64
64
|
*
|
|
@@ -67,7 +67,7 @@ export default class ItemType extends BaseResource {
|
|
|
67
67
|
*/
|
|
68
68
|
find(itemTypeId: string | ApiTypes.ItemTypeData): Promise<ApiTypes.ItemType>;
|
|
69
69
|
/**
|
|
70
|
-
* Retrieve a model
|
|
70
|
+
* Retrieve a model/block model
|
|
71
71
|
*
|
|
72
72
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
73
73
|
*
|
|
@@ -76,7 +76,7 @@ export default class ItemType extends BaseResource {
|
|
|
76
76
|
*/
|
|
77
77
|
rawFind(itemTypeId: string): Promise<RawApiTypes.ItemTypeSelfTargetSchema>;
|
|
78
78
|
/**
|
|
79
|
-
* Duplicate model
|
|
79
|
+
* Duplicate model/block model
|
|
80
80
|
*
|
|
81
81
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
82
82
|
*
|
|
@@ -85,7 +85,7 @@ export default class ItemType extends BaseResource {
|
|
|
85
85
|
*/
|
|
86
86
|
duplicate(itemTypeId: string | ApiTypes.ItemTypeData): Promise<ApiTypes.ItemType>;
|
|
87
87
|
/**
|
|
88
|
-
* Duplicate model
|
|
88
|
+
* Duplicate model/block model
|
|
89
89
|
*
|
|
90
90
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
91
91
|
*
|
|
@@ -94,7 +94,7 @@ export default class ItemType extends BaseResource {
|
|
|
94
94
|
*/
|
|
95
95
|
rawDuplicate(itemTypeId: string): Promise<RawApiTypes.ItemTypeDuplicateTargetSchema>;
|
|
96
96
|
/**
|
|
97
|
-
* Delete a model
|
|
97
|
+
* Delete a model/block model
|
|
98
98
|
*
|
|
99
99
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
100
100
|
*
|
|
@@ -103,7 +103,7 @@ export default class ItemType extends BaseResource {
|
|
|
103
103
|
*/
|
|
104
104
|
destroy(itemTypeId: string | ApiTypes.ItemTypeData, queryParams?: ApiTypes.ItemTypeDestroyHrefSchema): Promise<ApiTypes.ItemType>;
|
|
105
105
|
/**
|
|
106
|
-
* Delete a model
|
|
106
|
+
* Delete a model/block model
|
|
107
107
|
*
|
|
108
108
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
109
109
|
*
|
|
@@ -2,7 +2,7 @@ import * as Utils from '@datocms/rest-client-utils';
|
|
|
2
2
|
import BaseResource from '../../BaseResource';
|
|
3
3
|
export default class ItemType extends BaseResource {
|
|
4
4
|
/**
|
|
5
|
-
* Create a new model
|
|
5
|
+
* Create a new model/block model
|
|
6
6
|
*
|
|
7
7
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
8
8
|
*
|
|
@@ -41,7 +41,7 @@ export default class ItemType extends BaseResource {
|
|
|
41
41
|
}), queryParams).then((body) => Utils.deserializeResponseBody(body));
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Create a new model
|
|
44
|
+
* Create a new model/block model
|
|
45
45
|
*
|
|
46
46
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
47
47
|
*
|
|
@@ -57,7 +57,7 @@ export default class ItemType extends BaseResource {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
* Update a model
|
|
60
|
+
* Update a model/block model
|
|
61
61
|
*
|
|
62
62
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
63
63
|
*
|
|
@@ -98,7 +98,7 @@ export default class ItemType extends BaseResource {
|
|
|
98
98
|
})).then((body) => Utils.deserializeResponseBody(body));
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* Update a model
|
|
101
|
+
* Update a model/block model
|
|
102
102
|
*
|
|
103
103
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
104
104
|
*
|
|
@@ -113,7 +113,7 @@ export default class ItemType extends BaseResource {
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* List all models
|
|
116
|
+
* List all models/block models
|
|
117
117
|
*
|
|
118
118
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
119
119
|
*
|
|
@@ -124,7 +124,7 @@ export default class ItemType extends BaseResource {
|
|
|
124
124
|
return this.rawList().then((body) => Utils.deserializeResponseBody(body));
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* List all models
|
|
127
|
+
* List all models/block models
|
|
128
128
|
*
|
|
129
129
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
130
130
|
*
|
|
@@ -138,7 +138,7 @@ export default class ItemType extends BaseResource {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
* Retrieve a model
|
|
141
|
+
* Retrieve a model/block model
|
|
142
142
|
*
|
|
143
143
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
144
144
|
*
|
|
@@ -149,7 +149,7 @@ export default class ItemType extends BaseResource {
|
|
|
149
149
|
return this.rawFind(Utils.toId(itemTypeId)).then((body) => Utils.deserializeResponseBody(body));
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* Retrieve a model
|
|
152
|
+
* Retrieve a model/block model
|
|
153
153
|
*
|
|
154
154
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
155
155
|
*
|
|
@@ -163,7 +163,7 @@ export default class ItemType extends BaseResource {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
* Duplicate model
|
|
166
|
+
* Duplicate model/block model
|
|
167
167
|
*
|
|
168
168
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
169
169
|
*
|
|
@@ -174,7 +174,7 @@ export default class ItemType extends BaseResource {
|
|
|
174
174
|
return this.rawDuplicate(Utils.toId(itemTypeId)).then((body) => Utils.deserializeResponseBody(body));
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* Duplicate model
|
|
177
|
+
* Duplicate model/block model
|
|
178
178
|
*
|
|
179
179
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
180
180
|
*
|
|
@@ -188,7 +188,7 @@ export default class ItemType extends BaseResource {
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
|
-
* Delete a model
|
|
191
|
+
* Delete a model/block model
|
|
192
192
|
*
|
|
193
193
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
194
194
|
*
|
|
@@ -199,7 +199,7 @@ export default class ItemType extends BaseResource {
|
|
|
199
199
|
return this.rawDestroy(Utils.toId(itemTypeId), queryParams).then((body) => Utils.deserializeResponseBody(body));
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
|
-
* Delete a model
|
|
202
|
+
* Delete a model/block model
|
|
203
203
|
*
|
|
204
204
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
205
205
|
*
|
|
@@ -433,7 +433,7 @@ export class SchemaRepository {
|
|
|
433
433
|
include: 'item_types,item_types.fields',
|
|
434
434
|
});
|
|
435
435
|
if (!included) {
|
|
436
|
-
|
|
436
|
+
return;
|
|
437
437
|
}
|
|
438
438
|
const allItemTypes = included.filter((item) => item.type === 'item_type');
|
|
439
439
|
const allFields = included.filter((item) => item.type === 'field');
|