@datocms/cma-client 5.1.10 → 5.1.12

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.
Files changed (253) hide show
  1. package/README.md +569 -0
  2. package/dist/cjs/fieldTypes/boolean.js +2 -2
  3. package/dist/cjs/fieldTypes/boolean.js.map +1 -1
  4. package/dist/cjs/fieldTypes/color.js +2 -2
  5. package/dist/cjs/fieldTypes/color.js.map +1 -1
  6. package/dist/cjs/fieldTypes/date.js +2 -3
  7. package/dist/cjs/fieldTypes/date.js.map +1 -1
  8. package/dist/cjs/fieldTypes/date_time.js +2 -2
  9. package/dist/cjs/fieldTypes/date_time.js.map +1 -1
  10. package/dist/cjs/fieldTypes/file.js +33 -5
  11. package/dist/cjs/fieldTypes/file.js.map +1 -1
  12. package/dist/cjs/fieldTypes/float.js +2 -2
  13. package/dist/cjs/fieldTypes/float.js.map +1 -1
  14. package/dist/cjs/fieldTypes/gallery.js +20 -5
  15. package/dist/cjs/fieldTypes/gallery.js.map +1 -1
  16. package/dist/cjs/fieldTypes/index.js +2 -2
  17. package/dist/cjs/fieldTypes/index.js.map +1 -1
  18. package/dist/cjs/fieldTypes/integer.js +2 -2
  19. package/dist/cjs/fieldTypes/integer.js.map +1 -1
  20. package/dist/cjs/fieldTypes/json.js +2 -3
  21. package/dist/cjs/fieldTypes/json.js.map +1 -1
  22. package/dist/cjs/fieldTypes/lat_lon.js +2 -2
  23. package/dist/cjs/fieldTypes/lat_lon.js.map +1 -1
  24. package/dist/cjs/fieldTypes/link.js +4 -4
  25. package/dist/cjs/fieldTypes/link.js.map +1 -1
  26. package/dist/cjs/fieldTypes/links.js +5 -3
  27. package/dist/cjs/fieldTypes/links.js.map +1 -1
  28. package/dist/cjs/fieldTypes/rich_text.js +18 -18
  29. package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
  30. package/dist/cjs/fieldTypes/schema.js +3 -0
  31. package/dist/cjs/fieldTypes/schema.js.map +1 -0
  32. package/dist/cjs/fieldTypes/seo.js +2 -3
  33. package/dist/cjs/fieldTypes/seo.js.map +1 -1
  34. package/dist/cjs/fieldTypes/single_block.js +20 -19
  35. package/dist/cjs/fieldTypes/single_block.js.map +1 -1
  36. package/dist/cjs/fieldTypes/slug.js +2 -3
  37. package/dist/cjs/fieldTypes/slug.js.map +1 -1
  38. package/dist/cjs/fieldTypes/string.js +2 -2
  39. package/dist/cjs/fieldTypes/string.js.map +1 -1
  40. package/dist/cjs/fieldTypes/structured_text.js +17 -18
  41. package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
  42. package/dist/cjs/fieldTypes/text.js +2 -3
  43. package/dist/cjs/fieldTypes/text.js.map +1 -1
  44. package/dist/cjs/fieldTypes/video.js +2 -2
  45. package/dist/cjs/fieldTypes/video.js.map +1 -1
  46. package/dist/cjs/generated/Client.js +1 -1
  47. package/dist/cjs/generated/resources/Item.js.map +1 -1
  48. package/dist/cjs/generated/resources/ScheduledPublication.js.map +1 -1
  49. package/dist/cjs/generated/resources/ScheduledUnpublishing.js.map +1 -1
  50. package/dist/cjs/generated/resources/Upload.js.map +1 -1
  51. package/dist/cjs/index.js +5 -4
  52. package/dist/cjs/index.js.map +1 -1
  53. package/dist/cjs/utilities/buildBlockRecord.js +1 -45
  54. package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
  55. package/dist/cjs/utilities/duplicateBlockRecord.js +49 -0
  56. package/dist/cjs/utilities/duplicateBlockRecord.js.map +1 -0
  57. package/dist/cjs/utilities/inspectItem.js +427 -0
  58. package/dist/cjs/utilities/inspectItem.js.map +1 -0
  59. package/dist/cjs/utilities/{blocks.js → nonRecursiveBlocks.js} +60 -234
  60. package/dist/cjs/utilities/nonRecursiveBlocks.js.map +1 -0
  61. package/dist/cjs/utilities/{fieldValue.js → normalizedFieldValues.js} +53 -41
  62. package/dist/cjs/utilities/normalizedFieldValues.js.map +1 -0
  63. package/dist/cjs/utilities/recursiveBlocks.js +73 -92
  64. package/dist/cjs/utilities/recursiveBlocks.js.map +1 -1
  65. package/dist/cjs/utilities/schemaRepository.js +2 -2
  66. package/dist/esm/fieldTypes/boolean.d.ts +1 -1
  67. package/dist/esm/fieldTypes/boolean.js +2 -2
  68. package/dist/esm/fieldTypes/boolean.js.map +1 -1
  69. package/dist/esm/fieldTypes/color.d.ts +1 -1
  70. package/dist/esm/fieldTypes/color.js +2 -2
  71. package/dist/esm/fieldTypes/color.js.map +1 -1
  72. package/dist/esm/fieldTypes/date.d.ts +1 -1
  73. package/dist/esm/fieldTypes/date.js +2 -3
  74. package/dist/esm/fieldTypes/date.js.map +1 -1
  75. package/dist/esm/fieldTypes/date_time.d.ts +1 -1
  76. package/dist/esm/fieldTypes/date_time.js +2 -2
  77. package/dist/esm/fieldTypes/date_time.js.map +1 -1
  78. package/dist/esm/fieldTypes/file.d.ts +68 -1
  79. package/dist/esm/fieldTypes/file.js +29 -3
  80. package/dist/esm/fieldTypes/file.js.map +1 -1
  81. package/dist/esm/fieldTypes/float.d.ts +1 -1
  82. package/dist/esm/fieldTypes/float.js +2 -2
  83. package/dist/esm/fieldTypes/float.js.map +1 -1
  84. package/dist/esm/fieldTypes/gallery.d.ts +27 -11
  85. package/dist/esm/fieldTypes/gallery.js +17 -4
  86. package/dist/esm/fieldTypes/gallery.js.map +1 -1
  87. package/dist/esm/fieldTypes/index.d.ts +2 -2
  88. package/dist/esm/fieldTypes/index.js +2 -2
  89. package/dist/esm/fieldTypes/index.js.map +1 -1
  90. package/dist/esm/fieldTypes/integer.d.ts +1 -1
  91. package/dist/esm/fieldTypes/integer.js +2 -2
  92. package/dist/esm/fieldTypes/integer.js.map +1 -1
  93. package/dist/esm/fieldTypes/json.d.ts +1 -1
  94. package/dist/esm/fieldTypes/json.js +2 -3
  95. package/dist/esm/fieldTypes/json.js.map +1 -1
  96. package/dist/esm/fieldTypes/lat_lon.d.ts +1 -1
  97. package/dist/esm/fieldTypes/lat_lon.js +2 -2
  98. package/dist/esm/fieldTypes/lat_lon.js.map +1 -1
  99. package/dist/esm/fieldTypes/link.d.ts +1 -1
  100. package/dist/esm/fieldTypes/link.js +4 -4
  101. package/dist/esm/fieldTypes/link.js.map +1 -1
  102. package/dist/esm/fieldTypes/links.d.ts +1 -1
  103. package/dist/esm/fieldTypes/links.js +5 -3
  104. package/dist/esm/fieldTypes/links.js.map +1 -1
  105. package/dist/esm/fieldTypes/rich_text.d.ts +9 -10
  106. package/dist/esm/fieldTypes/rich_text.js +13 -13
  107. package/dist/esm/fieldTypes/rich_text.js.map +1 -1
  108. package/dist/esm/fieldTypes/schema.d.ts +59 -0
  109. package/dist/esm/fieldTypes/schema.js +2 -0
  110. package/dist/esm/fieldTypes/schema.js.map +1 -0
  111. package/dist/esm/fieldTypes/seo.d.ts +1 -1
  112. package/dist/esm/fieldTypes/seo.js +2 -3
  113. package/dist/esm/fieldTypes/seo.js.map +1 -1
  114. package/dist/esm/fieldTypes/single_block.d.ts +31 -16
  115. package/dist/esm/fieldTypes/single_block.js +15 -14
  116. package/dist/esm/fieldTypes/single_block.js.map +1 -1
  117. package/dist/esm/fieldTypes/slug.d.ts +1 -1
  118. package/dist/esm/fieldTypes/slug.js +2 -3
  119. package/dist/esm/fieldTypes/slug.js.map +1 -1
  120. package/dist/esm/fieldTypes/string.d.ts +1 -1
  121. package/dist/esm/fieldTypes/string.js +2 -2
  122. package/dist/esm/fieldTypes/string.js.map +1 -1
  123. package/dist/esm/fieldTypes/structured_text.d.ts +15 -16
  124. package/dist/esm/fieldTypes/structured_text.js +12 -13
  125. package/dist/esm/fieldTypes/structured_text.js.map +1 -1
  126. package/dist/esm/fieldTypes/text.d.ts +1 -1
  127. package/dist/esm/fieldTypes/text.js +2 -3
  128. package/dist/esm/fieldTypes/text.js.map +1 -1
  129. package/dist/esm/fieldTypes/video.d.ts +1 -1
  130. package/dist/esm/fieldTypes/video.js +2 -2
  131. package/dist/esm/fieldTypes/video.js.map +1 -1
  132. package/dist/esm/generated/ApiTypes.d.ts +90 -980
  133. package/dist/esm/generated/Client.js +1 -1
  134. package/dist/esm/generated/RawApiTypes.d.ts +156 -999
  135. package/dist/esm/generated/resources/Field.d.ts +200 -200
  136. package/dist/esm/generated/resources/Item.d.ts +34 -34
  137. package/dist/esm/generated/resources/Item.js.map +1 -1
  138. package/dist/esm/generated/resources/ItemVersion.d.ts +3 -1
  139. package/dist/esm/generated/resources/ScheduledPublication.d.ts +3 -3
  140. package/dist/esm/generated/resources/ScheduledPublication.js.map +1 -1
  141. package/dist/esm/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  142. package/dist/esm/generated/resources/ScheduledUnpublishing.js.map +1 -1
  143. package/dist/esm/generated/resources/Upload.d.ts +6 -6
  144. package/dist/esm/generated/resources/Upload.js.map +1 -1
  145. package/dist/esm/index.d.ts +5 -4
  146. package/dist/esm/index.js +5 -4
  147. package/dist/esm/index.js.map +1 -1
  148. package/dist/esm/utilities/buildBlockRecord.d.ts +3 -5
  149. package/dist/esm/utilities/buildBlockRecord.js +0 -43
  150. package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
  151. package/dist/esm/utilities/duplicateBlockRecord.d.ts +6 -0
  152. package/dist/esm/utilities/duplicateBlockRecord.js +45 -0
  153. package/dist/esm/utilities/duplicateBlockRecord.js.map +1 -0
  154. package/dist/esm/utilities/inspectItem.d.ts +8 -0
  155. package/dist/esm/utilities/inspectItem.js +400 -0
  156. package/dist/esm/utilities/inspectItem.js.map +1 -0
  157. package/dist/esm/utilities/itemDefinition.d.ts +45 -23
  158. package/dist/esm/utilities/nonRecursiveBlocks.d.ts +114 -0
  159. package/dist/esm/utilities/{blocks.js → nonRecursiveBlocks.js} +52 -220
  160. package/dist/esm/utilities/nonRecursiveBlocks.js.map +1 -0
  161. package/dist/{types/utilities/fieldValue.d.ts → esm/utilities/normalizedFieldValues.d.ts} +15 -14
  162. package/dist/esm/utilities/{fieldValue.js → normalizedFieldValues.js} +39 -28
  163. package/dist/esm/utilities/normalizedFieldValues.js.map +1 -0
  164. package/dist/esm/utilities/recursiveBlocks.d.ts +124 -11
  165. package/dist/esm/utilities/recursiveBlocks.js +65 -84
  166. package/dist/esm/utilities/recursiveBlocks.js.map +1 -1
  167. package/dist/esm/utilities/schemaRepository.d.ts +2 -2
  168. package/dist/esm/utilities/schemaRepository.js +2 -2
  169. package/dist/types/fieldTypes/boolean.d.ts +1 -1
  170. package/dist/types/fieldTypes/color.d.ts +1 -1
  171. package/dist/types/fieldTypes/date.d.ts +1 -1
  172. package/dist/types/fieldTypes/date_time.d.ts +1 -1
  173. package/dist/types/fieldTypes/file.d.ts +68 -1
  174. package/dist/types/fieldTypes/float.d.ts +1 -1
  175. package/dist/types/fieldTypes/gallery.d.ts +27 -11
  176. package/dist/types/fieldTypes/index.d.ts +2 -2
  177. package/dist/types/fieldTypes/integer.d.ts +1 -1
  178. package/dist/types/fieldTypes/json.d.ts +1 -1
  179. package/dist/types/fieldTypes/lat_lon.d.ts +1 -1
  180. package/dist/types/fieldTypes/link.d.ts +1 -1
  181. package/dist/types/fieldTypes/links.d.ts +1 -1
  182. package/dist/types/fieldTypes/rich_text.d.ts +9 -10
  183. package/dist/types/fieldTypes/schema.d.ts +59 -0
  184. package/dist/types/fieldTypes/seo.d.ts +1 -1
  185. package/dist/types/fieldTypes/single_block.d.ts +31 -16
  186. package/dist/types/fieldTypes/slug.d.ts +1 -1
  187. package/dist/types/fieldTypes/string.d.ts +1 -1
  188. package/dist/types/fieldTypes/structured_text.d.ts +15 -16
  189. package/dist/types/fieldTypes/text.d.ts +1 -1
  190. package/dist/types/fieldTypes/video.d.ts +1 -1
  191. package/dist/types/generated/ApiTypes.d.ts +90 -980
  192. package/dist/types/generated/RawApiTypes.d.ts +156 -999
  193. package/dist/types/generated/resources/Field.d.ts +200 -200
  194. package/dist/types/generated/resources/Item.d.ts +34 -34
  195. package/dist/types/generated/resources/ItemVersion.d.ts +3 -1
  196. package/dist/types/generated/resources/ScheduledPublication.d.ts +3 -3
  197. package/dist/types/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  198. package/dist/types/generated/resources/Upload.d.ts +6 -6
  199. package/dist/types/index.d.ts +5 -4
  200. package/dist/types/utilities/buildBlockRecord.d.ts +3 -5
  201. package/dist/types/utilities/duplicateBlockRecord.d.ts +6 -0
  202. package/dist/types/utilities/inspectItem.d.ts +8 -0
  203. package/dist/types/utilities/itemDefinition.d.ts +45 -23
  204. package/dist/types/utilities/nonRecursiveBlocks.d.ts +114 -0
  205. package/dist/{esm/utilities/fieldValue.d.ts → types/utilities/normalizedFieldValues.d.ts} +15 -14
  206. package/dist/types/utilities/recursiveBlocks.d.ts +124 -11
  207. package/dist/types/utilities/schemaRepository.d.ts +2 -2
  208. package/package.json +4 -4
  209. package/src/fieldTypes/boolean.ts +5 -3
  210. package/src/fieldTypes/color.ts +5 -3
  211. package/src/fieldTypes/date.ts +5 -4
  212. package/src/fieldTypes/date_time.ts +5 -3
  213. package/src/fieldTypes/file.ts +98 -4
  214. package/src/fieldTypes/float.ts +5 -3
  215. package/src/fieldTypes/gallery.ts +53 -20
  216. package/src/fieldTypes/index.ts +2 -3
  217. package/src/fieldTypes/integer.ts +5 -3
  218. package/src/fieldTypes/json.ts +5 -4
  219. package/src/fieldTypes/lat_lon.ts +5 -3
  220. package/src/fieldTypes/link.ts +7 -5
  221. package/src/fieldTypes/links.ts +8 -4
  222. package/src/fieldTypes/rich_text.ts +33 -31
  223. package/src/fieldTypes/schema.ts +657 -0
  224. package/src/fieldTypes/seo.ts +5 -4
  225. package/src/fieldTypes/single_block.ts +71 -46
  226. package/src/fieldTypes/slug.ts +5 -4
  227. package/src/fieldTypes/string.ts +5 -3
  228. package/src/fieldTypes/structured_text.ts +64 -58
  229. package/src/fieldTypes/text.ts +5 -4
  230. package/src/fieldTypes/video.ts +5 -3
  231. package/src/generated/ApiTypes.ts +217 -1880
  232. package/src/generated/Client.ts +1 -1
  233. package/src/generated/RawApiTypes.ts +272 -2113
  234. package/src/generated/resources/Item.ts +93 -187
  235. package/src/generated/resources/ScheduledPublication.ts +4 -15
  236. package/src/generated/resources/ScheduledUnpublishing.ts +4 -15
  237. package/src/generated/resources/Upload.ts +9 -32
  238. package/src/index.ts +5 -4
  239. package/src/utilities/buildBlockRecord.ts +4 -59
  240. package/src/utilities/duplicateBlockRecord.ts +52 -0
  241. package/src/utilities/inspectItem.ts +602 -0
  242. package/src/utilities/itemDefinition.ts +130 -92
  243. package/src/utilities/nonRecursiveBlocks.ts +406 -0
  244. package/src/utilities/{fieldValue.ts → normalizedFieldValues.ts} +70 -30
  245. package/src/utilities/recursiveBlocks.ts +484 -204
  246. package/src/utilities/schemaRepository.ts +2 -2
  247. package/dist/cjs/utilities/blocks.js.map +0 -1
  248. package/dist/cjs/utilities/fieldValue.js.map +0 -1
  249. package/dist/esm/utilities/blocks.d.ts +0 -180
  250. package/dist/esm/utilities/blocks.js.map +0 -1
  251. package/dist/esm/utilities/fieldValue.js.map +0 -1
  252. package/dist/types/utilities/blocks.d.ts +0 -180
  253. package/src/utilities/blocks.ts +0 -626
@@ -1,98 +1,36 @@
1
- import type { BooleanFieldAppearance, BooleanFieldValidators, BooleanFieldValue, ColorFieldAppearance, ColorFieldValidators, ColorFieldValue, DateFieldAppearance, DateFieldValidators, DateFieldValue, DateTimeFieldAppearance, DateTimeFieldValidators, DateTimeFieldValue, FileFieldAppearance, FileFieldValidators, FloatFieldAppearance, FloatFieldValidators, FloatFieldValue, GalleryFieldAppearance, GalleryFieldValidators, IntegerFieldAppearance, IntegerFieldValidators, IntegerFieldValue, JsonFieldAppearance, JsonFieldValidators, JsonFieldValue, LatLonFieldAppearance, LatLonFieldValidators, LatLonFieldValue, LinkFieldAppearance, LinkFieldValidators, LinksFieldAppearance, LinksFieldValidators, RichTextFieldAppearance, RichTextFieldValidators, SeoFieldAppearance, SeoFieldValidators, SingleBlockFieldAppearance, SingleBlockFieldValidators, SlugFieldAppearance, SlugFieldValidators, StringFieldAppearance, StringFieldValidators, StringFieldValue, StructuredTextFieldAppearance, StructuredTextFieldValidators, TextFieldAppearance, TextFieldValidators, TextFieldValue, VideoFieldAppearance, VideoFieldValidators } from '../fieldTypes';
2
- import type { ItemDefinition } from '../utilities/itemDefinition';
3
- /**
4
- * Enhanced appearance configuration with field-specific types and addon support
5
- */
6
- type FieldAppearanceConfig<TAppearance> = TAppearance & Omit<RawFieldAttributes['appearance'], keyof TAppearance>;
7
- /**
8
- * Base field configuration for attributes (non-localized), extending the original RawApiTypes
9
- */
10
- type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
11
- field_type: FieldType;
12
- localized: false;
13
- default_value: FieldValue;
14
- validators: FieldValidators;
15
- appearance: FieldAppearanceConfig<FieldAppearance>;
16
- };
17
- /**
18
- * Base field configuration for attributes (localized), extending the original RawApiTypes
19
- */
20
- type LocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
21
- field_type: FieldType;
22
- localized: true;
23
- default_value: FieldValue | Record<string, FieldValue>;
24
- validators: FieldValidators;
25
- appearance: FieldAppearanceConfig<FieldAppearance>;
26
- };
27
- /**
28
- * Union of localized and non-localized field configurations for attributes
29
- */
30
- type FieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = NonLocalizedFieldAttributesForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance> | LocalizedFieldAttributesForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance>;
31
- type GenericFieldAttributes<SourceType> = FieldAttributesForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldAttributesForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldAttributesForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldAttributesForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldAttributesForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldAttributesForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldAttributesForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldAttributesForFieldType<SourceType, 'lat_lon', LatLonFieldValue, LatLonFieldValidators, LatLonFieldAppearance> | FieldAttributesForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldAttributesForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldAttributesForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldAttributesForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldAttributesForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldAttributesForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldAttributesForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
32
- export type FieldAttributes = GenericFieldAttributes<RawFieldAttributes>;
33
- export type Field = RawField;
34
- type LocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
35
- field_type: FieldType;
36
- localized: true;
37
- default_value?: Record<string, FieldValue>;
38
- validators?: FieldValidators;
39
- appearance?: FieldAppearanceConfig<FieldAppearance>;
40
- };
41
- type NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
42
- field_type: FieldType;
43
- localized?: false;
44
- default_value?: FieldValue;
45
- validators?: FieldValidators;
46
- appearance?: FieldAppearanceConfig<FieldAppearance>;
47
- };
48
- type FieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = LocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance> | NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance>;
49
- type FieldCreateConfig<SourceType> = FieldCreateConfigForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'lat_lon', LatLonFieldValue, LatLonFieldValidators, LatLonFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
50
- export type FieldCreateSchema = Omit<RawFieldCreateSchema, 'data'> & {
51
- data: Omit<RawFieldCreateSchema['data'], 'attributes'> & {
52
- attributes: FieldCreateConfig<RawFieldCreateSchema['data']['attributes']>;
1
+ import type { FieldCreateConfig, FieldUpdateConfig, GenericFieldAttributes } from '../fieldTypes/schema';
2
+ import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest } from '../utilities/itemDefinition';
3
+ export type Field = FieldStableShell;
4
+ export type FieldAttributes = GenericFieldAttributes<FieldAttributesStableShell>;
5
+ export type FieldCreateSchema = Omit<FieldCreateSchemaStableShell, 'data'> & {
6
+ data: Omit<FieldCreateSchemaStableShell['data'], 'attributes'> & {
7
+ attributes: FieldCreateConfig<FieldCreateSchemaStableShell['data']['attributes']>;
53
8
  };
54
9
  };
55
- /**
56
- * Helper type to conditionally handle default values based on localization for field updates
57
- */
58
- type FieldUpdateDefaultValue<T> = T | Record<string, T> | undefined;
59
- type FieldUpdateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance'> & {
60
- field_type?: FieldType;
61
- default_value?: FieldUpdateDefaultValue<FieldValue>;
62
- validators?: FieldValidators;
63
- appearance?: FieldAppearanceConfig<FieldAppearance>;
64
- };
65
- type FieldUpdateConfig<SourceType> = FieldUpdateConfigForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'lat_lon', LatLonFieldValue, LatLonFieldValidators, LatLonFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldUpdateConfigForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
66
- export type FieldUpdateSchema = Omit<RawFieldUpdateSchema, 'data'> & {
67
- data: Omit<RawFieldUpdateSchema['data'], 'attributes'> & {
68
- attributes: FieldUpdateConfig<RawFieldUpdateSchema['data']['attributes']>;
10
+ export type FieldUpdateSchema = Omit<FieldUpdateSchemaStableShell, 'data'> & {
11
+ data: Omit<FieldUpdateSchemaStableShell['data'], 'attributes'> & {
12
+ attributes: FieldUpdateConfig<FieldUpdateSchemaStableShell['data']['attributes']>;
69
13
  };
70
14
  };
71
- type ForceItemTypeDataId<ItemTypeId> = Omit<ItemTypeData, 'id'> & {
72
- id: ItemTypeId;
73
- };
74
- type ForceItemTypeData<T, ItemTypeId> = {
75
- [K in keyof T]: T[K] extends ItemTypeData ? ForceItemTypeDataId<ItemTypeId> : T[K] extends object ? ForceItemTypeData<T[K], ItemTypeId> : T[K];
76
- };
77
- type ForceItemTypeId<T, ItemTypeId> = ForceItemTypeData<T, ItemTypeId> & {
78
- /** Useful for type narrowing */
79
- __itemTypeId?: ItemTypeId;
80
- };
81
- export type ApplyItemDefinitionToSchema<Schema, D extends ItemDefinition = ItemDefinition> = D extends any ? ForceItemTypeId<Schema, D['itemTypeId']> & {
82
- attributes: D['fields'];
83
- } : never;
84
- export type Item<D extends ItemDefinition = ItemDefinition> = ApplyItemDefinitionToSchema<RawItem, D>;
85
- export type ItemValidateExistingSchema<D extends ItemDefinition = ItemDefinition> = {
86
- data: ApplyItemDefinitionToSchema<RawItemValidateExistingSchema['data'], D>;
87
- };
88
- export type ItemValidateNewSchema<D extends ItemDefinition = ItemDefinition> = {
89
- data: ApplyItemDefinitionToSchema<RawItemValidateNewSchema['data'], D>;
15
+ export type ItemTypeData<D extends ItemTypeDefinition = ItemTypeDefinition> = {
16
+ type: ItemTypeType;
17
+ id: D extends ItemTypeDefinition ? D['itemTypeId'] : ItemTypeIdentity;
90
18
  };
91
- export type ItemCreateSchema<D extends ItemDefinition = ItemDefinition> = {
92
- data: ApplyItemDefinitionToSchema<RawItemCreateSchema['data'], D>;
19
+ export type Item<D extends ItemTypeDefinition = ItemTypeDefinition> = {
20
+ __itemTypeId?: D['itemTypeId'];
21
+ type: ItemType1;
22
+ id: ItemIdentity;
23
+ relationships: ItemRelationships<D>;
24
+ meta: ItemMeta;
25
+ attributes: ToItemAttributes<D>;
93
26
  };
94
- export type ItemUpdateSchema<D extends ItemDefinition = ItemDefinition> = {
95
- data: ApplyItemDefinitionToSchema<RawItemUpdateSchema['data'], D>;
27
+ export type ItemInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = {
28
+ __itemTypeId?: D['itemTypeId'];
29
+ type: ItemType1;
30
+ id: ItemIdentity;
31
+ relationships: ItemRelationships<D>;
32
+ meta: ItemMeta;
33
+ attributes: ToItemAttributesInNestedResponse<D>;
96
34
  };
97
35
  /**
98
36
  * This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND.
@@ -460,17 +398,17 @@ export type UploadCollectionInstancesHrefSchema = {
460
398
  };
461
399
  };
462
400
  /**
463
- * This interface was referenced by `Item<D>`'s JSON-Schema
401
+ * This interface was referenced by `Item`'s JSON-Schema
464
402
  * via the `definition` "type".
465
403
  */
466
404
  export type ItemType1 = 'item';
467
405
  /**
468
406
  * RFC 4122 UUID of record expressed in URL-safe base64 format
469
407
  *
470
- * This interface was referenced by `Item<D>`'s JSON-Schema
408
+ * This interface was referenced by `Item`'s JSON-Schema
471
409
  * via the `definition` "identity".
472
410
  *
473
- * This interface was referenced by `Item<D>`'s JSON-Schema
411
+ * This interface was referenced by `Item`'s JSON-Schema
474
412
  * via the `definition` "id".
475
413
  */
476
414
  export type ItemIdentity = string;
@@ -683,7 +621,7 @@ export type BuildEventInstancesHrefSchema = {
683
621
  [k: string]: unknown;
684
622
  };
685
623
  /**
686
- * This interface was referenced by `Item<D>`'s JSON-Schema
624
+ * This interface was referenced by `Item`'s JSON-Schema
687
625
  * via the `instances.hrefSchema` link.
688
626
  */
689
627
  export type ItemInstancesHrefSchema = {
@@ -747,7 +685,7 @@ export type ItemInstancesHrefSchema = {
747
685
  [k: string]: unknown;
748
686
  };
749
687
  /**
750
- * This interface was referenced by `Item<D>`'s JSON-Schema
688
+ * This interface was referenced by `Item`'s JSON-Schema
751
689
  * via the `references.hrefSchema` link.
752
690
  */
753
691
  export type ItemReferencesHrefSchema = {
@@ -762,7 +700,7 @@ export type ItemReferencesHrefSchema = {
762
700
  [k: string]: unknown;
763
701
  };
764
702
  /**
765
- * This interface was referenced by `Item<D>`'s JSON-Schema
703
+ * This interface was referenced by `Item`'s JSON-Schema
766
704
  * via the `self.hrefSchema` link.
767
705
  */
768
706
  export type ItemSelfHrefSchema = {
@@ -861,7 +799,7 @@ export type ItemVersionInstancesHrefSchema = {
861
799
  [k: string]: unknown;
862
800
  };
863
801
  /**
864
- * This interface was referenced by `Item<D>`'s JSON-Schema
802
+ * This interface was referenced by `Item`'s JSON-Schema
865
803
  * via the `publish.schema` link.
866
804
  */
867
805
  export type ItemPublishSchema = {
@@ -883,7 +821,7 @@ export type ItemPublishSchema = {
883
821
  };
884
822
  } | null;
885
823
  /**
886
- * This interface was referenced by `Item<D>`'s JSON-Schema
824
+ * This interface was referenced by `Item`'s JSON-Schema
887
825
  * via the `publish.hrefSchema` link.
888
826
  */
889
827
  export type ItemPublishHrefSchema = {
@@ -894,7 +832,7 @@ export type ItemPublishHrefSchema = {
894
832
  [k: string]: unknown;
895
833
  };
896
834
  /**
897
- * This interface was referenced by `Item<D>`'s JSON-Schema
835
+ * This interface was referenced by `Item`'s JSON-Schema
898
836
  * via the `unpublish.schema` link.
899
837
  */
900
838
  export type ItemUnpublishSchema = {
@@ -909,7 +847,7 @@ export type ItemUnpublishSchema = {
909
847
  };
910
848
  } | null;
911
849
  /**
912
- * This interface was referenced by `Item<D>`'s JSON-Schema
850
+ * This interface was referenced by `Item`'s JSON-Schema
913
851
  * via the `unpublish.hrefSchema` link.
914
852
  */
915
853
  export type ItemUnpublishHrefSchema = {
@@ -1519,60 +1457,6 @@ export type SiteSelfHrefSchema = {
1519
1457
  include?: string;
1520
1458
  [k: string]: unknown;
1521
1459
  };
1522
- export type DatoApi = {
1523
- role?: Role;
1524
- user?: User;
1525
- sso_user?: SsoUser;
1526
- audit_log_event?: AuditLogEvent;
1527
- account?: Account;
1528
- organization?: Organization;
1529
- site_plan?: SitePlan;
1530
- menu_item?: MenuItem;
1531
- schema_menu_item?: SchemaMenuItem;
1532
- upload_collection?: UploadCollection;
1533
- item_type?: ItemType;
1534
- field?: Field;
1535
- fieldset?: Fieldset;
1536
- job?: Job;
1537
- session?: Session;
1538
- access_token?: AccessToken;
1539
- plugin?: Plugin;
1540
- job_result?: JobResult;
1541
- subscription_limit?: SubscriptionLimit;
1542
- subscription_feature?: SubscriptionFeature;
1543
- build_event?: BuildEvent;
1544
- item?: Item;
1545
- item_current_vs_published_state?: ItemCurrentVsPublishedState;
1546
- item_version?: ItemVersion;
1547
- upload?: Upload;
1548
- upload_request?: UploadRequest;
1549
- upload_track?: UploadTrack;
1550
- scheduled_publication?: ScheduledPublication;
1551
- scheduled_unpublishing?: ScheduledUnpublishing;
1552
- search_result?: SearchResult;
1553
- environment?: Environment;
1554
- maintenance_mode?: MaintenanceMode;
1555
- webhook?: Webhook;
1556
- webhook_call?: WebhookCall;
1557
- build_trigger?: BuildTrigger;
1558
- item_type_filter?: ItemTypeFilter;
1559
- upload_filter?: UploadFilter;
1560
- site_invitation?: SiteInvitation;
1561
- editing_session?: EditingSession;
1562
- form_data?: FormData;
1563
- sso_group?: SsoGroup;
1564
- sso_settings?: SsoSettings;
1565
- emoji_suggestions?: EmojiSuggestions;
1566
- white_label_settings?: WhiteLabelSettings;
1567
- public_info?: PublicInfo;
1568
- daily_usage?: DailyUsage;
1569
- usage_counter?: UsageCounter;
1570
- upload_tag?: UploadTag;
1571
- upload_smart_tag?: UploadSmartTag;
1572
- site?: Site;
1573
- workflow?: Workflow;
1574
- [k: string]: unknown;
1575
- };
1576
1460
  /**
1577
1461
  * A Role represents a specific set of actions an editor (or an API token) can perform on your administrative area.
1578
1462
  *
@@ -3439,13 +3323,13 @@ export type MenuItemAttributes = {
3439
3323
  */
3440
3324
  export type MenuItemRelationships = {
3441
3325
  /**
3442
- * Item<D> type associated with the menu item
3326
+ * Item type associated with the menu item
3443
3327
  */
3444
3328
  item_type: {
3445
3329
  data: ItemTypeData | null;
3446
3330
  };
3447
3331
  /**
3448
- * Item<D> type filter associated with the menu item (to be used together with `item_type` relationship)
3332
+ * Item type filter associated with the menu item (to be used together with `item_type` relationship)
3449
3333
  */
3450
3334
  item_type_filter: {
3451
3335
  data: ItemTypeFilterData | null;
@@ -3463,16 +3347,6 @@ export type MenuItemRelationships = {
3463
3347
  data: MenuItemData[];
3464
3348
  };
3465
3349
  };
3466
- /**
3467
- * JSON API data
3468
- *
3469
- * This interface was referenced by `ItemType`'s JSON-Schema
3470
- * via the `definition` "data".
3471
- */
3472
- export type ItemTypeData = {
3473
- type: ItemTypeType;
3474
- id: ItemTypeIdentity;
3475
- };
3476
3350
  /**
3477
3351
  * JSON API data
3478
3352
  *
@@ -3524,13 +3398,13 @@ export type MenuItemCreateSchema = {
3524
3398
  };
3525
3399
  relationships?: {
3526
3400
  /**
3527
- * Item<D> type associated with the menu item
3401
+ * Item type associated with the menu item
3528
3402
  */
3529
3403
  item_type?: {
3530
3404
  data: ItemTypeData | null;
3531
3405
  };
3532
3406
  /**
3533
- * Item<D> type filter associated with the menu item (to be used together with `item_type` relationship)
3407
+ * Item type filter associated with the menu item (to be used together with `item_type` relationship)
3534
3408
  */
3535
3409
  item_type_filter?: {
3536
3410
  data: ItemTypeFilterData | null;
@@ -3582,13 +3456,13 @@ export type MenuItemUpdateSchema = {
3582
3456
  };
3583
3457
  relationships?: {
3584
3458
  /**
3585
- * Item<D> type associated with the menu item
3459
+ * Item type associated with the menu item
3586
3460
  */
3587
3461
  item_type?: {
3588
3462
  data: ItemTypeData | null;
3589
3463
  };
3590
3464
  /**
3591
- * Item<D> type filter associated with the menu item (to be used together with `item_type` relationship)
3465
+ * Item type filter associated with the menu item (to be used together with `item_type` relationship)
3592
3466
  */
3593
3467
  item_type_filter?: {
3594
3468
  data: ItemTypeFilterData | null;
@@ -3729,7 +3603,7 @@ export type SchemaMenuItemAttributes = {
3729
3603
  */
3730
3604
  export type SchemaMenuItemRelationships = {
3731
3605
  /**
3732
- * Item<D> type associated with the schema menu item
3606
+ * Item type associated with the schema menu item
3733
3607
  */
3734
3608
  item_type: {
3735
3609
  data: ItemTypeData | null;
@@ -3784,7 +3658,7 @@ export type SchemaMenuItemCreateSchema = {
3784
3658
  };
3785
3659
  relationships?: {
3786
3660
  /**
3787
- * Item<D> type associated with the menu item
3661
+ * Item type associated with the menu item
3788
3662
  */
3789
3663
  item_type?: {
3790
3664
  data: ItemTypeData | null;
@@ -3832,7 +3706,7 @@ export type SchemaMenuItemUpdateSchema = {
3832
3706
  };
3833
3707
  relationships?: {
3834
3708
  /**
3835
- * Item<D> type associated with the menu item
3709
+ * Item type associated with the menu item
3836
3710
  */
3837
3711
  item_type?: {
3838
3712
  data: ItemTypeData | null;
@@ -4279,7 +4153,7 @@ export type ItemTypeRelationships = {
4279
4153
  /**
4280
4154
  * JSON API data
4281
4155
  *
4282
- * This interface was referenced by `Item<D>`'s JSON-Schema
4156
+ * This interface was referenced by `Item`'s JSON-Schema
4283
4157
  * via the `definition` "data".
4284
4158
  */
4285
4159
  export type ItemData = {
@@ -5640,7 +5514,7 @@ export type ItemTypeReorderFieldsAndFieldsetsJobSchema = {
5640
5514
  * This interface was referenced by `DatoApi`'s JSON-Schema
5641
5515
  * via the `definition` "field".
5642
5516
  */
5643
- export type RawField = {
5517
+ export type FieldStableShell = {
5644
5518
  type: FieldType;
5645
5519
  id: FieldIdentity;
5646
5520
  attributes: FieldAttributes;
@@ -5652,7 +5526,7 @@ export type RawField = {
5652
5526
  * This interface was referenced by `Field`'s JSON-Schema
5653
5527
  * via the `definition` "attributes".
5654
5528
  */
5655
- export type RawFieldAttributes = {
5529
+ export type FieldAttributesStableShell = {
5656
5530
  /**
5657
5531
  * The label of the field
5658
5532
  */
@@ -5765,7 +5639,7 @@ export type FieldRelationships = {
5765
5639
  * This interface was referenced by `Field`'s JSON-Schema
5766
5640
  * via the `create.schema` link.
5767
5641
  */
5768
- export type RawFieldCreateSchema = {
5642
+ export type FieldCreateSchemaStableShell = {
5769
5643
  data: {
5770
5644
  id?: FieldIdentity;
5771
5645
  type: FieldType;
@@ -5893,7 +5767,7 @@ export type FieldCreateJobSchema = {
5893
5767
  * This interface was referenced by `Field`'s JSON-Schema
5894
5768
  * via the `update.schema` link.
5895
5769
  */
5896
- export type RawFieldUpdateSchema = {
5770
+ export type FieldUpdateSchemaStableShell = {
5897
5771
  data: {
5898
5772
  type: FieldType;
5899
5773
  id: FieldIdentity;
@@ -6749,775 +6623,18 @@ export type BuildEventInstancesTargetSchema = {
6749
6623
  export type BuildEventSelfTargetSchema = {
6750
6624
  data: BuildEvent;
6751
6625
  };
6752
- /**
6753
- * DatoCMS stores the individual pieces of content you create from a model as records (for backwards compatibility the API calls these `item`). The shape of a record’s attributes depends on the fields defined by that record’s model — see the [Object payload](#object-payload) section for the full object payload documentation.
6754
- *
6755
- * ```json
6756
- * // A simple record
6757
- * {
6758
- * "id": "A4gkL_8pTZmcyJ-IlIEd2w",
6759
- * "type": "item",
6760
- * "attributes": {
6761
- * "title": "My Blog Post",
6762
- * "publication_date": "2024-01-15"
6763
- * },
6764
- * "relationships": {
6765
- * "item_type": {
6766
- * "data": { "id": "BxZ9Y2aKQVeTnM4hP8wLpD", "type": "item_type" }
6767
- * }
6768
- * }
6769
- * }
6770
- * ```
6771
- *
6772
- * > [!PROTIP] 📘 New to content modeling?
6773
- * > Check out the [Content Modeling Guide](/docs/content-modelling) to understand how to design models, fields, and relationships before diving into API usage.
6774
- *
6775
- * ---
6776
- *
6777
- * ## Field types overview
6778
- *
6779
- * ###### Scalar fields
6780
- * These store basic data types (ie. strings, numbers, booleans):
6781
- *
6782
- * <details>
6783
- * <summary>Single-line string</summary>
6784
- *
6785
- * The field accepts `String` values or `null`.
6786
- *
6787
- * </details>
6788
- *
6789
- * <details>
6790
- * <summary>Slug</summary>
6791
- *
6792
- * The field accepts `String` values or `null`.
6793
- * </details>
6794
- *
6795
- * <details>
6796
- * <summary>Multi-line text</summary>
6797
- *
6798
- * The field accepts simple `String` values (can include newlines) or `null`
6799
- * </details>
6800
- *
6801
- * <details>
6802
- * <summary>Boolean</summary>
6803
- *
6804
- * The field accepts simple `Boolean` values or `null`.
6805
- * </details>
6806
- *
6807
- * <details>
6808
- * <summary>Integer</summary>
6809
- *
6810
- * The field accepts simple `Integer` values or `null`.
6811
- * </details>
6812
- *
6813
- * <details>
6814
- * <summary>Float</summary>
6815
- *
6816
- * The field accepts simple `Float` values or `null`.
6817
- *
6818
- * </details>
6819
- *
6820
- * <details>
6821
- * <summary>Date</summary>
6822
- *
6823
- * The field accepts `String` values in ISO 8601 date format (ie. `"2015-12-29"`) or `null`.
6824
- *
6825
- * </details>
6826
- *
6827
- * <details>
6828
- * <summary>Date time</summary>
6829
- *
6830
- * The field accepts `String` values in ISO 8601 date-time format (ie. `"2020-04-17T16:34:31.981+01:00"`) or `null`.
6831
- *
6832
- * If you're on [legacy timezone management](/product-updates/improved-timezone-management), remember that when sending an ISO8601 datetime you should keep in mind that the system will ignore any provided timezone, and will use the project's timezone instead.
6833
- * </details>
6834
- *
6835
- * <details>
6836
- * <summary>JSON</summary>
6837
- *
6838
- * The field accepts `String` values that are valid JSON or `null`.
6839
- *
6840
- * **Note**: Must be a JSON-serialized string, not a JavaScript object!
6841
- *
6842
- * </details>
6843
- *
6844
- * ###### Object Fields
6845
- * These require structured objects:
6846
- *
6847
- * <details>
6848
- * <summary>Color</summary>
6849
- *
6850
- * The field accepts an object with the following properties, or `null`:
6851
- *
6852
- * | Property | Required | Type |
6853
- * | -------- | -------- | --------------------------- |
6854
- * | `red` | ✅ | `Integer` between 0 and 255 |
6855
- * | `green` | ✅ | `Integer` between 0 and 255 |
6856
- * | `blue` | ✅ | `Integer` between 0 and 255 |
6857
- * | `alpha` | ✅ | `Integer` between 0 and 255 |
6858
- *
6859
- * </details>
6860
- *
6861
- *
6862
- * <details>
6863
- * <summary>Location</summary>
6864
- *
6865
- * The field accepts an object with the following properties, or `null`:
6866
- *
6867
- * | Property | Required | Type |
6868
- * | ----------- | -------- | ----------------------------- |
6869
- * | `latitude` | ✅ | `Float` between -90.0 to 90 |
6870
- * | `longitude` | ✅ | `Float` between -180.0 to 180 |
6871
- *
6872
- * </details>
6873
- *
6874
- * <details>
6875
- * <summary>SEO</summary>
6876
- *
6877
- * The field accepts an object with the following properties, or `null`:
6878
- *
6879
- * | Property | Required | Type | Description |
6880
- * | -------------- | -------- | ------------------------------------ | ----------------------------------------------- |
6881
- * | `title` | | `String` | Title meta tag (max. 320 characters) |
6882
- * | `description` | | `String` | Description meta tag (max. 320 characters) |
6883
- * | `image` | | `Upload ID` | Asset to be used for social shares |
6884
- * | `twitter_card` | | `"summary"`, `"summary_large_image"` | Type of Twitter card to use |
6885
- * | `no_index` | | `Boolean` | Whether the noindex meta tag should be returned |
6886
- *
6887
- * </details>
6888
- *
6889
- * <details>
6890
- * <summary>External video</summary>
6891
- *
6892
- * The field accepts an object with the following properties, or `null`:
6893
- *
6894
- * | Property | Required | Type | Description | Example |
6895
- * | --------------- | -------- | ------------------------------------ | -------------------------------------------------- | ---------------------------------------------------- |
6896
- * | `provider` | ✅ | `"youtube"`, `"vimeo"`, `"facebook"` | External video provider | `"youtube"` |
6897
- * | `provider_uid` | ✅ | `String` | Unique identifier of the video within the provider | `"vUdGBEb1i9g"` |
6898
- * | `url` | ✅ | `URL` | URL of the video | `"https://www.youtube.com/watch?v=qJhobECFQYk"` |
6899
- * | `width` | ✅ | `Integer` | Video width | `459` |
6900
- * | `height` | ✅ | `Integer` | Video height | `344` |
6901
- * | `thumbnail_url` | ✅ | `URL` | URL for the video thumb | `"https://i.ytimg.com/vi/vUdGBEb1i9g/hqdefault.jpg"` |
6902
- * | `title` | ✅ | `String` | Title of the video | `"Next.js Conf Booth Welcoming!"` |
6903
- *
6904
- * </details>
6905
- *
6906
- * ###### Reference Fields
6907
- *
6908
- * These point to other resources (either assets or other records):
6909
- *
6910
- * <details>
6911
- * <summary>Single-asset</summary>
6912
- *
6913
- * The field accepts an object with the following properties, or `null`:
6914
- *
6915
- * | Property | Required | Type | Description | Example |
6916
- * | ------------- | -------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
6917
- * | `upload_id` | ✅ | `Upload ID` | ID of an asset | `"dhVR2HqgRVCTGFi0bWqLqA"` |
6918
- * | `title` | | `String` | Title for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`) | `"From my trip to Italy"` |
6919
- * | `alt` | | `String` | Alternate text for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`) | `"Florence skyline"` |
6920
- * | `focal_point` | | `{ x: Float, y: Float }`, `null` | Focal point for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`). Values must be expressed as `Float` between 0 and 1. Focal point can only be specified for image assets. | `{ "x": 0.34, "y": 0.45 }` |
6921
- * | `custom_data` | | `Record<String, String>` | An object containing custom keys that you can use on your frontend projects | `{ "watermark_image": "true" }` |
6922
- *
6923
- * **API responses**: Always returns asset ID only (use separate asset API for details)
6924
- *
6925
- * </details>
6926
- *
6927
- * <details>
6928
- * <summary>Asset gallery</summary>
6929
- *
6930
- * This field accepts an `Array` of objects with the following properties, or `null`:
6931
- *
6932
- * | Property | Required | Type | Description | Example |
6933
- * | ------------- | -------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
6934
- * | `upload_id` | ✅ | `Upload ID` | ID of an asset | `"dhVR2HqgRVCTGFi0bWqLqA"` |
6935
- * | `title` | | `String` | Title for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`) | `"Gallery Image Title"` |
6936
- * | `alt` | | `String` | Alternate text for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`) | `"Gallery image description"` |
6937
- * | `focal_point` | | `{ x: Float, y: Float }`, `null` | Focal point for the asset, if you want to override the asset's default value (see Upload `default_field_metadata`). Values must be expressed as `Float` between 0 and 1. Focal point can only be specified for image assets. | `{ "x": 0.34, "y": 0.45 }` |
6938
- * | `custom_data` | | `Record<String, String>` | An object containing custom keys that you can use on your frontend projects | `{ "watermark_image": "true" }` |
6939
- *
6940
- * **API responses**: Always returns array of asset IDs only
6941
- *
6942
- * </details>
6943
- *
6944
- * <details>
6945
- * <summary>Single link</summary>
6946
- *
6947
- * This field accepts a `String` representing the ID of the linked record, or `null`. See [Link Fields Guide](/docs/content-modelling/links) for relationship modeling concepts.
6948
- *
6949
- * **API responses**: Always returns record ID only
6950
- *
6951
- * </details>
6952
- *
6953
- * <details>
6954
- * <summary>Multiple links</summary>
6955
- *
6956
- * This field accepts an `Array<String>` representing the IDs of the linked records, or `null`. See [Link Fields Guide](/docs/content-modelling/links) for relationship modeling concepts.
6957
- *
6958
- * **API responses**: Always returns array of record IDs only
6959
- *
6960
- * </details>
6961
- *
6962
- * ###### Block Fields
6963
- *
6964
- * These are special fields that contain **blocks within records**:
6965
- *
6966
- * | Field Type | What it contains |
6967
- * | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
6968
- * | **Modular content** | An array of blocks, perfect for building dynamic page sections |
6969
- * | **Single block** | A single block instance or `null` |
6970
- * | **Structured text** | A rich text document that can have blocks embedded within the flow of content ([DAST format](/docs/structured-text/dast)) |
6971
- *
6972
- * Blocks are **records within records** - they're separate items that live inside fields of other records.
6973
- *
6974
- * > [!PROTIP] 📚 Content Modeling Context
6975
- * > To understand when and how to design blocks vs models, see [Blocks Guide](/docs/content-modelling/blocks). For field-specific concepts, see [Modular Content](/docs/content-modelling/modular-content) and [Structured Text](/docs/content-modelling/structured-text).
6976
- *
6977
- * Blocks inside those fields are unique because they can be represented in two different ways depending on the context: as a lightweight reference (an ID) or as a full content object. Understanding this duality is key to working with them effectively:
6978
- *
6979
- * * **Block ID (Lightweight Reference)**: A simple `String` that uniquely identifies the block (ie. `"dhVR2HqgRVCTGFi_0bWqLqA"`). This is useful when you only need to know *which* block is there, not what's inside it.
6980
- *
6981
- * * **Block Object (Full Content)**: The complete record object for the block, containing its own `id`, `type`, `attributes`, and `relationships`. This is used when you need to read or modify the block's actual content.
6982
- *
6983
- * ```json
6984
- * {
6985
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
6986
- * "type": "item",
6987
- * "attributes": {
6988
- * "title": "Block Title",
6989
- * "content": "Block content..."
6990
- * },
6991
- * "relationships": {
6992
- * "item_type": {
6993
- * "data": { "id": "BxZ9Y2aKQVeTnM4hP8wLpD", "type": "item_type" }
6994
- * }
6995
- * }
6996
- * }
6997
- * ```
6998
- *
6999
- * <details>
7000
- * <summary>Modular Content</summary>
7001
- *
7002
- * A Modular Content field holds an array of blocks.
7003
- *
7004
- * **As an array of IDs:**
7005
- * ```json
7006
- * {
7007
- * "content_blocks": [
7008
- * "dhVR2HqgRVCTGFi_0bWqLqA",
7009
- * "kL9mN3pQrStUvWxYzAbCdE"
7010
- * ]
7011
- * }
7012
- * ```
7013
- *
7014
- * **As an array of full objects:**
7015
- *
7016
- * ```json
7017
- * {
7018
- * "content_blocks": [
7019
- * {
7020
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
7021
- * "type": "item",
7022
- * "attributes": { "title": "Hero Section", "content": "Welcome to our site" },
7023
- * "relationships": { "item_type": { "data": { "id": "...", "type": "item_type" } } }
7024
- * },
7025
- * {
7026
- * "id": "kL9mN3pQrStUvWxYzAbCdE",
7027
- * "type": "item",
7028
- * "attributes": { "title": "Image Gallery", "images": [...] },
7029
- * "relationships": { "item_type": { "data": { "id": "...", "type": "item_type" } } }
7030
- * }
7031
- * ]
7032
- * }
7033
- * ```
7034
- * </details>
7035
- *
7036
- * <details>
7037
- * <summary>Single Block</summary>
7038
- *
7039
- * A Single Block field holds exactly one block, or `null`.
7040
- *
7041
- * **As an ID:**
7042
- * ```json
7043
- * {
7044
- * "featured_block": "dhVR2HqgRVCTGFi_0bWqLqA"
7045
- * }
7046
- * ```
7047
- *
7048
- * **As an full object:**
7049
- *
7050
- * ```json
7051
- * {
7052
- * "featured_block": {
7053
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
7054
- * "type": "item",
7055
- * "attributes": { "title": "Featured Content", "summary": "A summary..." },
7056
- * "relationships": { "item_type": { "data": { "id": "...", "type": "item_type" } } }
7057
- * }
7058
- * }
7059
- * ```
7060
- * </details>
7061
- *
7062
- * <details>
7063
- * <summary>Structured Text</summary>
7064
- *
7065
- * A Structured Text field can contain blocks within its document structure ([DAST format](/docs/structured-text/dast)). The item property of a `block` or `inlineBlock` node will hold either the ID or the full object.
7066
- *
7067
- * **With block IDs:**
7068
- *
7069
- * ```json
7070
- * {
7071
- * "rich_text_content": {
7072
- * "schema": "dast",
7073
- * "document": {
7074
- * "type": "root",
7075
- * "children": [
7076
- * {
7077
- * "type": "paragraph",
7078
- * "children": [{ "type": "span", "value": "Text before block." }]
7079
- * },
7080
- * {
7081
- * "type": "block",
7082
- * "item": "dhVR2HqgRVCTGFi_0bWqLqA"
7083
- * }
7084
- * ]
7085
- * }
7086
- * }
7087
- * }
7088
- * ```
7089
- *
7090
- * **With full objects:**
7091
- *
7092
- * ```json
7093
- * {
7094
- * "rich_text_content": {
7095
- * "schema": "dast",
7096
- * "document": {
7097
- * "type": "root",
7098
- * "children": [
7099
- * {
7100
- * "type": "paragraph",
7101
- * "children": [{ "type": "span", "value": "Text before block." }]
7102
- * },
7103
- * {
7104
- * "type": "block",
7105
- * "item": {
7106
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
7107
- * "type": "item",
7108
- * "attributes": { "title": "Embedded Block", "content": "..." },
7109
- * "relationships": { "item_type": { "data": { "id": "...", "type": "item_type" } } }
7110
- * }
7111
- * }
7112
- * ]
7113
- * }
7114
- * }
7115
- * }
7116
- * ```
7117
- * </details>
7118
- *
7119
- * ---
7120
- *
7121
- * ## API response modes: Regular vs. Nested
7122
- *
7123
- * When fetching record data, the API gives you control over how block fields are represented in the response. These two modes, **Regular** and **Nested**, are available on the following endpoints:
7124
- *
7125
- * * [Retrieve a single record (`GET /items/:id`)](/docs/content-management-api/resources/item/self)
7126
- * * [Retrieve multiple records (`GET /items`)](/docs/content-management-api/resources/item/instances)
7127
- * * [Retrieve records referenced by a record (`GET /items/:id/references`)](/docs/content-management-api/resources/item/references)
7128
- * * [Retrieve records linked to an asset (`GET /upload/:id/references`)](/docs/content-management-api/resources/upload/references)
7129
- *
7130
- * ###### Regular mode (default)
7131
- *
7132
- * By default, the API returns block fields as IDs only. This is efficient and fast, making it ideal for listings or when you don't need the blocks' content immediately.
7133
- *
7134
- * ```json
7135
- * GET /items/A4gkL_8pTZmcyJ-IlIEd2w
7136
- *
7137
- * {
7138
- * "id": "A4gkL_8pTZmcyJ-IlIEd2w",
7139
- * "type": "item",
7140
- * "attributes": {
7141
- * "title": "My Blog Post",
7142
- * "content_blocks": ["dhVR2HqgRVCTGFi_0bWqLqA", "kL9mN3pQrStUvWxYzAbCdE"],
7143
- * "featured_block": "nZ8xY2vWqTuJkL3mNcBeFg"
7144
- * }
7145
- * }
7146
- * ```
7147
- *
7148
- * ###### Nested mode (`?nested=true`)
7149
- *
7150
- * The same endpoint, when passing the `?nested=true` option, returns **block fields as full objects**. This is essential when you need to display or edit the content within the blocks.
7151
- *
7152
- * ```json
7153
- * GET /items/A4gkL_8pTZmcyJ-IlIEd2w?nested=true
7154
- *
7155
- * {
7156
- * "id": "A4gkL_8pTZmcyJ-IlIEd2w",
7157
- * "type": "item",
7158
- * "attributes": {
7159
- * "title": "My Blog Post",
7160
- * "content_blocks": [
7161
- * {
7162
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
7163
- * "type": "item",
7164
- * "attributes": { "title": "Hero Section", "content": "Welcome to our site" },
7165
- * "relationships": { ... }
7166
- * },
7167
- * {
7168
- * "id": "kL9mN3pQrStUvWxYzAbCdE",
7169
- * "type": "item",
7170
- * "attributes": { "title": "Image Gallery", "images": [...] },
7171
- * "relationships": { ... }
7172
- * }
7173
- * ],
7174
- * "featured_block": {
7175
- * "id": "nZ8xY2vWqTuJkL3mNcBeFg",
7176
- * "type": "item",
7177
- * "attributes": { ... },
7178
- * "relationships": { ... }
7179
- * }
7180
- * }
7181
- * }
7182
- * ```
7183
- *
7184
- * > [!WARNING] Block Fields vs. Other Reference Fields
7185
- * > Block fields are the **only** field type that change representation between modes! Asset and link fields always return IDs. To get full details for assets or linked records, you need to make separate API calls using their IDs.
7186
- *
7187
- * ###### When to use each mode?
7188
- *
7189
- * | Use "Regular Mode" when... | Use "Nested Mode" when... |
7190
- * | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
7191
- * | Listing many records or building navigation. | Displaying or editing block content, as it provides the actual content needed. |
7192
- * | You only need to know which blocks exist. | You need to read the actual block content for display or updates. |
7193
- * | Building navigation | Preparing to update blocks |
7194
- * | Performance is critical; it's faster because it returns smaller responses (block IDs instead of full content). | You are building content editing interfaces where usability is more important than raw speed. |
7195
- *
7196
- *
7197
- * ---
7198
- *
7199
- * ## Creating and updating blocks
7200
- *
7201
- * Working with blocks follows one fundamental constraint:
7202
- *
7203
- * **You cannot create, edit, or delete blocks directly. You must always update the parent record that contains them.**
7204
- *
7205
- * This ensures data integrity. To create/modify blocks, you send a payload to the parent record's endpoint, using a mix of Block IDs and Block Objects to describe the desired changes.
7206
- *
7207
- * ###### Key rules for block operations
7208
- *
7209
- * 1. **To create a new block**: Provide the **full object**, including `type`, `attributes`, and the `relationships.item_type` which specifies the Block Model being used.
7210
- * 2. **To update an existing block**: Provide the **full object**, including its `id` and the changed `attributes`. You only need to include the specific attributes that you want to change - unchanged attributes will be preserved. You don't need to specify `relationships.item_type`.
7211
- * 3. **To keep an existing block unchanged**: Simply provide its **Block ID** string. This is the most efficient way to handle unchanged blocks.
7212
- * 4. **To delete a block**: Omit it from the payload. For a Modular Content array, remove its ID. For a Single Block field, set the value to `null`.
7213
- * 5. **To reorder blocks** (in Modular Content): Send an array of Block IDs in the new desired order.
7214
- *
7215
- *
7216
- * The following examples show how to apply these rules.
7217
- *
7218
- * <details>
7219
- * <summary>Working with Modular Content Fields</summary>
7220
- *
7221
- * **Current state** (from a regular API response):
7222
- * ```json
7223
- * {
7224
- * "content_blocks": ["dhVR2HqgRVCTGFi_0bWqLqA", "kL9mN3pQrStUvWxYzAbCdE", "fG8hI1jKlMnOpQrStUvWxY"]
7225
- * }
7226
- * ```
7227
- *
7228
- * **To update the second block and reorder the others:**
7229
- * ```json
7230
- * {
7231
- * "content_blocks": [
7232
- * "fG8hI1jKlMnOpQrStUvWxY", // Reordered: kept as ID
7233
- * {
7234
- * "id": "kL9mN3pQrStUvWxYzAbCdE", // Updated: sent as object
7235
- * "type": "item",
7236
- * "attributes": { "title": "Updated Title" }
7237
- * },
7238
- * "dhVR2HqgRVCTGFi_0bWqLqA" // Reordered: kept as ID
7239
- * ]
7240
- * }
7241
- * ```
7242
- *
7243
- * **To add a new block at the end and remove the first block:**
7244
- * ```json
7245
- * {
7246
- * "content_blocks": [
7247
- * "kL9mN3pQrStUvWxYzAbCdE", // Kept as ID
7248
- * "fG8hI1jKlMnOpQrStUvWxY", // Kept as ID
7249
- * {
7250
- * "type": "item", // New block: sent as object with relationships
7251
- * "attributes": { "title": "A Brand New Block" },
7252
- * "relationships": {
7253
- * "item_type": {
7254
- * "data": { "id": "BxZ9Y2aKQVeTnM4hP8wLpD", "type": "item_type" }
7255
- * }
7256
- * }
7257
- * }
7258
- * ]
7259
- * }
7260
- * ```
7261
- *
7262
- * </details>
7263
- *
7264
- * <details>
7265
- * <summary>Working with Single Block Fields</summary>
7266
- *
7267
- * **Current state** (from a regular API response):
7268
- * ```json
7269
- * {
7270
- * "hero_block": "dhVR2HqgRVCTGFi_0bWqLqA"
7271
- * }
7272
- * ```
7273
- *
7274
- * **To update the block's content:**
7275
- * ```json
7276
- * {
7277
- * "hero_block": {
7278
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA",
7279
- * "type": "item",
7280
- * "attributes": { "title": "Updated Hero Title" }
7281
- * }
7282
- * }
7283
- * ```
7284
- *
7285
- * **To replace it with a new block:**
7286
- * ```json
7287
- * {
7288
- * "hero_block": {
7289
- * "type": "item",
7290
- * "attributes": { "title": "New Hero Block" },
7291
- * "relationships": {
7292
- * "item_type": {
7293
- * "data": { "id": "BxZ9Y2aKQVeTnM4hP8wLpD", "type": "item_type" }
7294
- * }
7295
- * }
7296
- * }
7297
- * }
7298
- * ```
7299
- *
7300
- * **To remove (delete) the block:**
7301
- * ```json
7302
- * {
7303
- * "hero_block": null
7304
- * }
7305
- * ```
7306
- * </details>
7307
- *
7308
- * <details>
7309
- * <summary>Working with Structured Text Fields</summary>
7310
- *
7311
- * Updating blocks within Structured Text follows the same pattern: you replace the `item`'s ID with a full object for the block you want to change.
7312
- *
7313
- * **Current state** (from a regular API response):
7314
- * ```json
7315
- * {
7316
- * "rich_content": {
7317
- * "schema": "dast",
7318
- * "document": {
7319
- * "type": "root",
7320
- * "children": [
7321
- * { "type": "block", "item": "dhVR2HqgRVCTGFi_0bWqLqA" },
7322
- * { "type": "paragraph", "children": [{ "type": "span", "value": "Some text." }] }
7323
- * ]
7324
- * }
7325
- * }
7326
- * }
7327
- * ```
7328
- *
7329
- * **To update the block's content:**
7330
- * ```json
7331
- * {
7332
- * "rich_content": {
7333
- * "schema": "dast",
7334
- * "document": {
7335
- * "type": "root",
7336
- * "children": [
7337
- * {
7338
- * "type": "block",
7339
- * "item": {
7340
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA", // The block to update
7341
- * "type": "item",
7342
- * "attributes": { "title": "Updated DAST Block Title" }
7343
- * }
7344
- * },
7345
- * { "type": "paragraph", "children": [{ "type": "span", "value": "Some text." }] }
7346
- * ]
7347
- * }
7348
- * }
7349
- * }
7350
- * ```
7351
- * </details>
7352
- *
7353
- * ###### Deeply-nested blocks
7354
- *
7355
- * Blocks can contain other blocks, creating hierarchies multiple levels deep. **The same principles apply recursively.** When you fetch a record with `?nested=true`, the API will expand nested blocks at all levels.
7356
- *
7357
- * When updating, you are always sending a payload to the top-level parent record, but you can specify changes to deeply nested blocks using the same ID vs. object rules.
7358
- *
7359
- * <details>
7360
- * <summary>Example: Updating a nested block</summary>
7361
- *
7362
- * Imagine a "Wrapper" block that contains a Modular Content field with "Child" blocks inside it. To update "Child Block 1" while leaving "Child Block 2" untouched:
7363
- *
7364
- * ```json
7365
- * // This payload is sent to the top-level record containing the "Parent Block"
7366
- * {
7367
- * "wrapper_block": {
7368
- * "id": "dhVR2HqgRVCTGFi_0bWqLqA", // ID of the parent block being updated
7369
- * "type": "item",
7370
- * "attributes": {
7371
- * "nested_content": [
7372
- * {
7373
- * "id": "kL9mN3pQrStUvWxYzAbCdE", // ID of the nested block being updated
7374
- * "type": "item",
7375
- * "attributes": { "title": "Updated Child Block 1" }
7376
- * },
7377
- * "fG8hI1jKlMnOpQrStUvWxY" // Unchanged nested block, sent as ID
7378
- * ],
7379
- * // You can skip any attribute that does not need to change
7380
- * }
7381
- * }
7382
- * }
7383
- * ```
7384
- * </details>
7385
- *
7386
- * ---
7387
- *
7388
- * ## Localization
7389
- *
7390
- * Localization allows you to store different versions of your content for different languages or regions. When you mark a field as "localizable" in your model, its structure in the API changes to accommodate multiple values.
7391
- *
7392
- * The fundamental change is that the field's value is no longer a single piece of data but an **object keyed by locale codes**.
7393
- *
7394
- * For example, a simple non-localized `title` field looks like this:
7395
- * ```json
7396
- * {
7397
- * "title": "Hello World"
7398
- * }
7399
- * ```
7400
- *
7401
- * When localized, it becomes an object containing a value for each configured locale:
7402
- * ```json
7403
- * {
7404
- * "title": {
7405
- * "en": "Hello World",
7406
- * "it": "Ciao Mondo",
7407
- * "fr": "Bonjour le Monde"
7408
- * }
7409
- * }
7410
- * ```
7411
- * This principle applies to **every type of field**, from simple strings to **Modular Content**, **Single Block**, and **Structured Text** fields. For instance, a localized Modular Content field will contain a separate array of blocks for each language. This powerful feature allows you to have completely different block structures for each locale.
7412
- *
7413
- * <details>
7414
- * <summary>Example: Localized Modular Content field</summary>
7415
- *
7416
- * In a `regular` API response, you would see different arrays of block IDs for each locale.
7417
- *
7418
- * ```json
7419
- * {
7420
- * "content_blocks": {
7421
- * "en": ["dhVR2HqgRVCTGFi0bWqLqA", "kL9mN3pQrStUvWxYzAbCdE"],
7422
- * "it": ["fG8hI1jKlMnOpQrStUvWxY", "dhVR2HqgRVCTGFi0bWqLqA"]
7423
- * }
7424
- * }
7425
- * ```
7426
- * </details>
7427
- *
7428
- * <details>
7429
- * <summary>Example: Localized Single Block field</summary>
7430
- * A different block can be assigned to each locale.
7431
- *
7432
- * ```json
7433
- * {
7434
- * "hero_block": {
7435
- * "en": "dhVR2HqgRVCTGFi0bWqLqA",
7436
- * "it": "kL9mN3pQrStUvWxYzAbCdE"
7437
- * }
7438
- * }
7439
- * ```
7440
- * </details>
7441
- *
7442
- * <details>
7443
- * <summary>Example: Localized Structured Text field</summary>
7444
- *
7445
- * The entire DAST document is localized, allowing for different text and different embedded blocks per locale.
7446
- *
7447
- * ```json
7448
- * {
7449
- * "rich_content": {
7450
- * "en": {
7451
- * "schema": "dast",
7452
- * "document": {
7453
- * "type": "root",
7454
- * "children": [{ "type": "block", "item": "dhVR2HqgRVCTGFi0bWqLqA" }]
7455
- * }
7456
- * },
7457
- * "it": {
7458
- * "schema": "dast",
7459
- * "document": {
7460
- * "type": "root",
7461
- * "children": [{ "type": "block", "item": "kL9mN3pQrStUvWxYzAbCdE" }]
7462
- * }
7463
- * }
7464
- * }
7465
- * }
7466
- * ```
7467
- * </details>
7468
- *
7469
- * When reading or writing localized content, there are a few key rules to follow to ensure data integrity.
7470
- *
7471
- * ###### Locale consistency
7472
- * Within a single record, all localized fields must have a consistent set of locales. You cannot have a `title` with English and Italian, and a `description` with English and French in the same record.
7473
- *
7474
- * ```json
7475
- * // ❌ This will FAIL due to inconsistent locales ("it" vs "fr")
7476
- * {
7477
- * "title": { "en": "Title", "it": "Titolo" },
7478
- * "description": { "en": "Description", "fr": "Description" }
7479
- * }
7480
- *
7481
- * // ✅ This is VALID because locales are consistent across all fields
7482
- * {
7483
- * "title": { "en": "Title", "it": "Titolo" },
7484
- * "description": { "en": "Description", "it": "Descrizione" }
7485
- * }
7486
- * ```
7487
- *
7488
- * ###### Required locales
7489
- *
7490
- * Your model can be configured to require that all project's locales are always present ([`attributes.all_locales_required`](/docs/content-management-api/resources/item-type#object-payload)). If that's the case, when creating or updating a record, you must provide a value for all required locales.
7491
- *
7492
- * ```json
7493
- * // ❌ This will FAIL if all locales are required for the model
7494
- * {
7495
- * "title": { "en": "Title" }
7496
- * }
7497
- * ```
7498
- *
7499
- *
7500
- * This interface was referenced by `DatoApi`'s JSON-Schema
7501
- * via the `definition` "item".
7502
- */
7503
- export type RawItem = {
7504
- type: ItemType1;
7505
- id: ItemIdentity;
7506
- relationships: ItemRelationships;
7507
- meta: ItemMeta;
7508
- };
7509
6626
  /**
7510
6627
  * JSON API links
7511
6628
  *
7512
- * This interface was referenced by `Item<D>`'s JSON-Schema
6629
+ * This interface was referenced by `Item`'s JSON-Schema
7513
6630
  * via the `definition` "relationships".
7514
6631
  */
7515
- export type ItemRelationships = {
6632
+ export type ItemRelationships<D extends ItemTypeDefinition = ItemTypeDefinition> = {
7516
6633
  /**
7517
6634
  * The record's model
7518
6635
  */
7519
6636
  item_type: {
7520
- data: ItemTypeData;
6637
+ data: ItemTypeData<D>;
7521
6638
  };
7522
6639
  /**
7523
6640
  * The entity (account/collaborator/access token/sso user) who created the record
@@ -7529,7 +6646,7 @@ export type ItemRelationships = {
7529
6646
  /**
7530
6647
  * Meta information regarding the record
7531
6648
  *
7532
- * This interface was referenced by `Item<D>`'s JSON-Schema
6649
+ * This interface was referenced by `Item`'s JSON-Schema
7533
6650
  * via the `definition` "meta".
7534
6651
  */
7535
6652
  export type ItemMeta = {
@@ -7587,38 +6704,38 @@ export type ItemMeta = {
7587
6704
  has_children: null | boolean;
7588
6705
  };
7589
6706
  /**
7590
- * The JSON data associated to the record
7591
- *
7592
- * This interface was referenced by `Item<D>`'s JSON-Schema
7593
- * via the `definition` "attributes".
7594
- */
7595
- export type ItemAttributes = {
7596
- [k: string]: unknown;
7597
- };
7598
- /**
7599
- * This interface was referenced by `Item<D>`'s JSON-Schema
6707
+ * This interface was referenced by `Item`'s JSON-Schema
7600
6708
  * via the `instances.targetSchema` link.
7601
6709
  */
7602
- export type ItemInstancesTargetSchema<D extends ItemDefinition = ItemDefinition> = {
6710
+ export type ItemInstancesTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7603
6711
  data: Item<D>[];
7604
6712
  meta: {
7605
6713
  total_count: number;
7606
6714
  };
6715
+ } : {
6716
+ data: ItemInNestedResponse<D>[];
6717
+ meta: {
6718
+ total_count: number;
6719
+ };
7607
6720
  };
7608
6721
  /**
7609
- * This interface was referenced by `Item<D>`'s JSON-Schema
6722
+ * This interface was referenced by `Item`'s JSON-Schema
7610
6723
  * via the `validate_existing.schema` link.
7611
6724
  */
7612
- export type RawItemValidateExistingSchema = {
6725
+ export type ItemValidateExistingSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
7613
6726
  data: {
7614
6727
  id: ItemIdentity;
7615
6728
  type: ItemType1;
6729
+ /**
6730
+ * The JSON data associated to the record
6731
+ */
6732
+ attributes: ToItemAttributesInRequest<D>;
7616
6733
  relationships: {
7617
6734
  /**
7618
6735
  * The record's model
7619
6736
  */
7620
6737
  item_type: {
7621
- data: ItemTypeData;
6738
+ data: ItemTypeData<D>;
7622
6739
  };
7623
6740
  /**
7624
6741
  * The entity (account/collaborator/access token/sso user) who created the record
@@ -7630,18 +6747,22 @@ export type RawItemValidateExistingSchema = {
7630
6747
  };
7631
6748
  };
7632
6749
  /**
7633
- * This interface was referenced by `Item<D>`'s JSON-Schema
6750
+ * This interface was referenced by `Item`'s JSON-Schema
7634
6751
  * via the `validate_new.schema` link.
7635
6752
  */
7636
- export type RawItemValidateNewSchema = {
6753
+ export type ItemValidateNewSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
7637
6754
  data: {
7638
6755
  type: ItemType1;
6756
+ /**
6757
+ * The JSON data associated to the record
6758
+ */
6759
+ attributes: ToItemAttributesInRequest<D>;
7639
6760
  relationships: {
7640
6761
  /**
7641
6762
  * The record's model
7642
6763
  */
7643
6764
  item_type: {
7644
- data: ItemTypeData;
6765
+ data: ItemTypeData<D>;
7645
6766
  };
7646
6767
  /**
7647
6768
  * The entity (account/collaborator/access token/sso user) who created the record
@@ -7653,13 +6774,17 @@ export type RawItemValidateNewSchema = {
7653
6774
  };
7654
6775
  };
7655
6776
  /**
7656
- * This interface was referenced by `Item<D>`'s JSON-Schema
6777
+ * This interface was referenced by `Item`'s JSON-Schema
7657
6778
  * via the `create.schema` link.
7658
6779
  */
7659
- export type RawItemCreateSchema = {
6780
+ export type ItemCreateSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
7660
6781
  data: {
7661
6782
  id?: ItemIdentity;
7662
6783
  type: ItemType1;
6784
+ /**
6785
+ * The JSON data associated to the record
6786
+ */
6787
+ attributes: ToItemAttributesInRequest<D>;
7663
6788
  /**
7664
6789
  * Meta information regarding the record
7665
6790
  */
@@ -7710,7 +6835,7 @@ export type RawItemCreateSchema = {
7710
6835
  * The record's model
7711
6836
  */
7712
6837
  item_type: {
7713
- data: ItemTypeData;
6838
+ data: ItemTypeData<D>;
7714
6839
  };
7715
6840
  /**
7716
6841
  * The entity (account/collaborator/access token/sso user) who created the record
@@ -7722,36 +6847,46 @@ export type RawItemCreateSchema = {
7722
6847
  };
7723
6848
  };
7724
6849
  /**
7725
- * This interface was referenced by `Item<D>`'s JSON-Schema
6850
+ * This interface was referenced by `Item`'s JSON-Schema
7726
6851
  * via the `create.targetSchema` link.
7727
6852
  */
7728
- export type ItemCreateTargetSchema<D extends ItemDefinition = ItemDefinition> = {
6853
+ export type ItemCreateTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7729
6854
  data: Item<D>;
7730
6855
  included: (ItemType | Item)[];
6856
+ } : {
6857
+ data: ItemInNestedResponse<D>;
6858
+ included: (ItemType | Item)[];
7731
6859
  };
7732
6860
  /**
7733
- * This interface was referenced by `Item<D>`'s JSON-Schema
6861
+ * This interface was referenced by `Item`'s JSON-Schema
7734
6862
  * via the `duplicate.targetSchema` link.
7735
6863
  */
7736
6864
  export type ItemDuplicateTargetSchema = {
7737
6865
  data: Job;
7738
6866
  };
7739
6867
  /**
7740
- * This interface was referenced by `Item<D>`'s JSON-Schema
6868
+ * This interface was referenced by `Item`'s JSON-Schema
7741
6869
  * via the `duplicate.jobSchema` link.
7742
6870
  */
7743
- export type ItemDuplicateJobSchema<D extends ItemDefinition = ItemDefinition> = {
6871
+ export type ItemDuplicateJobSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7744
6872
  data: Item<D>;
7745
6873
  included: ItemType[];
6874
+ } : {
6875
+ data: ItemInNestedResponse<D>;
6876
+ included: ItemType[];
7746
6877
  };
7747
6878
  /**
7748
- * This interface was referenced by `Item<D>`'s JSON-Schema
6879
+ * This interface was referenced by `Item`'s JSON-Schema
7749
6880
  * via the `update.schema` link.
7750
6881
  */
7751
- export type RawItemUpdateSchema = {
6882
+ export type ItemUpdateSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
7752
6883
  data: {
7753
6884
  type: ItemType1;
7754
6885
  id: ItemIdentity;
6886
+ /**
6887
+ * The JSON data associated to the record
6888
+ */
6889
+ attributes?: ToItemAttributesInRequest<D>;
7755
6890
  /**
7756
6891
  * Meta information regarding the record
7757
6892
  */
@@ -7814,7 +6949,7 @@ export type RawItemUpdateSchema = {
7814
6949
  * The record's model
7815
6950
  */
7816
6951
  item_type?: {
7817
- data: ItemTypeData;
6952
+ data: ItemTypeData<D>;
7818
6953
  };
7819
6954
  /**
7820
6955
  * The entity (account/collaborator/access token/sso user) who created the record
@@ -7826,29 +6961,36 @@ export type RawItemUpdateSchema = {
7826
6961
  };
7827
6962
  };
7828
6963
  /**
7829
- * This interface was referenced by `Item<D>`'s JSON-Schema
6964
+ * This interface was referenced by `Item`'s JSON-Schema
7830
6965
  * via the `update.targetSchema` link.
7831
6966
  */
7832
- export type ItemUpdateTargetSchema<D extends ItemDefinition = ItemDefinition> = {
6967
+ export type ItemUpdateTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7833
6968
  data: Item<D>;
7834
6969
  included?: (ItemType | Item)[];
6970
+ } : {
6971
+ data: ItemInNestedResponse<D>;
6972
+ included?: (ItemType | Item)[];
7835
6973
  };
7836
6974
  /**
7837
- * This interface was referenced by `Item<D>`'s JSON-Schema
6975
+ * This interface was referenced by `Item`'s JSON-Schema
7838
6976
  * via the `references.targetSchema` link.
7839
6977
  */
7840
- export type ItemReferencesTargetSchema<D extends ItemDefinition = ItemDefinition> = {
6978
+ export type ItemReferencesTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7841
6979
  data: Item<D>[];
6980
+ } : {
6981
+ data: ItemInNestedResponse<D>[];
7842
6982
  };
7843
6983
  /**
7844
- * This interface was referenced by `Item<D>`'s JSON-Schema
6984
+ * This interface was referenced by `Item`'s JSON-Schema
7845
6985
  * via the `self.targetSchema` link.
7846
6986
  */
7847
- export type ItemSelfTargetSchema<D extends ItemDefinition = ItemDefinition> = {
6987
+ export type ItemSelfTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
7848
6988
  data: Item<D>;
6989
+ } : {
6990
+ data: ItemInNestedResponse<D>;
7849
6991
  };
7850
6992
  /**
7851
- * This interface was referenced by `Item<D>`'s JSON-Schema
6993
+ * This interface was referenced by `Item`'s JSON-Schema
7852
6994
  * via the `current_vs_published_state.targetSchema` link.
7853
6995
  */
7854
6996
  export type ItemCurrentVsPublishedStateTargetSchema = {
@@ -7994,7 +7136,7 @@ export type ScheduledPublicationAttributes = {
7994
7136
  */
7995
7137
  export type ScheduledPublicationRelationships = {
7996
7138
  /**
7997
- * Item<D>
7139
+ * Item
7998
7140
  */
7999
7141
  item: {
8000
7142
  data: ItemData;
@@ -8043,8 +7185,10 @@ export type ScheduledPublicationCreateTargetSchema = {
8043
7185
  * This interface was referenced by `ScheduledPublication`'s JSON-Schema
8044
7186
  * via the `destroy.targetSchema` link.
8045
7187
  */
8046
- export type ScheduledPublicationDestroyTargetSchema<D extends ItemDefinition = ItemDefinition> = {
7188
+ export type ScheduledPublicationDestroyTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8047
7189
  data: Item<D>;
7190
+ } : {
7191
+ data: ItemInNestedResponse<D>;
8048
7192
  };
8049
7193
  /**
8050
7194
  * You can create a scheduled unpublishing to unpublish records in the future
@@ -8082,7 +7226,7 @@ export type ScheduledUnpublishingAttributes = {
8082
7226
  */
8083
7227
  export type ScheduledUnpublishingRelationships = {
8084
7228
  /**
8085
- * Item<D>
7229
+ * Item
8086
7230
  */
8087
7231
  item: {
8088
7232
  data: ItemData;
@@ -8122,8 +7266,10 @@ export type ScheduledUnpublishingCreateTargetSchema = {
8122
7266
  * This interface was referenced by `ScheduledUnpublishing`'s JSON-Schema
8123
7267
  * via the `destroy.targetSchema` link.
8124
7268
  */
8125
- export type ScheduledUnpublishingDestroyTargetSchema<D extends ItemDefinition = ItemDefinition> = {
7269
+ export type ScheduledUnpublishingDestroyTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8126
7270
  data: Item<D>;
7271
+ } : {
7272
+ data: ItemInNestedResponse<D>;
8127
7273
  };
8128
7274
  /**
8129
7275
  * Every change to a record is stored as a separate record version in DatoCMS.
@@ -8208,8 +7354,10 @@ export type ItemVersionRestoreTargetSchema = {
8208
7354
  * This interface was referenced by `ItemVersion`'s JSON-Schema
8209
7355
  * via the `restore.jobSchema` link.
8210
7356
  */
8211
- export type ItemVersionRestoreJobSchema<D extends ItemDefinition = ItemDefinition> = {
7357
+ export type ItemVersionRestoreJobSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8212
7358
  data: [Item<D>, ItemVersion];
7359
+ } : {
7360
+ data: [ItemInNestedResponse<D>, ItemVersion];
8213
7361
  };
8214
7362
  /**
8215
7363
  * This interface was referenced by `ItemVersion`'s JSON-Schema
@@ -8229,37 +7377,45 @@ export type ItemVersionSelfTargetSchema = {
8229
7377
  data: ItemVersion;
8230
7378
  };
8231
7379
  /**
8232
- * This interface was referenced by `Item<D>`'s JSON-Schema
7380
+ * This interface was referenced by `Item`'s JSON-Schema
8233
7381
  * via the `destroy.targetSchema` link.
8234
7382
  */
8235
7383
  export type ItemDestroyTargetSchema = {
8236
7384
  data: Job;
8237
7385
  };
8238
7386
  /**
8239
- * This interface was referenced by `Item<D>`'s JSON-Schema
7387
+ * This interface was referenced by `Item`'s JSON-Schema
8240
7388
  * via the `destroy.jobSchema` link.
8241
7389
  */
8242
- export type ItemDestroyJobSchema<D extends ItemDefinition = ItemDefinition> = {
7390
+ export type ItemDestroyJobSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8243
7391
  data: Item<D>;
7392
+ } : {
7393
+ data: ItemInNestedResponse<D>;
8244
7394
  };
8245
7395
  /**
8246
- * This interface was referenced by `Item<D>`'s JSON-Schema
7396
+ * This interface was referenced by `Item`'s JSON-Schema
8247
7397
  * via the `publish.targetSchema` link.
8248
7398
  */
8249
- export type ItemPublishTargetSchema<D extends ItemDefinition = ItemDefinition> = {
7399
+ export type ItemPublishTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8250
7400
  data: Item<D>;
8251
7401
  included?: ItemType[];
7402
+ } : {
7403
+ data: ItemInNestedResponse<D>;
7404
+ included?: ItemType[];
8252
7405
  };
8253
7406
  /**
8254
- * This interface was referenced by `Item<D>`'s JSON-Schema
7407
+ * This interface was referenced by `Item`'s JSON-Schema
8255
7408
  * via the `unpublish.targetSchema` link.
8256
7409
  */
8257
- export type ItemUnpublishTargetSchema<D extends ItemDefinition = ItemDefinition> = {
7410
+ export type ItemUnpublishTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8258
7411
  data: Item<D>;
8259
7412
  included?: ItemType[];
7413
+ } : {
7414
+ data: ItemInNestedResponse<D>;
7415
+ included?: ItemType[];
8260
7416
  };
8261
7417
  /**
8262
- * This interface was referenced by `Item<D>`'s JSON-Schema
7418
+ * This interface was referenced by `Item`'s JSON-Schema
8263
7419
  * via the `bulk_publish.schema` link.
8264
7420
  */
8265
7421
  export type ItemBulkPublishSchema = {
@@ -8277,14 +7433,14 @@ export type ItemBulkPublishSchema = {
8277
7433
  };
8278
7434
  };
8279
7435
  /**
8280
- * This interface was referenced by `Item<D>`'s JSON-Schema
7436
+ * This interface was referenced by `Item`'s JSON-Schema
8281
7437
  * via the `bulk_publish.targetSchema` link.
8282
7438
  */
8283
7439
  export type ItemBulkPublishTargetSchema = {
8284
7440
  data: Job;
8285
7441
  };
8286
7442
  /**
8287
- * This interface was referenced by `Item<D>`'s JSON-Schema
7443
+ * This interface was referenced by `Item`'s JSON-Schema
8288
7444
  * via the `bulk_publish.jobSchema` link.
8289
7445
  */
8290
7446
  export type ItemBulkPublishJobSchema = {
@@ -8295,7 +7451,7 @@ export type ItemBulkPublishJobSchema = {
8295
7451
  };
8296
7452
  };
8297
7453
  /**
8298
- * This interface was referenced by `Item<D>`'s JSON-Schema
7454
+ * This interface was referenced by `Item`'s JSON-Schema
8299
7455
  * via the `bulk_unpublish.schema` link.
8300
7456
  */
8301
7457
  export type ItemBulkUnpublishSchema = {
@@ -8313,14 +7469,14 @@ export type ItemBulkUnpublishSchema = {
8313
7469
  };
8314
7470
  };
8315
7471
  /**
8316
- * This interface was referenced by `Item<D>`'s JSON-Schema
7472
+ * This interface was referenced by `Item`'s JSON-Schema
8317
7473
  * via the `bulk_unpublish.targetSchema` link.
8318
7474
  */
8319
7475
  export type ItemBulkUnpublishTargetSchema = {
8320
7476
  data: Job;
8321
7477
  };
8322
7478
  /**
8323
- * This interface was referenced by `Item<D>`'s JSON-Schema
7479
+ * This interface was referenced by `Item`'s JSON-Schema
8324
7480
  * via the `bulk_unpublish.jobSchema` link.
8325
7481
  */
8326
7482
  export type ItemBulkUnpublishJobSchema = {
@@ -8331,7 +7487,7 @@ export type ItemBulkUnpublishJobSchema = {
8331
7487
  };
8332
7488
  };
8333
7489
  /**
8334
- * This interface was referenced by `Item<D>`'s JSON-Schema
7490
+ * This interface was referenced by `Item`'s JSON-Schema
8335
7491
  * via the `bulk_destroy.schema` link.
8336
7492
  */
8337
7493
  export type ItemBulkDestroySchema = {
@@ -8349,14 +7505,14 @@ export type ItemBulkDestroySchema = {
8349
7505
  };
8350
7506
  };
8351
7507
  /**
8352
- * This interface was referenced by `Item<D>`'s JSON-Schema
7508
+ * This interface was referenced by `Item`'s JSON-Schema
8353
7509
  * via the `bulk_destroy.targetSchema` link.
8354
7510
  */
8355
7511
  export type ItemBulkDestroyTargetSchema = {
8356
7512
  data: Job;
8357
7513
  };
8358
7514
  /**
8359
- * This interface was referenced by `Item<D>`'s JSON-Schema
7515
+ * This interface was referenced by `Item`'s JSON-Schema
8360
7516
  * via the `bulk_destroy.jobSchema` link.
8361
7517
  */
8362
7518
  export type ItemBulkDestroyJobSchema = {
@@ -8367,7 +7523,7 @@ export type ItemBulkDestroyJobSchema = {
8367
7523
  };
8368
7524
  };
8369
7525
  /**
8370
- * This interface was referenced by `Item<D>`'s JSON-Schema
7526
+ * This interface was referenced by `Item`'s JSON-Schema
8371
7527
  * via the `bulk_move_to_stage.schema` link.
8372
7528
  */
8373
7529
  export type ItemBulkMoveToStageSchema = {
@@ -8391,14 +7547,14 @@ export type ItemBulkMoveToStageSchema = {
8391
7547
  };
8392
7548
  };
8393
7549
  /**
8394
- * This interface was referenced by `Item<D>`'s JSON-Schema
7550
+ * This interface was referenced by `Item`'s JSON-Schema
8395
7551
  * via the `bulk_move_to_stage.targetSchema` link.
8396
7552
  */
8397
7553
  export type ItemBulkMoveToStageTargetSchema = {
8398
7554
  data: Job;
8399
7555
  };
8400
7556
  /**
8401
- * This interface was referenced by `Item<D>`'s JSON-Schema
7557
+ * This interface was referenced by `Item`'s JSON-Schema
8402
7558
  * via the `bulk_move_to_stage.jobSchema` link.
8403
7559
  */
8404
7560
  export type ItemBulkMoveToStageJobSchema = {
@@ -8843,8 +7999,10 @@ export type UploadUpdateJobSchema = {
8843
7999
  * This interface was referenced by `Upload`'s JSON-Schema
8844
8000
  * via the `references.targetSchema` link.
8845
8001
  */
8846
- export type UploadReferencesTargetSchema<D extends ItemDefinition = ItemDefinition> = {
8002
+ export type UploadReferencesTargetSchema<D extends ItemTypeDefinition = ItemTypeDefinition, NestedMode extends boolean = false> = NestedMode extends false ? {
8847
8003
  data: Item<D>[];
8004
+ } : {
8005
+ data: ItemInNestedResponse<D>[];
8848
8006
  };
8849
8007
  /**
8850
8008
  * This interface was referenced by `Upload`'s JSON-Schema
@@ -12154,4 +11312,3 @@ export type WorkflowInstancesTargetSchema = {
12154
11312
  export type WorkflowSelfTargetSchema = {
12155
11313
  data: Workflow;
12156
11314
  };
12157
- export {};