@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,90 +0,0 @@
1
- import { GraphQLClient, GraphQLRequestClientFactory } from '../graphql-request-client';
2
- import { CacheClient, CacheOptions } from '../cache-client';
3
- /**
4
- * Configuration for the PersonalizeService.
5
- * @public
6
- */
7
- export type PersonalizeServiceConfig = CacheOptions & {
8
- /**
9
- * Timeout (ms) for the Personalize request. Default is 400.
10
- */
11
- timeout?: number;
12
- /**
13
- * Optional Sitecore Personalize scope identifier allowing you to isolate your personalization data between XM Cloud environments
14
- * @deprecated Will be removed in a future release.
15
- */
16
- scope?: string;
17
- /**
18
- * Override fetch method. Uses 'GraphQLRequestClient' default otherwise.
19
- */
20
- fetch?: typeof fetch;
21
- /**
22
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
23
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
24
- */
25
- clientFactory: GraphQLRequestClientFactory;
26
- };
27
- /**
28
- * Object model of personlize info
29
- * @public
30
- */
31
- export type PersonalizeInfo = {
32
- /**
33
- * The page id
34
- */
35
- pageId: string;
36
- /**
37
- * The configured variant ids
38
- */
39
- variantIds: string[];
40
- };
41
- type PersonalizeQueryResult = {
42
- layout: {
43
- item: {
44
- id: string;
45
- version: string;
46
- personalization: {
47
- variantIds: string[];
48
- };
49
- };
50
- };
51
- };
52
- /**
53
- * Fetch personalize data using the Sitecore GraphQL endpoint.
54
- * @public
55
- */
56
- export declare class PersonalizeService {
57
- protected config: PersonalizeServiceConfig;
58
- private graphQLClient;
59
- private cache;
60
- /**
61
- * Fetch personalize data using the Sitecore GraphQL endpoint.
62
- * @param {PersonalizeServiceConfig} config
63
- */
64
- constructor(config: PersonalizeServiceConfig);
65
- protected get query(): string;
66
- /**
67
- * Get personalize information for a route
68
- * @param {string} itemPath page route
69
- * @param {string} language language
70
- * @param {string} siteName site name
71
- * @returns {Promise<PersonalizeInfo | undefined>} the personalize information or undefined (if itemPath / language not found)
72
- */
73
- getPersonalizeInfo(itemPath: string, language: string, siteName: string): Promise<PersonalizeInfo | undefined>;
74
- /**
75
- * Gets cache client implementation
76
- * Override this method if custom cache needs to be used
77
- * @returns CacheClient instance
78
- */
79
- protected getCacheClient(): CacheClient<PersonalizeQueryResult>;
80
- protected getCacheKey(itemPath: string, language: string, siteName: string): string;
81
- /**
82
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
83
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
84
- * want to use something else.
85
- * @returns {GraphQLClient} implementation
86
- */
87
- protected getGraphQLClient(): GraphQLClient;
88
- }
89
- export {};
90
- //# sourceMappingURL=personalize-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"personalize-service.d.ts","sourceRoot":"","sources":["../../src/personalize/personalize-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAE/E;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE;QAAE,IAAI,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,eAAe,EAAE;gBAAE,UAAU,EAAE,MAAM,EAAE,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAC9F,CAAC;AAEF;;;GAGG;AACH,qBAAa,kBAAkB;IAQjB,SAAS,CAAC,MAAM,EAAE,wBAAwB;IAPtD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAAsC;IAEnD;;;OAGG;gBACmB,MAAM,EAAE,wBAAwB;IAMtD,SAAS,KAAK,KAAK,IAAI,MAAM,CAc5B;IAED;;;;;;OAMG;IACG,kBAAkB,CACtB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAgCvC;;;;OAIG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW,CAAC,sBAAsB,CAAC;IAO/D,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAI1E;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAW5C"}
@@ -1,78 +0,0 @@
1
- /** @internal */
2
- export declare const DEFAULT_VARIANT = "_default";
3
- /** @internal */
4
- export declare const VARIANT_PREFIX = "_variantId_";
5
- /** @public */
6
- export type PersonalizedRewriteData = {
7
- variantId: string;
8
- componentVariantIds?: string[];
9
- };
10
- /**
11
- * Get a personalized rewrite path for given pathname
12
- * @param {string} pathname the pathname
13
- * @param {string[]} variantIds the variantIds to include in the rewrite
14
- * @returns {string} the rewrite path
15
- * @public
16
- */
17
- export declare function getPersonalizedRewrite(pathname: string, variantIds: string[]): string;
18
- /**
19
- * Get personalize data from the rewrite path
20
- * @param {string} pathname the pathname
21
- * @returns {PersonalizedRewriteData} the personalize data from the rewrite
22
- * @public
23
- */
24
- export declare function getPersonalizedRewriteData(pathname: string): PersonalizedRewriteData;
25
- /**
26
- * Parses a list of variantIds and divides into layout and component variants
27
- * @param {string[]} variantIds the list of variant IDs for a page
28
- * @returns {PersonalizedRewriteData} object with variant IDs sorted
29
- * @public
30
- */
31
- export declare function getGroomedVariantIds(variantIds: string[]): PersonalizedRewriteData;
32
- /**
33
- * Normalize a personalized rewrite path (remove personalize data)
34
- * @param {string} pathname the pathname
35
- * @returns {string} the pathname with personalize data removed
36
- * @public
37
- */
38
- export declare function normalizePersonalizedRewrite(pathname: string): string;
39
- /**
40
- * Static utility class for Sitecore CDP
41
- * @public
42
- */
43
- export declare class CdpHelper {
44
- /**
45
- * Gets the page variant id for CDP in the required format
46
- * @param {string} pageId the page id
47
- * @param {string} language the language
48
- * @param {string} variantId the variant id
49
- * @param {string} [scope] the scope value
50
- * @returns {string} the formatted page variant id
51
- */
52
- static getPageVariantId(pageId: string, language: string, variantId: string, scope?: string): string;
53
- /**
54
- * Gets the friendly id for (page-level) Embedded Personalization in the required format `embedded_[<scope>_]<id>_<lang>`
55
- * @param {string} pageId the page id
56
- * @param {string} language the language
57
- * @param {string} [scope] the scope value
58
- * @returns {string} the friendly id
59
- */
60
- static getPageFriendlyId(pageId: string, language: string, scope?: string): string;
61
- /**
62
- * Gets the friendly id for Component A/B Testing in the required format `component_[<scope>_]<pageId>_<componentId>_<language>*`
63
- * @param {string} pageId the page id
64
- * @param {string} componentId the component id
65
- * @param {string} language the language
66
- * @param {string} [scope] the scope value
67
- * @returns {string} the friendly id
68
- */
69
- static getComponentFriendlyId(pageId: string, componentId: string, language: string, scope?: string): string;
70
- /**
71
- * Normalizes the scope from the given string value
72
- * Removes all non-alphanumeric characters
73
- * @param {string} [scope] the scope value
74
- * @returns {string} normalized scope value
75
- */
76
- static normalizeScope(scope?: string): string;
77
- }
78
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/personalize/utils.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,gBAAgB;AAChB,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,cAAc;AACd,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAGrF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAWpF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,2BAmBxD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASrE;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM;IAWT;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAOlF;;;;;;;OAOG;IACH,MAAM,CAAC,sBAAsB,CAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM;IAQT;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;CAG9C"}
@@ -1,64 +0,0 @@
1
- import { FetchOptions, GraphQLClient } from '../client';
2
- import { LayoutServiceData } from '../layout';
3
- import { GraphQLRequestClientFactory } from '../graphql-request-client';
4
- import { GraphQLServiceConfig } from '../sitecore-service-base';
5
- /**
6
- * Configuration for @see ErrorPagesService instances
7
- * @public
8
- */
9
- export interface ErrorPagesServiceConfig extends GraphQLServiceConfig {
10
- /**
11
- * The language
12
- */
13
- language: string;
14
- /**
15
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
16
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
17
- */
18
- clientFactory: GraphQLRequestClientFactory;
19
- }
20
- /**
21
- * Object model of Error Pages result
22
- * @public
23
- */
24
- export type ErrorPages = {
25
- notFoundPage: {
26
- rendered: LayoutServiceData;
27
- };
28
- notFoundPagePath: string;
29
- serverErrorPage: {
30
- rendered: LayoutServiceData;
31
- };
32
- serverErrorPagePath: string;
33
- };
34
- /**
35
- * Service that fetch the error pages data using Sitecore's GraphQL API.
36
- * @public
37
- */
38
- export declare class ErrorPagesService {
39
- options: ErrorPagesServiceConfig;
40
- private graphQLClient;
41
- /**
42
- * Creates an instance of graphQL error pages service with the provided options
43
- * @param {ErrorPagesServiceConfig} options instance
44
- */
45
- constructor(options: ErrorPagesServiceConfig);
46
- protected get query(): string;
47
- /**
48
- * Fetch list of error pages for the site
49
- * @param {string} siteName The site name
50
- * @param {string} locale The language
51
- * @param {FetchOptions} [fetchOptions] Options to override graphQL client details like retries and fetch implementation
52
- * @returns {ErrorPages} list of url's error pages
53
- * @throws {Error} if the siteName is empty.
54
- */
55
- fetchErrorPages(siteName: string, locale?: string, fetchOptions?: FetchOptions): Promise<ErrorPages | null>;
56
- /**
57
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
58
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
59
- * want to use something else.
60
- * @returns {GraphQLClient} implementation
61
- */
62
- protected getGraphQLClient(): GraphQLClient;
63
- }
64
- //# sourceMappingURL=error-pages-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-pages-service.d.ts","sourceRoot":"","sources":["../../src/site/error-pages-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAsBhE;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE;QAAE,QAAQ,EAAE,iBAAiB,CAAA;KAAE,CAAC;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE;QAAE,QAAQ,EAAE,iBAAiB,CAAA;KAAE,CAAC;IACjD,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AASF;;;GAGG;AACH,qBAAa,iBAAiB;IAOT,OAAO,EAAE,uBAAuB;IANnD,OAAO,CAAC,aAAa,CAAgB;IAErC;;;OAGG;gBACgB,OAAO,EAAE,uBAAuB;IAInD,SAAS,KAAK,KAAK,IAAI,MAAM,CAE5B;IAED;;;;;;;OAOG;IACG,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAqB7B;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAW5C"}
@@ -1,10 +0,0 @@
1
- export { RobotsQueryResult, RobotsService, RobotsServiceConfig } from './robots-service';
2
- export { RedirectInfo, RedirectsQueryResult, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, RedirectsService, RedirectsServiceConfig, } from './redirects-service';
3
- export { SitemapQueryResult, SitemapXmlService, SitemapXmlServiceConfig, } from './sitemap-xml-service';
4
- export { ErrorPages, ErrorPagesService, ErrorPagesServiceConfig } from './error-pages-service';
5
- export { SiteInfoService, SiteInfoServiceConfig } from './siteinfo-service';
6
- export { SitePathService, SitePathServiceConfig } from './sitepath-service';
7
- export { SiteInfo } from './models';
8
- export { getSiteRewrite, getSiteRewriteData, normalizeSiteRewrite, SiteRewriteData, SITE_PREFIX, SITE_KEY, } from './utils';
9
- export { SiteResolver } from './site-resolver';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/site/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Object model of Site Info result
3
- * @public
4
- */
5
- export type SiteInfo = {
6
- /**
7
- * Additional user-defined properties
8
- */
9
- [key: string]: unknown;
10
- /**
11
- * Site name
12
- */
13
- name: string;
14
- /**
15
- * Site host name. May include multiple values (separated by '|') and wildcards ('*')
16
- */
17
- hostName: string;
18
- /**
19
- * Site default language
20
- */
21
- language: string;
22
- };
23
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/site/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -1,92 +0,0 @@
1
- import { FetchOptions, GraphQLClient } from '../client';
2
- import { CacheOptions, CacheClient } from '../cache-client';
3
- import { GraphQLRequestClientFactory } from '../graphql-request-client';
4
- /**
5
- * Redirect type for 301 redirects
6
- * @public
7
- */
8
- export declare const REDIRECT_TYPE_301 = "REDIRECT_301";
9
- /**
10
- * Redirect type for 302 redirects
11
- * @public
12
- */
13
- export declare const REDIRECT_TYPE_302 = "REDIRECT_302";
14
- /**
15
- * Redirect type for server transfer
16
- * @public
17
- */
18
- export declare const REDIRECT_TYPE_SERVER_TRANSFER = "SERVER_TRANSFER";
19
- /**
20
- * Object model of Redirect Info result
21
- * @public
22
- */
23
- export type RedirectInfo = {
24
- pattern: string;
25
- target: string;
26
- redirectType: string;
27
- isQueryStringPreserved: boolean;
28
- locale: string;
29
- };
30
- /**
31
- * Configuration for @see RedirectsService instances
32
- * @public
33
- */
34
- export type RedirectsServiceConfig = CacheOptions & {
35
- /**
36
- * Override fetch method. Uses 'GraphQLRequestClient' default otherwise.
37
- */
38
- fetch?: typeof fetch;
39
- /**
40
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
41
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
42
- */
43
- clientFactory: GraphQLRequestClientFactory;
44
- };
45
- /**
46
- * The schema of data returned in response to redirects array request
47
- * @public
48
- */
49
- export type RedirectsQueryResult = {
50
- site: {
51
- siteInfo: {
52
- redirects: RedirectInfo[];
53
- } | null;
54
- };
55
- };
56
- /**
57
- * The RedirectsService class is used to query the Content SDK redirects using Graphql endpoint
58
- * @public
59
- */
60
- export declare class RedirectsService {
61
- private options;
62
- private graphQLClient;
63
- private cache;
64
- /**
65
- * Creates an instance of graphQL redirects service with the provided options
66
- * @param {RedirectsServiceConfig} options instance
67
- */
68
- constructor(options: RedirectsServiceConfig);
69
- protected get query(): string;
70
- /**
71
- * Fetch an array of redirects from API
72
- * @param {string} siteName site name
73
- * @returns Promise<RedirectInfo[]>
74
- * @param {FetchOptions} [fetchOptions] Options to override graphQL client details like retries and fetch implementation
75
- * @throws {Error} if the siteName is empty.
76
- */
77
- fetchRedirects(siteName: string, fetchOptions?: FetchOptions): Promise<RedirectInfo[]>;
78
- /**
79
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
80
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
81
- * want to use something else.
82
- * @returns {GraphQLClient} implementation
83
- */
84
- protected getGraphQLClient(): GraphQLClient;
85
- /**
86
- * Gets cache client implementation
87
- * Override this method if custom cache needs to be used
88
- * @returns CacheClient instance
89
- */
90
- protected getCacheClient(): CacheClient<RedirectsQueryResult>;
91
- }
92
- //# sourceMappingURL=redirects-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redirects-service.d.ts","sourceRoot":"","sources":["../../src/site/redirects-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAqB,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmBF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE;QAAE,QAAQ,EAAE;YAAE,SAAS,EAAE,YAAY,EAAE,CAAA;SAAE,GAAG,IAAI,CAAA;KAAE,CAAC;CAC1D,CAAC;AAEF;;;GAGG;AACH,qBAAa,gBAAgB;IAQf,OAAO,CAAC,OAAO;IAP3B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAAoC;IAEjD;;;OAGG;gBACiB,OAAO,EAAE,sBAAsB;IAKnD,SAAS,KAAK,KAAK,IAAI,MAAM,CAE5B;IAED;;;;;;OAMG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAsB5F;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAW3C;;;;OAIG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW,CAAC,oBAAoB,CAAC;CAM9D"}
@@ -1,57 +0,0 @@
1
- import { FetchOptions, GraphQLClient } from '../client';
2
- import { GraphQLRequestClientFactory } from '../graphql-request-client';
3
- /**
4
- * Configuration for @see RobotsService instances
5
- * @public
6
- */
7
- export type RobotsServiceConfig = {
8
- /**
9
- * The Content SDK application name
10
- */
11
- siteName: string;
12
- /**
13
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
14
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
15
- */
16
- clientFactory: GraphQLRequestClientFactory;
17
- };
18
- /**
19
- * The schema of data returned in response to robots.txt request
20
- * @public
21
- */
22
- export type RobotsQueryResult = {
23
- site: {
24
- siteInfo: {
25
- robots: string;
26
- };
27
- };
28
- };
29
- /**
30
- * Service that fetch the robots.txt data using Sitecore's GraphQL API.
31
- * @public
32
- */
33
- export declare class RobotsService {
34
- options: RobotsServiceConfig;
35
- private graphQLClient;
36
- /**
37
- * Creates an instance of graphQL robots.txt service with the provided options
38
- * @param {RobotsServiceConfig} options instance
39
- */
40
- constructor(options: RobotsServiceConfig);
41
- protected get query(): string;
42
- /**
43
- * Fetch a data of robots.txt from API
44
- * @param {FetchOptions} fetchOptions - The fetch options to be used for the request.
45
- * @returns text of robots.txt
46
- * @throws {Error} if the siteName is empty.
47
- */
48
- fetchRobots(fetchOptions?: FetchOptions): Promise<string>;
49
- /**
50
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
51
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
52
- * want to use something else.
53
- * @returns {GraphQLClient} implementation
54
- */
55
- protected getGraphQLClient(): GraphQLClient;
56
- }
57
- //# sourceMappingURL=robots-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"robots-service.d.ts","sourceRoot":"","sources":["../../src/site/robots-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAaxE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE;QAAE,QAAQ,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAE3E;;;GAGG;AACH,qBAAa,aAAa;IAOL,OAAO,EAAE,mBAAmB;IAN/C,OAAO,CAAC,aAAa,CAAgB;IAErC;;;OAGG;gBACgB,OAAO,EAAE,mBAAmB;IAI/C,SAAS,KAAK,KAAK,IAAI,MAAM,CAE5B;IAED;;;;;OAKG;IACG,WAAW,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB/D;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAS5C"}
@@ -1,28 +0,0 @@
1
- import { SiteInfo } from './models';
2
- /**
3
- * Resolves site based on the provided host or site name
4
- * @public
5
- */
6
- export declare class SiteResolver {
7
- readonly sites: SiteInfo[];
8
- /**
9
- * @param {SiteInfo[]} sites Array of sites to be used in resolution
10
- */
11
- constructor(sites: SiteInfo[]);
12
- /**
13
- * Resolve site by host name
14
- * @param {string} hostName the host name
15
- * @returns {SiteInfo} the resolved site
16
- * @throws {Error} if a matching site is not found
17
- */
18
- getByHost: (hostName: string) => SiteInfo;
19
- /**
20
- * Resolve site by site name
21
- * @param {string} siteName the site name
22
- * @returns {SiteInfo} the resolved site or undefined if not found
23
- */
24
- getByName: (siteName: string) => SiteInfo | undefined;
25
- protected getHostMap: () => Map<string, SiteInfo>;
26
- protected matchesPattern(hostname: string, pattern: string): boolean;
27
- }
28
- //# sourceMappingURL=site-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"site-resolver.d.ts","sourceRoot":"","sources":["../../src/site/site-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKpC;;;GAGG;AACH,qBAAa,YAAY;IAIX,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;IAHtC;;OAEG;gBACkB,KAAK,EAAE,QAAQ,EAAE;IAEtC;;;;;OAKG;IACI,SAAS,GAAI,UAAU,MAAM,KAAG,QAAQ,CAO7C;IAEF;;;;OAIG;IACI,SAAS,GAAI,UAAU,MAAM,0BAMlC;IAEF,SAAS,CAAC,UAAU,QAAO,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CA2B9C;IAEF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;CASrE"}
@@ -1,65 +0,0 @@
1
- import { FetchOptions, GraphQLClient } from '../client';
2
- import { CacheClient, CacheOptions } from '../cache-client';
3
- import { GraphQLRequestClientFactory } from '../graphql-request-client';
4
- import { SiteInfo } from './models';
5
- /**
6
- * Configuration for @see SiteInfoService instances
7
- * @public
8
- */
9
- export type SiteInfoServiceConfig = CacheOptions & {
10
- /**
11
- * common variable for all GraphQL queries
12
- * it will be used for every type of query to regulate result batch size
13
- * Optional. How many result items to fetch in each GraphQL call. This is needed for pagination.
14
- * @default 10
15
- */
16
- pageSize?: number;
17
- /**
18
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
19
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
20
- */
21
- clientFactory: GraphQLRequestClientFactory;
22
- };
23
- /**
24
- * Object model of Site Info result
25
- * @public
26
- */
27
- export type GraphQLSiteInfoResult = {
28
- name: string;
29
- hostName: string;
30
- language: string;
31
- };
32
- /**
33
- * Service to fetch site information
34
- * @public
35
- */
36
- export declare class SiteInfoService {
37
- private config;
38
- private graphQLClient;
39
- private cache;
40
- /**
41
- * Creates an instance of graphQL service to retrieve site configuration list from Sitecore
42
- * @param {SiteInfoServiceConfig} config instance
43
- */
44
- constructor(config: SiteInfoServiceConfig);
45
- /**
46
- * site query is available on XM Cloud and XP 10.4+
47
- */
48
- protected get siteQuery(): string;
49
- fetchSiteInfo(fetchOptions?: FetchOptions): Promise<SiteInfo[]>;
50
- /**
51
- * Gets cache client implementation
52
- * Override this method if custom cache needs to be used
53
- * @returns CacheClient instance
54
- */
55
- protected getCacheClient(): CacheClient<SiteInfo[]>;
56
- /**
57
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
58
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
59
- * want to use something else.
60
- * @returns {GraphQLClient} implementation
61
- */
62
- protected getGraphQLClient(): GraphQLClient;
63
- private getCacheKey;
64
- }
65
- //# sourceMappingURL=siteinfo-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"siteinfo-service.d.ts","sourceRoot":"","sources":["../../src/site/siteinfo-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAcpC;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAQF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAe;IAQd,OAAO,CAAC,MAAM;IAP1B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAA0B;IAEvC;;;OAGG;gBACiB,MAAM,EAAE,qBAAqB;IAKjD;;OAEG;IACH,SAAS,KAAK,SAAS,IAAI,MAAM,CAEhC;IAEK,aAAa,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IA8BrE;;;;OAIG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAOnD;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAU3C,OAAO,CAAC,WAAW;CAGpB"}
@@ -1,63 +0,0 @@
1
- import { FetchOptions, GraphQLClient } from '../client';
2
- import { GraphQLRequestClientFactory } from '../graphql-request-client';
3
- /**
4
- * Configuration for @see SitemapXmlService instances
5
- * @public
6
- */
7
- export type SitemapXmlServiceConfig = {
8
- /**
9
- * The Content SDK application name
10
- */
11
- siteName: string;
12
- /**
13
- * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
14
- * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
15
- */
16
- clientFactory: GraphQLRequestClientFactory;
17
- };
18
- /**
19
- * The schema of data returned in response to sitemaps request
20
- * @public
21
- */
22
- export type SitemapQueryResult = {
23
- site: {
24
- siteInfo: {
25
- sitemap: string[];
26
- };
27
- };
28
- };
29
- /**
30
- * Service that fetch the sitemaps data using Sitecore's GraphQL API.
31
- * @public
32
- */
33
- export declare class SitemapXmlService {
34
- options: SitemapXmlServiceConfig;
35
- private graphQLClient;
36
- /**
37
- * Creates an instance of graphQL sitemaps service with the provided options
38
- * @param {SitemapXmlServiceConfig} options instance
39
- */
40
- constructor(options: SitemapXmlServiceConfig);
41
- protected get query(): string;
42
- /**
43
- * Fetch list of sitemaps for the site
44
- * @returns {string[]} list of sitemap paths
45
- * @param {FetchOptions} [fetchOptions] Options to override graphQL client details like retries and fetch implementation
46
- * @throws {Error} if the siteName is empty.
47
- */
48
- fetchSitemaps(fetchOptions?: FetchOptions): Promise<string[]>;
49
- /**
50
- * Get sitemap file path for sitemap id
51
- * @param {string} id the sitemap id (can be empty for default 'sitemap.xml' file)
52
- * @returns {string | undefined} the sitemap file path or undefined if one doesn't exist
53
- */
54
- getSitemap(id: string): Promise<string | undefined>;
55
- /**
56
- * Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
57
- * library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
58
- * want to use something else.
59
- * @returns {GraphQLClient} implementation
60
- */
61
- protected getGraphQLClient(): GraphQLClient;
62
- }
63
- //# sourceMappingURL=sitemap-xml-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sitemap-xml-service.d.ts","sourceRoot":"","sources":["../../src/site/sitemap-xml-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAexE;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE;QAAE,QAAQ,EAAE;YAAE,OAAO,EAAE,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAE/E;;;GAGG;AACH,qBAAa,iBAAiB;IAOT,OAAO,EAAE,uBAAuB;IANnD,OAAO,CAAC,aAAa,CAAgB;IAErC;;;OAGG;gBACgB,OAAO,EAAE,uBAAuB;IAInD,SAAS,KAAK,KAAK,IAAI,MAAM,CAE5B;IAED;;;;;OAKG;IACG,aAAa,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAqBnE;;;;OAIG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAiBzD;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAS5C"}