@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.
@@ -4728,7 +4728,26 @@ export type UploadCollectionUpdateSchema = {
4728
4728
  children?: UploadCollectionData[];
4729
4729
  };
4730
4730
  /**
4731
- * The way you define the kind of content you can edit inside your administrative area passes through the concept of Models, which are much like database tables. For backward-compatibility reasons, the API refers to models as "item types".
4731
+ * 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".
4732
+ *
4733
+ * ## Models
4734
+ *
4735
+ * 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.
4736
+ *
4737
+ * ## Block Models
4738
+ *
4739
+ * 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).
4740
+ *
4741
+ * ### Key differences:
4742
+ *
4743
+ * - **Models** create standalone records that can be referenced and have independent value
4744
+ * - **Block models** create blocks that only exist within parent records and cannot be referenced via link fields
4745
+ * - Block models defined in the library can be reused across different models
4746
+ * - When a record gets deleted, all the blocks it contains are deleted with it
4747
+ * - Blocks do not count towards your plan's records limit
4748
+ *
4749
+ * You can distinguish between models and block models using the `modular_block` attribute: `true` indicates a block model, `false` indicates a regular model.
4750
+ *
4732
4751
  *
4733
4752
  * This interface was referenced by `DatoApi`'s JSON-Schema
4734
4753
  * via the `definition` "item_type".
@@ -4737,11 +4756,11 @@ export type ItemType = {
4737
4756
  id: ItemTypeIdentity;
4738
4757
  type: ItemTypeType;
4739
4758
  /**
4740
- * Name of the model
4759
+ * Name of the model/block model
4741
4760
  */
4742
4761
  name: string;
4743
4762
  /**
4744
- * API key of the model
4763
+ * API key of the model/block model
4745
4764
  */
4746
4765
  api_key: string;
4747
4766
  /**
@@ -4749,11 +4768,11 @@ export type ItemType = {
4749
4768
  */
4750
4769
  collection_appeareance?: 'compact' | 'table';
4751
4770
  /**
4752
- * The way the model collection should be presented to the editors
4771
+ * The way the model/block model collection should be presented to the editors
4753
4772
  */
4754
4773
  collection_appearance: 'compact' | 'table';
4755
4774
  /**
4756
- * Whether the model is single-instance or not
4775
+ * Whether the model is single-instance or not. This property only applies to models, not block models
4757
4776
  */
4758
4777
  singleton: boolean;
4759
4778
  /**
@@ -4761,31 +4780,31 @@ export type ItemType = {
4761
4780
  */
4762
4781
  all_locales_required: boolean;
4763
4782
  /**
4764
- * Whether editors can sort records via drag & drop or not
4783
+ * Whether editors can sort records via drag & drop or not. Must be false for block models
4765
4784
  */
4766
4785
  sortable: boolean;
4767
4786
  /**
4768
- * Whether this model is a modular content block or not
4787
+ * Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
4769
4788
  */
4770
4789
  modular_block: boolean;
4771
4790
  /**
4772
- * Whether draft/published mode is active or not
4791
+ * Whether draft/published mode is active or not. Must be false for block models
4773
4792
  */
4774
4793
  draft_mode_active: boolean;
4775
4794
  /**
4776
- * Whether draft records can be saved without satisfying the validations or not
4795
+ * Whether draft records can be saved without satisfying the validations or not. Must be false for block models
4777
4796
  */
4778
4797
  draft_saving_active: boolean;
4779
4798
  /**
4780
- * Whether editors can organize records in a tree or not
4799
+ * Whether editors can organize records in a tree or not. Must be false for block models
4781
4800
  */
4782
4801
  tree: boolean;
4783
4802
  /**
4784
- * If an ordering field is set, this fields specify the sorting direction
4803
+ * If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
4785
4804
  */
4786
4805
  ordering_direction: null | 'asc' | 'desc';
4787
4806
  /**
4788
- * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
4807
+ * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
4789
4808
  */
4790
4809
  ordering_meta:
4791
4810
  | null
@@ -4794,15 +4813,15 @@ export type ItemType = {
4794
4813
  | 'first_published_at'
4795
4814
  | 'published_at';
4796
4815
  /**
4797
- * If this model is single-instance, this tells the single-instance record has already been created or not
4816
+ * 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
4798
4817
  */
4799
4818
  has_singleton_item: boolean;
4800
4819
  /**
4801
- * A hint shown to editors to help them understand the purpose of this model/block
4820
+ * A hint shown to editors to help them understand the purpose of this model/block model
4802
4821
  */
4803
4822
  hint: string | null;
4804
4823
  /**
4805
- * Whether inverse relationships fields are expressed in GraphQL or not
4824
+ * Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
4806
4825
  */
4807
4826
  inverse_relationships_enabled: boolean;
4808
4827
  singleton_item: ItemData | null;
@@ -4863,14 +4882,14 @@ export type WorkflowData = {
4863
4882
  id: WorkflowIdentity;
4864
4883
  };
4865
4884
  /**
4866
- * Meta information regarding the item type
4885
+ * Meta information regarding the model/block model
4867
4886
  *
4868
4887
  * This interface was referenced by `ItemType`'s JSON-Schema
4869
4888
  * via the `definition` "meta".
4870
4889
  */
4871
4890
  export type ItemTypeMeta = {
4872
4891
  /**
4873
- * If this model is single-instance, this tells the single-instance record has already been created or not
4892
+ * 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
4874
4893
  */
4875
4894
  has_singleton_item: boolean;
4876
4895
  };
@@ -4882,11 +4901,11 @@ export type ItemTypeMeta = {
4882
4901
  */
4883
4902
  export type ItemTypeAttributes = {
4884
4903
  /**
4885
- * Name of the model
4904
+ * Name of the model/block model
4886
4905
  */
4887
4906
  name: string;
4888
4907
  /**
4889
- * API key of the model
4908
+ * API key of the model/block model
4890
4909
  */
4891
4910
  api_key: string;
4892
4911
  /**
@@ -4894,11 +4913,11 @@ export type ItemTypeAttributes = {
4894
4913
  */
4895
4914
  collection_appeareance?: 'compact' | 'table';
4896
4915
  /**
4897
- * The way the model collection should be presented to the editors
4916
+ * The way the model/block model collection should be presented to the editors
4898
4917
  */
4899
4918
  collection_appearance: 'compact' | 'table';
4900
4919
  /**
4901
- * Whether the model is single-instance or not
4920
+ * Whether the model is single-instance or not. This property only applies to models, not block models
4902
4921
  */
4903
4922
  singleton: boolean;
4904
4923
  /**
@@ -4906,31 +4925,31 @@ export type ItemTypeAttributes = {
4906
4925
  */
4907
4926
  all_locales_required: boolean;
4908
4927
  /**
4909
- * Whether editors can sort records via drag & drop or not
4928
+ * Whether editors can sort records via drag & drop or not. Must be false for block models
4910
4929
  */
4911
4930
  sortable: boolean;
4912
4931
  /**
4913
- * Whether this model is a modular content block or not
4932
+ * Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
4914
4933
  */
4915
4934
  modular_block: boolean;
4916
4935
  /**
4917
- * Whether draft/published mode is active or not
4936
+ * Whether draft/published mode is active or not. Must be false for block models
4918
4937
  */
4919
4938
  draft_mode_active: boolean;
4920
4939
  /**
4921
- * Whether draft records can be saved without satisfying the validations or not
4940
+ * Whether draft records can be saved without satisfying the validations or not. Must be false for block models
4922
4941
  */
4923
4942
  draft_saving_active: boolean;
4924
4943
  /**
4925
- * Whether editors can organize records in a tree or not
4944
+ * Whether editors can organize records in a tree or not. Must be false for block models
4926
4945
  */
4927
4946
  tree: boolean;
4928
4947
  /**
4929
- * If an ordering field is set, this fields specify the sorting direction
4948
+ * If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
4930
4949
  */
4931
4950
  ordering_direction: null | 'asc' | 'desc';
4932
4951
  /**
4933
- * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
4952
+ * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
4934
4953
  */
4935
4954
  ordering_meta:
4936
4955
  | null
@@ -4939,15 +4958,15 @@ export type ItemTypeAttributes = {
4939
4958
  | 'first_published_at'
4940
4959
  | 'published_at';
4941
4960
  /**
4942
- * If this model is single-instance, this tells the single-instance record has already been created or not
4961
+ * 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
4943
4962
  */
4944
4963
  has_singleton_item: boolean;
4945
4964
  /**
4946
- * A hint shown to editors to help them understand the purpose of this model/block
4965
+ * A hint shown to editors to help them understand the purpose of this model/block model
4947
4966
  */
4948
4967
  hint: string | null;
4949
4968
  /**
4950
- * Whether inverse relationships fields are expressed in GraphQL or not
4969
+ * Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
4951
4970
  */
4952
4971
  inverse_relationships_enabled: boolean;
4953
4972
  };
@@ -4977,15 +4996,15 @@ export type ItemTypeCreateSchema = {
4977
4996
  id?: ItemTypeIdentity;
4978
4997
  type?: ItemTypeType;
4979
4998
  /**
4980
- * Name of the model
4999
+ * Name of the model/block model
4981
5000
  */
4982
5001
  name: string;
4983
5002
  /**
4984
- * API key of the model
5003
+ * API key of the model/block model
4985
5004
  */
4986
5005
  api_key: string;
4987
5006
  /**
4988
- * Whether the model is single-instance or not
5007
+ * Whether the model is single-instance or not. This property only applies to models, not block models
4989
5008
  */
4990
5009
  singleton?: boolean;
4991
5010
  /**
@@ -4993,31 +5012,31 @@ export type ItemTypeCreateSchema = {
4993
5012
  */
4994
5013
  all_locales_required?: boolean;
4995
5014
  /**
4996
- * Whether editors can sort records via drag & drop or not
5015
+ * Whether editors can sort records via drag & drop or not. Must be false for block models
4997
5016
  */
4998
5017
  sortable?: boolean;
4999
5018
  /**
5000
- * Whether this model is a modular content block or not
5019
+ * Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
5001
5020
  */
5002
5021
  modular_block?: boolean;
5003
5022
  /**
5004
- * Whether draft/published mode is active or not
5023
+ * Whether draft/published mode is active or not. Must be false for block models
5005
5024
  */
5006
5025
  draft_mode_active?: boolean;
5007
5026
  /**
5008
- * Whether draft records can be saved without satisfying the validations or not
5027
+ * Whether draft records can be saved without satisfying the validations or not. Must be false for block models
5009
5028
  */
5010
5029
  draft_saving_active?: boolean;
5011
5030
  /**
5012
- * Whether editors can organize records in a tree or not
5031
+ * Whether editors can organize records in a tree or not. Must be false for block models
5013
5032
  */
5014
5033
  tree?: boolean;
5015
5034
  /**
5016
- * If an ordering field is set, this fields specify the sorting direction
5035
+ * If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
5017
5036
  */
5018
5037
  ordering_direction?: null | 'asc' | 'desc';
5019
5038
  /**
5020
- * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
5039
+ * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
5021
5040
  */
5022
5041
  ordering_meta?:
5023
5042
  | null
@@ -5030,15 +5049,15 @@ export type ItemTypeCreateSchema = {
5030
5049
  */
5031
5050
  collection_appeareance?: 'compact' | 'table';
5032
5051
  /**
5033
- * The way the model collection should be presented to the editors
5052
+ * The way the model/block model collection should be presented to the editors
5034
5053
  */
5035
5054
  collection_appearance?: 'compact' | 'table';
5036
5055
  /**
5037
- * A hint shown to editors to help them understand the purpose of this model/block
5056
+ * A hint shown to editors to help them understand the purpose of this model/block model
5038
5057
  */
5039
5058
  hint?: string | null;
5040
5059
  /**
5041
- * Whether inverse relationships fields are expressed in GraphQL or not
5060
+ * Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
5042
5061
  */
5043
5062
  inverse_relationships_enabled?: boolean;
5044
5063
  ordering_field?: FieldData | null;
@@ -5057,11 +5076,11 @@ export type ItemTypeUpdateSchema = {
5057
5076
  id?: ItemTypeIdentity;
5058
5077
  type?: ItemTypeType;
5059
5078
  /**
5060
- * Name of the model
5079
+ * Name of the model/block model
5061
5080
  */
5062
5081
  name?: string;
5063
5082
  /**
5064
- * API key of the model
5083
+ * API key of the model/block model
5065
5084
  */
5066
5085
  api_key?: string;
5067
5086
  /**
@@ -5069,11 +5088,11 @@ export type ItemTypeUpdateSchema = {
5069
5088
  */
5070
5089
  collection_appeareance?: 'compact' | 'table';
5071
5090
  /**
5072
- * The way the model collection should be presented to the editors
5091
+ * The way the model/block model collection should be presented to the editors
5073
5092
  */
5074
5093
  collection_appearance?: 'compact' | 'table';
5075
5094
  /**
5076
- * Whether the model is single-instance or not
5095
+ * Whether the model is single-instance or not. This property only applies to models, not block models
5077
5096
  */
5078
5097
  singleton?: boolean;
5079
5098
  /**
@@ -5081,31 +5100,31 @@ export type ItemTypeUpdateSchema = {
5081
5100
  */
5082
5101
  all_locales_required?: boolean;
5083
5102
  /**
5084
- * Whether editors can sort records via drag & drop or not
5103
+ * Whether editors can sort records via drag & drop or not. Must be false for block models
5085
5104
  */
5086
5105
  sortable?: boolean;
5087
5106
  /**
5088
- * Whether this model is a modular content block or not
5107
+ * Whether this is a block model or not. Block models define structures that can be embedded inside records, while regular models create standalone records
5089
5108
  */
5090
5109
  modular_block?: boolean;
5091
5110
  /**
5092
- * Whether draft/published mode is active or not
5111
+ * Whether draft/published mode is active or not. Must be false for block models
5093
5112
  */
5094
5113
  draft_mode_active?: boolean;
5095
5114
  /**
5096
- * Whether draft records can be saved without satisfying the validations or not
5115
+ * Whether draft records can be saved without satisfying the validations or not. Must be false for block models
5097
5116
  */
5098
5117
  draft_saving_active?: boolean;
5099
5118
  /**
5100
- * Whether editors can organize records in a tree or not
5119
+ * Whether editors can organize records in a tree or not. Must be false for block models
5101
5120
  */
5102
5121
  tree?: boolean;
5103
5122
  /**
5104
- * If an ordering field is set, this fields specify the sorting direction
5123
+ * If an ordering field is set, this field specifies the sorting direction. This property does not apply to block models
5105
5124
  */
5106
5125
  ordering_direction?: null | 'asc' | 'desc';
5107
5126
  /**
5108
- * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field
5127
+ * Specifies the model's sorting method. Cannot be set in concurrency with ordering_field. This property does not apply to block models
5109
5128
  */
5110
5129
  ordering_meta?:
5111
5130
  | null
@@ -5114,15 +5133,15 @@ export type ItemTypeUpdateSchema = {
5114
5133
  | 'first_published_at'
5115
5134
  | 'published_at';
5116
5135
  /**
5117
- * If this model is single-instance, this tells the single-instance record has already been created or not
5136
+ * 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
5118
5137
  */
5119
5138
  has_singleton_item?: boolean;
5120
5139
  /**
5121
- * A hint shown to editors to help them understand the purpose of this model/block
5140
+ * A hint shown to editors to help them understand the purpose of this model/block model
5122
5141
  */
5123
5142
  hint?: string | null;
5124
5143
  /**
5125
- * Whether inverse relationships fields are expressed in GraphQL or not
5144
+ * Whether inverse relationships fields are expressed in GraphQL or not. Must be false for block models
5126
5145
  */
5127
5146
  inverse_relationships_enabled?: boolean;
5128
5147
  ordering_field?: FieldData | null;
@@ -5134,7 +5153,7 @@ export type ItemTypeUpdateSchema = {
5134
5153
  workflow?: WorkflowData | null;
5135
5154
  meta?: {
5136
5155
  /**
5137
- * If this model is single-instance, this tells the single-instance record has already been created or not
5156
+ * 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
5138
5157
  */
5139
5158
  has_singleton_item?: boolean;
5140
5159
  };
@@ -147,7 +147,7 @@ export class Client {
147
147
  ...this.config,
148
148
  ...options,
149
149
  logFn: this.config.logFn || console.log,
150
- userAgent: '@datocms/cma-client v5.1.27',
150
+ userAgent: '@datocms/cma-client v5.1.29',
151
151
  baseUrl: this.baseUrl,
152
152
  preCallStack: new Error().stack,
153
153
  extraHeaders: {