@sitecore-content-sdk/core 1.3.0-canary.9 → 1.4.0-canary.2
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.
- package/README.md +7 -7
- package/dist/cjs/cache-client.js +55 -54
- package/dist/cjs/client/constants.js +7 -7
- package/dist/cjs/client/edge-proxy.js +24 -22
- package/dist/cjs/client/index.js +15 -15
- package/dist/cjs/client/models.js +2 -2
- package/dist/cjs/client/sitecore-client.js +421 -419
- package/dist/cjs/client/utils.js +47 -46
- package/dist/cjs/config/define-config.js +194 -193
- package/dist/cjs/config/index.js +7 -7
- package/dist/cjs/config/models.js +12 -11
- package/dist/cjs/config-cli/define-cli-config.js +23 -22
- package/dist/cjs/config-cli/index.js +7 -7
- package/dist/cjs/config-cli/models.js +8 -7
- package/dist/cjs/constants.js +49 -17
- package/dist/cjs/debug.js +48 -46
- package/dist/cjs/editing/codegen/index.js +14 -9
- package/dist/cjs/editing/codegen/preview.js +277 -193
- package/dist/cjs/editing/component-layout-service.js +62 -61
- package/dist/cjs/editing/design-library.js +183 -126
- package/dist/cjs/editing/editing-service.js +75 -74
- package/dist/cjs/editing/index.js +33 -27
- package/dist/cjs/editing/metadata.js +42 -42
- package/dist/cjs/editing/models.js +44 -38
- package/dist/cjs/editing/utils.js +108 -90
- package/dist/cjs/form/form.js +81 -78
- package/dist/cjs/form/index.js +7 -7
- package/dist/cjs/graphql-request-client.js +108 -107
- package/dist/cjs/i18n/dictionary-service.js +122 -121
- package/dist/cjs/i18n/index.js +7 -7
- package/dist/cjs/i18n/utils.js +16 -15
- package/dist/cjs/index.js +60 -60
- package/dist/cjs/layout/content-styles.js +72 -71
- package/dist/cjs/layout/index.js +24 -24
- package/dist/cjs/layout/layout-service.js +62 -57
- package/dist/cjs/layout/models.js +39 -34
- package/dist/cjs/layout/themes.js +76 -75
- package/dist/cjs/layout/utils.js +117 -110
- package/dist/cjs/media/index.js +38 -38
- package/dist/cjs/media/media-api.js +100 -96
- package/dist/cjs/models.js +2 -2
- package/dist/cjs/native-fetcher.js +194 -179
- package/dist/cjs/personalize/index.js +15 -15
- package/dist/cjs/personalize/layout-personalizer.js +98 -97
- package/dist/cjs/personalize/personalize-service.js +98 -94
- package/dist/cjs/personalize/utils.js +143 -136
- package/dist/cjs/retries.js +43 -42
- package/dist/cjs/site/error-pages-service.js +65 -64
- package/dist/cjs/site/index.js +26 -26
- package/dist/cjs/site/models.js +2 -2
- package/dist/cjs/site/redirects-service.js +94 -81
- package/dist/cjs/site/robots-service.js +66 -65
- package/dist/cjs/site/site-resolver.js +73 -72
- package/dist/cjs/site/siteinfo-service.js +84 -80
- package/dist/cjs/site/sitemap-xml-service.js +84 -83
- package/dist/cjs/site/sitepath-service.js +165 -164
- package/dist/cjs/site/utils.js +55 -47
- package/dist/cjs/sitecore-service-base.js +36 -36
- package/dist/cjs/tools/auth/flow.js +65 -64
- package/dist/cjs/tools/auth/index.js +5 -5
- package/dist/cjs/tools/auth/models.js +2 -2
- package/dist/cjs/tools/auth/tenant-store.js +38 -38
- package/dist/cjs/tools/codegen/component-generation.js +52 -50
- package/dist/cjs/tools/codegen/extract-files.js +105 -107
- package/dist/cjs/tools/codegen/import-map.js +401 -349
- package/dist/cjs/tools/codegen/utils.js +418 -418
- package/dist/cjs/tools/generate-map.js +2 -2
- package/dist/cjs/tools/generateMetadata.js +36 -35
- package/dist/cjs/tools/generateSites.js +59 -58
- package/dist/cjs/tools/index.js +75 -73
- package/dist/cjs/tools/scaffold.js +60 -59
- package/dist/cjs/tools/templating/components.js +96 -266
- package/dist/cjs/tools/templating/index.js +11 -14
- package/dist/cjs/tools/templating/plugins.js +80 -78
- package/dist/cjs/tools/templating/utils.js +67 -66
- package/dist/cjs/utils/ensurePath.js +20 -20
- package/dist/cjs/utils/env.js +28 -27
- package/dist/cjs/utils/globalCache.js +55 -0
- package/dist/cjs/utils/index.js +26 -21
- package/dist/cjs/utils/is-server.js +11 -10
- package/dist/cjs/utils/normalize-url.js +5 -5
- package/dist/cjs/utils/timeout-promise.js +31 -31
- package/dist/cjs/utils/utils.js +254 -229
- package/dist/esm/cache-client.js +51 -50
- package/dist/esm/client/constants.js +4 -4
- package/dist/esm/client/edge-proxy.js +19 -17
- package/dist/esm/client/index.js +5 -5
- package/dist/esm/client/models.js +1 -1
- package/dist/esm/client/sitecore-client.js +414 -412
- package/dist/esm/client/utils.js +43 -42
- package/dist/esm/config/define-config.js +188 -187
- package/dist/esm/config/index.js +2 -2
- package/dist/esm/config/models.js +9 -8
- package/dist/esm/config-cli/define-cli-config.js +19 -18
- package/dist/esm/config-cli/index.js +2 -2
- package/dist/esm/config-cli/models.js +5 -4
- package/dist/esm/constants.js +46 -14
- package/dist/esm/debug.js +41 -39
- package/dist/esm/editing/codegen/index.js +1 -1
- package/dist/esm/editing/codegen/preview.js +263 -185
- package/dist/esm/editing/component-layout-service.js +55 -54
- package/dist/esm/editing/design-library.js +171 -117
- package/dist/esm/editing/editing-service.js +68 -67
- package/dist/esm/editing/index.js +6 -5
- package/dist/esm/editing/metadata.js +39 -39
- package/dist/esm/editing/models.js +41 -35
- package/dist/esm/editing/utils.js +98 -80
- package/dist/esm/form/form.js +72 -69
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/graphql-request-client.js +101 -100
- package/dist/esm/i18n/dictionary-service.js +115 -114
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/i18n/utils.js +13 -12
- package/dist/esm/index.js +13 -13
- package/dist/esm/layout/content-styles.js +64 -63
- package/dist/esm/layout/index.js +6 -6
- package/dist/esm/layout/layout-service.js +55 -50
- package/dist/esm/layout/models.js +36 -31
- package/dist/esm/layout/themes.js +71 -70
- package/dist/esm/layout/utils.js +109 -102
- package/dist/esm/media/index.js +2 -2
- package/dist/esm/media/media-api.js +90 -86
- package/dist/esm/models.js +1 -1
- package/dist/esm/native-fetcher.js +187 -172
- package/dist/esm/personalize/index.js +3 -3
- package/dist/esm/personalize/layout-personalizer.js +93 -92
- package/dist/esm/personalize/personalize-service.js +91 -87
- package/dist/esm/personalize/utils.js +135 -128
- package/dist/esm/retries.js +39 -38
- package/dist/esm/site/error-pages-service.js +58 -57
- package/dist/esm/site/index.js +8 -8
- package/dist/esm/site/models.js +1 -1
- package/dist/esm/site/redirects-service.js +87 -74
- package/dist/esm/site/robots-service.js +59 -58
- package/dist/esm/site/site-resolver.js +69 -68
- package/dist/esm/site/siteinfo-service.js +77 -73
- package/dist/esm/site/sitemap-xml-service.js +77 -76
- package/dist/esm/site/sitepath-service.js +157 -156
- package/dist/esm/site/utils.js +49 -41
- package/dist/esm/sitecore-service-base.js +29 -29
- package/dist/esm/tools/auth/flow.js +62 -61
- package/dist/esm/tools/auth/index.js +1 -1
- package/dist/esm/tools/auth/models.js +1 -1
- package/dist/esm/tools/auth/tenant-store.js +35 -35
- package/dist/esm/tools/codegen/component-generation.js +44 -42
- package/dist/esm/tools/codegen/extract-files.js +99 -101
- package/dist/esm/tools/codegen/import-map.js +358 -306
- package/dist/esm/tools/codegen/utils.js +373 -373
- package/dist/esm/tools/generate-map.js +1 -1
- package/dist/esm/tools/generateMetadata.js +29 -28
- package/dist/esm/tools/generateSites.js +52 -51
- package/dist/esm/tools/index.js +28 -27
- package/dist/esm/tools/scaffold.js +52 -51
- package/dist/esm/tools/templating/components.js +59 -223
- package/dist/esm/tools/templating/index.js +3 -3
- package/dist/esm/tools/templating/plugins.js +72 -70
- package/dist/esm/tools/templating/utils.js +59 -58
- package/dist/esm/utils/ensurePath.js +13 -13
- package/dist/esm/utils/env.js +24 -23
- package/dist/esm/utils/globalCache.js +49 -0
- package/dist/esm/utils/index.js +4 -3
- package/dist/esm/utils/is-server.js +9 -8
- package/dist/esm/utils/normalize-url.js +1 -1
- package/dist/esm/utils/timeout-promise.js +28 -28
- package/dist/esm/utils/utils.js +238 -213
- package/package.json +73 -5
- package/types/cache-client.d.ts +68 -64
- package/types/cache-client.d.ts.map +1 -0
- package/types/client/constants.d.ts +5 -4
- package/types/client/constants.d.ts.map +1 -0
- package/types/client/edge-proxy.d.ts +18 -15
- package/types/client/edge-proxy.d.ts.map +1 -0
- package/types/client/index.d.ts +8 -7
- package/types/client/index.d.ts.map +1 -0
- package/types/client/models.d.ts +21 -19
- package/types/client/models.d.ts.map +1 -0
- package/types/client/sitecore-client.d.ts +338 -327
- package/types/client/sitecore-client.d.ts.map +1 -0
- package/types/client/utils.d.ts +15 -9
- package/types/client/utils.d.ts.map +1 -0
- package/types/config/define-config.d.ts +20 -18
- package/types/config/define-config.d.ts.map +1 -0
- package/types/config/index.d.ts +3 -2
- package/types/config/index.d.ts.map +1 -0
- package/types/config/models.d.ts +287 -268
- package/types/config/models.d.ts.map +1 -0
- package/types/config-cli/define-cli-config.d.ts +9 -7
- package/types/config-cli/define-cli-config.d.ts.map +1 -0
- package/types/config-cli/index.d.ts +3 -2
- package/types/config-cli/index.d.ts.map +1 -0
- package/types/config-cli/models.d.ts +6 -4
- package/types/config-cli/models.d.ts.map +1 -0
- package/types/constants.d.ts +44 -11
- package/types/constants.d.ts.map +1 -0
- package/types/debug.d.ts +35 -28
- package/types/debug.d.ts.map +1 -0
- package/types/editing/codegen/index.d.ts +2 -1
- package/types/editing/codegen/index.d.ts.map +1 -0
- package/types/editing/codegen/preview.d.ts +256 -195
- package/types/editing/codegen/preview.d.ts.map +1 -0
- package/types/editing/component-layout-service.d.ts +84 -80
- package/types/editing/component-layout-service.d.ts.map +1 -0
- package/types/editing/design-library.d.ts +111 -63
- package/types/editing/design-library.d.ts.map +1 -0
- package/types/editing/editing-service.d.ts +72 -62
- package/types/editing/editing-service.d.ts.map +1 -0
- package/types/editing/index.d.ts +7 -6
- package/types/editing/index.d.ts.map +1 -0
- package/types/editing/metadata.d.ts +8 -7
- package/types/editing/metadata.d.ts.map +1 -0
- package/types/editing/models.d.ts +103 -92
- package/types/editing/models.d.ts.map +1 -0
- package/types/editing/utils.d.ts +91 -74
- package/types/editing/utils.d.ts.map +1 -0
- package/types/form/form.d.ts +25 -21
- package/types/form/form.d.ts.map +1 -0
- package/types/form/index.d.ts +2 -1
- package/types/form/index.d.ts.map +1 -0
- package/types/graphql-request-client.d.ts +112 -105
- package/types/graphql-request-client.d.ts.map +1 -0
- package/types/i18n/dictionary-service.d.ts +135 -131
- package/types/i18n/dictionary-service.d.ts.map +1 -0
- package/types/i18n/index.d.ts +3 -2
- package/types/i18n/index.d.ts.map +1 -0
- package/types/i18n/utils.d.ts +9 -7
- package/types/i18n/utils.d.ts.map +1 -0
- package/types/index.d.ts +13 -12
- package/types/index.d.ts.map +1 -0
- package/types/layout/content-styles.d.ts +20 -18
- package/types/layout/content-styles.d.ts.map +1 -0
- package/types/layout/index.d.ts +6 -5
- package/types/layout/index.d.ts.map +1 -0
- package/types/layout/layout-service.d.ts +45 -35
- package/types/layout/layout-service.d.ts.map +1 -0
- package/types/layout/models.d.ts +174 -151
- package/types/layout/models.d.ts.map +1 -0
- package/types/layout/themes.d.ts +13 -11
- package/types/layout/themes.d.ts.map +1 -0
- package/types/layout/utils.d.ts +56 -41
- package/types/layout/utils.d.ts.map +1 -0
- package/types/media/index.d.ts +3 -2
- package/types/media/index.d.ts.map +1 -0
- package/types/media/media-api.d.ts +60 -55
- package/types/media/media-api.d.ts.map +1 -0
- package/types/models.d.ts +94 -84
- package/types/models.d.ts.map +1 -0
- package/types/native-fetcher.d.ts +124 -114
- package/types/native-fetcher.d.ts.map +1 -0
- package/types/personalize/index.d.ts +4 -3
- package/types/personalize/index.d.ts.map +1 -0
- package/types/personalize/layout-personalizer.d.ts +29 -27
- package/types/personalize/layout-personalizer.d.ts.map +1 -0
- package/types/personalize/personalize-service.d.ts +90 -80
- package/types/personalize/personalize-service.d.ts.map +1 -0
- package/types/personalize/utils.d.ts +78 -69
- package/types/personalize/utils.d.ts.map +1 -0
- package/types/retries.d.ts +26 -24
- package/types/retries.d.ts.map +1 -0
- package/types/site/error-pages-service.d.ts +64 -57
- package/types/site/error-pages-service.d.ts.map +1 -0
- package/types/site/index.d.ts +10 -9
- package/types/site/index.d.ts.map +1 -0
- package/types/site/models.d.ts +23 -18
- package/types/site/models.d.ts.map +1 -0
- package/types/site/redirects-service.d.ts +92 -69
- package/types/site/redirects-service.d.ts.map +1 -0
- package/types/site/robots-service.d.ts +57 -50
- package/types/site/robots-service.d.ts.map +1 -0
- package/types/site/site-resolver.d.ts +28 -26
- package/types/site/site-resolver.d.ts.map +1 -0
- package/types/site/siteinfo-service.d.ts +65 -52
- package/types/site/siteinfo-service.d.ts.map +1 -0
- package/types/site/sitemap-xml-service.d.ts +63 -56
- package/types/site/sitemap-xml-service.d.ts.map +1 -0
- package/types/site/sitepath-service.d.ts +137 -134
- package/types/site/sitepath-service.d.ts.map +1 -0
- package/types/site/utils.d.ts +41 -28
- package/types/site/utils.d.ts.map +1 -0
- package/types/sitecore-service-base.d.ts +31 -30
- package/types/sitecore-service-base.d.ts.map +1 -0
- package/types/tools/auth/flow.d.ts +29 -27
- package/types/tools/auth/flow.d.ts.map +1 -0
- package/types/tools/auth/index.d.ts +2 -1
- package/types/tools/auth/index.d.ts.map +1 -0
- package/types/tools/auth/models.d.ts +35 -33
- package/types/tools/auth/models.d.ts.map +1 -0
- package/types/tools/auth/tenant-store.d.ts +12 -11
- package/types/tools/auth/tenant-store.d.ts.map +1 -0
- package/types/tools/codegen/component-generation.d.ts +50 -47
- package/types/tools/codegen/component-generation.d.ts.map +1 -0
- package/types/tools/codegen/extract-files.d.ts +24 -22
- package/types/tools/codegen/extract-files.d.ts.map +1 -0
- package/types/tools/codegen/import-map.d.ts +103 -70
- package/types/tools/codegen/import-map.d.ts.map +1 -0
- package/types/tools/codegen/utils.d.ts +76 -75
- package/types/tools/codegen/utils.d.ts.map +1 -0
- package/types/tools/generate-map.d.ts +36 -26
- package/types/tools/generate-map.d.ts.map +1 -0
- package/types/tools/generateMetadata.d.ts +24 -22
- package/types/tools/generateMetadata.d.ts.map +1 -0
- package/types/tools/generateSites.d.ts +25 -22
- package/types/tools/generateSites.d.ts.map +1 -0
- package/types/tools/index.d.ts +22 -20
- package/types/tools/index.d.ts.map +1 -0
- package/types/tools/scaffold.d.ts +27 -25
- package/types/tools/scaffold.d.ts.map +1 -0
- package/types/tools/templating/components.d.ts +104 -103
- package/types/tools/templating/components.d.ts.map +1 -0
- package/types/tools/templating/index.d.ts +4 -3
- package/types/tools/templating/index.d.ts.map +1 -0
- package/types/tools/templating/plugins.d.ts +71 -67
- package/types/tools/templating/plugins.d.ts.map +1 -0
- package/types/tools/templating/utils.d.ts +42 -40
- package/types/tools/templating/utils.d.ts.map +1 -0
- package/types/utils/ensurePath.d.ts +7 -6
- package/types/utils/ensurePath.d.ts.map +1 -0
- package/types/utils/env.d.ts +9 -7
- package/types/utils/env.d.ts.map +1 -0
- package/types/utils/globalCache.d.ts +37 -0
- package/types/utils/globalCache.d.ts.map +1 -0
- package/types/utils/index.d.ts +5 -3
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/is-server.d.ts +8 -6
- package/types/utils/is-server.d.ts.map +1 -0
- package/types/utils/normalize-url.d.ts +2 -1
- package/types/utils/normalize-url.d.ts.map +1 -0
- package/types/utils/timeout-promise.d.ts +18 -17
- package/types/utils/timeout-promise.d.ts.map +1 -0
- package/types/utils/utils.d.ts +104 -79
- package/types/utils/utils.d.ts.map +1 -0
- package/client.js +0 -1
- package/codegen.js +0 -1
- package/config-cli.js +0 -1
- package/config.js +0 -1
- package/editing.js +0 -1
- package/i18n.js +0 -1
- package/layout.js +0 -1
- package/media.js +0 -1
- package/personalize.js +0 -1
- package/site.js +0 -1
- package/tools.js +0 -1
- package/utils.js +0 -1
|
@@ -1,105 +1,112 @@
|
|
|
1
|
-
import { ClientError } from 'graphql-request';
|
|
2
|
-
import { DocumentNode } from 'graphql';
|
|
3
|
-
import { Debugger } from './debug';
|
|
4
|
-
import { GenericGraphQLClientError, RetryStrategy, FetchOptions } from './models';
|
|
5
|
-
/**
|
|
6
|
-
* An interface for GraphQL clients for Sitecore APIs
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
* @param {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
export type
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
private
|
|
83
|
-
private
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @param {
|
|
93
|
-
* @param {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
* @param {string
|
|
100
|
-
* @param {
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
1
|
+
import { ClientError } from 'graphql-request';
|
|
2
|
+
import { DocumentNode } from 'graphql';
|
|
3
|
+
import { Debugger } from './debug';
|
|
4
|
+
import { GenericGraphQLClientError, RetryStrategy, FetchOptions } from './models';
|
|
5
|
+
/**
|
|
6
|
+
* An interface for GraphQL clients for Sitecore APIs
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface GraphQLClient {
|
|
10
|
+
/**
|
|
11
|
+
* Execute graphql request
|
|
12
|
+
* @param {string | DocumentNode} query graphql query
|
|
13
|
+
* @param {RequestOptions} [options] options and variables for configuring a GraphQL request.
|
|
14
|
+
*/
|
|
15
|
+
request<T>(query: string | DocumentNode, variables?: {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}, options?: FetchOptions): Promise<T>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This type represents errors that can occur in a GraphQL client.
|
|
21
|
+
* In cases where an error status was sent back from the server (`!response.ok`), the `response` will be populated with details. In cases where a response was never received, the `code` can be populated with the error code (e.g. Node's 'ECONNRESET', 'ETIMEDOUT', etc).
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export type GraphQLClientError = Partial<ClientError> & GenericGraphQLClientError;
|
|
25
|
+
/**
|
|
26
|
+
* Minimum configuration options for classes that implement @see GraphQLClient
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export type GraphQLRequestClientConfig = {
|
|
30
|
+
/**
|
|
31
|
+
* The API key to use for authentication. This will be added as an 'sc_apikey' header.
|
|
32
|
+
*/
|
|
33
|
+
apiKey?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Override debugger for logging. Uses 'content-sdk:http' by default.
|
|
36
|
+
*/
|
|
37
|
+
debugger?: Debugger;
|
|
38
|
+
/**
|
|
39
|
+
* Override fetch method. Uses 'graphql-request' library default otherwise ('cross-fetch').
|
|
40
|
+
*/
|
|
41
|
+
fetch?: typeof fetch;
|
|
42
|
+
/**
|
|
43
|
+
* GraphQLClient request timeout (in milliseconds).
|
|
44
|
+
*/
|
|
45
|
+
timeout?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Number of retries for client. Will use the specified `retryStrategy`.
|
|
48
|
+
*/
|
|
49
|
+
retries?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Retry strategy for the client. Uses `DefaultRetryStrategy` by default with exponential
|
|
52
|
+
* back-off factor of 2 for codes 429, 502, 503, 504, 520, 521, 522, 523, 524.
|
|
53
|
+
*/
|
|
54
|
+
retryStrategy?: RetryStrategy;
|
|
55
|
+
/**
|
|
56
|
+
* Custom headers to be sent with each request.
|
|
57
|
+
*/
|
|
58
|
+
headers?: Record<string, string>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A GraphQL Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
|
|
62
|
+
* This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
|
|
63
|
+
* @param config - The configuration object that specifies how the GraphQL client should be set up.
|
|
64
|
+
* @returns An instance of a GraphQL Request Client ready to send GraphQL requests.
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export type GraphQLRequestClientFactory = (config?: Omit<GraphQLRequestClientConfig, 'apiKey'>) => GraphQLRequestClient;
|
|
68
|
+
/**
|
|
69
|
+
* Configuration type for @type GraphQLRequestClientFactory
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
export type GraphQLRequestClientFactoryConfig = {
|
|
73
|
+
endpoint: string;
|
|
74
|
+
apiKey?: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* A GraphQL client for Sitecore APIs that uses the 'graphql-request' library.
|
|
78
|
+
* https://github.com/prisma-labs/graphql-request
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare class GraphQLRequestClient implements GraphQLClient {
|
|
82
|
+
private endpoint;
|
|
83
|
+
private client;
|
|
84
|
+
private headers;
|
|
85
|
+
private debug;
|
|
86
|
+
private abortTimeout?;
|
|
87
|
+
private timeout?;
|
|
88
|
+
private retries;
|
|
89
|
+
private retryStrategy;
|
|
90
|
+
/**
|
|
91
|
+
* Provides ability to execute graphql query using given `endpoint`
|
|
92
|
+
* @param {string} endpoint The Graphql endpoint
|
|
93
|
+
* @param {GraphQLRequestClientConfig} [clientConfig] GraphQL request client configuration.
|
|
94
|
+
*/
|
|
95
|
+
constructor(endpoint: string, clientConfig?: GraphQLRequestClientConfig);
|
|
96
|
+
/**
|
|
97
|
+
* Factory method for creating a GraphQLRequestClientFactory.
|
|
98
|
+
* @param {object} config - client configuration options.
|
|
99
|
+
* @param {string} config.endpoint - endpoint
|
|
100
|
+
* @param {string} [config.apiKey] - apikey
|
|
101
|
+
*/
|
|
102
|
+
static createClientFactory({ endpoint, apiKey, }: GraphQLRequestClientFactoryConfig): GraphQLRequestClientFactory;
|
|
103
|
+
/**
|
|
104
|
+
* Execute graphql request
|
|
105
|
+
* @param {string | DocumentNode} query graphql query
|
|
106
|
+
* @param {RequestOptions} [options] Options for configuring a GraphQL request.
|
|
107
|
+
*/
|
|
108
|
+
request<T>(query: string | DocumentNode, variables?: {
|
|
109
|
+
[key: string]: unknown;
|
|
110
|
+
}, options?: FetchOptions): Promise<T>;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=graphql-request-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-request-client.d.ts","sourceRoot":"","sources":["../src/graphql-request-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGlF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,CAAC,CAAC,EACP,KAAK,EAAE,MAAM,GAAG,YAAY,EAC5B,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EACtC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,yBAAyB,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,CACxC,MAAM,CAAC,EAAE,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,KAChD,oBAAoB,CAAC;AAE1B;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IAc5C,OAAO,CAAC,QAAQ;IAb5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa,CAAgB;IAErC;;;;OAIG;gBACiB,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAE,0BAA+B;IA0BnF;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,EACzB,QAAQ,EACR,MAAM,GACP,EAAE,iCAAiC,GAAG,2BAA2B;IAKlE;;;;OAIG;IACG,OAAO,CAAC,CAAC,EACb,KAAK,EAAE,MAAM,GAAG,YAAY,EAC5B,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EACtC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC;CAmDd"}
|
|
@@ -1,131 +1,135 @@
|
|
|
1
|
-
import { GraphQLClient, GraphQLRequestClientFactory } from '../graphql-request-client';
|
|
2
|
-
import { CacheClient, CacheOptions } from '../cache-client';
|
|
3
|
-
import { PageInfo } from '../client';
|
|
4
|
-
import { GraphQLServiceConfig } from '../sitecore-service-base';
|
|
5
|
-
import { FetchOptions } from '../models';
|
|
6
|
-
/** @private */
|
|
7
|
-
export declare const queryError = "Valid value for rootItemId not provided and failed to auto-resolve app root item.";
|
|
8
|
-
/**
|
|
9
|
-
* Query variables for dictionary graphql query
|
|
10
|
-
*/
|
|
11
|
-
export interface DictionaryQueryVariables {
|
|
12
|
-
/**
|
|
13
|
-
* Optional. The ID of the search root item. Fetch items that have this item as an ancestor.
|
|
14
|
-
*/
|
|
15
|
-
rootItemId?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional. Sitecore template ID(s). Fetch items that inherit from this template(s).
|
|
18
|
-
*/
|
|
19
|
-
templates?: string;
|
|
20
|
-
/**
|
|
21
|
-
* common variable for all GraphQL queries
|
|
22
|
-
* it will be used for every type of query to regulate result batch size
|
|
23
|
-
* Optional. How many result items to fetch in each GraphQL call. This is needed for pagination.
|
|
24
|
-
* @default 10
|
|
25
|
-
*/
|
|
26
|
-
pageSize?: number;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Object model for Sitecore dictionary phrases
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
* @
|
|
100
|
-
* @
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @
|
|
108
|
-
* @
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
1
|
+
import { GraphQLClient, GraphQLRequestClientFactory } from '../graphql-request-client';
|
|
2
|
+
import { CacheClient, CacheOptions } from '../cache-client';
|
|
3
|
+
import { PageInfo } from '../client';
|
|
4
|
+
import { GraphQLServiceConfig } from '../sitecore-service-base';
|
|
5
|
+
import { FetchOptions } from '../models';
|
|
6
|
+
/** @private */
|
|
7
|
+
export declare const queryError = "Valid value for rootItemId not provided and failed to auto-resolve app root item.";
|
|
8
|
+
/**
|
|
9
|
+
* Query variables for dictionary graphql query
|
|
10
|
+
*/
|
|
11
|
+
export interface DictionaryQueryVariables {
|
|
12
|
+
/**
|
|
13
|
+
* Optional. The ID of the search root item. Fetch items that have this item as an ancestor.
|
|
14
|
+
*/
|
|
15
|
+
rootItemId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional. Sitecore template ID(s). Fetch items that inherit from this template(s).
|
|
18
|
+
*/
|
|
19
|
+
templates?: string;
|
|
20
|
+
/**
|
|
21
|
+
* common variable for all GraphQL queries
|
|
22
|
+
* it will be used for every type of query to regulate result batch size
|
|
23
|
+
* Optional. How many result items to fetch in each GraphQL call. This is needed for pagination.
|
|
24
|
+
* @default 10
|
|
25
|
+
*/
|
|
26
|
+
pageSize?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Object model for Sitecore dictionary phrases
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export interface DictionaryPhrases {
|
|
33
|
+
[k: string]: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Configuration options for @see DictionaryService instances
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface DictionaryServiceConfig extends CacheOptions, GraphQLServiceConfig {
|
|
40
|
+
/**
|
|
41
|
+
* A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
|
|
42
|
+
* This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
|
|
43
|
+
*/
|
|
44
|
+
clientFactory: GraphQLRequestClientFactory;
|
|
45
|
+
/**
|
|
46
|
+
* Optional. The template ID to use when searching for dictionary entries.
|
|
47
|
+
* @default '6d1cd89719364a3aa511289a94c2a7b1' (/sitecore/templates/System/Dictionary/Dictionary entry)
|
|
48
|
+
*/
|
|
49
|
+
dictionaryEntryTemplateId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* common variable for all GraphQL queries
|
|
52
|
+
* it will be used for every type of query to regulate result batch size
|
|
53
|
+
* Optional. How many result items to fetch in each GraphQL call. This is needed for pagination.
|
|
54
|
+
* @default 10
|
|
55
|
+
*/
|
|
56
|
+
pageSize?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The schema of data returned in response to a dictionary query request.
|
|
60
|
+
*/
|
|
61
|
+
export type DictionaryQueryResult = {
|
|
62
|
+
key: {
|
|
63
|
+
value: string;
|
|
64
|
+
};
|
|
65
|
+
phrase: {
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type DictionarySiteQueryResponse = {
|
|
70
|
+
site: {
|
|
71
|
+
siteInfo: {
|
|
72
|
+
dictionary: {
|
|
73
|
+
results: {
|
|
74
|
+
key: string;
|
|
75
|
+
value: string;
|
|
76
|
+
}[];
|
|
77
|
+
pageInfo: PageInfo;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Service that fetch dictionary data using Sitecore's GraphQL API.
|
|
84
|
+
* @augments DictionaryServiceBase
|
|
85
|
+
* @mixes SearchQueryService<DictionaryQueryResult>
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export declare class DictionaryService implements CacheClient<DictionaryPhrases> {
|
|
89
|
+
options: DictionaryServiceConfig;
|
|
90
|
+
private graphQLClient;
|
|
91
|
+
private cache;
|
|
92
|
+
/**
|
|
93
|
+
* Creates an instance of graphQL dictionary service with the provided options
|
|
94
|
+
* @param {DictionaryService} options instance
|
|
95
|
+
*/
|
|
96
|
+
constructor(options: DictionaryServiceConfig);
|
|
97
|
+
/**
|
|
98
|
+
* Fetches dictionary data for internalization. Uses search query by default
|
|
99
|
+
* @param {string} language the language to fetch
|
|
100
|
+
* @param {string} site site name to fetch data for.
|
|
101
|
+
* @param {FetchOptions} [fetchOptions] Options to override graphQL client details like retries and fetch implementation
|
|
102
|
+
* @returns {Promise<DictionaryPhrases>} dictionary phrases
|
|
103
|
+
* @throws {Error} if the app root was not found for the specified site and language.
|
|
104
|
+
*/
|
|
105
|
+
fetchDictionaryData(language: string, site: string, fetchOptions?: FetchOptions): Promise<DictionaryPhrases>;
|
|
106
|
+
/**
|
|
107
|
+
* Caches a @see DictionaryPhrases value for the specified cache key.
|
|
108
|
+
* @param {string} key The cache key.
|
|
109
|
+
* @param {DictionaryPhrases} value The value to cache.
|
|
110
|
+
* @returns The value added to the cache.
|
|
111
|
+
* @mixes CacheClient<DictionaryPhrases>
|
|
112
|
+
*/
|
|
113
|
+
setCacheValue(key: string, value: DictionaryPhrases): DictionaryPhrases;
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves a @see DictionaryPhrases value from the cache.
|
|
116
|
+
* @param {string} key The cache key.
|
|
117
|
+
* @returns The @see DictionaryPhrases value, or null if the specified key is not found in the cache.
|
|
118
|
+
*/
|
|
119
|
+
getCacheValue(key: string): DictionaryPhrases | null;
|
|
120
|
+
/**
|
|
121
|
+
* Gets a cache client that can cache data. Uses memory-cache as the default
|
|
122
|
+
* library for caching (@see MemoryCacheClient). Override this method if you
|
|
123
|
+
* want to use something else.
|
|
124
|
+
* @returns {CacheClient} implementation
|
|
125
|
+
*/
|
|
126
|
+
protected getCacheClient(): CacheClient<DictionaryPhrases>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
|
|
129
|
+
* library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
|
|
130
|
+
* want to use something else.
|
|
131
|
+
* @returns {GraphQLClient} implementation
|
|
132
|
+
*/
|
|
133
|
+
protected getGraphQLClient(): GraphQLClient;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=dictionary-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary-service.d.ts","sourceRoot":"","sources":["../../src/i18n/dictionary-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,eAAe;AACf,eAAO,MAAM,UAAU,sFAC8D,CAAC;AA2BtF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY,EAAE,oBAAoB;IACjF;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;IAE3C;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,UAAU,EAAE;gBACV,OAAO,EAAE;oBAAE,GAAG,EAAE,MAAM,CAAC;oBAAC,KAAK,EAAE,MAAM,CAAA;iBAAE,EAAE,CAAC;gBAC1C,QAAQ,EAAE,QAAQ,CAAC;aACpB,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,WAAW,CAAC,iBAAiB,CAAC;IAOnD,OAAO,EAAE,uBAAuB;IANnD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAAiC;IAC9C;;;OAGG;gBACgB,OAAO,EAAE,uBAAuB;IAKnD;;;;;;;OAOG;IACG,mBAAmB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,iBAAiB,CAAC;IAiD7B;;;;;;OAMG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,iBAAiB;IAIvE;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAIpD;;;;;OAKG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW,CAAC,iBAAiB,CAAC;IAI1D;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAU5C"}
|
package/types/i18n/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { DictionaryPhrases, DictionaryServiceConfig, DictionaryService, } from './dictionary-service';
|
|
2
|
-
export { getLocaleRewrite } from './utils';
|
|
1
|
+
export { DictionaryPhrases, DictionaryServiceConfig, DictionaryService, } from './dictionary-service';
|
|
2
|
+
export { getLocaleRewrite } from './utils';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
package/types/i18n/utils.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get a locale rewrite path for given pathname
|
|
3
|
-
* @param {string} pathname the pathname
|
|
4
|
-
* @param {string} locale the site data to include in the rewrite
|
|
5
|
-
* @returns {string} the rewrite path
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Get a locale rewrite path for given pathname
|
|
3
|
+
* @param {string} pathname the pathname
|
|
4
|
+
* @param {string} locale the site data to include in the rewrite
|
|
5
|
+
* @returns {string} the rewrite path
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare function getLocaleRewrite(pathname: string, locale: string): string;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/i18n/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMzE"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import * as constants from './constants';
|
|
2
|
-
import * as form from './form';
|
|
3
|
-
export { default as debug, Debugger, enableDebug } from './debug';
|
|
4
|
-
export { GraphQLClient, GraphQLRequestClient, GraphQLRequestClientConfig, GraphQLRequestClientFactory, GraphQLRequestClientFactoryConfig, } from './graphql-request-client';
|
|
5
|
-
export { DefaultRetryStrategy } from './retries';
|
|
6
|
-
export { CacheClient, CacheOptions, MemoryCacheClient } from './cache-client';
|
|
7
|
-
export { ClientError } from 'graphql-request';
|
|
8
|
-
export { NativeDataFetcher, NativeDataFetcherConfig, NativeDataFetcherError, NativeDataFetcherResponse, } from './native-fetcher';
|
|
9
|
-
export { HTMLLink, RetryStrategy, GenericGraphQLClientError, StaticPath } from './models';
|
|
10
|
-
export { constants };
|
|
11
|
-
export { form };
|
|
12
|
-
export { defineConfig } from './config';
|
|
1
|
+
import * as constants from './constants';
|
|
2
|
+
import * as form from './form';
|
|
3
|
+
export { default as debug, Debugger, enableDebug } from './debug';
|
|
4
|
+
export { GraphQLClient, GraphQLRequestClient, GraphQLRequestClientConfig, GraphQLRequestClientFactory, GraphQLRequestClientFactoryConfig, } from './graphql-request-client';
|
|
5
|
+
export { DefaultRetryStrategy } from './retries';
|
|
6
|
+
export { CacheClient, CacheOptions, MemoryCacheClient } from './cache-client';
|
|
7
|
+
export { ClientError } from 'graphql-request';
|
|
8
|
+
export { NativeDataFetcher, NativeDataFetcherConfig, NativeDataFetcherError, NativeDataFetcherResponse, } from './native-fetcher';
|
|
9
|
+
export { HTMLLink, RetryStrategy, GenericGraphQLClientError, StaticPath } from './models';
|
|
10
|
+
export { constants };
|
|
11
|
+
export { form };
|
|
12
|
+
export { defineConfig } from './config';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { ComponentRendering, Field, Item, LayoutServiceData, RouteData } from './index';
|
|
2
|
-
import { HTMLLink } from '../models';
|
|
3
|
-
type Config = {
|
|
4
|
-
loadStyles: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Get the content styles link to be loaded from the Sitecore Edge Platform
|
|
8
|
-
* @param {LayoutServiceData} layoutData Layout service data
|
|
9
|
-
* @param {string} sitecoreEdgeContextId Sitecore Edge Context ID
|
|
10
|
-
* @param {string} [sitecoreEdgeUrl] Sitecore Edge Platform URL. Default is https://edge-platform.sitecorecloud.io
|
|
11
|
-
* @returns {HTMLLink | null} content styles link, null if no styles are used in layout
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export
|
|
1
|
+
import { ComponentRendering, Field, Item, LayoutServiceData, RouteData } from './index';
|
|
2
|
+
import { HTMLLink } from '../models';
|
|
3
|
+
type Config = {
|
|
4
|
+
loadStyles: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Get the content styles link to be loaded from the Sitecore Edge Platform
|
|
8
|
+
* @param {LayoutServiceData} layoutData Layout service data
|
|
9
|
+
* @param {string} sitecoreEdgeContextId Sitecore Edge Context ID
|
|
10
|
+
* @param {string} [sitecoreEdgeUrl] Sitecore Edge Platform URL. Default is https://edge-platform.sitecorecloud.io
|
|
11
|
+
* @returns {HTMLLink | null} content styles link, null if no styles are used in layout
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare const getContentStylesheetLink: (layoutData: LayoutServiceData, sitecoreEdgeContextId: string, sitecoreEdgeUrl?: string) => HTMLLink | null;
|
|
15
|
+
export declare const getContentStylesheetUrl: (sitecoreEdgeContextId: string, sitecoreEdgeUrl?: string) => string;
|
|
16
|
+
export declare const traversePlaceholder: (components: Array<ComponentRendering>, config: Config) => void;
|
|
17
|
+
export declare const traverseField: (field: Field | Item | Item[] | undefined, config: Config) => void;
|
|
18
|
+
export declare const traverseComponent: (component: RouteData | ComponentRendering, config: Config) => void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=content-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-styles.d.ts","sourceRoot":"","sources":["../../src/layout/content-styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQrC,KAAK,MAAM,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,iBAAiB,EAC7B,uBAAuB,MAAM,EAC7B,wBAA2C,KAC1C,QAAQ,GAAG,IAab,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,uBAAuB,MAAM,EAC7B,wBAA2C,KAC1C,MAGsF,CAAC;AAE1F,eAAO,MAAM,mBAAmB,GAAI,YAAY,KAAK,CAAC,kBAAkB,CAAC,EAAE,QAAQ,MAAM,SAMxF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,QAAQ,MAAM,SAcrF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,GAAG,kBAAkB,EAAE,QAAQ,MAAM,SAc1F,CAAC"}
|
package/types/layout/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, RouteData, PlaceholderData, ComponentRendering, Field, GenericFieldValue, Item, PlaceholdersData, ComponentFields, ComponentParams, EditMode, FieldMetadata, RenderingType, RouteOptions, EDITING_COMPONENT_PLACEHOLDER, EDITING_COMPONENT_ID, } from './models';
|
|
2
|
-
export { getFieldValue, getChildPlaceholder, isFieldValueEmpty, isDynamicPlaceholder, getDynamicPlaceholderPattern, EMPTY_DATE_FIELD_VALUE, } from './utils';
|
|
3
|
-
export { getContentStylesheetLink } from './content-styles';
|
|
4
|
-
export { LayoutService, LayoutServiceConfig, GRAPHQL_LAYOUT_QUERY_NAME } from './layout-service';
|
|
5
|
-
export { getDesignLibraryStylesheetLinks } from './themes';
|
|
1
|
+
export { LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, RouteData, PlaceholderData, ComponentRendering, Field, GenericFieldValue, Item, PlaceholdersData, ComponentFields, ComponentParams, EditMode, FieldMetadata, RenderingType, RouteOptions, EDITING_COMPONENT_PLACEHOLDER, EDITING_COMPONENT_ID, } from './models';
|
|
2
|
+
export { getFieldValue, getChildPlaceholder, isFieldValueEmpty, isDynamicPlaceholder, getDynamicPlaceholderPattern, EMPTY_DATE_FIELD_VALUE, } from './utils';
|
|
3
|
+
export { getContentStylesheetLink } from './content-styles';
|
|
4
|
+
export { LayoutService, LayoutServiceConfig, GRAPHQL_LAYOUT_QUERY_NAME } from './layout-service';
|
|
5
|
+
export { getDesignLibraryStylesheetLinks } from './themes';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|