@datocms/cma-client 5.1.1 → 5.1.3

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 (444) hide show
  1. package/dist/cjs/fieldTypes/boolean.js +7 -1
  2. package/dist/cjs/fieldTypes/boolean.js.map +1 -1
  3. package/dist/cjs/fieldTypes/color.js +7 -1
  4. package/dist/cjs/fieldTypes/color.js.map +1 -1
  5. package/dist/cjs/fieldTypes/date.js +7 -1
  6. package/dist/cjs/fieldTypes/date.js.map +1 -1
  7. package/dist/cjs/fieldTypes/date_time.js +7 -1
  8. package/dist/cjs/fieldTypes/date_time.js.map +1 -1
  9. package/dist/cjs/fieldTypes/file.js +7 -1
  10. package/dist/cjs/fieldTypes/file.js.map +1 -1
  11. package/dist/cjs/fieldTypes/float.js +7 -1
  12. package/dist/cjs/fieldTypes/float.js.map +1 -1
  13. package/dist/cjs/fieldTypes/gallery.js +7 -1
  14. package/dist/cjs/fieldTypes/gallery.js.map +1 -1
  15. package/dist/cjs/fieldTypes/integer.js +7 -1
  16. package/dist/cjs/fieldTypes/integer.js.map +1 -1
  17. package/dist/cjs/fieldTypes/json.js +7 -1
  18. package/dist/cjs/fieldTypes/json.js.map +1 -1
  19. package/dist/cjs/fieldTypes/lat_lon.js +7 -1
  20. package/dist/cjs/fieldTypes/lat_lon.js.map +1 -1
  21. package/dist/cjs/fieldTypes/link.js +7 -1
  22. package/dist/cjs/fieldTypes/link.js.map +1 -1
  23. package/dist/cjs/fieldTypes/links.js +7 -1
  24. package/dist/cjs/fieldTypes/links.js.map +1 -1
  25. package/dist/cjs/fieldTypes/rich_text.js +23 -5
  26. package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
  27. package/dist/cjs/fieldTypes/seo.js +7 -1
  28. package/dist/cjs/fieldTypes/seo.js.map +1 -1
  29. package/dist/cjs/fieldTypes/single_block.js +37 -17
  30. package/dist/cjs/fieldTypes/single_block.js.map +1 -1
  31. package/dist/cjs/fieldTypes/slug.js +8 -2
  32. package/dist/cjs/fieldTypes/slug.js.map +1 -1
  33. package/dist/cjs/fieldTypes/string.js +7 -1
  34. package/dist/cjs/fieldTypes/string.js.map +1 -1
  35. package/dist/cjs/fieldTypes/structured_text.js +28 -22
  36. package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
  37. package/dist/cjs/fieldTypes/text.js +7 -1
  38. package/dist/cjs/fieldTypes/text.js.map +1 -1
  39. package/dist/cjs/fieldTypes/video.js +7 -1
  40. package/dist/cjs/fieldTypes/video.js.map +1 -1
  41. package/dist/cjs/generated/{SchemaTypes.js → ApiTypes.js} +1 -1
  42. package/dist/cjs/generated/ApiTypes.js.map +1 -0
  43. package/dist/cjs/generated/Client.js +1 -1
  44. package/dist/cjs/generated/{SimpleSchemaTypes.js → RawApiTypes.js} +1 -1
  45. package/dist/cjs/generated/RawApiTypes.js.map +1 -0
  46. package/dist/cjs/generated/resources/AccessToken.js.map +1 -1
  47. package/dist/cjs/generated/resources/AuditLogEvent.js.map +1 -1
  48. package/dist/cjs/generated/resources/BuildEvent.js.map +1 -1
  49. package/dist/cjs/generated/resources/BuildTrigger.js.map +1 -1
  50. package/dist/cjs/generated/resources/EditingSession.js.map +1 -1
  51. package/dist/cjs/generated/resources/EmojiSuggestions.js.map +1 -1
  52. package/dist/cjs/generated/resources/Environment.js.map +1 -1
  53. package/dist/cjs/generated/resources/Field.js.map +1 -1
  54. package/dist/cjs/generated/resources/Fieldset.js.map +1 -1
  55. package/dist/cjs/generated/resources/Item.js.map +1 -1
  56. package/dist/cjs/generated/resources/ItemType.js.map +1 -1
  57. package/dist/cjs/generated/resources/ItemTypeFilter.js.map +1 -1
  58. package/dist/cjs/generated/resources/ItemVersion.js.map +1 -1
  59. package/dist/cjs/generated/resources/JobResult.js.map +1 -1
  60. package/dist/cjs/generated/resources/MaintenanceMode.js.map +1 -1
  61. package/dist/cjs/generated/resources/MenuItem.js.map +1 -1
  62. package/dist/cjs/generated/resources/Plugin.js.map +1 -1
  63. package/dist/cjs/generated/resources/PublicInfo.js.map +1 -1
  64. package/dist/cjs/generated/resources/Role.js.map +1 -1
  65. package/dist/cjs/generated/resources/ScheduledPublication.js.map +1 -1
  66. package/dist/cjs/generated/resources/ScheduledUnpublishing.js.map +1 -1
  67. package/dist/cjs/generated/resources/SchemaMenuItem.js.map +1 -1
  68. package/dist/cjs/generated/resources/SearchResult.js.map +1 -1
  69. package/dist/cjs/generated/resources/Session.js.map +1 -1
  70. package/dist/cjs/generated/resources/Site.js.map +1 -1
  71. package/dist/cjs/generated/resources/SiteInvitation.js.map +1 -1
  72. package/dist/cjs/generated/resources/SsoGroup.js.map +1 -1
  73. package/dist/cjs/generated/resources/SsoSettings.js.map +1 -1
  74. package/dist/cjs/generated/resources/SsoUser.js.map +1 -1
  75. package/dist/cjs/generated/resources/SubscriptionLimit.js.map +1 -1
  76. package/dist/cjs/generated/resources/Upload.js.map +1 -1
  77. package/dist/cjs/generated/resources/UploadCollection.js.map +1 -1
  78. package/dist/cjs/generated/resources/UploadFilter.js.map +1 -1
  79. package/dist/cjs/generated/resources/UploadRequest.js.map +1 -1
  80. package/dist/cjs/generated/resources/UploadSmartTag.js.map +1 -1
  81. package/dist/cjs/generated/resources/UploadTag.js.map +1 -1
  82. package/dist/cjs/generated/resources/UploadTrack.js.map +1 -1
  83. package/dist/cjs/generated/resources/UsageCounter.js.map +1 -1
  84. package/dist/cjs/generated/resources/User.js.map +1 -1
  85. package/dist/cjs/generated/resources/Webhook.js.map +1 -1
  86. package/dist/cjs/generated/resources/WebhookCall.js.map +1 -1
  87. package/dist/cjs/generated/resources/WhiteLabelSettings.js.map +1 -1
  88. package/dist/cjs/generated/resources/Workflow.js.map +1 -1
  89. package/dist/cjs/index.js +3 -5
  90. package/dist/cjs/index.js.map +1 -1
  91. package/dist/cjs/resources/Role.js.map +1 -1
  92. package/dist/cjs/utilities/blocks.js +7 -7
  93. package/dist/cjs/utilities/blocks.js.map +1 -1
  94. package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
  95. package/dist/cjs/utilities/{fieldValueLocalization.js → fieldValue.js} +52 -52
  96. package/dist/cjs/utilities/fieldValue.js.map +1 -0
  97. package/dist/cjs/utilities/fieldsContainingReferences.js.map +1 -1
  98. package/dist/cjs/utilities/recursiveBlocks.js +18 -19
  99. package/dist/cjs/utilities/recursiveBlocks.js.map +1 -1
  100. package/dist/cjs/utilities/schemaRepository.js.map +1 -1
  101. package/dist/esm/fieldTypes/boolean.d.ts +2 -0
  102. package/dist/esm/fieldTypes/boolean.js +5 -0
  103. package/dist/esm/fieldTypes/boolean.js.map +1 -1
  104. package/dist/esm/fieldTypes/color.d.ts +2 -0
  105. package/dist/esm/fieldTypes/color.js +5 -0
  106. package/dist/esm/fieldTypes/color.js.map +1 -1
  107. package/dist/esm/fieldTypes/date.d.ts +2 -0
  108. package/dist/esm/fieldTypes/date.js +5 -0
  109. package/dist/esm/fieldTypes/date.js.map +1 -1
  110. package/dist/esm/fieldTypes/date_time.d.ts +2 -0
  111. package/dist/esm/fieldTypes/date_time.js +5 -0
  112. package/dist/esm/fieldTypes/date_time.js.map +1 -1
  113. package/dist/esm/fieldTypes/file.d.ts +2 -0
  114. package/dist/esm/fieldTypes/file.js +5 -0
  115. package/dist/esm/fieldTypes/file.js.map +1 -1
  116. package/dist/esm/fieldTypes/float.d.ts +2 -0
  117. package/dist/esm/fieldTypes/float.js +5 -0
  118. package/dist/esm/fieldTypes/float.js.map +1 -1
  119. package/dist/esm/fieldTypes/gallery.d.ts +2 -0
  120. package/dist/esm/fieldTypes/gallery.js +5 -0
  121. package/dist/esm/fieldTypes/gallery.js.map +1 -1
  122. package/dist/esm/fieldTypes/integer.d.ts +2 -0
  123. package/dist/esm/fieldTypes/integer.js +5 -0
  124. package/dist/esm/fieldTypes/integer.js.map +1 -1
  125. package/dist/esm/fieldTypes/json.d.ts +2 -0
  126. package/dist/esm/fieldTypes/json.js +5 -0
  127. package/dist/esm/fieldTypes/json.js.map +1 -1
  128. package/dist/esm/fieldTypes/lat_lon.d.ts +2 -0
  129. package/dist/esm/fieldTypes/lat_lon.js +5 -0
  130. package/dist/esm/fieldTypes/lat_lon.js.map +1 -1
  131. package/dist/esm/fieldTypes/link.d.ts +2 -0
  132. package/dist/esm/fieldTypes/link.js +5 -0
  133. package/dist/esm/fieldTypes/link.js.map +1 -1
  134. package/dist/esm/fieldTypes/links.d.ts +2 -0
  135. package/dist/esm/fieldTypes/links.js +5 -0
  136. package/dist/esm/fieldTypes/links.js.map +1 -1
  137. package/dist/esm/fieldTypes/rich_text.d.ts +13 -9
  138. package/dist/esm/fieldTypes/rich_text.js +20 -5
  139. package/dist/esm/fieldTypes/rich_text.js.map +1 -1
  140. package/dist/esm/fieldTypes/seo.d.ts +2 -0
  141. package/dist/esm/fieldTypes/seo.js +5 -0
  142. package/dist/esm/fieldTypes/seo.js.map +1 -1
  143. package/dist/esm/fieldTypes/single_block.d.ts +33 -23
  144. package/dist/esm/fieldTypes/single_block.js +30 -13
  145. package/dist/esm/fieldTypes/single_block.js.map +1 -1
  146. package/dist/esm/fieldTypes/slug.d.ts +2 -0
  147. package/dist/esm/fieldTypes/slug.js +6 -1
  148. package/dist/esm/fieldTypes/slug.js.map +1 -1
  149. package/dist/esm/fieldTypes/string.d.ts +2 -0
  150. package/dist/esm/fieldTypes/string.js +5 -0
  151. package/dist/esm/fieldTypes/string.js.map +1 -1
  152. package/dist/esm/fieldTypes/structured_text.d.ts +22 -83
  153. package/dist/esm/fieldTypes/structured_text.js +25 -22
  154. package/dist/esm/fieldTypes/structured_text.js.map +1 -1
  155. package/dist/esm/fieldTypes/text.d.ts +2 -0
  156. package/dist/esm/fieldTypes/text.js +5 -0
  157. package/dist/esm/fieldTypes/text.js.map +1 -1
  158. package/dist/esm/fieldTypes/video.d.ts +2 -0
  159. package/dist/esm/fieldTypes/video.js +5 -0
  160. package/dist/esm/fieldTypes/video.js.map +1 -1
  161. package/dist/esm/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +2 -2
  162. package/dist/esm/generated/ApiTypes.js +2 -0
  163. package/dist/esm/generated/ApiTypes.js.map +1 -0
  164. package/dist/esm/generated/Client.d.ts +1 -1
  165. package/dist/esm/generated/Client.js +1 -1
  166. package/dist/esm/generated/{SchemaTypes.d.ts → RawApiTypes.d.ts} +2 -2
  167. package/dist/esm/generated/RawApiTypes.js +2 -0
  168. package/dist/esm/generated/RawApiTypes.js.map +1 -0
  169. package/dist/esm/generated/resources/AccessToken.d.ts +14 -14
  170. package/dist/esm/generated/resources/AccessToken.js.map +1 -1
  171. package/dist/esm/generated/resources/AuditLogEvent.d.ts +4 -4
  172. package/dist/esm/generated/resources/AuditLogEvent.js.map +1 -1
  173. package/dist/esm/generated/resources/BuildEvent.d.ts +8 -8
  174. package/dist/esm/generated/resources/BuildEvent.js.map +1 -1
  175. package/dist/esm/generated/resources/BuildTrigger.d.ts +16 -16
  176. package/dist/esm/generated/resources/BuildTrigger.js.map +1 -1
  177. package/dist/esm/generated/resources/DailyUsage.d.ts +4 -4
  178. package/dist/esm/generated/resources/EditingSession.d.ts +7 -7
  179. package/dist/esm/generated/resources/EditingSession.js.map +1 -1
  180. package/dist/esm/generated/resources/EmojiSuggestions.d.ts +4 -4
  181. package/dist/esm/generated/resources/EmojiSuggestions.js.map +1 -1
  182. package/dist/esm/generated/resources/Environment.d.ts +14 -14
  183. package/dist/esm/generated/resources/Environment.js.map +1 -1
  184. package/dist/esm/generated/resources/Field.d.ts +713 -713
  185. package/dist/esm/generated/resources/Field.js.map +1 -1
  186. package/dist/esm/generated/resources/Fieldset.d.ts +12 -12
  187. package/dist/esm/generated/resources/Fieldset.js.map +1 -1
  188. package/dist/esm/generated/resources/Item.d.ts +36 -36
  189. package/dist/esm/generated/resources/Item.js.map +1 -1
  190. package/dist/esm/generated/resources/ItemType.d.ts +15 -15
  191. package/dist/esm/generated/resources/ItemType.js.map +1 -1
  192. package/dist/esm/generated/resources/ItemTypeFilter.d.ts +12 -12
  193. package/dist/esm/generated/resources/ItemTypeFilter.js.map +1 -1
  194. package/dist/esm/generated/resources/ItemVersion.d.ts +10 -10
  195. package/dist/esm/generated/resources/ItemVersion.js.map +1 -1
  196. package/dist/esm/generated/resources/JobResult.d.ts +4 -4
  197. package/dist/esm/generated/resources/JobResult.js.map +1 -1
  198. package/dist/esm/generated/resources/MaintenanceMode.d.ts +8 -8
  199. package/dist/esm/generated/resources/MaintenanceMode.js.map +1 -1
  200. package/dist/esm/generated/resources/MenuItem.d.ts +14 -14
  201. package/dist/esm/generated/resources/MenuItem.js.map +1 -1
  202. package/dist/esm/generated/resources/Plugin.d.ts +14 -14
  203. package/dist/esm/generated/resources/Plugin.js.map +1 -1
  204. package/dist/esm/generated/resources/PublicInfo.d.ts +4 -4
  205. package/dist/esm/generated/resources/PublicInfo.js.map +1 -1
  206. package/dist/esm/generated/resources/Role.d.ts +14 -14
  207. package/dist/esm/generated/resources/Role.js.map +1 -1
  208. package/dist/esm/generated/resources/ScheduledPublication.d.ts +6 -6
  209. package/dist/esm/generated/resources/ScheduledPublication.js.map +1 -1
  210. package/dist/esm/generated/resources/ScheduledUnpublishing.d.ts +6 -6
  211. package/dist/esm/generated/resources/ScheduledUnpublishing.js.map +1 -1
  212. package/dist/esm/generated/resources/SchemaMenuItem.d.ts +14 -14
  213. package/dist/esm/generated/resources/SchemaMenuItem.js.map +1 -1
  214. package/dist/esm/generated/resources/SearchResult.d.ts +6 -6
  215. package/dist/esm/generated/resources/SearchResult.js.map +1 -1
  216. package/dist/esm/generated/resources/Session.d.ts +4 -4
  217. package/dist/esm/generated/resources/Session.js.map +1 -1
  218. package/dist/esm/generated/resources/Site.d.ts +24 -24
  219. package/dist/esm/generated/resources/Site.js.map +1 -1
  220. package/dist/esm/generated/resources/SiteInvitation.d.ts +14 -14
  221. package/dist/esm/generated/resources/SiteInvitation.js.map +1 -1
  222. package/dist/esm/generated/resources/SsoGroup.d.ts +10 -10
  223. package/dist/esm/generated/resources/SsoGroup.js.map +1 -1
  224. package/dist/esm/generated/resources/SsoSettings.d.ts +8 -8
  225. package/dist/esm/generated/resources/SsoSettings.js.map +1 -1
  226. package/dist/esm/generated/resources/SsoUser.d.ts +10 -10
  227. package/dist/esm/generated/resources/SsoUser.js.map +1 -1
  228. package/dist/esm/generated/resources/SubscriptionFeature.d.ts +4 -4
  229. package/dist/esm/generated/resources/SubscriptionLimit.d.ts +6 -6
  230. package/dist/esm/generated/resources/SubscriptionLimit.js.map +1 -1
  231. package/dist/esm/generated/resources/Upload.d.ts +22 -22
  232. package/dist/esm/generated/resources/Upload.js.map +1 -1
  233. package/dist/esm/generated/resources/UploadCollection.d.ts +14 -14
  234. package/dist/esm/generated/resources/UploadCollection.js.map +1 -1
  235. package/dist/esm/generated/resources/UploadFilter.d.ts +12 -12
  236. package/dist/esm/generated/resources/UploadFilter.js.map +1 -1
  237. package/dist/esm/generated/resources/UploadRequest.d.ts +4 -4
  238. package/dist/esm/generated/resources/UploadRequest.js.map +1 -1
  239. package/dist/esm/generated/resources/UploadSmartTag.d.ts +6 -6
  240. package/dist/esm/generated/resources/UploadSmartTag.js.map +1 -1
  241. package/dist/esm/generated/resources/UploadTag.d.ts +8 -8
  242. package/dist/esm/generated/resources/UploadTag.js.map +1 -1
  243. package/dist/esm/generated/resources/UploadTrack.d.ts +10 -10
  244. package/dist/esm/generated/resources/UploadTrack.js.map +1 -1
  245. package/dist/esm/generated/resources/UsageCounter.d.ts +4 -4
  246. package/dist/esm/generated/resources/UsageCounter.js.map +1 -1
  247. package/dist/esm/generated/resources/User.d.ts +12 -12
  248. package/dist/esm/generated/resources/User.js.map +1 -1
  249. package/dist/esm/generated/resources/Webhook.d.ts +12 -12
  250. package/dist/esm/generated/resources/Webhook.js.map +1 -1
  251. package/dist/esm/generated/resources/WebhookCall.d.ts +9 -9
  252. package/dist/esm/generated/resources/WebhookCall.js.map +1 -1
  253. package/dist/esm/generated/resources/WhiteLabelSettings.d.ts +6 -6
  254. package/dist/esm/generated/resources/WhiteLabelSettings.js.map +1 -1
  255. package/dist/esm/generated/resources/Workflow.d.ts +11 -11
  256. package/dist/esm/generated/resources/Workflow.js.map +1 -1
  257. package/dist/esm/index.d.ts +6 -4
  258. package/dist/esm/index.js +2 -4
  259. package/dist/esm/index.js.map +1 -1
  260. package/dist/esm/resources/Role.d.ts +4 -4
  261. package/dist/esm/resources/Role.js.map +1 -1
  262. package/dist/esm/utilities/blocks.d.ts +17 -17
  263. package/dist/esm/utilities/blocks.js +3 -3
  264. package/dist/esm/utilities/blocks.js.map +1 -1
  265. package/dist/esm/utilities/buildBlockRecord.d.ts +5 -5
  266. package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
  267. package/dist/{types/utilities/fieldValueLocalization.d.ts → esm/utilities/fieldValue.d.ts} +30 -29
  268. package/dist/esm/utilities/{fieldValueLocalization.js → fieldValue.js} +39 -39
  269. package/dist/esm/utilities/fieldValue.js.map +1 -0
  270. package/dist/esm/utilities/fieldsContainingReferences.d.ts +4 -4
  271. package/dist/esm/utilities/fieldsContainingReferences.js.map +1 -1
  272. package/dist/esm/utilities/recursiveBlocks.d.ts +13 -10
  273. package/dist/esm/utilities/recursiveBlocks.js +19 -20
  274. package/dist/esm/utilities/recursiveBlocks.js.map +1 -1
  275. package/dist/esm/utilities/schemaRepository.d.ts +29 -26
  276. package/dist/esm/utilities/schemaRepository.js.map +1 -1
  277. package/dist/types/fieldTypes/boolean.d.ts +2 -0
  278. package/dist/types/fieldTypes/color.d.ts +2 -0
  279. package/dist/types/fieldTypes/date.d.ts +2 -0
  280. package/dist/types/fieldTypes/date_time.d.ts +2 -0
  281. package/dist/types/fieldTypes/file.d.ts +2 -0
  282. package/dist/types/fieldTypes/float.d.ts +2 -0
  283. package/dist/types/fieldTypes/gallery.d.ts +2 -0
  284. package/dist/types/fieldTypes/integer.d.ts +2 -0
  285. package/dist/types/fieldTypes/json.d.ts +2 -0
  286. package/dist/types/fieldTypes/lat_lon.d.ts +2 -0
  287. package/dist/types/fieldTypes/link.d.ts +2 -0
  288. package/dist/types/fieldTypes/links.d.ts +2 -0
  289. package/dist/types/fieldTypes/rich_text.d.ts +13 -9
  290. package/dist/types/fieldTypes/seo.d.ts +2 -0
  291. package/dist/types/fieldTypes/single_block.d.ts +33 -23
  292. package/dist/types/fieldTypes/slug.d.ts +2 -0
  293. package/dist/types/fieldTypes/string.d.ts +2 -0
  294. package/dist/types/fieldTypes/structured_text.d.ts +22 -83
  295. package/dist/types/fieldTypes/text.d.ts +2 -0
  296. package/dist/types/fieldTypes/video.d.ts +2 -0
  297. package/dist/types/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +2 -2
  298. package/dist/types/generated/Client.d.ts +1 -1
  299. package/dist/types/generated/{SchemaTypes.d.ts → RawApiTypes.d.ts} +2 -2
  300. package/dist/types/generated/resources/AccessToken.d.ts +14 -14
  301. package/dist/types/generated/resources/AuditLogEvent.d.ts +4 -4
  302. package/dist/types/generated/resources/BuildEvent.d.ts +8 -8
  303. package/dist/types/generated/resources/BuildTrigger.d.ts +16 -16
  304. package/dist/types/generated/resources/DailyUsage.d.ts +4 -4
  305. package/dist/types/generated/resources/EditingSession.d.ts +7 -7
  306. package/dist/types/generated/resources/EmojiSuggestions.d.ts +4 -4
  307. package/dist/types/generated/resources/Environment.d.ts +14 -14
  308. package/dist/types/generated/resources/Field.d.ts +713 -713
  309. package/dist/types/generated/resources/Fieldset.d.ts +12 -12
  310. package/dist/types/generated/resources/Item.d.ts +36 -36
  311. package/dist/types/generated/resources/ItemType.d.ts +15 -15
  312. package/dist/types/generated/resources/ItemTypeFilter.d.ts +12 -12
  313. package/dist/types/generated/resources/ItemVersion.d.ts +10 -10
  314. package/dist/types/generated/resources/JobResult.d.ts +4 -4
  315. package/dist/types/generated/resources/MaintenanceMode.d.ts +8 -8
  316. package/dist/types/generated/resources/MenuItem.d.ts +14 -14
  317. package/dist/types/generated/resources/Plugin.d.ts +14 -14
  318. package/dist/types/generated/resources/PublicInfo.d.ts +4 -4
  319. package/dist/types/generated/resources/Role.d.ts +14 -14
  320. package/dist/types/generated/resources/ScheduledPublication.d.ts +6 -6
  321. package/dist/types/generated/resources/ScheduledUnpublishing.d.ts +6 -6
  322. package/dist/types/generated/resources/SchemaMenuItem.d.ts +14 -14
  323. package/dist/types/generated/resources/SearchResult.d.ts +6 -6
  324. package/dist/types/generated/resources/Session.d.ts +4 -4
  325. package/dist/types/generated/resources/Site.d.ts +24 -24
  326. package/dist/types/generated/resources/SiteInvitation.d.ts +14 -14
  327. package/dist/types/generated/resources/SsoGroup.d.ts +10 -10
  328. package/dist/types/generated/resources/SsoSettings.d.ts +8 -8
  329. package/dist/types/generated/resources/SsoUser.d.ts +10 -10
  330. package/dist/types/generated/resources/SubscriptionFeature.d.ts +4 -4
  331. package/dist/types/generated/resources/SubscriptionLimit.d.ts +6 -6
  332. package/dist/types/generated/resources/Upload.d.ts +22 -22
  333. package/dist/types/generated/resources/UploadCollection.d.ts +14 -14
  334. package/dist/types/generated/resources/UploadFilter.d.ts +12 -12
  335. package/dist/types/generated/resources/UploadRequest.d.ts +4 -4
  336. package/dist/types/generated/resources/UploadSmartTag.d.ts +6 -6
  337. package/dist/types/generated/resources/UploadTag.d.ts +8 -8
  338. package/dist/types/generated/resources/UploadTrack.d.ts +10 -10
  339. package/dist/types/generated/resources/UsageCounter.d.ts +4 -4
  340. package/dist/types/generated/resources/User.d.ts +12 -12
  341. package/dist/types/generated/resources/Webhook.d.ts +12 -12
  342. package/dist/types/generated/resources/WebhookCall.d.ts +9 -9
  343. package/dist/types/generated/resources/WhiteLabelSettings.d.ts +6 -6
  344. package/dist/types/generated/resources/Workflow.d.ts +11 -11
  345. package/dist/types/index.d.ts +6 -4
  346. package/dist/types/resources/Role.d.ts +4 -4
  347. package/dist/types/utilities/blocks.d.ts +17 -17
  348. package/dist/types/utilities/buildBlockRecord.d.ts +5 -5
  349. package/dist/{esm/utilities/fieldValueLocalization.d.ts → types/utilities/fieldValue.d.ts} +30 -29
  350. package/dist/types/utilities/fieldsContainingReferences.d.ts +4 -4
  351. package/dist/types/utilities/recursiveBlocks.d.ts +13 -10
  352. package/dist/types/utilities/schemaRepository.d.ts +29 -26
  353. package/package.json +5 -5
  354. package/src/fieldTypes/boolean.ts +11 -0
  355. package/src/fieldTypes/color.ts +11 -0
  356. package/src/fieldTypes/date.ts +11 -0
  357. package/src/fieldTypes/date_time.ts +11 -0
  358. package/src/fieldTypes/file.ts +11 -0
  359. package/src/fieldTypes/float.ts +11 -0
  360. package/src/fieldTypes/gallery.ts +11 -0
  361. package/src/fieldTypes/integer.ts +11 -0
  362. package/src/fieldTypes/json.ts +11 -0
  363. package/src/fieldTypes/lat_lon.ts +11 -0
  364. package/src/fieldTypes/link.ts +11 -0
  365. package/src/fieldTypes/links.ts +11 -0
  366. package/src/fieldTypes/rich_text.ts +45 -15
  367. package/src/fieldTypes/seo.ts +11 -0
  368. package/src/fieldTypes/single_block.ts +76 -30
  369. package/src/fieldTypes/slug.ts +12 -1
  370. package/src/fieldTypes/string.ts +11 -0
  371. package/src/fieldTypes/structured_text.ts +63 -148
  372. package/src/fieldTypes/text.ts +11 -0
  373. package/src/fieldTypes/video.ts +11 -0
  374. package/src/generated/{SimpleSchemaTypes.ts → ApiTypes.ts} +2 -2
  375. package/src/generated/Client.ts +2 -2
  376. package/src/generated/{SchemaTypes.ts → RawApiTypes.ts} +2 -2
  377. package/src/generated/resources/AccessToken.ts +32 -34
  378. package/src/generated/resources/AuditLogEvent.ts +8 -8
  379. package/src/generated/resources/BuildEvent.ts +16 -18
  380. package/src/generated/resources/BuildTrigger.ts +30 -30
  381. package/src/generated/resources/DailyUsage.ts +5 -5
  382. package/src/generated/resources/EditingSession.ts +12 -12
  383. package/src/generated/resources/EmojiSuggestions.ts +7 -7
  384. package/src/generated/resources/Environment.ts +33 -39
  385. package/src/generated/resources/Field.ts +40 -54
  386. package/src/generated/resources/Fieldset.ts +28 -36
  387. package/src/generated/resources/Item.ts +99 -126
  388. package/src/generated/resources/ItemType.ts +37 -45
  389. package/src/generated/resources/ItemTypeFilter.ts +26 -26
  390. package/src/generated/resources/ItemVersion.ts +22 -26
  391. package/src/generated/resources/JobResult.ts +6 -8
  392. package/src/generated/resources/MaintenanceMode.ts +13 -13
  393. package/src/generated/resources/MenuItem.ts +34 -44
  394. package/src/generated/resources/Plugin.ts +30 -42
  395. package/src/generated/resources/PublicInfo.ts +5 -7
  396. package/src/generated/resources/Role.ts +29 -44
  397. package/src/generated/resources/ScheduledPublication.ts +13 -13
  398. package/src/generated/resources/ScheduledUnpublishing.ts +13 -13
  399. package/src/generated/resources/SchemaMenuItem.ts +34 -34
  400. package/src/generated/resources/SearchResult.ts +12 -12
  401. package/src/generated/resources/Session.ts +8 -10
  402. package/src/generated/resources/Site.ts +43 -47
  403. package/src/generated/resources/SiteInvitation.ts +30 -30
  404. package/src/generated/resources/SsoGroup.ts +20 -24
  405. package/src/generated/resources/SsoSettings.ts +14 -16
  406. package/src/generated/resources/SsoUser.ts +18 -22
  407. package/src/generated/resources/SubscriptionFeature.ts +5 -5
  408. package/src/generated/resources/SubscriptionLimit.ts +9 -9
  409. package/src/generated/resources/Upload.ts +57 -73
  410. package/src/generated/resources/UploadCollection.ts +34 -34
  411. package/src/generated/resources/UploadFilter.ts +26 -26
  412. package/src/generated/resources/UploadRequest.ts +8 -8
  413. package/src/generated/resources/UploadSmartTag.ts +12 -12
  414. package/src/generated/resources/UploadTag.ts +18 -20
  415. package/src/generated/resources/UploadTrack.ts +25 -29
  416. package/src/generated/resources/UsageCounter.ts +8 -8
  417. package/src/generated/resources/User.ts +28 -39
  418. package/src/generated/resources/Webhook.ts +26 -34
  419. package/src/generated/resources/WebhookCall.ts +17 -19
  420. package/src/generated/resources/WhiteLabelSettings.ts +11 -11
  421. package/src/generated/resources/Workflow.ts +23 -29
  422. package/src/index.ts +8 -4
  423. package/src/resources/Role.ts +6 -6
  424. package/src/utilities/blocks.ts +30 -30
  425. package/src/utilities/buildBlockRecord.ts +4 -4
  426. package/src/utilities/{fieldValueLocalization.ts → fieldValue.ts} +59 -74
  427. package/src/utilities/fieldsContainingReferences.ts +4 -4
  428. package/src/utilities/recursiveBlocks.ts +47 -44
  429. package/src/utilities/schemaRepository.ts +53 -56
  430. package/dist/cjs/generated/SchemaTypes.js.map +0 -1
  431. package/dist/cjs/generated/SimpleSchemaTypes.js.map +0 -1
  432. package/dist/cjs/utilities/fieldValueLocalization.js.map +0 -1
  433. package/dist/cjs/utilities/structuredText.js +0 -371
  434. package/dist/cjs/utilities/structuredText.js.map +0 -1
  435. package/dist/esm/generated/SchemaTypes.js +0 -2
  436. package/dist/esm/generated/SchemaTypes.js.map +0 -1
  437. package/dist/esm/generated/SimpleSchemaTypes.js +0 -2
  438. package/dist/esm/generated/SimpleSchemaTypes.js.map +0 -1
  439. package/dist/esm/utilities/fieldValueLocalization.js.map +0 -1
  440. package/dist/esm/utilities/structuredText.d.ts +0 -177
  441. package/dist/esm/utilities/structuredText.js +0 -354
  442. package/dist/esm/utilities/structuredText.js.map +0 -1
  443. package/dist/types/utilities/structuredText.d.ts +0 -177
  444. package/src/utilities/structuredText.ts +0 -590
@@ -29,7 +29,7 @@ export function isLocalized(field) {
29
29
  * @param value - The field value to convert (either a localized object or direct value)
30
30
  * @returns Array of entries where each entry contains a locale (string for localized, undefined for non-localized) and the corresponding value
31
31
  */
32
- export function fieldValueToPossiblyLocalizedEntries(field, value) {
32
+ export function fieldValueToEntries(field, value) {
33
33
  if (isLocalized(field)) {
34
34
  const localizedValue = value;
35
35
  return Object.entries(localizedValue).map(([locale, value]) => ({ locale, value }));
@@ -47,7 +47,7 @@ export function fieldValueToPossiblyLocalizedEntries(field, value) {
47
47
  * @param possiblyLocalizedEntries - Array of entries to convert back to field value format
48
48
  * @returns Either a localized object (for localized fields) or the direct value (for non-localized fields)
49
49
  */
50
- export function possiblyLocalizedEntriesToFieldValue(field, possiblyLocalizedEntries) {
50
+ export function entriesToFieldValue(field, possiblyLocalizedEntries) {
51
51
  var _a;
52
52
  if (isLocalized(field)) {
53
53
  return Object.fromEntries(possiblyLocalizedEntries.map(({ locale, value }) => [locale, value]));
@@ -55,9 +55,9 @@ export function possiblyLocalizedEntriesToFieldValue(field, possiblyLocalizedEnt
55
55
  return (_a = possiblyLocalizedEntries[0]) === null || _a === void 0 ? void 0 : _a.value;
56
56
  }
57
57
  /**
58
- * Maps localized field values using a provided mapping function.
58
+ * Maps field values using a provided mapping function.
59
59
  * For localized fields, applies the mapping function to each locale value.
60
- * For non-localized fields, applies the mapping function directly to the only non-localizeed value.
60
+ * For non-localized fields, applies the mapping function directly to the value.
61
61
  *
62
62
  * @template T - The type that the mapping function returns
63
63
  * @param field - The DatoCMS field definition
@@ -65,18 +65,18 @@ export function possiblyLocalizedEntriesToFieldValue(field, possiblyLocalizedEnt
65
65
  * @param mapFn - The function to apply to each locale value or the direct value
66
66
  * @returns The mapped value with the same structure as the input
67
67
  */
68
- export function mapLocalizedFieldValues(field, value, mapFn) {
69
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
68
+ export function mapFieldValue(field, value, mapFn) {
69
+ const entries = fieldValueToEntries(field, value);
70
70
  const mappedEntries = entries.map(({ locale, value }) => ({
71
71
  locale,
72
72
  value: mapFn(locale, value),
73
73
  }));
74
- return possiblyLocalizedEntriesToFieldValue(field, mappedEntries);
74
+ return entriesToFieldValue(field, mappedEntries);
75
75
  }
76
76
  /**
77
- * Maps localized field values using a provided mapping function (async version).
77
+ * Maps field values using a provided mapping function (async version).
78
78
  * For localized fields, applies the mapping function to each locale value.
79
- * For non-localized fields, applies the mapping function directly to the only non-localizeed value.
79
+ * For non-localized fields, applies the mapping function directly to the value.
80
80
  *
81
81
  * @template T - The type that the mapping function returns
82
82
  * @param field - The DatoCMS field definition
@@ -84,20 +84,20 @@ export function mapLocalizedFieldValues(field, value, mapFn) {
84
84
  * @param mapFn - The function to apply to each locale value or the direct value
85
85
  * @returns The mapped value with the same structure as the input
86
86
  */
87
- export function mapLocalizedFieldValuesAsync(field, value, mapFn) {
87
+ export function mapFieldValueAsync(field, value, mapFn) {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
89
+ const entries = fieldValueToEntries(field, value);
90
90
  const mappedEntries = yield Promise.all(entries.map(({ locale, value }) => __awaiter(this, void 0, void 0, function* () {
91
91
  return ({
92
92
  locale,
93
93
  value: yield mapFn(locale, value),
94
94
  });
95
95
  })));
96
- return possiblyLocalizedEntriesToFieldValue(field, mappedEntries);
96
+ return entriesToFieldValue(field, mappedEntries);
97
97
  });
98
98
  }
99
99
  /**
100
- * Filters localized field values using a provided filter function.
100
+ * Filters field values using a provided filter function.
101
101
  * For localized fields, filters each locale value.
102
102
  * For non-localized fields, returns the value if the filter passes, otherwise undefined.
103
103
  *
@@ -106,17 +106,17 @@ export function mapLocalizedFieldValuesAsync(field, value, mapFn) {
106
106
  * @param filterFn - The function to test each locale value or the direct value
107
107
  * @returns The filtered value with the same structure as the input
108
108
  */
109
- export function filterLocalizedFieldValues(field, value, filterFn) {
109
+ export function filterFieldValue(field, value, filterFn) {
110
110
  var _a;
111
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
111
+ const entries = fieldValueToEntries(field, value);
112
112
  const filteredEntries = entries.filter(({ locale, value }) => filterFn(locale, value));
113
113
  if (isLocalized(field)) {
114
- return possiblyLocalizedEntriesToFieldValue(field, filteredEntries);
114
+ return entriesToFieldValue(field, filteredEntries);
115
115
  }
116
116
  return filteredEntries.length > 0 ? (_a = filteredEntries[0]) === null || _a === void 0 ? void 0 : _a.value : undefined;
117
117
  }
118
118
  /**
119
- * Filters localized field values using a provided filter function (async version).
119
+ * Filters field values using a provided filter function (async version).
120
120
  * For localized fields, filters each locale value.
121
121
  * For non-localized fields, returns the value if the filter passes, otherwise undefined.
122
122
  *
@@ -125,10 +125,10 @@ export function filterLocalizedFieldValues(field, value, filterFn) {
125
125
  * @param filterFn - The function to test each locale value or the direct value
126
126
  * @returns The filtered value with the same structure as the input
127
127
  */
128
- export function filterLocalizedFieldValuesAsync(field, value, filterFn) {
128
+ export function filterFieldValueAsync(field, value, filterFn) {
129
129
  var _a;
130
130
  return __awaiter(this, void 0, void 0, function* () {
131
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
131
+ const entries = fieldValueToEntries(field, value);
132
132
  const results = yield Promise.all(entries.map(({ locale, value }) => __awaiter(this, void 0, void 0, function* () {
133
133
  return ({
134
134
  locale,
@@ -140,13 +140,13 @@ export function filterLocalizedFieldValuesAsync(field, value, filterFn) {
140
140
  .filter(({ passed }) => passed)
141
141
  .map(({ locale, value }) => ({ locale, value }));
142
142
  if (isLocalized(field)) {
143
- return possiblyLocalizedEntriesToFieldValue(field, filteredEntries);
143
+ return entriesToFieldValue(field, filteredEntries);
144
144
  }
145
145
  return filteredEntries.length > 0 ? (_a = filteredEntries[0]) === null || _a === void 0 ? void 0 : _a.value : undefined;
146
146
  });
147
147
  }
148
148
  /**
149
- * Tests whether at least one localized field value passes the test implemented by the provided function.
149
+ * Tests whether at least one field value passes the test implemented by the provided function.
150
150
  * For localized fields, tests each locale value.
151
151
  * For non-localized fields, tests the direct value.
152
152
  *
@@ -155,12 +155,12 @@ export function filterLocalizedFieldValuesAsync(field, value, filterFn) {
155
155
  * @param testFn - The function to test each locale value or the direct value
156
156
  * @returns true if at least one value passes the test, false otherwise
157
157
  */
158
- export function someLocalizedFieldValues(field, value, testFn) {
159
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
158
+ export function someFieldValue(field, value, testFn) {
159
+ const entries = fieldValueToEntries(field, value);
160
160
  return entries.some(({ locale, value }) => testFn(locale, value));
161
161
  }
162
162
  /**
163
- * Tests whether at least one localized field value passes the test implemented by the provided function (async version).
163
+ * Tests whether at least one field value passes the test implemented by the provided function (async version).
164
164
  * For localized fields, tests each locale value.
165
165
  * For non-localized fields, tests the direct value.
166
166
  *
@@ -169,15 +169,15 @@ export function someLocalizedFieldValues(field, value, testFn) {
169
169
  * @param testFn - The function to test each locale value or the direct value
170
170
  * @returns true if at least one value passes the test, false otherwise
171
171
  */
172
- export function someLocalizedFieldValuesAsync(field, value, testFn) {
172
+ export function someFieldValueAsync(field, value, testFn) {
173
173
  return __awaiter(this, void 0, void 0, function* () {
174
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
174
+ const entries = fieldValueToEntries(field, value);
175
175
  const results = yield Promise.all(entries.map(({ locale, value }) => testFn(locale, value)));
176
176
  return results.some((result) => result);
177
177
  });
178
178
  }
179
179
  /**
180
- * Tests whether all localized field values pass the test implemented by the provided function.
180
+ * Tests whether all field values pass the test implemented by the provided function.
181
181
  * For localized fields, tests each locale value.
182
182
  * For non-localized fields, tests the direct value.
183
183
  *
@@ -186,11 +186,11 @@ export function someLocalizedFieldValuesAsync(field, value, testFn) {
186
186
  * @param testFn - The function to test each locale value or the direct value
187
187
  * @returns true if all values pass the test, false otherwise
188
188
  */
189
- export function everyLocalizedFieldValues(field, value, testFn) {
190
- return !someLocalizedFieldValues(field, value, (locale, localeValue) => !testFn(locale, localeValue));
189
+ export function everyFieldValue(field, value, testFn) {
190
+ return !someFieldValue(field, value, (locale, localeValue) => !testFn(locale, localeValue));
191
191
  }
192
192
  /**
193
- * Tests whether all localized field values pass the test implemented by the provided function (async version).
193
+ * Tests whether all field values pass the test implemented by the provided function (async version).
194
194
  * For localized fields, tests each locale value.
195
195
  * For non-localized fields, tests the direct value.
196
196
  *
@@ -199,13 +199,13 @@ export function everyLocalizedFieldValues(field, value, testFn) {
199
199
  * @param testFn - The function to test each locale value or the direct value
200
200
  * @returns true if all values pass the test, false otherwise
201
201
  */
202
- export function everyLocalizedFieldValuesAsync(field, value, testFn) {
202
+ export function everyFieldValueAsync(field, value, testFn) {
203
203
  return __awaiter(this, void 0, void 0, function* () {
204
- return !(yield someLocalizedFieldValuesAsync(field, value, (locale, localeValue) => __awaiter(this, void 0, void 0, function* () { return !(yield testFn(locale, localeValue)); })));
204
+ return !(yield someFieldValueAsync(field, value, (locale, localeValue) => __awaiter(this, void 0, void 0, function* () { return !(yield testFn(locale, localeValue)); })));
205
205
  });
206
206
  }
207
207
  /**
208
- * Visits each localized field value with the provided function.
208
+ * Visits each field value with the provided function.
209
209
  * For localized fields, visits each locale value.
210
210
  * For non-localized fields, visits the direct value.
211
211
  *
@@ -213,14 +213,14 @@ export function everyLocalizedFieldValuesAsync(field, value, testFn) {
213
213
  * @param value - The field value (either localized object or direct value)
214
214
  * @param visitFn - The function to call for each locale value or the direct value
215
215
  */
216
- export function visitLocalizedFieldValues(field, value, visitFn) {
217
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
216
+ export function visitFieldValue(field, value, visitFn) {
217
+ const entries = fieldValueToEntries(field, value);
218
218
  for (const { locale, value } of entries) {
219
219
  visitFn(locale, value);
220
220
  }
221
221
  }
222
222
  /**
223
- * Visits each localized field value with the provided function (async version).
223
+ * Visits each field value with the provided function (async version).
224
224
  * For localized fields, visits each locale value.
225
225
  * For non-localized fields, visits the direct value.
226
226
  *
@@ -228,10 +228,10 @@ export function visitLocalizedFieldValues(field, value, visitFn) {
228
228
  * @param value - The field value (either localized object or direct value)
229
229
  * @param visitFn - The function to call for each locale value or the direct value
230
230
  */
231
- export function visitLocalizedFieldValuesAsync(field, value, visitFn) {
231
+ export function visitFieldValueAsync(field, value, visitFn) {
232
232
  return __awaiter(this, void 0, void 0, function* () {
233
- const entries = fieldValueToPossiblyLocalizedEntries(field, value);
233
+ const entries = fieldValueToEntries(field, value);
234
234
  yield Promise.all(entries.map(({ locale, value }) => visitFn(locale, value)));
235
235
  });
236
236
  }
237
- //# sourceMappingURL=fieldValueLocalization.js.map
237
+ //# sourceMappingURL=fieldValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldValue.js","sourceRoot":"","sources":["../../../src/utilities/fieldValue.ts"],"names":[],"mappings":";;;;;;;;;AA+BA;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CACzB,KAAyC;IAEzC,OAAO,YAAY,IAAI,KAAK,CAAC,CAAC,C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AmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;CAAA"}
@@ -1,4 +1,4 @@
1
- import type * as SchemaTypes from '../generated/SchemaTypes';
2
- import type * as SimpleSchemaTypes from '../generated/SimpleSchemaTypes';
3
- export declare function modelIdsReferencedInField(field: SchemaTypes.Field | SimpleSchemaTypes.Field): string[];
4
- export declare function blockModelIdsReferencedInField(field: SchemaTypes.Field | SimpleSchemaTypes.Field): string[];
1
+ import type * as ApiTypes from '../generated/ApiTypes';
2
+ import type * as RawApiTypes from '../generated/RawApiTypes';
3
+ export declare function modelIdsReferencedInField(field: RawApiTypes.Field | ApiTypes.Field): string[];
4
+ export declare function blockModelIdsReferencedInField(field: RawApiTypes.Field | ApiTypes.Field): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"fieldsContainingReferences.js","sourceRoot":"","sources":["../../../src/utilities/fieldsContainingReferences.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,yBAAyB,CACvC,KAAkD;IAElD,MAAM,UAAU,GAAG,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC;SACxD;QACD,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC;SACzD;QACD,KAAK,iBAAiB,CAAC,CAAC;YACtB,OAAO,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,UAAU,CAAC;SAC/D;QACD,OAAO,CAAC,CAAC;YACP,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,KAAkD;IAElD,MAAM,UAAU,GAAG,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,cAAc,CAAC,CAAC;YACnB,OAAO,UAAU,CAAC,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC;SAC7D;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,UAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC;SAC1D;QACD,KAAK,iBAAiB,CAAC,CAAC;YACtB,OAAO;gBACL,GAAG,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,UAAU;gBAC1D,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,6BAA6B;oBACrD,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,6BAA6B,CAAC,UAAU;oBAChE,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;SACH;QACD,OAAO,CAAC,CAAC;YACP,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC"}
1
+ {"version":3,"file":"fieldsContainingReferences.js","sourceRoot":"","sources":["../../../src/utilities/fieldsContainingReferences.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,yBAAyB,CACvC,KAAyC;IAEzC,MAAM,UAAU,GAAG,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC;SACxD;QACD,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC;SACzD;QACD,KAAK,iBAAiB,CAAC,CAAC;YACtB,OAAO,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,UAAU,CAAC;SAC/D;QACD,OAAO,CAAC,CAAC;YACP,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,KAAyC;IAEzC,MAAM,UAAU,GAAG,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,cAAc,CAAC,CAAC;YACnB,OAAO,UAAU,CAAC,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC;SAC7D;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,UAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC;SAC1D;QACD,KAAK,iBAAiB,CAAC,CAAC;YACtB,OAAO;gBACL,GAAG,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,UAAU;gBAC1D,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,6BAA6B;oBACrD,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,6BAA6B,CAAC,UAAU;oBAChE,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;SACH;QACD,OAAO,CAAC,CAAC;YACP,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC"}
@@ -1,15 +1,18 @@
1
1
  import { type BlockItemInARequest } from '../fieldTypes';
2
- import type * as SchemaTypes from '../generated/SchemaTypes';
3
- import type * as SimpleSchemaTypes from '../generated/SimpleSchemaTypes';
2
+ import type * as ApiTypes from '../generated/ApiTypes';
3
+ import type * as RawApiTypes from '../generated/RawApiTypes';
4
4
  import type { SchemaRepository } from './schemaRepository';
5
- import type { TreePath } from './structuredText';
6
- export declare function visitBlocksInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, visitor: (item: BlockItemInARequest, path: TreePath) => void | Promise<void>, path?: TreePath): Promise<void>;
7
- export declare function findAllBlocksInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<Array<{
5
+ /**
6
+ * Path through a field value (ie. ['content', 0, 'attributes', 'title'])
7
+ */
8
+ export type TreePath = readonly (string | number)[];
9
+ export declare function visitBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitor: (item: BlockItemInARequest, path: TreePath) => void | Promise<void>, path?: TreePath): Promise<void>;
10
+ export declare function findAllBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<Array<{
8
11
  item: BlockItemInARequest;
9
12
  path: TreePath;
10
13
  }>>;
11
- export declare function filterBlocksInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<unknown>;
12
- export declare function reduceBlocksInFieldValues<R>(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, reducer: (accumulator: R, item: BlockItemInARequest, path: TreePath) => R | Promise<R>, initialValue: R, path?: TreePath): Promise<R>;
13
- export declare function someBlocksInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
14
- export declare function everyBlockInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
15
- export declare function mapBlocksInFieldValues(schemaRepository: SchemaRepository, field: SchemaTypes.Field | SimpleSchemaTypes.Field, value: unknown, mapper: (item: BlockItemInARequest, path: TreePath) => BlockItemInARequest | Promise<BlockItemInARequest>, path?: TreePath): Promise<unknown>;
14
+ export declare function filterBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<unknown>;
15
+ export declare function reduceBlocksInFieldValues<R>(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, reducer: (accumulator: R, item: BlockItemInARequest, path: TreePath) => R | Promise<R>, initialValue: R, path?: TreePath): Promise<R>;
16
+ export declare function someBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
17
+ export declare function everyBlockInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
18
+ export declare function mapBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapper: (item: BlockItemInARequest, path: TreePath) => BlockItemInARequest | Promise<BlockItemInARequest>, path?: TreePath): Promise<unknown>;
@@ -7,20 +7,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { isBlockObject } from '../fieldTypes';
10
+ import { isItemWithOptionalIdAndMeta, } from '../fieldTypes';
11
11
  import { nonRecursiveFilterBlocksInFieldValueAsync, nonRecursiveFindAllBlocksInFieldValueAsync, nonRecursiveMapBlocksInFieldValueAsync, nonRecursiveReduceBlocksInFieldValueAsync, nonRecursiveSomeBlocksInFieldValueAsync, nonRecursiveVisitBlocksInFieldValueAsync, } from './blocks';
12
- import { mapLocalizedFieldValuesAsync, visitLocalizedFieldValuesAsync, } from './fieldValueLocalization';
12
+ import { mapFieldValueAsync, visitFieldValueAsync } from './fieldValue';
13
13
  export function visitBlocksInFieldValues(schemaRepository, field, value, visitor, path = []) {
14
14
  return __awaiter(this, void 0, void 0, function* () {
15
15
  yield nonRecursiveVisitBlocksInFieldValueAsync(field, value, (block, innerPath) => __awaiter(this, void 0, void 0, function* () {
16
16
  yield visitor(block, [...path, ...innerPath]);
17
- if (!isBlockObject(block)) {
17
+ if (!isItemWithOptionalIdAndMeta(block)) {
18
18
  return;
19
19
  }
20
20
  const itemType = yield schemaRepository.getRawItemTypeById(block.relationships.item_type.data.id);
21
21
  const fields = yield schemaRepository.getRawItemTypeFields(itemType);
22
22
  for (const field of fields) {
23
- yield visitLocalizedFieldValuesAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => visitBlocksInFieldValues(schemaRepository, field, valueForLocale, visitor, [
23
+ yield visitFieldValueAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => visitBlocksInFieldValues(schemaRepository, field, valueForLocale, visitor, [
24
24
  ...path,
25
25
  ...innerPath,
26
26
  'attributes',
@@ -40,13 +40,13 @@ export function findAllBlocksInFieldValues(schemaRepository, field, value, predi
40
40
  path: [...path, ...innerPath],
41
41
  })));
42
42
  yield nonRecursiveVisitBlocksInFieldValueAsync(field, value, (block, innerPath) => __awaiter(this, void 0, void 0, function* () {
43
- if (!isBlockObject(block)) {
43
+ if (!isItemWithOptionalIdAndMeta(block)) {
44
44
  return;
45
45
  }
46
46
  const itemType = yield schemaRepository.getRawItemTypeById(block.relationships.item_type.data.id);
47
47
  const fields = yield schemaRepository.getRawItemTypeFields(itemType);
48
48
  for (const field of fields) {
49
- yield visitLocalizedFieldValuesAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
49
+ yield visitFieldValueAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
50
50
  const nestedResults = yield findAllBlocksInFieldValues(schemaRepository, field, valueForLocale, predicate, [
51
51
  ...path,
52
52
  ...innerPath,
@@ -69,19 +69,18 @@ export function filterBlocksInFieldValues(schemaRepository, field, value, predic
69
69
  if (!passes) {
70
70
  return false;
71
71
  }
72
- if (!isBlockObject(block)) {
72
+ if (!isItemWithOptionalIdAndMeta(block)) {
73
73
  return true;
74
74
  }
75
75
  const itemType = yield schemaRepository.getRawItemTypeById(block.relationships.item_type.data.id);
76
76
  const fields = yield schemaRepository.getRawItemTypeFields(itemType);
77
77
  for (const field of fields) {
78
- block.attributes[field.attributes.api_key] =
79
- yield mapLocalizedFieldValuesAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => filterBlocksInFieldValues(schemaRepository, field, valueForLocale, predicate, [
80
- ...blockPath,
81
- 'attributes',
82
- field.attributes.api_key,
83
- ...(locale ? [locale] : []),
84
- ]));
78
+ block.attributes[field.attributes.api_key] = yield mapFieldValueAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => filterBlocksInFieldValues(schemaRepository, field, valueForLocale, predicate, [
79
+ ...blockPath,
80
+ 'attributes',
81
+ field.attributes.api_key,
82
+ ...(locale ? [locale] : []),
83
+ ]));
85
84
  }
86
85
  return true;
87
86
  }));
@@ -91,13 +90,13 @@ export function reduceBlocksInFieldValues(schemaRepository, field, value, reduce
91
90
  return __awaiter(this, void 0, void 0, function* () {
92
91
  let accumulator = yield nonRecursiveReduceBlocksInFieldValueAsync(field, value, (acc, block, innerPath) => __awaiter(this, void 0, void 0, function* () { return yield reducer(acc, block, [...path, ...innerPath]); }), initialValue);
93
92
  yield nonRecursiveVisitBlocksInFieldValueAsync(field, value, (block, innerPath) => __awaiter(this, void 0, void 0, function* () {
94
- if (!isBlockObject(block)) {
93
+ if (!isItemWithOptionalIdAndMeta(block)) {
95
94
  return;
96
95
  }
97
96
  const itemType = yield schemaRepository.getRawItemTypeById(block.relationships.item_type.data.id);
98
97
  const fields = yield schemaRepository.getRawItemTypeFields(itemType);
99
98
  for (const field of fields) {
100
- yield visitLocalizedFieldValuesAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
99
+ yield visitFieldValueAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
101
100
  accumulator = yield reduceBlocksInFieldValues(schemaRepository, field, valueForLocale, reducer, accumulator, [
102
101
  ...path,
103
102
  ...innerPath,
@@ -119,7 +118,7 @@ export function someBlocksInFieldValues(schemaRepository, field, value, predicat
119
118
  }
120
119
  let found = false;
121
120
  yield nonRecursiveVisitBlocksInFieldValueAsync(field, value, (block, innerPath) => __awaiter(this, void 0, void 0, function* () {
122
- if (found || !isBlockObject(block)) {
121
+ if (found || !isItemWithOptionalIdAndMeta(block)) {
123
122
  return;
124
123
  }
125
124
  const itemType = yield schemaRepository.getRawItemTypeById(block.relationships.item_type.data.id);
@@ -127,7 +126,7 @@ export function someBlocksInFieldValues(schemaRepository, field, value, predicat
127
126
  for (const field of fields) {
128
127
  if (found)
129
128
  break;
130
- yield visitLocalizedFieldValuesAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
129
+ yield visitFieldValueAsync(field, block.attributes[field.attributes.api_key], (locale, valueForLocale) => __awaiter(this, void 0, void 0, function* () {
131
130
  if (found)
132
131
  return;
133
132
  const nestedMatch = yield someBlocksInFieldValues(schemaRepository, field, valueForLocale, predicate, [
@@ -155,14 +154,14 @@ export function mapBlocksInFieldValues(schemaRepository, field, value, mapper, p
155
154
  return __awaiter(this, void 0, void 0, function* () {
156
155
  return nonRecursiveMapBlocksInFieldValueAsync(field, value, (block, innerPath) => __awaiter(this, void 0, void 0, function* () {
157
156
  const newBlock = yield mapper(block, [...path, ...innerPath]);
158
- if (!isBlockObject(newBlock)) {
157
+ if (!isItemWithOptionalIdAndMeta(newBlock)) {
159
158
  return newBlock;
160
159
  }
161
160
  const itemType = yield schemaRepository.getRawItemTypeById(newBlock.relationships.item_type.data.id);
162
161
  const fields = yield schemaRepository.getRawItemTypeFields(itemType);
163
162
  for (const field of fields) {
164
163
  newBlock.attributes[field.attributes.api_key] =
165
- yield mapLocalizedFieldValuesAsync(field, newBlock.attributes[field.attributes.api_key], (locale, valueForLocale) => mapBlocksInFieldValues(schemaRepository, field, valueForLocale, mapper, [
164
+ yield mapFieldValueAsync(field, newBlock.attributes[field.attributes.api_key], (locale, valueForLocale) => mapBlocksInFieldValues(schemaRepository, field, valueForLocale, mapper, [
166
165
  ...path,
167
166
  ...innerPath,
168
167
  'attributes',
@@ -1 +1 @@
1
- {"version":3,"file":"recursiveBlocks.js","sourceRoot":"","sources":["../../../src/utilities/recursiveBlocks.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAA4B,aAAa,EAAE,MAAM,eAAe,CAAC;AAGxE,OAAO,EACL,yCAAyC,EACzC,0CAA0C,EAC1C,sCAAsC,EACtC,yCAAyC,EACzC,uCAAuC,EACvC,wCAAwC,GACzC,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAIlC,MAAM,UAAgB,wBAAwB,CAC5C,gBAAkC,EAClC,KAAkD,EAClD,KAAc,EACd,OAA4E,EAC5E,OAAiB,EAAE;;QAEnB,MAAM,wCAAwC,CAC5C,KAAK,EACL,KAAK,EACL,CAAO,KAAK,EAAE,SAAS,EAAE,EAAE;YACzB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;YAE9C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBACzB,OAAO;aACR;YAED,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC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,EAC7C,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,CACzB,sBAAsB,CACpB,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,MAAM,EACN;wBACE,GAAG,IAAI;wBACP,GAAG,SAAS;wBACZ,YAAY;wBACZ,KAAK,CAAC,UAAU,CAAC,OAAO;wBACxB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;qBAC5B,CACF,CACJ,CAAC;aACL;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CACF,CAAC;IACJ,CAAC;CAAA"}
@@ -1,24 +1,27 @@
1
- import type * as SchemaTypes from '../generated/SchemaTypes';
2
- import type * as SimpleSchemaTypes from '../generated/SimpleSchemaTypes';
1
+ import type * as ApiTypes from '../generated/ApiTypes';
2
+ import type * as RawApiTypes from '../generated/RawApiTypes';
3
3
  interface GenericClient {
4
4
  itemTypes: {
5
5
  rawList(): Promise<{
6
- data: SchemaTypes.ItemType[];
6
+ data: RawApiTypes.ItemType[];
7
7
  }>;
8
8
  };
9
9
  fields: {
10
10
  rawList(itemTypeId: string): Promise<{
11
- data: SchemaTypes.Field[];
11
+ data: RawApiTypes.Field[];
12
+ }>;
13
+ rawReferencing(itemTypeId: string): Promise<{
14
+ data: RawApiTypes.Field[];
12
15
  }>;
13
16
  };
14
17
  fieldsets: {
15
18
  rawList(itemTypeId: string): Promise<{
16
- data: SchemaTypes.Fieldset[];
19
+ data: RawApiTypes.Fieldset[];
17
20
  }>;
18
21
  };
19
22
  plugins: {
20
23
  rawList(): Promise<{
21
- data: SchemaTypes.Plugin[];
24
+ data: RawApiTypes.Plugin[];
22
25
  }>;
23
26
  };
24
27
  }
@@ -51,88 +54,88 @@ export declare class SchemaRepository {
51
54
  * Gets all item types from the DatoCMS project.
52
55
  * @returns Promise that resolves to an array of all item types
53
56
  */
54
- getAllItemTypes(): Promise<SimpleSchemaTypes.ItemType[]>;
57
+ getAllItemTypes(): Promise<ApiTypes.ItemType[]>;
55
58
  /**
56
59
  * Gets all item types from the DatoCMS project.
57
60
  * @returns Promise that resolves to an array of all item types
58
61
  */
59
- getAllRawItemTypes(): Promise<SchemaTypes.ItemType[]>;
62
+ getAllRawItemTypes(): Promise<RawApiTypes.ItemType[]>;
60
63
  /**
61
64
  * Gets all item types that are models (not modular blocks).
62
65
  * @returns Promise that resolves to an array of model item types
63
66
  */
64
- getAllModels(): Promise<SimpleSchemaTypes.ItemType[]>;
67
+ getAllModels(): Promise<ApiTypes.ItemType[]>;
65
68
  /**
66
69
  * Gets all item types that are models (not modular blocks).
67
70
  * @returns Promise that resolves to an array of model item types
68
71
  */
69
- getAllRawModels(): Promise<SchemaTypes.ItemType[]>;
72
+ getAllRawModels(): Promise<RawApiTypes.ItemType[]>;
70
73
  /**
71
74
  * Gets all item types that are modular blocks.
72
75
  * @returns Promise that resolves to an array of block model item types
73
76
  */
74
- getAllBlockModels(): Promise<SimpleSchemaTypes.ItemType[]>;
77
+ getAllBlockModels(): Promise<ApiTypes.ItemType[]>;
75
78
  /**
76
79
  * Gets all item types that are modular blocks.
77
80
  * @returns Promise that resolves to an array of block model item types
78
81
  */
79
- getAllRawBlockModels(): Promise<SchemaTypes.ItemType[]>;
82
+ getAllRawBlockModels(): Promise<RawApiTypes.ItemType[]>;
80
83
  /**
81
84
  * Gets an item type by its API key.
82
85
  * @param apiKey - The API key of the item type to retrieve
83
86
  * @returns Promise that resolves to the item type
84
87
  * @throws Error if the item type is not found
85
88
  */
86
- getItemTypeByApiKey(apiKey: string): Promise<SimpleSchemaTypes.ItemType>;
89
+ getItemTypeByApiKey(apiKey: string): Promise<ApiTypes.ItemType>;
87
90
  /**
88
91
  * Gets an item type by its API key.
89
92
  * @param apiKey - The API key of the item type to retrieve
90
93
  * @returns Promise that resolves to the item type
91
94
  * @throws Error if the item type is not found
92
95
  */
93
- getRawItemTypeByApiKey(apiKey: string): Promise<SchemaTypes.ItemType>;
96
+ getRawItemTypeByApiKey(apiKey: string): Promise<RawApiTypes.ItemType>;
94
97
  /**
95
98
  * Gets an item type by its ID.
96
99
  * @param id - The ID of the item type to retrieve
97
100
  * @returns Promise that resolves to the item type
98
101
  * @throws Error if the item type is not found
99
102
  */
100
- getItemTypeById(id: string): Promise<SimpleSchemaTypes.ItemType>;
103
+ getItemTypeById(id: string): Promise<ApiTypes.ItemType>;
101
104
  /**
102
105
  * Gets an item type by its ID.
103
106
  * @param id - The ID of the item type to retrieve
104
107
  * @returns Promise that resolves to the item type
105
108
  * @throws Error if the item type is not found
106
109
  */
107
- getRawItemTypeById(id: string): Promise<SchemaTypes.ItemType>;
110
+ getRawItemTypeById(id: string): Promise<RawApiTypes.ItemType>;
108
111
  /**
109
112
  * Gets all fields for a given item type.
110
113
  * Fields are cached after the first request for performance.
111
114
  * @param itemType - The item type to get fields for
112
115
  * @returns Promise that resolves to an array of fields
113
116
  */
114
- getItemTypeFields(itemType: SimpleSchemaTypes.ItemType | SchemaTypes.ItemType): Promise<SimpleSchemaTypes.Field[]>;
117
+ getItemTypeFields(itemType: ApiTypes.ItemType | RawApiTypes.ItemType): Promise<ApiTypes.Field[]>;
115
118
  /**
116
119
  * Gets all fields for a given item type.
117
120
  * Fields are cached after the first request for performance.
118
121
  * @param itemType - The item type to get fields for
119
122
  * @returns Promise that resolves to an array of fields
120
123
  */
121
- getRawItemTypeFields(itemType: SchemaTypes.ItemType): Promise<SchemaTypes.Field[]>;
124
+ getRawItemTypeFields(itemType: RawApiTypes.ItemType): Promise<RawApiTypes.Field[]>;
122
125
  /**
123
126
  * Gets all fieldsets for a given item type.
124
127
  * Fieldsets are cached after the first request for performance.
125
128
  * @param itemType - The item type to get fieldsets for
126
129
  * @returns Promise that resolves to an array of fieldsets
127
130
  */
128
- getItemTypeFieldsets(itemType: SimpleSchemaTypes.ItemType | SchemaTypes.ItemType): Promise<SimpleSchemaTypes.Fieldset[]>;
131
+ getItemTypeFieldsets(itemType: ApiTypes.ItemType | RawApiTypes.ItemType): Promise<ApiTypes.Fieldset[]>;
129
132
  /**
130
133
  * Gets all fieldsets for a given item type.
131
134
  * Fieldsets are cached after the first request for performance.
132
135
  * @param itemType - The item type to get fieldsets for
133
136
  * @returns Promise that resolves to an array of fieldsets
134
137
  */
135
- getRawItemTypeFieldsets(itemType: SchemaTypes.ItemType): Promise<SchemaTypes.Fieldset[]>;
138
+ getRawItemTypeFieldsets(itemType: RawApiTypes.ItemType): Promise<RawApiTypes.Fieldset[]>;
136
139
  /**
137
140
  * Loads and caches all plugins from the DatoCMS API.
138
141
  * This method is called lazily and caches the result for subsequent calls.
@@ -143,39 +146,39 @@ export declare class SchemaRepository {
143
146
  * Gets all plugins from the DatoCMS project.
144
147
  * @returns Promise that resolves to an array of all plugins
145
148
  */
146
- getAllPlugins(): Promise<SimpleSchemaTypes.Plugin[]>;
149
+ getAllPlugins(): Promise<ApiTypes.Plugin[]>;
147
150
  /**
148
151
  * Gets all plugins from the DatoCMS project.
149
152
  * @returns Promise that resolves to an array of all plugins
150
153
  */
151
- getAllRawPlugins(): Promise<SchemaTypes.Plugin[]>;
154
+ getAllRawPlugins(): Promise<RawApiTypes.Plugin[]>;
152
155
  /**
153
156
  * Gets a plugin by its ID.
154
157
  * @param id - The ID of the plugin to retrieve
155
158
  * @returns Promise that resolves to the plugin
156
159
  * @throws Error if the plugin is not found
157
160
  */
158
- getPluginById(id: string): Promise<SimpleSchemaTypes.Plugin>;
161
+ getPluginById(id: string): Promise<ApiTypes.Plugin>;
159
162
  /**
160
163
  * Gets a plugin by its ID.
161
164
  * @param id - The ID of the plugin to retrieve
162
165
  * @returns Promise that resolves to the plugin
163
166
  * @throws Error if the plugin is not found
164
167
  */
165
- getRawPluginById(id: string): Promise<SchemaTypes.Plugin>;
168
+ getRawPluginById(id: string): Promise<RawApiTypes.Plugin>;
166
169
  /**
167
170
  * Gets a plugin by its package name.
168
171
  * @param packageName - The package name of the plugin to retrieve
169
172
  * @returns Promise that resolves to the plugin
170
173
  * @throws Error if the plugin is not found
171
174
  */
172
- getPluginByPackageName(packageName: string): Promise<SimpleSchemaTypes.Plugin>;
175
+ getPluginByPackageName(packageName: string): Promise<ApiTypes.Plugin>;
173
176
  /**
174
177
  * Gets a plugin by its package name.
175
178
  * @param packageName - The package name of the plugin to retrieve
176
179
  * @returns Promise that resolves to the plugin
177
180
  * @throws Error if the plugin is not found
178
181
  */
179
- getRawPluginByPackageName(packageName: string): Promise<SchemaTypes.Plugin>;
182
+ getRawPluginByPackageName(packageName: string): Promise<RawApiTypes.Plugin>;
180
183
  }
181
184
  export {};