@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,47 +0,0 @@
1
- import { GraphQLRequestClient } from '../graphql-request-client';
2
- import { getEdgeProxyContentUrl } from './edge-proxy';
3
- /**
4
- * Creates a new GraphQLRequestClientFactory instance
5
- * @param {GraphQLClientOptions} options content sdk config
6
- * @returns GraphQLRequestClientFactory instance
7
- * @public
8
- */
9
- export const createGraphQLClientFactory = (options) => {
10
- let clientConfig;
11
- const { api } = options;
12
- const { edge, local } = api !== null && api !== void 0 ? api : {};
13
- const isBrowser = typeof window !== 'undefined';
14
- if (edge === null || edge === void 0 ? void 0 : edge.contextId) {
15
- // Real client for server-side rendering / API routes
16
- clientConfig = {
17
- endpoint: getEdgeProxyContentUrl(edge.contextId, edge.edgeUrl),
18
- };
19
- }
20
- else if (isBrowser && (edge === null || edge === void 0 ? void 0 : edge.clientContextId)) {
21
- // Real client for client-side requests
22
- clientConfig = {
23
- endpoint: getEdgeProxyContentUrl(edge.clientContextId, edge.edgeUrl),
24
- };
25
- }
26
- else if ((local === null || local === void 0 ? void 0 : local.apiKey) && (local === null || local === void 0 ? void 0 : local.apiHost)) {
27
- // Fallback to local API settings
28
- clientConfig = {
29
- endpoint: `${local.apiHost}${local.path}`,
30
- apiKey: local.apiKey,
31
- };
32
- }
33
- else if (isBrowser) {
34
- // Browser bundle has no IDs – initialise a dummy client and warn
35
- /* eslint-disable no-console */
36
- console.warn('GraphQL client initialised in the browser without Edge or local API configuration; client-side requests may fail.');
37
- clientConfig = { endpoint: '/api/graphql' };
38
- }
39
- else {
40
- throw new Error(`GraphQL client misconfigured.
41
- Configure one of the following in sitecore.config or your .env file:
42
- Edge mode: set both sitecore.edge.contextId (server-side) and sitecore.edge.clientContextId (browser).
43
- Local API mode: set api.local.apiHost and api.local.apiKey.
44
- Supplying only api.edge.clientContextId will cause the application to fail at runtime.`);
45
- }
46
- return GraphQLRequestClient.createClientFactory(Object.assign(Object.assign({}, clientConfig), options));
47
- };
@@ -1,189 +0,0 @@
1
- import { SITECORE_EDGE_URL_DEFAULT } from '../constants';
2
- import { DefaultRetryStrategy } from '../retries';
3
- import { SITECORE_CLI_MODE_ENV_VAR } from '../config-cli';
4
- /**
5
- * Provides default initial values for SitecoreConfig
6
- * @returns default config
7
- */
8
- export const getFallbackConfig = () => ({
9
- api: {
10
- edge: {
11
- contextId: process.env.SITECORE_EDGE_CONTEXT_ID || '',
12
- clientContextId: '',
13
- edgeUrl: process.env.SITECORE_EDGE_URL || SITECORE_EDGE_URL_DEFAULT,
14
- },
15
- local: {
16
- apiKey: process.env.SITECORE_API_KEY || process.env.NEXT_PUBLIC_SITECORE_API_KEY || '',
17
- apiHost: process.env.SITECORE_API_HOST || process.env.NEXT_PUBLIC_SITECORE_API_HOST || '',
18
- path: '/sitecore/api/graph/edge',
19
- },
20
- },
21
- editingSecret: process.env.SITECORE_EDITING_SECRET || 'editing-secret-missing',
22
- retries: {
23
- count: 3,
24
- retryStrategy: new DefaultRetryStrategy({
25
- statusCodes: [429, 502, 503, 504, 520, 521, 522, 523, 524],
26
- }),
27
- },
28
- redirects: {
29
- enabled: process.env.NODE_ENV !== 'development',
30
- locales: ['en'],
31
- },
32
- multisite: {
33
- enabled: true,
34
- useCookieResolution: () => false,
35
- },
36
- personalize: {
37
- enabled: process.env.NODE_ENV !== 'development',
38
- edgeTimeout: parseInt(process.env.PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT, 10) || 400,
39
- cdpTimeout: parseInt(process.env.PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT, 10) || 400,
40
- scope: '',
41
- channel: 'WEB',
42
- currency: 'USD',
43
- },
44
- defaultSite: '',
45
- defaultLanguage: 'en',
46
- layout: {
47
- formatLayoutQuery: null,
48
- },
49
- dictionary: {
50
- caching: {
51
- enabled: true,
52
- timeout: 60,
53
- },
54
- },
55
- disableCodeGeneration: false,
56
- });
57
- /**
58
- * Deep merge utility that skips undefined or empty string values in the override.
59
- * @param {T} base base value
60
- * @param {DeepPartial<T>} [override] override value
61
- */
62
- export function deepMerge(base, override) {
63
- if (!override)
64
- return base;
65
- const result = Object.assign({}, base);
66
- for (const key in override) {
67
- if (!Object.prototype.hasOwnProperty.call(override, key))
68
- continue;
69
- const typedKey = key;
70
- const baseValue = base[typedKey];
71
- const overrideValue = override[typedKey];
72
- // Skip undefined and empty string overrides
73
- if (overrideValue === undefined || overrideValue === '') {
74
- continue;
75
- }
76
- if (typeof overrideValue === 'object' &&
77
- overrideValue !== null &&
78
- !Array.isArray(overrideValue) &&
79
- Object.getPrototypeOf(overrideValue) === Object.prototype) {
80
- result[typedKey] = deepMerge(baseValue, overrideValue);
81
- }
82
- else {
83
- result[typedKey] = overrideValue;
84
- }
85
- }
86
- return result;
87
- }
88
- /**
89
- * Resolves sitecore config based on base config and overrides
90
- * @param {SitecoreConfig} base base sitecore config object
91
- * @param {SitecoreConfig} override override sitecore config object
92
- * @returns resolved SitecoreConfig object
93
- */
94
- const resolveConfig = (base, override) => {
95
- const result = deepMerge(base, override);
96
- if (Number.isNaN(result.personalize.cdpTimeout) || !result.personalize.cdpTimeout) {
97
- result.personalize.cdpTimeout = base.personalize.cdpTimeout;
98
- }
99
- if (Number.isNaN(result.personalize.edgeTimeout) || !result.personalize.edgeTimeout) {
100
- result.personalize.edgeTimeout = base.personalize.edgeTimeout;
101
- }
102
- return result;
103
- };
104
- const validateApiConfiguration = (config) => {
105
- var _a, _b, _c, _d, _e, _f, _g, _h;
106
- const isBrowser = typeof window !== 'undefined';
107
- const hasEdgeContextId = !!((_b = (_a = config.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.contextId);
108
- const hasClientContextId = !!((_d = (_c = config.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.clientContextId);
109
- const hasLocalCreds = !!((_f = (_e = config.api) === null || _e === void 0 ? void 0 : _e.local) === null || _f === void 0 ? void 0 : _f.apiHost) && !!((_h = (_g = config.api) === null || _g === void 0 ? void 0 : _g.local) === null || _h === void 0 ? void 0 : _h.apiKey);
110
- // Server-side: allow Edge OR Local; clientContextId alone is NOT sufficient
111
- if (!isBrowser) {
112
- if (!hasEdgeContextId && !hasLocalCreds) {
113
- throw new Error('Configuration error: provide either Edge contextId (api.edge.contextId) or local credentials (api.local.apiHost + api.local.apiKey).');
114
- }
115
- if (hasEdgeContextId && !hasClientContextId) {
116
- // eslint-disable-next-line no-console
117
- if (process.env.NODE_ENV === 'development') {
118
- console.warn('Warning: only a server-side edge contextId is provided. Client-side requests will require api.edge.clientContextId or a proxy.');
119
- }
120
- }
121
- return; // validation complete on the server
122
- }
123
- // Browser-side warning (runs only if contextId exists but clientContextId is missing)
124
- if (isBrowser && !hasClientContextId) {
125
- // eslint-disable-next-line no-console
126
- if (process.env.NODE_ENV === 'development') {
127
- console.warn(`Warning: clientContextId is missing. The browser will use contextId instead.
128
- Client Side functionalities (like Tracking and Personalization) may be limited.`);
129
- }
130
- }
131
- };
132
- /**
133
- * The validators for the config object during build time.
134
- * Validators are called when the literal path of the config object is accessed.
135
- */
136
- const PROPERTY_VALIDATORS = {
137
- 'api.edge.contextId': validateApiConfiguration,
138
- 'api.local.apiKey': validateApiConfiguration,
139
- };
140
- /**
141
- * Creates a proxy for the config object to validate the config object during build time.
142
- * @param {SitecoreConfig} config - The config object to create a proxy for.
143
- * @returns {SitecoreConfig} The proxy for the config object.
144
- */
145
- const createConfigProxy = (config) => {
146
- const validated = new Set();
147
- const createProxy = (target, propPath = '') => {
148
- return new Proxy(target, {
149
- get(obj, prop, receiver) {
150
- // Skip symbol properties, do not attempt to stringify them
151
- // Type safety check
152
- if (typeof prop === 'symbol') {
153
- return Reflect.get(obj, prop, receiver);
154
- }
155
- const fullPath = propPath ? `${propPath}.${prop}` : prop;
156
- const value = Reflect.get(obj, prop, receiver);
157
- if (fullPath in PROPERTY_VALIDATORS &&
158
- !validated.has(fullPath)) {
159
- const validator = PROPERTY_VALIDATORS[fullPath];
160
- validator(config);
161
- validated.add(fullPath);
162
- }
163
- if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
164
- return createProxy(value, fullPath);
165
- }
166
- return value;
167
- },
168
- });
169
- };
170
- return createProxy(config);
171
- };
172
- /**
173
- * Accepts a SitecoreConfigInput object and returns full sitecore configuration
174
- * @param {SitecoreConfigInput} config override values to be written over default config settings
175
- * @returns {SitecoreConfig} full sitecore configuration to use in application
176
- * @public
177
- */
178
- export const defineConfig = (config) => {
179
- const resolvedConfig = resolveConfig(getFallbackConfig(), config);
180
- const isCLI = process.env[SITECORE_CLI_MODE_ENV_VAR] === 'true';
181
- // At `build time`, we create a proxy for the config object to validate the config by
182
- // accessing the literal paths instead of validating the whole object at once.
183
- // At `runtime` all the config should be validated to fail fast in case of invalid configuration.
184
- if (isCLI) {
185
- return createConfigProxy(resolvedConfig);
186
- }
187
- validateApiConfiguration(resolvedConfig);
188
- return resolvedConfig;
189
- };
@@ -1,2 +0,0 @@
1
- export { ComponentTemplateType, } from './models';
2
- export { defineConfig } from './define-config';
@@ -1,9 +0,0 @@
1
- /**
2
- * Enumeration of default component templates
3
- * @internal
4
- */
5
- export var ComponentTemplateType;
6
- (function (ComponentTemplateType) {
7
- ComponentTemplateType["BYOC"] = "byoc";
8
- ComponentTemplateType["DEFAULT"] = "default";
9
- })(ComponentTemplateType || (ComponentTemplateType = {}));
@@ -1,19 +0,0 @@
1
- const validateConfig = (cliConfig) => {
2
- var _a, _b, _c, _d;
3
- if (!((_b = (_a = cliConfig.build) === null || _a === void 0 ? void 0 : _a.commands) === null || _b === void 0 ? void 0 : _b.length)) {
4
- throw new Error('Configuration error: build commands should be defined in sitecore.cli.config');
5
- }
6
- if (!((_d = (_c = cliConfig.scaffold) === null || _c === void 0 ? void 0 : _c.templates) === null || _d === void 0 ? void 0 : _d.length)) {
7
- throw new Error('Configuration error: scaffold templates should be defined in sitecore.cli.config');
8
- }
9
- };
10
- /**
11
- * Accepts a `SitecoreCliConfigInput` object and returns Sitecore Content SDK CLI configuration, updated with required default values
12
- * @param {SitecoreCliConfigInput} cliConfig the cli configuration provided by the application
13
- * @returns {SitecoreCliConfig} full sitecore cli configuration to use with cli
14
- * @public
15
- */
16
- export const defineCliConfig = (cliConfig) => {
17
- validateConfig(cliConfig);
18
- return cliConfig;
19
- };
@@ -1,2 +0,0 @@
1
- export { defineCliConfig } from './define-cli-config';
2
- export { SITECORE_CLI_MODE_ENV_VAR } from './models';
@@ -1,5 +0,0 @@
1
- /**
2
- * Environment variable to indicate that the application is running in CLI mode
3
- * @internal
4
- */
5
- export const SITECORE_CLI_MODE_ENV_VAR = 'SITECORE_CLI_MODE';
@@ -1 +0,0 @@
1
- export { addComponentPreviewHandler, addServerComponentPreviewHandler, getDesignLibraryComponentPreviewErrorEvent, getDesignLibraryComponentPropsEvent, getDesignLibraryImportMapEvent, getImportMapInfo, addStyleElement, createComponentInstance, sendErrorEvent, DesignLibraryPreviewError, fetchGeneratedComponentFromCache, } from './preview';
@@ -1,288 +0,0 @@
1
- import { NativeDataFetcher } from '../../native-fetcher';
2
- import { SITECORE_EDGE_URL_DEFAULT } from '../../constants';
3
- import { validateEvent } from '../design-library';
4
- import debug from '../../debug';
5
- /**
6
- * Event to send import map to design library
7
- */
8
- const DESIGN_LIBRARY_IMPORT_MAP_EVENT_NAME = 'component:generation:import-map';
9
- /**
10
- * Event to send component props to design library
11
- */
12
- const DESIGN_LIBRARY_COMPONENT_PROPS_EVENT_NAME = 'component:generation:component-props';
13
- /**
14
- * Event to receive component data from design library
15
- */
16
- const DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME = 'component:generation:component-preview';
17
- /**
18
- * Event to send component error to design library
19
- */
20
- const DESIGN_LIBRARY_COMPONENT_PREVIEW_ERROR_EVENT_NAME = 'component:generation:component-preview-error';
21
- /**
22
- * Enumeration of error types for the design library preview.
23
- * @internal
24
- */
25
- export var DesignLibraryPreviewError;
26
- (function (DesignLibraryPreviewError) {
27
- /**
28
- * Error occurred during component rendering.
29
- */
30
- DesignLibraryPreviewError["Render"] = "render";
31
- /**
32
- * Error occurred during component and event handlers initialization.
33
- */
34
- DesignLibraryPreviewError["RenderInit"] = "render-init";
35
- })(DesignLibraryPreviewError || (DesignLibraryPreviewError = {}));
36
- /**
37
- * Builds the component dependencies from the component imports and the import map.
38
- * @param {ComponentImport[]} componentImports - The component imports.
39
- * @param {ImportEntry[]} importMap - The import map to be used for the component.
40
- * @returns {Array<{ name: string; value: unknown }>} The component dependencies.
41
- */
42
- export function buildComponentDependencies(componentImports, importMap) {
43
- const successful = [];
44
- const missing = {
45
- modules: [],
46
- exports: [],
47
- };
48
- componentImports.forEach((componentImport) => {
49
- const moduleEntry = importMap.find((entry) => entry.module === componentImport.module);
50
- if (!moduleEntry) {
51
- missing.modules.push({
52
- module: componentImport.module,
53
- alias: componentImport.alias,
54
- });
55
- return;
56
- }
57
- const exportEntry = moduleEntry.exports.find((exp) => exp.name === componentImport.export);
58
- if (!exportEntry) {
59
- missing.exports.push({
60
- alias: componentImport.alias,
61
- export: componentImport.export,
62
- module: componentImport.module,
63
- });
64
- return;
65
- }
66
- return successful.push({
67
- name: componentImport.alias,
68
- value: exportEntry.value,
69
- });
70
- });
71
- return {
72
- successful,
73
- missing,
74
- };
75
- }
76
- /**
77
- * Adds the browser-side event handler for 'component:generation:component-preview' message used in Design Library
78
- * The event should contain the component code, styles and imports.
79
- * @param {ImportEntry[]} importMap - The import map to be used for the component.
80
- * @param {Function} callback callback to be called after component is received
81
- * @internal
82
- */
83
- export const addComponentPreviewHandler = (importMap, callback) => {
84
- if (!window)
85
- return;
86
- const handler = (e) => {
87
- const eventArgs = e.data;
88
- try {
89
- if (!validateEvent(e, DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME)) {
90
- return;
91
- }
92
- console.debug('Component Library: message received', eventArgs);
93
- const Component = createComponentInstance(importMap, eventArgs.message);
94
- addStyleElement(eventArgs.message.styles.content);
95
- callback(null, Component);
96
- }
97
- catch (error) {
98
- sendErrorEvent(eventArgs.message.uid, error, DesignLibraryPreviewError.RenderInit);
99
- callback(error, null);
100
- }
101
- };
102
- window.addEventListener('message', handler);
103
- const unsubscribe = () => {
104
- window.removeEventListener('message', handler);
105
- };
106
- return unsubscribe;
107
- };
108
- /**
109
- * Adds the browser-side event handler for 'component:generation:component-preview' message used in Design Library for server components
110
- * The event should contain the cache id and token which will be used to fetch the component code, styles and imports from secured endpoint
111
- * @param {Function} callback callback to be called after component is received
112
- * @internal
113
- */
114
- export const addServerComponentPreviewHandler = (callback) => {
115
- const handler = (e) => {
116
- if (!validateEvent(e, DESIGN_LIBRARY_COMPONENT_PREVIEW_EVENT_NAME)) {
117
- return;
118
- }
119
- console.debug('Component Library: message received', e.data);
120
- callback(e.data);
121
- };
122
- window.addEventListener('message', handler);
123
- const unsubscribe = () => {
124
- window.removeEventListener('message', handler);
125
- };
126
- return unsubscribe;
127
- };
128
- /**
129
- * Adds <style> element in the document head with the provided CSS.
130
- * If an existing style element with the id "content-sdk-style-preview" is found, it is removed
131
- * to prevent duplicates
132
- * @param {string} stylesContent - The raw CSS text to inject into the style element.
133
- * @internal
134
- */
135
- export function addStyleElement(stylesContent) {
136
- const styleId = 'content-sdk-style-preview';
137
- const styleElement = document.getElementById(styleId);
138
- // remove existing style element if it exists to avoid duplicates
139
- if (styleElement) {
140
- styleElement.remove();
141
- }
142
- // create new style element and attach it to DOM
143
- const style = document.createElement('style');
144
- style.setAttribute('id', styleId);
145
- style.innerHTML = stylesContent;
146
- document.head.appendChild(style);
147
- }
148
- /**
149
- * Dynamically creates a React component instance from provided importMap and from code, styles, and dependencies provided in the preview event.
150
- * @param {ImportEntry[]} importMap - The import map containing module and export references that might be injected as dependencies in the provided code.
151
- * @param {GeneratedComponentData} generatedComponentData - The generated component data received from design library.
152
- * @returns The dynamically created React component instance.
153
- * @throws If any required modules or exports are missing from the import map, an error is thrown describing the missing dependencies.
154
- * @internal
155
- */
156
- export const createComponentInstance = (importMap, generatedComponentData) => {
157
- const dependencies = buildComponentDependencies(generatedComponentData.imports, importMap);
158
- if (dependencies.missing.modules.length > 0 || dependencies.missing.exports.length > 0) {
159
- let errorMessage = '';
160
- dependencies.missing.modules.forEach((mod) => {
161
- errorMessage += `Missing module: '${mod.module}' with alias: '${mod.alias}'\n`;
162
- });
163
- dependencies.missing.exports.forEach((exp) => {
164
- const alias = exp.export !== exp.alias ? ` with alias: '${exp.alias}'` : '';
165
- errorMessage += `Missing export: '${exp.export}' from module: '${exp.module}'${alias}\n`;
166
- });
167
- throw errorMessage;
168
- }
169
- const importNames = dependencies.successful.map((entry) => entry.name);
170
- const importInstances = dependencies.successful.map((entry) => entry.value);
171
- const exports = { Component: null };
172
- const componentFn = new Function('exports', generatedComponentData.styles.styleImport.name, ...importNames, generatedComponentData.code.content);
173
- // Function will set exports.Component
174
- componentFn(exports, generatedComponentData.styles.styleImport.content, ...importInstances);
175
- return exports.Component;
176
- };
177
- /**
178
- * Generates a DesignLibraryComponentPreviewErrorEvent with the given uid and error.
179
- * @param {string} uid - The unique identifier for the event.
180
- * @param {unknown} error - The error to be sent.
181
- * @param {DesignLibraryPreviewError} type - The type of error.
182
- * @returns An object representing the DesignLibraryComponentPreviewErrorEvent.
183
- * @internal
184
- */
185
- export function getDesignLibraryComponentPreviewErrorEvent(uid, error, type) {
186
- return {
187
- name: DESIGN_LIBRARY_COMPONENT_PREVIEW_ERROR_EVENT_NAME,
188
- message: { uid, error, type },
189
- };
190
- }
191
- /**
192
- * Generates a DesignLibraryComponentPropsEvent with the given uid, fields and parameters.
193
- * @param {string} uid - The unique identifier for the event.
194
- * @param {ComponentFields} fields - The fields of the component.
195
- * @param {ComponentParams} parameters - The parameters of the component.
196
- * @returns An object representing the DesignLibraryComponentPropsEvent.
197
- * @internal
198
- */
199
- export function getDesignLibraryComponentPropsEvent(uid, fields = {}, parameters = {}) {
200
- return {
201
- name: DESIGN_LIBRARY_COMPONENT_PROPS_EVENT_NAME,
202
- message: {
203
- uid,
204
- fields,
205
- parameters,
206
- },
207
- };
208
- }
209
- /**
210
- * Generates a DesignLibraryImportMapEvent with the given uid and importMap.
211
- * @param {string} uid - The unique identifier for the event.
212
- * @param {ImportEntry[]} importMap - The imports map to be sent.
213
- * @returns An object representing the DesignLibraryImportMapEvent.
214
- * @internal
215
- */
216
- export function getDesignLibraryImportMapEvent(uid, importMap) {
217
- const importMapPayload = isImportEntryInfoArray(importMap)
218
- ? importMap
219
- : getImportMapInfo(importMap);
220
- return {
221
- name: DESIGN_LIBRARY_IMPORT_MAP_EVENT_NAME,
222
- message: {
223
- uid,
224
- importMap: importMapPayload,
225
- },
226
- };
227
- }
228
- /**
229
- * Generates the payload for the import map to be sent to design library.
230
- * @param {ImportEntry[]} importMap - The imports map to be sent.
231
- * @internal
232
- */
233
- export function getImportMapInfo(importMap) {
234
- return importMap.map((entry) => ({
235
- module: entry.module,
236
- exports: entry.exports.map((exp) => exp.name),
237
- }));
238
- }
239
- /**
240
- * Type guard for ImportEntryInfo[]
241
- * @param {unknown} data import entry data to check
242
- * @returns true if the data is ImportEntryInfo array
243
- */
244
- export function isImportEntryInfoArray(data) {
245
- return (Array.isArray(data) &&
246
- data.length > 0 &&
247
- typeof data[0].module === 'string' &&
248
- Array.isArray(data[0].exports) &&
249
- typeof data[0].exports[0] === 'string');
250
- }
251
- /**
252
- * Sends a component preview error event to the design library
253
- * @param {string} uid - The unique identifier of the component that's being edited.
254
- * @param {unknown} error - The error object or message to be sent.
255
- * @param {DesignLibraryPreviewError} type - The type of error, as defined in DesignLibraryPreviewError.
256
- * @internal
257
- */
258
- export const sendErrorEvent = (uid, error, type) => {
259
- const errorEvent = getDesignLibraryComponentPreviewErrorEvent(uid, error, type);
260
- console.error('Component Library: sending error event', errorEvent);
261
- if (typeof window !== 'undefined') {
262
- const target = window.parent && window.parent !== window ? window.parent : window;
263
- target.postMessage(errorEvent, '*');
264
- }
265
- };
266
- /**
267
- * Fetches generated component data from the authoring cache endpoint.
268
- * 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.
269
- * @param {string} id - The unique identifier of the component to fetch from cache.
270
- * @param {string} token - The authorization token for authentication.
271
- * @param {string} [edgeUrl] - The URL of the Sitecore Edge endpoint.
272
- * @returns A Promise that resolves to the component rendering data, component generation data, or undefined if the fetch fails.
273
- * @internal
274
- */
275
- export async function fetchGeneratedComponentFromCache(id, token, edgeUrl = SITECORE_EDGE_URL_DEFAULT) {
276
- const dataFetcher = new NativeDataFetcher({ debugger: debug.editing });
277
- const componentDataResponse = await dataFetcher.fetch(`${edgeUrl}/authoring/api/v1/components/cache/${id}`, {
278
- method: 'GET',
279
- headers: {
280
- Authorization: `Bearer ${token}`,
281
- },
282
- });
283
- if (componentDataResponse.status !== 200) {
284
- throw new Error(`Failed to fetch generated component data from cache for id: ${id}. Response Status: ${componentDataResponse.status}, Response Status Text: ${componentDataResponse.statusText}`);
285
- }
286
- const generatedComponentData = JSON.parse(componentDataResponse.data.content);
287
- return generatedComponentData;
288
- }
@@ -1,56 +0,0 @@
1
- import { NativeDataFetcher } from '../native-fetcher';
2
- import debug from '../debug';
3
- import { SITECORE_EDGE_URL_DEFAULT } from '../constants';
4
- import { resolveUrl } from '../utils';
5
- import { DesignLibraryMode } from './models';
6
- /**
7
- * REST service that enables Design Library functionality.
8
- * Returns layout data for a single rendered component.
9
- * @public
10
- */
11
- export class ComponentLayoutService {
12
- constructor(config) {
13
- this.config = config;
14
- }
15
- fetchComponentData(params, fetchOptions) {
16
- const fetcher = new NativeDataFetcher({ debugger: debug.layout });
17
- debug.layout('fetching component with uid %s for %s %s %s %s', params.componentUid, params.itemId, params.language, params.siteName, params.dataSourceId);
18
- return fetcher
19
- .get(this.getFetchUrl(params), Object.assign(Object.assign({}, fetchOptions), { headers: Object.assign(Object.assign({}, fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.headers), { sc_editMode: `${params.mode === DesignLibraryMode.Metadata}` }) }))
20
- .then((response) => response.data)
21
- .catch((error) => {
22
- var _a;
23
- if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
24
- return error.response.data;
25
- }
26
- throw error;
27
- });
28
- }
29
- getComponentFetchParams(params) {
30
- // Choose the correct Edge ID per environment
31
- const sitecoreContextId = this.config.contextId || this.config.clientContextId;
32
- if (!sitecoreContextId) {
33
- throw new Error(`ComponentLayoutService misconfigured: contextId is missing.
34
- Provide contextId on the server, and clientContextId in the browser if you need to full client-side functionality.`);
35
- }
36
- // strip undefined fields
37
- return JSON.parse(JSON.stringify({
38
- sitecoreContextId,
39
- item: params.itemId,
40
- uid: params.componentUid,
41
- dataSourceId: params.dataSourceId,
42
- renderingItemId: params.renderingId,
43
- version: params.version,
44
- sc_site: params.siteName,
45
- sc_lang: params.language || 'en',
46
- }));
47
- }
48
- /**
49
- * Get the fetch URL for the partial layout data endpoint
50
- * @param {ComponentLayoutRequestParams} params - The parameters for the request
51
- * @returns {string} The fetch URL for the component data
52
- */
53
- getFetchUrl(params) {
54
- return resolveUrl(`${this.config.edgeUrl || SITECORE_EDGE_URL_DEFAULT}/layout/component`, this.getComponentFetchParams(params));
55
- }
56
- }