@sitecore-content-sdk/core 1.5.0 → 2.0.0-canary.10

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 (337) hide show
  1. package/LICENSE.txt +202 -202
  2. package/dist/cjs/constants.js +7 -21
  3. package/dist/cjs/debug.js +14 -18
  4. package/dist/cjs/graphql-request-client.js +10 -5
  5. package/dist/cjs/index.js +3 -7
  6. package/dist/cjs/native-fetcher.js +1 -1
  7. package/dist/cjs/{utils → tools}/ensurePath.js +1 -0
  8. package/dist/cjs/{media/index.js → tools/index-node.js} +27 -3
  9. package/dist/cjs/tools/index.js +28 -72
  10. package/dist/cjs/tools/{generateMetadata.js → metadata/generateMetadata.js} +2 -2
  11. package/dist/cjs/tools/metadata/index.js +5 -0
  12. package/dist/cjs/{editing → tools/metadata}/metadata.js +1 -6
  13. package/dist/cjs/tools/normalize-env-value.js +22 -0
  14. package/dist/cjs/{utils → tools}/normalize-url.js +6 -0
  15. package/dist/cjs/tools/resolve-edge-url.js +95 -0
  16. package/dist/cjs/{utils → tools}/utils.js +6 -64
  17. package/dist/esm/constants.js +6 -20
  18. package/dist/esm/debug.js +13 -17
  19. package/dist/esm/graphql-request-client.js +10 -5
  20. package/dist/esm/index.js +1 -6
  21. package/dist/esm/native-fetcher.js +1 -1
  22. package/dist/esm/{utils → tools}/ensurePath.js +1 -0
  23. package/dist/esm/tools/index-node.js +22 -0
  24. package/dist/esm/tools/index.js +6 -28
  25. package/dist/esm/tools/{generateMetadata.js → metadata/generateMetadata.js} +2 -2
  26. package/dist/esm/tools/metadata/index.js +1 -0
  27. package/dist/esm/{editing → tools/metadata}/metadata.js +1 -6
  28. package/dist/esm/tools/normalize-env-value.js +19 -0
  29. package/dist/esm/tools/normalize-url.js +7 -0
  30. package/dist/esm/tools/resolve-edge-url.js +89 -0
  31. package/dist/esm/{utils → tools}/utils.js +5 -61
  32. package/node-tools.d.ts +1 -0
  33. package/package.json +98 -163
  34. package/types/constants.d.ts +6 -17
  35. package/types/constants.d.ts.map +1 -1
  36. package/types/debug.d.ts +13 -13
  37. package/types/debug.d.ts.map +1 -1
  38. package/types/graphql-request-client.d.ts +8 -2
  39. package/types/graphql-request-client.d.ts.map +1 -1
  40. package/types/index.d.ts +3 -6
  41. package/types/index.d.ts.map +1 -1
  42. package/types/models.d.ts +0 -31
  43. package/types/models.d.ts.map +1 -1
  44. package/types/{utils → tools}/ensurePath.d.ts +1 -0
  45. package/types/tools/ensurePath.d.ts.map +1 -0
  46. package/types/{utils → tools}/globalCache.d.ts.map +1 -1
  47. package/types/tools/index-node.d.ts +14 -0
  48. package/types/tools/index-node.d.ts.map +1 -0
  49. package/types/tools/index.d.ts +5 -21
  50. package/types/tools/index.d.ts.map +1 -1
  51. package/types/tools/is-server.d.ts.map +1 -0
  52. package/types/tools/metadata/generateMetadata.d.ts.map +1 -0
  53. package/types/tools/metadata/index.d.ts +3 -0
  54. package/types/tools/metadata/index.d.ts.map +1 -0
  55. package/types/{editing → tools/metadata}/metadata.d.ts +9 -1
  56. package/types/tools/metadata/metadata.d.ts.map +1 -0
  57. package/types/tools/normalize-env-value.d.ts +10 -0
  58. package/types/tools/normalize-env-value.d.ts.map +1 -0
  59. package/types/tools/normalize-url.d.ts +8 -0
  60. package/types/tools/normalize-url.d.ts.map +1 -0
  61. package/types/tools/resolve-edge-url.d.ts +52 -0
  62. package/types/tools/resolve-edge-url.d.ts.map +1 -0
  63. package/types/{utils → tools}/timeout-promise.d.ts.map +1 -1
  64. package/types/{utils → tools}/utils.d.ts +6 -26
  65. package/types/tools/utils.d.ts.map +1 -0
  66. package/client.d.ts +0 -1
  67. package/codegen.d.ts +0 -1
  68. package/config-cli.d.ts +0 -1
  69. package/config.d.ts +0 -1
  70. package/dist/cjs/client/constants.js +0 -7
  71. package/dist/cjs/client/edge-proxy.js +0 -24
  72. package/dist/cjs/client/index.js +0 -15
  73. package/dist/cjs/client/models.js +0 -2
  74. package/dist/cjs/client/sitecore-client.js +0 -424
  75. package/dist/cjs/client/utils.js +0 -51
  76. package/dist/cjs/config/define-config.js +0 -195
  77. package/dist/cjs/config/index.js +0 -7
  78. package/dist/cjs/config/models.js +0 -12
  79. package/dist/cjs/config-cli/define-cli-config.js +0 -23
  80. package/dist/cjs/config-cli/index.js +0 -7
  81. package/dist/cjs/config-cli/models.js +0 -8
  82. package/dist/cjs/editing/codegen/index.js +0 -15
  83. package/dist/cjs/editing/codegen/preview.js +0 -306
  84. package/dist/cjs/editing/component-layout-service.js +0 -63
  85. package/dist/cjs/editing/design-library.js +0 -190
  86. package/dist/cjs/editing/editing-service.js +0 -81
  87. package/dist/cjs/editing/index.js +0 -34
  88. package/dist/cjs/editing/models.js +0 -44
  89. package/dist/cjs/editing/utils.js +0 -108
  90. package/dist/cjs/form/form.js +0 -81
  91. package/dist/cjs/form/index.js +0 -7
  92. package/dist/cjs/i18n/dictionary-service.js +0 -144
  93. package/dist/cjs/i18n/index.js +0 -7
  94. package/dist/cjs/i18n/utils.js +0 -16
  95. package/dist/cjs/layout/content-styles.js +0 -72
  96. package/dist/cjs/layout/index.js +0 -24
  97. package/dist/cjs/layout/layout-service.js +0 -68
  98. package/dist/cjs/layout/models.js +0 -39
  99. package/dist/cjs/layout/themes.js +0 -76
  100. package/dist/cjs/layout/utils.js +0 -117
  101. package/dist/cjs/media/media-api.js +0 -100
  102. package/dist/cjs/personalize/index.js +0 -15
  103. package/dist/cjs/personalize/layout-personalizer.js +0 -98
  104. package/dist/cjs/personalize/personalize-service.js +0 -109
  105. package/dist/cjs/personalize/utils.js +0 -143
  106. package/dist/cjs/site/error-pages-service.js +0 -82
  107. package/dist/cjs/site/index.js +0 -26
  108. package/dist/cjs/site/models.js +0 -2
  109. package/dist/cjs/site/redirects-service.js +0 -108
  110. package/dist/cjs/site/robots-service.js +0 -74
  111. package/dist/cjs/site/site-resolver.js +0 -73
  112. package/dist/cjs/site/siteinfo-service.js +0 -94
  113. package/dist/cjs/site/sitemap-xml-service.js +0 -92
  114. package/dist/cjs/site/sitepath-service.js +0 -201
  115. package/dist/cjs/site/utils.js +0 -55
  116. package/dist/cjs/sitecore-service-base.js +0 -36
  117. package/dist/cjs/tools/codegen/component-generation.js +0 -52
  118. package/dist/cjs/tools/codegen/extract-files.js +0 -105
  119. package/dist/cjs/tools/codegen/import-map.js +0 -411
  120. package/dist/cjs/tools/codegen/utils.js +0 -418
  121. package/dist/cjs/tools/generate-map.js +0 -2
  122. package/dist/cjs/tools/generateSites.js +0 -59
  123. package/dist/cjs/tools/scaffold.js +0 -62
  124. package/dist/cjs/tools/templating/components.js +0 -96
  125. package/dist/cjs/tools/templating/index.js +0 -11
  126. package/dist/cjs/tools/templating/plugins.js +0 -80
  127. package/dist/cjs/tools/templating/utils.js +0 -67
  128. package/dist/cjs/utils/env.js +0 -28
  129. package/dist/cjs/utils/index.js +0 -26
  130. package/dist/esm/client/constants.js +0 -4
  131. package/dist/esm/client/edge-proxy.js +0 -19
  132. package/dist/esm/client/index.js +0 -5
  133. package/dist/esm/client/models.js +0 -1
  134. package/dist/esm/client/sitecore-client.js +0 -417
  135. package/dist/esm/client/utils.js +0 -47
  136. package/dist/esm/config/define-config.js +0 -189
  137. package/dist/esm/config/index.js +0 -2
  138. package/dist/esm/config/models.js +0 -9
  139. package/dist/esm/config-cli/define-cli-config.js +0 -19
  140. package/dist/esm/config-cli/index.js +0 -2
  141. package/dist/esm/config-cli/models.js +0 -5
  142. package/dist/esm/editing/codegen/index.js +0 -1
  143. package/dist/esm/editing/codegen/preview.js +0 -288
  144. package/dist/esm/editing/component-layout-service.js +0 -56
  145. package/dist/esm/editing/design-library.js +0 -178
  146. package/dist/esm/editing/editing-service.js +0 -74
  147. package/dist/esm/editing/index.js +0 -6
  148. package/dist/esm/editing/models.js +0 -41
  149. package/dist/esm/editing/utils.js +0 -98
  150. package/dist/esm/form/form.js +0 -72
  151. package/dist/esm/form/index.js +0 -1
  152. package/dist/esm/i18n/dictionary-service.js +0 -137
  153. package/dist/esm/i18n/index.js +0 -2
  154. package/dist/esm/i18n/utils.js +0 -13
  155. package/dist/esm/layout/content-styles.js +0 -64
  156. package/dist/esm/layout/index.js +0 -6
  157. package/dist/esm/layout/layout-service.js +0 -61
  158. package/dist/esm/layout/models.js +0 -36
  159. package/dist/esm/layout/themes.js +0 -71
  160. package/dist/esm/layout/utils.js +0 -109
  161. package/dist/esm/media/index.js +0 -2
  162. package/dist/esm/media/media-api.js +0 -90
  163. package/dist/esm/personalize/index.js +0 -3
  164. package/dist/esm/personalize/layout-personalizer.js +0 -93
  165. package/dist/esm/personalize/personalize-service.js +0 -102
  166. package/dist/esm/personalize/utils.js +0 -135
  167. package/dist/esm/site/error-pages-service.js +0 -75
  168. package/dist/esm/site/index.js +0 -8
  169. package/dist/esm/site/models.js +0 -1
  170. package/dist/esm/site/redirects-service.js +0 -101
  171. package/dist/esm/site/robots-service.js +0 -67
  172. package/dist/esm/site/site-resolver.js +0 -69
  173. package/dist/esm/site/siteinfo-service.js +0 -87
  174. package/dist/esm/site/sitemap-xml-service.js +0 -85
  175. package/dist/esm/site/sitepath-service.js +0 -193
  176. package/dist/esm/site/utils.js +0 -49
  177. package/dist/esm/sitecore-service-base.js +0 -29
  178. package/dist/esm/tools/codegen/component-generation.js +0 -44
  179. package/dist/esm/tools/codegen/extract-files.js +0 -99
  180. package/dist/esm/tools/codegen/import-map.js +0 -368
  181. package/dist/esm/tools/codegen/utils.js +0 -373
  182. package/dist/esm/tools/generate-map.js +0 -1
  183. package/dist/esm/tools/generateSites.js +0 -52
  184. package/dist/esm/tools/scaffold.js +0 -54
  185. package/dist/esm/tools/templating/components.js +0 -59
  186. package/dist/esm/tools/templating/index.js +0 -3
  187. package/dist/esm/tools/templating/plugins.js +0 -72
  188. package/dist/esm/tools/templating/utils.js +0 -59
  189. package/dist/esm/utils/env.js +0 -24
  190. package/dist/esm/utils/index.js +0 -4
  191. package/dist/esm/utils/normalize-url.js +0 -1
  192. package/editing.d.ts +0 -1
  193. package/i18n.d.ts +0 -1
  194. package/layout.d.ts +0 -1
  195. package/media.d.ts +0 -1
  196. package/personalize.d.ts +0 -1
  197. package/site.d.ts +0 -1
  198. package/types/client/constants.d.ts +0 -5
  199. package/types/client/constants.d.ts.map +0 -1
  200. package/types/client/edge-proxy.d.ts +0 -18
  201. package/types/client/edge-proxy.d.ts.map +0 -1
  202. package/types/client/index.d.ts +0 -8
  203. package/types/client/index.d.ts.map +0 -1
  204. package/types/client/models.d.ts +0 -21
  205. package/types/client/models.d.ts.map +0 -1
  206. package/types/client/sitecore-client.d.ts +0 -338
  207. package/types/client/sitecore-client.d.ts.map +0 -1
  208. package/types/client/utils.d.ts +0 -15
  209. package/types/client/utils.d.ts.map +0 -1
  210. package/types/config/define-config.d.ts +0 -20
  211. package/types/config/define-config.d.ts.map +0 -1
  212. package/types/config/index.d.ts +0 -3
  213. package/types/config/index.d.ts.map +0 -1
  214. package/types/config/models.d.ts +0 -287
  215. package/types/config/models.d.ts.map +0 -1
  216. package/types/config-cli/define-cli-config.d.ts +0 -9
  217. package/types/config-cli/define-cli-config.d.ts.map +0 -1
  218. package/types/config-cli/index.d.ts +0 -3
  219. package/types/config-cli/index.d.ts.map +0 -1
  220. package/types/config-cli/models.d.ts +0 -6
  221. package/types/config-cli/models.d.ts.map +0 -1
  222. package/types/editing/codegen/index.d.ts +0 -2
  223. package/types/editing/codegen/index.d.ts.map +0 -1
  224. package/types/editing/codegen/preview.d.ts +0 -289
  225. package/types/editing/codegen/preview.d.ts.map +0 -1
  226. package/types/editing/component-layout-service.d.ts +0 -84
  227. package/types/editing/component-layout-service.d.ts.map +0 -1
  228. package/types/editing/design-library.d.ts +0 -118
  229. package/types/editing/design-library.d.ts.map +0 -1
  230. package/types/editing/editing-service.d.ts +0 -72
  231. package/types/editing/editing-service.d.ts.map +0 -1
  232. package/types/editing/index.d.ts +0 -7
  233. package/types/editing/index.d.ts.map +0 -1
  234. package/types/editing/metadata.d.ts.map +0 -1
  235. package/types/editing/models.d.ts +0 -103
  236. package/types/editing/models.d.ts.map +0 -1
  237. package/types/editing/utils.d.ts +0 -91
  238. package/types/editing/utils.d.ts.map +0 -1
  239. package/types/form/form.d.ts +0 -25
  240. package/types/form/form.d.ts.map +0 -1
  241. package/types/form/index.d.ts +0 -2
  242. package/types/form/index.d.ts.map +0 -1
  243. package/types/i18n/dictionary-service.d.ts +0 -135
  244. package/types/i18n/dictionary-service.d.ts.map +0 -1
  245. package/types/i18n/index.d.ts +0 -3
  246. package/types/i18n/index.d.ts.map +0 -1
  247. package/types/i18n/utils.d.ts +0 -9
  248. package/types/i18n/utils.d.ts.map +0 -1
  249. package/types/layout/content-styles.d.ts +0 -20
  250. package/types/layout/content-styles.d.ts.map +0 -1
  251. package/types/layout/index.d.ts +0 -6
  252. package/types/layout/index.d.ts.map +0 -1
  253. package/types/layout/layout-service.d.ts +0 -45
  254. package/types/layout/layout-service.d.ts.map +0 -1
  255. package/types/layout/models.d.ts +0 -174
  256. package/types/layout/models.d.ts.map +0 -1
  257. package/types/layout/themes.d.ts +0 -13
  258. package/types/layout/themes.d.ts.map +0 -1
  259. package/types/layout/utils.d.ts +0 -56
  260. package/types/layout/utils.d.ts.map +0 -1
  261. package/types/media/index.d.ts +0 -3
  262. package/types/media/index.d.ts.map +0 -1
  263. package/types/media/media-api.d.ts +0 -60
  264. package/types/media/media-api.d.ts.map +0 -1
  265. package/types/personalize/index.d.ts +0 -4
  266. package/types/personalize/index.d.ts.map +0 -1
  267. package/types/personalize/layout-personalizer.d.ts +0 -29
  268. package/types/personalize/layout-personalizer.d.ts.map +0 -1
  269. package/types/personalize/personalize-service.d.ts +0 -90
  270. package/types/personalize/personalize-service.d.ts.map +0 -1
  271. package/types/personalize/utils.d.ts +0 -78
  272. package/types/personalize/utils.d.ts.map +0 -1
  273. package/types/site/error-pages-service.d.ts +0 -64
  274. package/types/site/error-pages-service.d.ts.map +0 -1
  275. package/types/site/index.d.ts +0 -10
  276. package/types/site/index.d.ts.map +0 -1
  277. package/types/site/models.d.ts +0 -23
  278. package/types/site/models.d.ts.map +0 -1
  279. package/types/site/redirects-service.d.ts +0 -92
  280. package/types/site/redirects-service.d.ts.map +0 -1
  281. package/types/site/robots-service.d.ts +0 -57
  282. package/types/site/robots-service.d.ts.map +0 -1
  283. package/types/site/site-resolver.d.ts +0 -28
  284. package/types/site/site-resolver.d.ts.map +0 -1
  285. package/types/site/siteinfo-service.d.ts +0 -65
  286. package/types/site/siteinfo-service.d.ts.map +0 -1
  287. package/types/site/sitemap-xml-service.d.ts +0 -63
  288. package/types/site/sitemap-xml-service.d.ts.map +0 -1
  289. package/types/site/sitepath-service.d.ts +0 -137
  290. package/types/site/sitepath-service.d.ts.map +0 -1
  291. package/types/site/utils.d.ts +0 -41
  292. package/types/site/utils.d.ts.map +0 -1
  293. package/types/sitecore-service-base.d.ts +0 -31
  294. package/types/sitecore-service-base.d.ts.map +0 -1
  295. package/types/tools/codegen/component-generation.d.ts +0 -50
  296. package/types/tools/codegen/component-generation.d.ts.map +0 -1
  297. package/types/tools/codegen/extract-files.d.ts +0 -24
  298. package/types/tools/codegen/extract-files.d.ts.map +0 -1
  299. package/types/tools/codegen/import-map.d.ts +0 -102
  300. package/types/tools/codegen/import-map.d.ts.map +0 -1
  301. package/types/tools/codegen/utils.d.ts +0 -76
  302. package/types/tools/codegen/utils.d.ts.map +0 -1
  303. package/types/tools/generate-map.d.ts +0 -36
  304. package/types/tools/generate-map.d.ts.map +0 -1
  305. package/types/tools/generateMetadata.d.ts.map +0 -1
  306. package/types/tools/generateSites.d.ts +0 -25
  307. package/types/tools/generateSites.d.ts.map +0 -1
  308. package/types/tools/scaffold.d.ts +0 -27
  309. package/types/tools/scaffold.d.ts.map +0 -1
  310. package/types/tools/templating/components.d.ts +0 -104
  311. package/types/tools/templating/components.d.ts.map +0 -1
  312. package/types/tools/templating/index.d.ts +0 -4
  313. package/types/tools/templating/index.d.ts.map +0 -1
  314. package/types/tools/templating/plugins.d.ts +0 -71
  315. package/types/tools/templating/plugins.d.ts.map +0 -1
  316. package/types/tools/templating/utils.d.ts +0 -42
  317. package/types/tools/templating/utils.d.ts.map +0 -1
  318. package/types/utils/ensurePath.d.ts.map +0 -1
  319. package/types/utils/env.d.ts +0 -9
  320. package/types/utils/env.d.ts.map +0 -1
  321. package/types/utils/index.d.ts +0 -5
  322. package/types/utils/index.d.ts.map +0 -1
  323. package/types/utils/is-server.d.ts.map +0 -1
  324. package/types/utils/normalize-url.d.ts +0 -2
  325. package/types/utils/normalize-url.d.ts.map +0 -1
  326. package/types/utils/utils.d.ts.map +0 -1
  327. package/utils.d.ts +0 -1
  328. /package/dist/cjs/{utils → tools}/globalCache.js +0 -0
  329. /package/dist/cjs/{utils → tools}/is-server.js +0 -0
  330. /package/dist/cjs/{utils → tools}/timeout-promise.js +0 -0
  331. /package/dist/esm/{utils → tools}/globalCache.js +0 -0
  332. /package/dist/esm/{utils → tools}/is-server.js +0 -0
  333. /package/dist/esm/{utils → tools}/timeout-promise.js +0 -0
  334. /package/types/{utils → tools}/globalCache.d.ts +0 -0
  335. /package/types/{utils → tools}/is-server.d.ts +0 -0
  336. /package/types/tools/{generateMetadata.d.ts → metadata/generateMetadata.d.ts} +0 -0
  337. /package/types/{utils → tools}/timeout-promise.d.ts +0 -0
@@ -1,287 +0,0 @@
1
- import { RetryStrategy } from '../models';
2
- import { GenerateMapFunction, GenerateMapArgs } from '../tools';
3
- /**
4
- * Utility type to make every property in a type required
5
- * @public
6
- */
7
- export type DeepRequired<T> = Required<{
8
- [K in keyof T]: T[K] extends Required<T[K]> ? T[K] : DeepRequired<T[K]>;
9
- }>;
10
- /**
11
- * Utility type to make all properties in a type optional, recursively
12
- * @internal
13
- */
14
- export type DeepPartial<T> = {
15
- [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
16
- };
17
- /**
18
- * Type to be used as config input in sitecore.config
19
- * @public
20
- */
21
- export type SitecoreConfigInput = {
22
- /**
23
- * API settings required to connect to Sitecore.
24
- * Both edge and local sets can be specified; the Content SDK app will choose
25
- * the correct credentials (Edge or local) at runtime.
26
- */
27
- api?: {
28
- /**
29
- * Edge endpoint credentials for connecting to an XM Cloud instance.
30
- */
31
- edge?: {
32
- /**
33
- * A unified identifier used to connect and retrieve data from XM Cloud instance
34
- * Must be provided together with `clientContextId` to support both server-
35
- * side and browser-side data fetching.
36
- */
37
- contextId: string;
38
- /**
39
- * Optional identifier used to connect and retrieve data from XM Cloud instance in client-side functionality
40
- */
41
- clientContextId?: string;
42
- /**
43
- * XM Cloud endpoint that the app will communicate and retrieve data from
44
- * @default https://edge-platform.sitecorecloud.io
45
- */
46
- edgeUrl?: string;
47
- };
48
- /**
49
- * API endpoint credentials for connecting to a local Sitecore instance.
50
- */
51
- local?: {
52
- /**
53
- * Sitecore API key used to connect to the GraphQL endpoint
54
- */
55
- apiKey: string;
56
- /**
57
- * Sitecore API hostname that the app connects to
58
- */
59
- apiHost: string;
60
- /**
61
- * GraphQL endpoint path (appended to `apiHost` to form the full URL).
62
- * @default /sitecore/api/graph/edge
63
- */
64
- path?: string;
65
- };
66
- };
67
- /**
68
- * The default and fallback locale for your site.
69
- * Ensure it aligns with the framework-specific settings used in your application.
70
- */
71
- defaultLanguage?: string;
72
- /**
73
- * Your default site name. When using the multisite feature this variable defines the fallback site.
74
- */
75
- defaultSite?: string;
76
- /**
77
- * Editing secret required for Sitecore editing and preview functionality.
78
- * Default comes from the SITECORE_EDITING_SECRET environment variable.
79
- */
80
- editingSecret?: string;
81
- /**
82
- * Retry configuration applied to Layout, Dictionary and ErrorPages services
83
- */
84
- retries?: {
85
- /**
86
- * Number of retries for the GraphQL client.
87
- * @default 3
88
- */
89
- count?: number;
90
- /**
91
- * Retry strategy for the client. By default, uses exponential
92
- * back-off factor of 2 for codes 429, 502, 503, 504, 520, 521, 522, 523, 524.
93
- * @default DefaultRetryStrategy
94
- */
95
- retryStrategy?: RetryStrategy;
96
- };
97
- /**
98
- * Settings for Layout Service
99
- */
100
- layout?: {
101
- /**
102
- * Override the first part of graphQL query for Layout Service (excluding the fields part)
103
- * @param {string} siteName your site name
104
- * @param {string} itemPath full path to Sitecore item/route
105
- * @param {string} [locale] item/route language
106
- * @returns {string} custom layout query
107
- * @default 'layout(site:"${siteName}", routePath:"${itemPath}", language:"${language}")'
108
- */
109
- formatLayoutQuery?: ((siteName: string, itemPath: string, locale?: string) => string) | null;
110
- };
111
- /**
112
- * Settings for Dictionary Service
113
- */
114
- dictionary?: {
115
- /**
116
- * Configure local memory caching for Dictionary Service requests
117
- */
118
- caching?: {
119
- enabled?: boolean;
120
- timeout?: number;
121
- };
122
- };
123
- /**
124
- * Settings for multisite functionality
125
- */
126
- multisite?: {
127
- /**
128
- * Enable multisite
129
- *
130
- * **WARNING: Do NOT disable multisite in App Router applications.**
131
- *
132
- * The App Router route structure requires the `[site]` segment in the path (`/[site]/[locale]/[[...path]]`).
133
- * Disabling this will break routing and cause 404 errors for regular requests.
134
- *
135
- * Preview and Editing modes will still work (they bypass this check), but regular page requests will fail.
136
- *
137
- * **For single-site setups**: Keep `enabled: true` and configure only one site in your sites configuration.
138
- * The middleware will always use that single site, achieving the desired single-site behavior.
139
- * @default true
140
- */
141
- enabled?: boolean;
142
- /**
143
- * Function used to determine if site should be resolved from sc_site cookie when present
144
- */
145
- useCookieResolution?: (req?: RequestInit, res?: ResponseInit) => boolean;
146
- };
147
- /**
148
- * Settings for Personalize functionality
149
- */
150
- personalize?: {
151
- /**
152
- * Enable personalize middleware
153
- * @default process.env.NODE_ENV !== 'development'
154
- */
155
- enabled?: boolean;
156
- /**
157
- * Configuration for your Sitecore Experience Edge endpoint
158
- * by default set by the PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT environment variable
159
- * if not set, will use the default value of 400ms
160
- */
161
- edgeTimeout?: number;
162
- /**
163
- * Configuration for your Sitecore CDP endpoint
164
- * by default set by the PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT environment variable
165
- * if not set, will use the default value of 400ms
166
- */
167
- cdpTimeout?: number;
168
- /**
169
- * Optional Sitecore Personalize scope ID (to isolate data between environments)
170
- */
171
- scope?: string;
172
- /**
173
- * The Sitecore CDP channel to use for events. Uses 'WEB' by default.
174
- */
175
- channel?: string;
176
- /**
177
- * Currency for CDP requests
178
- * @default 'USA'
179
- */
180
- currency?: string;
181
- };
182
- /**
183
- * Settings for redirects functionality
184
- */
185
- redirects?: {
186
- /**
187
- * Enable redirects middleware
188
- * @default process.env.NODE_ENV !== 'development'
189
- */
190
- enabled?: boolean;
191
- /**
192
- * These are all the locales you support in your application.
193
- * These should match those in framework-specific configuration of your app.
194
- */
195
- locales?: string[];
196
- };
197
- /**
198
- * Opt-out setting for code generation feature
199
- * Disables code extraction procedure
200
- */
201
- disableCodeGeneration?: boolean;
202
- };
203
- /**
204
- * Final Sitecore config type used at runtime.
205
- * Every property is populated, either from sitecore.config or fallback values.
206
- * @public
207
- */
208
- export type SitecoreConfig = DeepRequired<SitecoreConfigInput>;
209
- /**
210
- * Type used as CLI config input in sitecore.cli.config
211
- * @public
212
- */
213
- export type SitecoreCliConfigInput = {
214
- /**
215
- * Sitecore configuration (`sitecore.config` file)
216
- */
217
- config?: SitecoreConfig;
218
- /**
219
- * Configuration for the `sitecore-tools build` CLI command
220
- */
221
- build?: {
222
- /**
223
- * Commands to run during the build process
224
- */
225
- commands?: Array<(args?: {
226
- scConfig?: SitecoreConfig;
227
- }) => Promise<void>>;
228
- };
229
- /**
230
- * Configuration for the `sitecore-tools scaffold` CLI command
231
- */
232
- scaffold?: {
233
- /**
234
- * Scaffold templates available for generating components
235
- */
236
- templates?: ScaffoldTemplate[];
237
- };
238
- /**
239
- * Configuration for the `sitecore-tools component generate-map` CLI command
240
- */
241
- componentMap?: GenerateMapArgs & {
242
- /**
243
- * Function implementation for generating a component map
244
- */
245
- generator?: GenerateMapFunction;
246
- };
247
- };
248
- /**
249
- * Final Sitecore CLI config type required by the CLI
250
- * @public
251
- */
252
- export type SitecoreCliConfig = DeepRequired<SitecoreCliConfigInput>;
253
- /**
254
- * Represents a scaffold template used for generating components
255
- * @public
256
- */
257
- export type ScaffoldTemplate = {
258
- /**
259
- * Name of the template
260
- */
261
- name: string;
262
- /**
263
- * File extension for the generated component
264
- */
265
- fileExtension: string;
266
- /**
267
- * Function to generate the component file contents based on the component name.
268
- * @param componentName - The name of the component.
269
- * @returns The generated content as a string.
270
- */
271
- generateTemplate: (componentName: string) => string;
272
- /**
273
- * Optional function to get the next steps to be shown by the cli after generating the component.
274
- * @param componentOutputPath - The output path of the generated component.
275
- * @returns An array of strings representing the next steps.
276
- */
277
- getNextSteps?: (componentOutputPath: string) => string[];
278
- };
279
- /**
280
- * Enumeration of default component templates
281
- * @internal
282
- */
283
- export declare enum ComponentTemplateType {
284
- BYOC = "byoc",
285
- DEFAULT = "default"
286
- }
287
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/config/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC;KACpC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF;;;GAGG;AACH,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E,mBAAmB,CAAC;KACjC,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACpD;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;CAC1D,CAAC;AAEF;;;GAGG;AACH,oBAAY,qBAAqB;IAC/B,IAAI,SAAS;IACb,OAAO,YAAY;CACpB"}
@@ -1,9 +0,0 @@
1
- import { SitecoreCliConfig, SitecoreCliConfigInput } from '../config/models';
2
- /**
3
- * Accepts a `SitecoreCliConfigInput` object and returns Sitecore Content SDK CLI configuration, updated with required default values
4
- * @param {SitecoreCliConfigInput} cliConfig the cli configuration provided by the application
5
- * @returns {SitecoreCliConfig} full sitecore cli configuration to use with cli
6
- * @public
7
- */
8
- export declare const defineCliConfig: (cliConfig: SitecoreCliConfigInput) => SitecoreCliConfig;
9
- //# sourceMappingURL=define-cli-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-cli-config.d.ts","sourceRoot":"","sources":["../../src/config-cli/define-cli-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAc7E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,sBAAsB,KAAG,iBAGnE,CAAC"}
@@ -1,3 +0,0 @@
1
- export { defineCliConfig } from './define-cli-config';
2
- export { SITECORE_CLI_MODE_ENV_VAR } from './models';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config-cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Environment variable to indicate that the application is running in CLI mode
3
- * @internal
4
- */
5
- export declare const SITECORE_CLI_MODE_ENV_VAR = "SITECORE_CLI_MODE";
6
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/config-cli/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,sBAAsB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { addComponentPreviewHandler, addServerComponentPreviewHandler, getDesignLibraryComponentPreviewErrorEvent, getDesignLibraryComponentPropsEvent, getDesignLibraryImportMapEvent, getImportMapInfo, addStyleElement, createComponentInstance, sendErrorEvent, DesignLibraryPreviewError, ImportEntry, ImportEntryInfo, GeneratedComponentData, ComponentPreviewEventArgs, ServerComponentPreviewEventArgs, fetchGeneratedComponentFromCache, } from './preview';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editing/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,0CAA0C,EAC1C,mCAAmC,EACnC,8BAA8B,EAC9B,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,WAAW,CAAC"}
@@ -1,289 +0,0 @@
1
- import { ComponentFields, ComponentParams } from '../../layout/models';
2
- import { DesignLibraryEvent } from '../design-library';
3
- /**
4
- * Event to send import map to design library
5
- */
6
- declare const DESIGN_LIBRARY_IMPORT_MAP_EVENT_NAME = "component:generation:import-map";
7
- /**
8
- * Event to send component props to design library
9
- */
10
- declare const DESIGN_LIBRARY_COMPONENT_PROPS_EVENT_NAME = "component:generation:component-props";
11
- /**
12
- * Event to receive component data from design library
13
- */
14
- declare const DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME = "component:generation:component-preview";
15
- /**
16
- * Event to send component error to design library
17
- */
18
- declare const DESIGN_LIBRARY_COMPONENT_PREVIEW_ERROR_EVENT_NAME = "component:generation:component-preview-error";
19
- /**
20
- * Represents an import map entry.
21
- * @public
22
- */
23
- export interface ImportEntry {
24
- module: string;
25
- exports: {
26
- name: string | 'default' | '*';
27
- value: unknown;
28
- }[];
29
- }
30
- /**
31
- * Represents the info for the import entry to be sent to design library.
32
- * @internal
33
- */
34
- export interface ImportEntryInfo {
35
- module: string;
36
- exports: string[];
37
- }
38
- /**
39
- * Represents a component import.
40
- */
41
- export type ComponentImport = {
42
- /**
43
- * The name of the module to be imported.
44
- * e.g. 'react'
45
- */
46
- module: string;
47
- /**
48
- * The name of the export to be imported.
49
- * e.g. 'useMemo'
50
- */
51
- export: string;
52
- /**
53
- * The alias of the import.
54
- * e.g. 'useMemoFn'
55
- */
56
- alias: string;
57
- };
58
- /**
59
- * Represents the data needed to render AI generated component.
60
- * @internal
61
- */
62
- export type GeneratedComponentData = {
63
- /**
64
- * The unique identifier for the component.
65
- */
66
- uid: string;
67
- /**
68
- * The code of the component.
69
- */
70
- code: {
71
- type: 'function';
72
- content: string;
73
- };
74
- /**
75
- * The styles of the component.
76
- */
77
- styles: {
78
- type: 'style-element';
79
- /**
80
- * The styles content to be attached to the DOM.
81
- */
82
- content: string;
83
- /**
84
- * The CSS module import
85
- */
86
- styleImport: {
87
- /**
88
- * The name of the style import.
89
- */
90
- name: string;
91
- /**
92
- * The value of the style import
93
- */
94
- content: unknown;
95
- };
96
- };
97
- /**
98
- * The imports of the component.
99
- */
100
- imports: ComponentImport[];
101
- };
102
- /**
103
- * Represents a component preview event data sent from design library
104
- * @internal
105
- */
106
- export interface ComponentPreviewEventArgs extends DesignLibraryEvent {
107
- name: typeof DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME;
108
- message: GeneratedComponentData;
109
- }
110
- /**
111
- * Represents a server component preview event data sent from design library in variant generation mode.
112
- * @internal
113
- */
114
- export interface ServerComponentPreviewEventArgs extends DesignLibraryEvent {
115
- name: typeof DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME;
116
- message: {
117
- /**
118
- * The cache information for the component preview, used for server components in Design Library variant generation mode.
119
- */
120
- cache: {
121
- /** The unique identifier for the cache entry. */
122
- id: string;
123
- /** The jwt token for authentication when fetching the preview component from the cache. */
124
- token: string;
125
- };
126
- };
127
- }
128
- /**
129
- * Represents an event indicating the import map to be sent to design library
130
- */
131
- export interface DesignLibraryImportMapEvent extends DesignLibraryEvent {
132
- name: typeof DESIGN_LIBRARY_IMPORT_MAP_EVENT_NAME;
133
- message: {
134
- uid: string;
135
- importMap: {
136
- module: string;
137
- exports: string[];
138
- }[];
139
- };
140
- }
141
- /**
142
- * Represents an event indicating the component props to be sent to design library
143
- */
144
- export interface DesignLibraryComponentPropsEvent extends DesignLibraryEvent {
145
- name: typeof DESIGN_LIBRARY_COMPONENT_PROPS_EVENT_NAME;
146
- message: {
147
- uid: string;
148
- fields: ComponentFields;
149
- parameters: ComponentParams;
150
- };
151
- }
152
- /**
153
- * Represents an event indicating the preview error to be sent to design library.
154
- */
155
- export interface DesignLibraryComponentPreviewErrorEvent extends DesignLibraryEvent {
156
- name: typeof DESIGN_LIBRARY_COMPONENT_PREVIEW_ERROR_EVENT_NAME;
157
- message: {
158
- uid: string;
159
- error: unknown;
160
- type: DesignLibraryPreviewError;
161
- };
162
- }
163
- /**
164
- * Enumeration of error types for the design library preview.
165
- * @internal
166
- */
167
- export declare enum DesignLibraryPreviewError {
168
- /**
169
- * Error occurred during component rendering.
170
- */
171
- Render = "render",
172
- /**
173
- * Error occurred during component and event handlers initialization.
174
- */
175
- RenderInit = "render-init"
176
- }
177
- /**
178
- * Builds the component dependencies from the component imports and the import map.
179
- * @param {ComponentImport[]} componentImports - The component imports.
180
- * @param {ImportEntry[]} importMap - The import map to be used for the component.
181
- * @returns {Array<{ name: string; value: unknown }>} The component dependencies.
182
- */
183
- export declare function buildComponentDependencies(componentImports: ComponentImport[], importMap: ImportEntry[]): {
184
- successful: {
185
- name: string;
186
- value: unknown;
187
- }[];
188
- missing: {
189
- modules: {
190
- module: string;
191
- alias: string;
192
- }[];
193
- exports: {
194
- alias: string;
195
- export: string;
196
- module: string;
197
- }[];
198
- };
199
- };
200
- /**
201
- * Adds the browser-side event handler for 'component:generation:component-preview' message used in Design Library
202
- * The event should contain the component code, styles and imports.
203
- * @param {ImportEntry[]} importMap - The import map to be used for the component.
204
- * @param {Function} callback callback to be called after component is received
205
- * @internal
206
- */
207
- export declare const addComponentPreviewHandler: (importMap: ImportEntry[], callback: (error: unknown | null, Component: unknown) => void) => (() => void) | undefined;
208
- /**
209
- * Adds the browser-side event handler for 'component:generation:component-preview' message used in Design Library for server components
210
- * The event should contain the cache id and token which will be used to fetch the component code, styles and imports from secured endpoint
211
- * @param {Function} callback callback to be called after component is received
212
- * @internal
213
- */
214
- export declare const addServerComponentPreviewHandler: (callback: (eventArgs: ServerComponentPreviewEventArgs) => void) => () => void;
215
- /**
216
- * Adds <style> element in the document head with the provided CSS.
217
- * If an existing style element with the id "content-sdk-style-preview" is found, it is removed
218
- * to prevent duplicates
219
- * @param {string} stylesContent - The raw CSS text to inject into the style element.
220
- * @internal
221
- */
222
- export declare function addStyleElement(stylesContent: string): void;
223
- /**
224
- * Dynamically creates a React component instance from provided importMap and from code, styles, and dependencies provided in the preview event.
225
- * @param {ImportEntry[]} importMap - The import map containing module and export references that might be injected as dependencies in the provided code.
226
- * @param {GeneratedComponentData} generatedComponentData - The generated component data received from design library.
227
- * @returns The dynamically created React component instance.
228
- * @throws If any required modules or exports are missing from the import map, an error is thrown describing the missing dependencies.
229
- * @internal
230
- */
231
- export declare const createComponentInstance: (importMap: ImportEntry[], generatedComponentData: GeneratedComponentData) => unknown;
232
- /**
233
- * Generates a DesignLibraryComponentPreviewErrorEvent with the given uid and error.
234
- * @param {string} uid - The unique identifier for the event.
235
- * @param {unknown} error - The error to be sent.
236
- * @param {DesignLibraryPreviewError} type - The type of error.
237
- * @returns An object representing the DesignLibraryComponentPreviewErrorEvent.
238
- * @internal
239
- */
240
- export declare function getDesignLibraryComponentPreviewErrorEvent(uid: string, error: unknown, type: DesignLibraryPreviewError): DesignLibraryComponentPreviewErrorEvent;
241
- /**
242
- * Generates a DesignLibraryComponentPropsEvent with the given uid, fields and parameters.
243
- * @param {string} uid - The unique identifier for the event.
244
- * @param {ComponentFields} fields - The fields of the component.
245
- * @param {ComponentParams} parameters - The parameters of the component.
246
- * @returns An object representing the DesignLibraryComponentPropsEvent.
247
- * @internal
248
- */
249
- export declare function getDesignLibraryComponentPropsEvent(uid: string, fields?: ComponentFields, parameters?: ComponentParams): DesignLibraryComponentPropsEvent;
250
- /**
251
- * Generates a DesignLibraryImportMapEvent with the given uid and importMap.
252
- * @param {string} uid - The unique identifier for the event.
253
- * @param {ImportEntry[]} importMap - The imports map to be sent.
254
- * @returns An object representing the DesignLibraryImportMapEvent.
255
- * @internal
256
- */
257
- export declare function getDesignLibraryImportMapEvent(uid: string, importMap: ImportEntry[] | ImportEntryInfo[]): DesignLibraryImportMapEvent;
258
- /**
259
- * Generates the payload for the import map to be sent to design library.
260
- * @param {ImportEntry[]} importMap - The imports map to be sent.
261
- * @internal
262
- */
263
- export declare function getImportMapInfo(importMap: ImportEntry[]): ImportEntryInfo[];
264
- /**
265
- * Type guard for ImportEntryInfo[]
266
- * @param {unknown} data import entry data to check
267
- * @returns true if the data is ImportEntryInfo array
268
- */
269
- export declare function isImportEntryInfoArray(data: unknown): data is ImportEntryInfo[];
270
- /**
271
- * Sends a component preview error event to the design library
272
- * @param {string} uid - The unique identifier of the component that's being edited.
273
- * @param {unknown} error - The error object or message to be sent.
274
- * @param {DesignLibraryPreviewError} type - The type of error, as defined in DesignLibraryPreviewError.
275
- * @internal
276
- */
277
- export declare const sendErrorEvent: (uid: string, error: unknown, type: DesignLibraryPreviewError) => void;
278
- /**
279
- * Fetches generated component data from the authoring cache endpoint.
280
- * This is used by the Design Studio Server to fetch the updated component data from the secured cache endpoint and render it in the Design Library Studio preview iframe.
281
- * @param {string} id - The unique identifier of the component to fetch from cache.
282
- * @param {string} token - The authorization token for authentication.
283
- * @param {string} [edgeUrl] - The URL of the Sitecore Edge endpoint.
284
- * @returns A Promise that resolves to the component rendering data, component generation data, or undefined if the fetch fails.
285
- * @internal
286
- */
287
- export declare function fetchGeneratedComponentFromCache(id: string, token: string, edgeUrl?: string): Promise<GeneratedComponentData>;
288
- export {};
289
- //# sourceMappingURL=preview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/editing/codegen/preview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGtE;;GAEG;AACH,QAAA,MAAM,oCAAoC,oCAAoC,CAAC;AAE/E;;GAEG;AACH,QAAA,MAAM,yCAAyC,yCAAyC,CAAC;AAEzF;;GAEG;AACH,QAAA,MAAM,2CAA2C,2CAA2C,CAAC;AAE7F;;GAEG;AACH,QAAA,MAAM,iDAAiD,iDACP,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAC/D;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM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