@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
@@ -51,48 +51,12 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
51
51
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
52
52
  };
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.nonRecursiveEveryBlockInFieldValueAsync = exports.nonRecursiveEveryBlockInFieldValue = exports.nonRecursiveSomeBlocksInFieldValueAsync = exports.nonRecursiveSomeBlocksInFieldValue = exports.nonRecursiveReduceBlocksInFieldValueAsync = exports.nonRecursiveReduceBlocksInFieldValue = exports.nonRecursiveFilterBlocksInFieldValueAsync = exports.nonRecursiveFilterBlocksInFieldValue = exports.nonRecursiveFindAllBlocksInFieldValueAsync = exports.nonRecursiveFindAllBlocksInFieldValue = exports.nonRecursiveMapBlocksInFieldValueAsync = exports.nonRecursiveMapBlocksInFieldValue = exports.nonRecursiveVisitBlocksInFieldValueAsync = exports.nonRecursiveVisitBlocksInFieldValue = void 0;
54
+ exports.nonRecursiveEveryBlockInNonLocalizedFieldValueAsync = exports.nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveMapBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveMapBlocksInNonLocalizedFieldValue = exports.nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync = void 0;
55
55
  const datocms_structured_text_utils_1 = require("datocms-structured-text-utils");
56
- function getFieldType(field) {
57
- return 'attributes' in field ? field.attributes.field_type : field.field_type;
58
- }
59
- function* iterateBlocks(field, value) {
60
- const fieldType = getFieldType(field);
61
- if (fieldType === 'rich_text') {
62
- const richTextValue = value;
63
- if (richTextValue) {
64
- for (let index = 0; index < richTextValue.length; index++) {
65
- const item = richTextValue[index];
66
- yield { item, path: [index] };
67
- }
68
- }
69
- return;
70
- }
71
- if (fieldType === 'single_block') {
72
- const singleBlockValue = value;
73
- if (singleBlockValue) {
74
- yield { item: singleBlockValue, path: [] };
75
- }
76
- return;
77
- }
78
- if (fieldType === 'structured_text') {
79
- const structuredTextValue = value;
80
- if (structuredTextValue) {
81
- const foundNodes = (0, datocms_structured_text_utils_1.collectNodes)(structuredTextValue.document, (node) => node.type === 'block' || node.type === 'inlineBlock');
82
- for (const { node, path } of foundNodes) {
83
- if (node.type === 'block' || node.type === 'inlineBlock') {
84
- yield { item: node.item, path };
85
- }
86
- }
87
- }
88
- return;
89
- }
90
- }
91
- function iterateBlocksAsync(field, value) {
56
+ function iterateBlocksAsync(fieldType, nonLocalizedFieldValue) {
92
57
  return __asyncGenerator(this, arguments, function* iterateBlocksAsync_1() {
93
- const fieldType = getFieldType(field);
94
58
  if (fieldType === 'rich_text') {
95
- const richTextValue = value;
59
+ const richTextValue = nonLocalizedFieldValue;
96
60
  if (richTextValue) {
97
61
  for (let index = 0; index < richTextValue.length; index++) {
98
62
  const item = richTextValue[index];
@@ -102,14 +66,14 @@ function iterateBlocksAsync(field, value) {
102
66
  return yield __await(void 0);
103
67
  }
104
68
  if (fieldType === 'single_block') {
105
- const singleBlockValue = value;
69
+ const singleBlockValue = nonLocalizedFieldValue;
106
70
  if (singleBlockValue) {
107
71
  yield yield __await({ item: singleBlockValue, path: [] });
108
72
  }
109
73
  return yield __await(void 0);
110
74
  }
111
75
  if (fieldType === 'structured_text') {
112
- const structuredTextValue = value;
76
+ const structuredTextValue = nonLocalizedFieldValue;
113
77
  if (structuredTextValue) {
114
78
  const foundNodes = yield __await((0, datocms_structured_text_utils_1.collectNodesAsync)(structuredTextValue.document, (node) => __awaiter(this, void 0, void 0, function* () { return node.type === 'block' || node.type === 'inlineBlock'; })));
115
79
  for (const { node, path } of foundNodes) {
@@ -126,30 +90,16 @@ function iterateBlocksAsync(field, value) {
126
90
  * Visit every block in a field value, calling the visitor function for each block found.
127
91
  * Supports rich text, single block, and structured text field types.
128
92
  *
129
- * @param field - The DatoCMS field definition that determines how blocks are processed
130
- * @param value - The field value containing blocks to visit
131
- * @param visitor - Synchronous function called for each block. Receives the block item and its path
132
- */
133
- function nonRecursiveVisitBlocksInFieldValue(field, value, visitor) {
134
- for (const { item, path } of iterateBlocks(field, value)) {
135
- visitor(item, path);
136
- }
137
- }
138
- exports.nonRecursiveVisitBlocksInFieldValue = nonRecursiveVisitBlocksInFieldValue;
139
- /**
140
- * Visit every block in a field value, calling the visitor function for each block found.
141
- * Supports rich text, single block, and structured text field types.
142
- *
143
- * @param field - The DatoCMS field definition that determines how blocks are processed
144
- * @param value - The field value containing blocks to visit
93
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
94
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to visit
145
95
  * @param visitor - Asynchronous function called for each block. Receives the block item and its path
146
96
  * @returns Promise that resolves when all blocks have been visited
147
97
  */
148
- function nonRecursiveVisitBlocksInFieldValueAsync(field, value, visitor) {
98
+ function nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, visitor) {
149
99
  var _a, e_1, _b, _c;
150
100
  return __awaiter(this, void 0, void 0, function* () {
151
101
  try {
152
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
102
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
153
103
  _c = _f.value;
154
104
  _d = false;
155
105
  try {
@@ -170,31 +120,30 @@ function nonRecursiveVisitBlocksInFieldValueAsync(field, value, visitor) {
170
120
  }
171
121
  });
172
122
  }
173
- exports.nonRecursiveVisitBlocksInFieldValueAsync = nonRecursiveVisitBlocksInFieldValueAsync;
123
+ exports.nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync = nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync;
174
124
  /**
175
125
  * Transform blocks in a field value by applying a mapping function to each block.
176
126
  * Creates a new field value structure with transformed blocks while preserving the original structure.
177
127
  * Supports rich text, single block, and structured text field types.
178
128
  *
179
- * @param field - The DatoCMS field definition that determines how blocks are processed
180
- * @param value - The field value containing blocks to transform
129
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
130
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to transform
181
131
  * @param mapper - Synchronous function that transforms each block. Receives block item and path, returns new block
182
132
  * @returns The new field value with transformed blocks
183
133
  */
184
- function nonRecursiveMapBlocksInFieldValue(field, value, mapper) {
185
- const fieldType = getFieldType(field);
134
+ function nonRecursiveMapBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, mapper) {
186
135
  if (fieldType === 'rich_text') {
187
- const richTextValue = value;
136
+ const richTextValue = nonLocalizedFieldValue;
188
137
  return richTextValue
189
138
  ? richTextValue.map((item, index) => mapper(item, [index]))
190
139
  : richTextValue;
191
140
  }
192
141
  if (fieldType === 'single_block') {
193
- const singleBlockValue = value;
142
+ const singleBlockValue = nonLocalizedFieldValue;
194
143
  return singleBlockValue ? mapper(singleBlockValue, []) : null;
195
144
  }
196
145
  if (fieldType === 'structured_text') {
197
- const structuredTextValue = value;
146
+ const structuredTextValue = nonLocalizedFieldValue;
198
147
  if (!structuredTextValue) {
199
148
  return null;
200
149
  }
@@ -208,34 +157,33 @@ function nonRecursiveMapBlocksInFieldValue(field, value, mapper) {
208
157
  }),
209
158
  };
210
159
  }
211
- return value;
160
+ return nonLocalizedFieldValue;
212
161
  }
213
- exports.nonRecursiveMapBlocksInFieldValue = nonRecursiveMapBlocksInFieldValue;
162
+ exports.nonRecursiveMapBlocksInNonLocalizedFieldValue = nonRecursiveMapBlocksInNonLocalizedFieldValue;
214
163
  /**
215
164
  * Transform blocks in a field value by applying a mapping function to each block.
216
165
  * Creates a new field value structure with transformed blocks while preserving the original structure.
217
166
  * Supports rich text, single block, and structured text field types.
218
167
  *
219
- * @param field - The DatoCMS field definition that determines how blocks are processed
220
- * @param value - The field value containing blocks to transform
168
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
169
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to transform
221
170
  * @param mapper - Asynchronous function that transforms each block. Receives block item and path, returns new block
222
171
  * @returns Promise that resolves to the new field value with transformed blocks
223
172
  */
224
- function nonRecursiveMapBlocksInFieldValueAsync(field, value, mapper) {
173
+ function nonRecursiveMapBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, mapper) {
225
174
  return __awaiter(this, void 0, void 0, function* () {
226
- const fieldType = getFieldType(field);
227
175
  if (fieldType === 'rich_text') {
228
- const richTextValue = value;
176
+ const richTextValue = nonLocalizedFieldValue;
229
177
  return richTextValue
230
178
  ? yield Promise.all(richTextValue.map((item, index) => mapper(item, [index])))
231
179
  : richTextValue;
232
180
  }
233
181
  if (fieldType === 'single_block') {
234
- const singleBlockValue = value;
182
+ const singleBlockValue = nonLocalizedFieldValue;
235
183
  return singleBlockValue ? yield mapper(singleBlockValue, []) : null;
236
184
  }
237
185
  if (fieldType === 'structured_text') {
238
- const structuredTextValue = value;
186
+ const structuredTextValue = nonLocalizedFieldValue;
239
187
  if (!structuredTextValue) {
240
188
  return null;
241
189
  }
@@ -249,44 +197,25 @@ function nonRecursiveMapBlocksInFieldValueAsync(field, value, mapper) {
249
197
  })),
250
198
  };
251
199
  }
252
- return value;
200
+ return nonLocalizedFieldValue;
253
201
  });
254
202
  }
255
- exports.nonRecursiveMapBlocksInFieldValueAsync = nonRecursiveMapBlocksInFieldValueAsync;
256
- /**
257
- * Find all blocks that match the predicate function.
258
- * Searches through all blocks in the field value and returns all matches.
259
- *
260
- * @param field - The DatoCMS field definition that determines how blocks are processed
261
- * @param value - The field value containing blocks to search
262
- * @param predicate - Synchronous function that tests each block. Should return true for matching blocks
263
- * @returns Array of objects, each containing a matching block and its path
264
- */
265
- function nonRecursiveFindAllBlocksInFieldValue(field, value, predicate) {
266
- const results = [];
267
- for (const { item, path } of iterateBlocks(field, value)) {
268
- if (predicate(item, path)) {
269
- results.push({ item, path });
270
- }
271
- }
272
- return results;
273
- }
274
- exports.nonRecursiveFindAllBlocksInFieldValue = nonRecursiveFindAllBlocksInFieldValue;
203
+ exports.nonRecursiveMapBlocksInNonLocalizedFieldValueAsync = nonRecursiveMapBlocksInNonLocalizedFieldValueAsync;
275
204
  /**
276
205
  * Find all blocks that match the predicate function.
277
- * Searches through all blocks in the field value and returns all matches.
206
+ * Searches through all blocks in the non-localized field value and returns all matches.
278
207
  *
279
- * @param field - The DatoCMS field definition that determines how blocks are processed
280
- * @param value - The field value containing blocks to search
208
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
209
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to search
281
210
  * @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
282
211
  * @returns Promise that resolves to an array of objects, each containing a matching block and its path
283
212
  */
284
- function nonRecursiveFindAllBlocksInFieldValueAsync(field, value, predicate) {
213
+ function nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
285
214
  var _a, e_2, _b, _c;
286
215
  return __awaiter(this, void 0, void 0, function* () {
287
216
  const results = [];
288
217
  try {
289
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
218
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
290
219
  _c = _f.value;
291
220
  _d = false;
292
221
  try {
@@ -310,75 +239,24 @@ function nonRecursiveFindAllBlocksInFieldValueAsync(field, value, predicate) {
310
239
  return results;
311
240
  });
312
241
  }
313
- exports.nonRecursiveFindAllBlocksInFieldValueAsync = nonRecursiveFindAllBlocksInFieldValueAsync;
242
+ exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync = nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync;
314
243
  /**
315
244
  * Filter blocks in a field value, removing those that don't match the predicate.
316
245
  * Creates a new field value containing only blocks that pass the predicate test.
317
246
  * Preserves the original field value structure and hierarchy.
318
247
  *
319
- * @param field - The DatoCMS field definition that determines how blocks are processed
320
- * @param value - The field value containing blocks to filter
321
- * @param predicate - Synchronous function that tests each block. Blocks returning false are removed
322
- * @returns The new field value with filtered blocks
323
- */
324
- function nonRecursiveFilterBlocksInFieldValue(field, value, predicate) {
325
- const fieldType = getFieldType(field);
326
- if (fieldType === 'rich_text') {
327
- const filteredItems = [];
328
- for (const { item, path } of iterateBlocks(field, value)) {
329
- if (predicate(item, path)) {
330
- filteredItems.push(item);
331
- }
332
- }
333
- return value ? filteredItems : value;
334
- }
335
- if (fieldType === 'single_block') {
336
- for (const { item, path } of iterateBlocks(field, value)) {
337
- if (predicate(item, path)) {
338
- return item;
339
- }
340
- }
341
- return null;
342
- }
343
- if (fieldType === 'structured_text') {
344
- const structuredTextValue = value;
345
- if (!structuredTextValue) {
346
- return null;
347
- }
348
- const filteredDocument = (0, datocms_structured_text_utils_1.filterNodes)(structuredTextValue.document, (node, _parent, path) => {
349
- if (node.type === 'block' || node.type === 'inlineBlock') {
350
- return predicate(node.item, path);
351
- }
352
- return true;
353
- });
354
- return filteredDocument
355
- ? {
356
- schema: 'dast',
357
- document: filteredDocument,
358
- }
359
- : null;
360
- }
361
- return value;
362
- }
363
- exports.nonRecursiveFilterBlocksInFieldValue = nonRecursiveFilterBlocksInFieldValue;
364
- /**
365
- * Filter blocks in a field value, removing those that don't match the predicate.
366
- * Creates a new field value containing only blocks that pass the predicate test.
367
- * Preserves the original field value structure and hierarchy.
368
- *
369
- * @param field - The DatoCMS field definition that determines how blocks are processed
370
- * @param value - The field value containing blocks to filter
248
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
249
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to filter
371
250
  * @param predicate - Asynchronous function that tests each block. Blocks returning false are removed
372
251
  * @returns Promise that resolves to the new field value with filtered blocks
373
252
  */
374
- function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
253
+ function nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
375
254
  var _a, e_3, _b, _c, _d, e_4, _e, _f;
376
255
  return __awaiter(this, void 0, void 0, function* () {
377
- const fieldType = getFieldType(field);
378
256
  if (fieldType === 'rich_text') {
379
257
  const filteredItems = [];
380
258
  try {
381
- for (var _g = true, _h = __asyncValues(iterateBlocksAsync(field, value)), _j; _j = yield _h.next(), _a = _j.done, !_a;) {
259
+ for (var _g = true, _h = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _j; _j = yield _h.next(), _a = _j.done, !_a;) {
382
260
  _c = _j.value;
383
261
  _g = false;
384
262
  try {
@@ -399,11 +277,11 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
399
277
  }
400
278
  finally { if (e_3) throw e_3.error; }
401
279
  }
402
- return value ? filteredItems : value;
280
+ return filteredItems;
403
281
  }
404
282
  if (fieldType === 'single_block') {
405
283
  try {
406
- for (var _k = true, _l = __asyncValues(iterateBlocksAsync(field, value)), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
284
+ for (var _k = true, _l = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
407
285
  _f = _m.value;
408
286
  _k = false;
409
287
  try {
@@ -427,7 +305,7 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
427
305
  return null;
428
306
  }
429
307
  if (fieldType === 'structured_text') {
430
- const structuredTextValue = value;
308
+ const structuredTextValue = nonLocalizedFieldValue;
431
309
  if (!structuredTextValue) {
432
310
  return null;
433
311
  }
@@ -444,46 +322,27 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
444
322
  }
445
323
  : null;
446
324
  }
447
- return value;
325
+ return nonLocalizedFieldValue;
448
326
  });
449
327
  }
450
- exports.nonRecursiveFilterBlocksInFieldValueAsync = nonRecursiveFilterBlocksInFieldValueAsync;
451
- /**
452
- * Reduce all blocks in a field value to a single value by applying a reducer function.
453
- * Processes each block in the field value and accumulates the results into a single value.
454
- *
455
- * @template R - The type of the accumulated result
456
- * @param field - The DatoCMS field definition that determines how blocks are processed
457
- * @param value - The field value containing blocks to reduce
458
- * @param reducer - Synchronous function that processes each block and updates the accumulator
459
- * @param initialValue - The initial value for the accumulator
460
- * @returns The final accumulated value
461
- */
462
- function nonRecursiveReduceBlocksInFieldValue(field, value, reducer, initialValue) {
463
- let accumulator = initialValue;
464
- for (const { item, path } of iterateBlocks(field, value)) {
465
- accumulator = reducer(accumulator, item, path);
466
- }
467
- return accumulator;
468
- }
469
- exports.nonRecursiveReduceBlocksInFieldValue = nonRecursiveReduceBlocksInFieldValue;
328
+ exports.nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync = nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync;
470
329
  /**
471
330
  * Reduce all blocks in a field value to a single value by applying a reducer function.
472
- * Processes each block in the field value and accumulates the results into a single value.
331
+ * Processes each block in the non-localized field value and accumulates the results into a single value.
473
332
  *
474
333
  * @template R - The type of the accumulated result
475
- * @param field - The DatoCMS field definition that determines how blocks are processed
476
- * @param value - The field value containing blocks to reduce
334
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
335
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to reduce
477
336
  * @param reducer - Asynchronous function that processes each block and updates the accumulator
478
337
  * @param initialValue - The initial value for the accumulator
479
338
  * @returns Promise that resolves to the final accumulated value
480
339
  */
481
- function nonRecursiveReduceBlocksInFieldValueAsync(field, value, reducer, initialValue) {
340
+ function nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, reducer, initialValue) {
482
341
  var _a, e_5, _b, _c;
483
342
  return __awaiter(this, void 0, void 0, function* () {
484
343
  let accumulator = initialValue;
485
344
  try {
486
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
345
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
487
346
  _c = _f.value;
488
347
  _d = false;
489
348
  try {
@@ -505,39 +364,21 @@ function nonRecursiveReduceBlocksInFieldValueAsync(field, value, reducer, initia
505
364
  return accumulator;
506
365
  });
507
366
  }
508
- exports.nonRecursiveReduceBlocksInFieldValueAsync = nonRecursiveReduceBlocksInFieldValueAsync;
509
- /**
510
- * Check if any block in the field value matches the predicate function.
511
- * Returns true as soon as the first matching block is found (short-circuit evaluation).
512
- *
513
- * @param field - The DatoCMS field definition that determines how blocks are processed
514
- * @param value - The field value containing blocks to test
515
- * @param predicate - Synchronous function that tests each block. Should return true for matching blocks
516
- * @returns True if any block matches, false otherwise
517
- */
518
- function nonRecursiveSomeBlocksInFieldValue(field, value, predicate) {
519
- for (const { item, path } of iterateBlocks(field, value)) {
520
- if (predicate(item, path)) {
521
- return true;
522
- }
523
- }
524
- return false;
525
- }
526
- exports.nonRecursiveSomeBlocksInFieldValue = nonRecursiveSomeBlocksInFieldValue;
367
+ exports.nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync = nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync;
527
368
  /**
528
- * Check if any block in the field value matches the predicate function.
369
+ * Check if any block in the non-localized field value matches the predicate function.
529
370
  * Returns true as soon as the first matching block is found (short-circuit evaluation).
530
371
  *
531
- * @param field - The DatoCMS field definition that determines how blocks are processed
532
- * @param value - The field value containing blocks to test
372
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
373
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
533
374
  * @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
534
375
  * @returns Promise that resolves to true if any block matches, false otherwise
535
376
  */
536
- function nonRecursiveSomeBlocksInFieldValueAsync(field, value, predicate) {
377
+ function nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
537
378
  var _a, e_6, _b, _c;
538
379
  return __awaiter(this, void 0, void 0, function* () {
539
380
  try {
540
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
381
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
541
382
  _c = _f.value;
542
383
  _d = false;
543
384
  try {
@@ -561,37 +402,22 @@ function nonRecursiveSomeBlocksInFieldValueAsync(field, value, predicate) {
561
402
  return false;
562
403
  });
563
404
  }
564
- exports.nonRecursiveSomeBlocksInFieldValueAsync = nonRecursiveSomeBlocksInFieldValueAsync;
565
- /**
566
- * Check if every block in the field value matches the predicate function.
567
- * Returns false as soon as the first non-matching block is found (short-circuit evaluation).
568
- *
569
- * @param field - The DatoCMS field definition that determines how blocks are processed
570
- * @param value - The field value containing blocks to test
571
- * @param predicate - Synchronous function that tests each block. Should return true for valid blocks
572
- * @returns True if all blocks match, false otherwise
573
- */
574
- function nonRecursiveEveryBlockInFieldValue(field, value, predicate) {
575
- return !nonRecursiveSomeBlocksInFieldValue(field, value, (item, path) => {
576
- return !predicate(item, path);
577
- });
578
- }
579
- exports.nonRecursiveEveryBlockInFieldValue = nonRecursiveEveryBlockInFieldValue;
405
+ exports.nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync = nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync;
580
406
  /**
581
- * Check if every block in the field value matches the predicate function.
407
+ * Check if every block in the non-localized field value matches the predicate function.
582
408
  * Returns false as soon as the first non-matching block is found (short-circuit evaluation).
583
409
  *
584
- * @param field - The DatoCMS field definition that determines how blocks are processed
585
- * @param value - The field value containing blocks to test
410
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
411
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
586
412
  * @param predicate - Asynchronous function that tests each block. Should return true for valid blocks
587
413
  * @returns Promise that resolves to true if all blocks match, false otherwise
588
414
  */
589
- function nonRecursiveEveryBlockInFieldValueAsync(field, value, predicate) {
415
+ function nonRecursiveEveryBlockInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
590
416
  return __awaiter(this, void 0, void 0, function* () {
591
- return !(yield nonRecursiveSomeBlocksInFieldValueAsync(field, value, (item, path) => __awaiter(this, void 0, void 0, function* () {
417
+ return !(yield nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, (item, path) => __awaiter(this, void 0, void 0, function* () {
592
418
  return !(yield predicate(item, path));
593
419
  })));
594
420
  });
595
421
  }
596
- exports.nonRecursiveEveryBlockInFieldValueAsync = nonRecursiveEveryBlockInFieldValueAsync;
597
- //# sourceMappingURL=blocks.js.map
422
+ exports.nonRecursiveEveryBlockInNonLocalizedFieldValueAsync = nonRecursiveEveryBlockInNonLocalizedFieldValueAsync;
423
+ //# sourceMappingURL=nonRecursiveBlocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonRecursiveBlocks.js","sourceRoot":"","sources":["../../../src/utilities/nonRecursiveBlocks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iFAMuC;AA4BvC,SAAgB,kBAAkB,CAChC,SAAuC,EACvC,sBAA+B;;QAE/B,IAAI,SAAS,KAAK,WAAW,EAAE;YAC7B,MAAM,aAAa,GAAG,sBAA+C,CAAC;YACtE,IAAI,aAAa,EAAE;gBACjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBACzD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAE,CAAC;oBACnC,oBAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAA,CAAC;iBAC/B;aACF;YACD,6BAAO;SACR;QAED,IAAI,SAAS,KAAK,cAAc,EAAE;YAChC,MAAM,gBAAgB,GAAG,sBAAkD,CAAC;YAC5E,IAAI,gBAAgB,EAAE;gBACpB,oBAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA,CAAC;aAC5C;YACD,6BAAO;SACR;QAED,IAAI,SAAS,KAAK,iBAAiB,EAAE;YACnC,MAAM,mBAAmB,GACvB,sBAAqD,CAAC;YACxD,IAAI,mBAAmB,EAAE;gBACvB,MAAM,UAAU,GAAG,cAAM,IAAA,iDAAiB,EACxC,mBAAmB,CAAC,QAAQ,EAC5B,CAAO,IAAI,EAAE,EAAE,gDAAC,OAAA,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,CAAA,GAAA,CACrE,CAAA,CAAC;gBAEF,KAAK,M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