@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.
- package/LICENSE.txt +202 -202
- package/dist/cjs/constants.js +7 -21
- package/dist/cjs/debug.js +14 -18
- package/dist/cjs/graphql-request-client.js +10 -5
- package/dist/cjs/index.js +3 -7
- package/dist/cjs/native-fetcher.js +1 -1
- package/dist/cjs/{utils → tools}/ensurePath.js +1 -0
- package/dist/cjs/{media/index.js → tools/index-node.js} +27 -3
- package/dist/cjs/tools/index.js +28 -72
- package/dist/cjs/tools/{generateMetadata.js → metadata/generateMetadata.js} +2 -2
- package/dist/cjs/tools/metadata/index.js +5 -0
- package/dist/cjs/{editing → tools/metadata}/metadata.js +1 -6
- package/dist/cjs/tools/normalize-env-value.js +22 -0
- package/dist/cjs/{utils → tools}/normalize-url.js +6 -0
- package/dist/cjs/tools/resolve-edge-url.js +95 -0
- package/dist/cjs/{utils → tools}/utils.js +6 -64
- package/dist/esm/constants.js +6 -20
- package/dist/esm/debug.js +13 -17
- package/dist/esm/graphql-request-client.js +10 -5
- package/dist/esm/index.js +1 -6
- package/dist/esm/native-fetcher.js +1 -1
- package/dist/esm/{utils → tools}/ensurePath.js +1 -0
- package/dist/esm/tools/index-node.js +22 -0
- package/dist/esm/tools/index.js +6 -28
- package/dist/esm/tools/{generateMetadata.js → metadata/generateMetadata.js} +2 -2
- package/dist/esm/tools/metadata/index.js +1 -0
- package/dist/esm/{editing → tools/metadata}/metadata.js +1 -6
- package/dist/esm/tools/normalize-env-value.js +19 -0
- package/dist/esm/tools/normalize-url.js +7 -0
- package/dist/esm/tools/resolve-edge-url.js +89 -0
- package/dist/esm/{utils → tools}/utils.js +5 -61
- package/node-tools.d.ts +1 -0
- package/package.json +98 -163
- package/types/constants.d.ts +6 -17
- package/types/constants.d.ts.map +1 -1
- package/types/debug.d.ts +13 -13
- package/types/debug.d.ts.map +1 -1
- package/types/graphql-request-client.d.ts +8 -2
- package/types/graphql-request-client.d.ts.map +1 -1
- package/types/index.d.ts +3 -6
- package/types/index.d.ts.map +1 -1
- package/types/models.d.ts +0 -31
- package/types/models.d.ts.map +1 -1
- package/types/{utils → tools}/ensurePath.d.ts +1 -0
- package/types/tools/ensurePath.d.ts.map +1 -0
- package/types/{utils → tools}/globalCache.d.ts.map +1 -1
- package/types/tools/index-node.d.ts +14 -0
- package/types/tools/index-node.d.ts.map +1 -0
- package/types/tools/index.d.ts +5 -21
- package/types/tools/index.d.ts.map +1 -1
- package/types/tools/is-server.d.ts.map +1 -0
- package/types/tools/metadata/generateMetadata.d.ts.map +1 -0
- package/types/tools/metadata/index.d.ts +3 -0
- package/types/tools/metadata/index.d.ts.map +1 -0
- package/types/{editing → tools/metadata}/metadata.d.ts +9 -1
- package/types/tools/metadata/metadata.d.ts.map +1 -0
- package/types/tools/normalize-env-value.d.ts +10 -0
- package/types/tools/normalize-env-value.d.ts.map +1 -0
- package/types/tools/normalize-url.d.ts +8 -0
- package/types/tools/normalize-url.d.ts.map +1 -0
- package/types/tools/resolve-edge-url.d.ts +52 -0
- package/types/tools/resolve-edge-url.d.ts.map +1 -0
- package/types/{utils → tools}/timeout-promise.d.ts.map +1 -1
- package/types/{utils → tools}/utils.d.ts +6 -26
- package/types/tools/utils.d.ts.map +1 -0
- package/client.d.ts +0 -1
- package/codegen.d.ts +0 -1
- package/config-cli.d.ts +0 -1
- package/config.d.ts +0 -1
- package/dist/cjs/client/constants.js +0 -7
- package/dist/cjs/client/edge-proxy.js +0 -24
- package/dist/cjs/client/index.js +0 -15
- package/dist/cjs/client/models.js +0 -2
- package/dist/cjs/client/sitecore-client.js +0 -424
- package/dist/cjs/client/utils.js +0 -51
- package/dist/cjs/config/define-config.js +0 -195
- package/dist/cjs/config/index.js +0 -7
- package/dist/cjs/config/models.js +0 -12
- package/dist/cjs/config-cli/define-cli-config.js +0 -23
- package/dist/cjs/config-cli/index.js +0 -7
- package/dist/cjs/config-cli/models.js +0 -8
- package/dist/cjs/editing/codegen/index.js +0 -15
- package/dist/cjs/editing/codegen/preview.js +0 -306
- package/dist/cjs/editing/component-layout-service.js +0 -63
- package/dist/cjs/editing/design-library.js +0 -190
- package/dist/cjs/editing/editing-service.js +0 -81
- package/dist/cjs/editing/index.js +0 -34
- package/dist/cjs/editing/models.js +0 -44
- package/dist/cjs/editing/utils.js +0 -108
- package/dist/cjs/form/form.js +0 -81
- package/dist/cjs/form/index.js +0 -7
- package/dist/cjs/i18n/dictionary-service.js +0 -144
- package/dist/cjs/i18n/index.js +0 -7
- package/dist/cjs/i18n/utils.js +0 -16
- package/dist/cjs/layout/content-styles.js +0 -72
- package/dist/cjs/layout/index.js +0 -24
- package/dist/cjs/layout/layout-service.js +0 -68
- package/dist/cjs/layout/models.js +0 -39
- package/dist/cjs/layout/themes.js +0 -76
- package/dist/cjs/layout/utils.js +0 -117
- package/dist/cjs/media/media-api.js +0 -100
- package/dist/cjs/personalize/index.js +0 -15
- package/dist/cjs/personalize/layout-personalizer.js +0 -98
- package/dist/cjs/personalize/personalize-service.js +0 -109
- package/dist/cjs/personalize/utils.js +0 -143
- package/dist/cjs/site/error-pages-service.js +0 -82
- package/dist/cjs/site/index.js +0 -26
- package/dist/cjs/site/models.js +0 -2
- package/dist/cjs/site/redirects-service.js +0 -108
- package/dist/cjs/site/robots-service.js +0 -74
- package/dist/cjs/site/site-resolver.js +0 -73
- package/dist/cjs/site/siteinfo-service.js +0 -94
- package/dist/cjs/site/sitemap-xml-service.js +0 -92
- package/dist/cjs/site/sitepath-service.js +0 -201
- package/dist/cjs/site/utils.js +0 -55
- package/dist/cjs/sitecore-service-base.js +0 -36
- package/dist/cjs/tools/codegen/component-generation.js +0 -52
- package/dist/cjs/tools/codegen/extract-files.js +0 -105
- package/dist/cjs/tools/codegen/import-map.js +0 -411
- package/dist/cjs/tools/codegen/utils.js +0 -418
- package/dist/cjs/tools/generate-map.js +0 -2
- package/dist/cjs/tools/generateSites.js +0 -59
- package/dist/cjs/tools/scaffold.js +0 -62
- package/dist/cjs/tools/templating/components.js +0 -96
- package/dist/cjs/tools/templating/index.js +0 -11
- package/dist/cjs/tools/templating/plugins.js +0 -80
- package/dist/cjs/tools/templating/utils.js +0 -67
- package/dist/cjs/utils/env.js +0 -28
- package/dist/cjs/utils/index.js +0 -26
- package/dist/esm/client/constants.js +0 -4
- package/dist/esm/client/edge-proxy.js +0 -19
- package/dist/esm/client/index.js +0 -5
- package/dist/esm/client/models.js +0 -1
- package/dist/esm/client/sitecore-client.js +0 -417
- package/dist/esm/client/utils.js +0 -47
- package/dist/esm/config/define-config.js +0 -189
- package/dist/esm/config/index.js +0 -2
- package/dist/esm/config/models.js +0 -9
- package/dist/esm/config-cli/define-cli-config.js +0 -19
- package/dist/esm/config-cli/index.js +0 -2
- package/dist/esm/config-cli/models.js +0 -5
- package/dist/esm/editing/codegen/index.js +0 -1
- package/dist/esm/editing/codegen/preview.js +0 -288
- package/dist/esm/editing/component-layout-service.js +0 -56
- package/dist/esm/editing/design-library.js +0 -178
- package/dist/esm/editing/editing-service.js +0 -74
- package/dist/esm/editing/index.js +0 -6
- package/dist/esm/editing/models.js +0 -41
- package/dist/esm/editing/utils.js +0 -98
- package/dist/esm/form/form.js +0 -72
- package/dist/esm/form/index.js +0 -1
- package/dist/esm/i18n/dictionary-service.js +0 -137
- package/dist/esm/i18n/index.js +0 -2
- package/dist/esm/i18n/utils.js +0 -13
- package/dist/esm/layout/content-styles.js +0 -64
- package/dist/esm/layout/index.js +0 -6
- package/dist/esm/layout/layout-service.js +0 -61
- package/dist/esm/layout/models.js +0 -36
- package/dist/esm/layout/themes.js +0 -71
- package/dist/esm/layout/utils.js +0 -109
- package/dist/esm/media/index.js +0 -2
- package/dist/esm/media/media-api.js +0 -90
- package/dist/esm/personalize/index.js +0 -3
- package/dist/esm/personalize/layout-personalizer.js +0 -93
- package/dist/esm/personalize/personalize-service.js +0 -102
- package/dist/esm/personalize/utils.js +0 -135
- package/dist/esm/site/error-pages-service.js +0 -75
- package/dist/esm/site/index.js +0 -8
- package/dist/esm/site/models.js +0 -1
- package/dist/esm/site/redirects-service.js +0 -101
- package/dist/esm/site/robots-service.js +0 -67
- package/dist/esm/site/site-resolver.js +0 -69
- package/dist/esm/site/siteinfo-service.js +0 -87
- package/dist/esm/site/sitemap-xml-service.js +0 -85
- package/dist/esm/site/sitepath-service.js +0 -193
- package/dist/esm/site/utils.js +0 -49
- package/dist/esm/sitecore-service-base.js +0 -29
- package/dist/esm/tools/codegen/component-generation.js +0 -44
- package/dist/esm/tools/codegen/extract-files.js +0 -99
- package/dist/esm/tools/codegen/import-map.js +0 -368
- package/dist/esm/tools/codegen/utils.js +0 -373
- package/dist/esm/tools/generate-map.js +0 -1
- package/dist/esm/tools/generateSites.js +0 -52
- package/dist/esm/tools/scaffold.js +0 -54
- package/dist/esm/tools/templating/components.js +0 -59
- package/dist/esm/tools/templating/index.js +0 -3
- package/dist/esm/tools/templating/plugins.js +0 -72
- package/dist/esm/tools/templating/utils.js +0 -59
- package/dist/esm/utils/env.js +0 -24
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/utils/normalize-url.js +0 -1
- package/editing.d.ts +0 -1
- package/i18n.d.ts +0 -1
- package/layout.d.ts +0 -1
- package/media.d.ts +0 -1
- package/personalize.d.ts +0 -1
- package/site.d.ts +0 -1
- package/types/client/constants.d.ts +0 -5
- package/types/client/constants.d.ts.map +0 -1
- package/types/client/edge-proxy.d.ts +0 -18
- package/types/client/edge-proxy.d.ts.map +0 -1
- package/types/client/index.d.ts +0 -8
- package/types/client/index.d.ts.map +0 -1
- package/types/client/models.d.ts +0 -21
- package/types/client/models.d.ts.map +0 -1
- package/types/client/sitecore-client.d.ts +0 -338
- package/types/client/sitecore-client.d.ts.map +0 -1
- package/types/client/utils.d.ts +0 -15
- package/types/client/utils.d.ts.map +0 -1
- package/types/config/define-config.d.ts +0 -20
- package/types/config/define-config.d.ts.map +0 -1
- package/types/config/index.d.ts +0 -3
- package/types/config/index.d.ts.map +0 -1
- package/types/config/models.d.ts +0 -287
- package/types/config/models.d.ts.map +0 -1
- package/types/config-cli/define-cli-config.d.ts +0 -9
- package/types/config-cli/define-cli-config.d.ts.map +0 -1
- package/types/config-cli/index.d.ts +0 -3
- package/types/config-cli/index.d.ts.map +0 -1
- package/types/config-cli/models.d.ts +0 -6
- package/types/config-cli/models.d.ts.map +0 -1
- package/types/editing/codegen/index.d.ts +0 -2
- package/types/editing/codegen/index.d.ts.map +0 -1
- package/types/editing/codegen/preview.d.ts +0 -289
- package/types/editing/codegen/preview.d.ts.map +0 -1
- package/types/editing/component-layout-service.d.ts +0 -84
- package/types/editing/component-layout-service.d.ts.map +0 -1
- package/types/editing/design-library.d.ts +0 -118
- package/types/editing/design-library.d.ts.map +0 -1
- package/types/editing/editing-service.d.ts +0 -72
- package/types/editing/editing-service.d.ts.map +0 -1
- package/types/editing/index.d.ts +0 -7
- package/types/editing/index.d.ts.map +0 -1
- package/types/editing/metadata.d.ts.map +0 -1
- package/types/editing/models.d.ts +0 -103
- package/types/editing/models.d.ts.map +0 -1
- package/types/editing/utils.d.ts +0 -91
- package/types/editing/utils.d.ts.map +0 -1
- package/types/form/form.d.ts +0 -25
- package/types/form/form.d.ts.map +0 -1
- package/types/form/index.d.ts +0 -2
- package/types/form/index.d.ts.map +0 -1
- package/types/i18n/dictionary-service.d.ts +0 -135
- package/types/i18n/dictionary-service.d.ts.map +0 -1
- package/types/i18n/index.d.ts +0 -3
- package/types/i18n/index.d.ts.map +0 -1
- package/types/i18n/utils.d.ts +0 -9
- package/types/i18n/utils.d.ts.map +0 -1
- package/types/layout/content-styles.d.ts +0 -20
- package/types/layout/content-styles.d.ts.map +0 -1
- package/types/layout/index.d.ts +0 -6
- package/types/layout/index.d.ts.map +0 -1
- package/types/layout/layout-service.d.ts +0 -45
- package/types/layout/layout-service.d.ts.map +0 -1
- package/types/layout/models.d.ts +0 -174
- package/types/layout/models.d.ts.map +0 -1
- package/types/layout/themes.d.ts +0 -13
- package/types/layout/themes.d.ts.map +0 -1
- package/types/layout/utils.d.ts +0 -56
- package/types/layout/utils.d.ts.map +0 -1
- package/types/media/index.d.ts +0 -3
- package/types/media/index.d.ts.map +0 -1
- package/types/media/media-api.d.ts +0 -60
- package/types/media/media-api.d.ts.map +0 -1
- package/types/personalize/index.d.ts +0 -4
- package/types/personalize/index.d.ts.map +0 -1
- package/types/personalize/layout-personalizer.d.ts +0 -29
- package/types/personalize/layout-personalizer.d.ts.map +0 -1
- package/types/personalize/personalize-service.d.ts +0 -90
- package/types/personalize/personalize-service.d.ts.map +0 -1
- package/types/personalize/utils.d.ts +0 -78
- package/types/personalize/utils.d.ts.map +0 -1
- package/types/site/error-pages-service.d.ts +0 -64
- package/types/site/error-pages-service.d.ts.map +0 -1
- package/types/site/index.d.ts +0 -10
- package/types/site/index.d.ts.map +0 -1
- package/types/site/models.d.ts +0 -23
- package/types/site/models.d.ts.map +0 -1
- package/types/site/redirects-service.d.ts +0 -92
- package/types/site/redirects-service.d.ts.map +0 -1
- package/types/site/robots-service.d.ts +0 -57
- package/types/site/robots-service.d.ts.map +0 -1
- package/types/site/site-resolver.d.ts +0 -28
- package/types/site/site-resolver.d.ts.map +0 -1
- package/types/site/siteinfo-service.d.ts +0 -65
- package/types/site/siteinfo-service.d.ts.map +0 -1
- package/types/site/sitemap-xml-service.d.ts +0 -63
- package/types/site/sitemap-xml-service.d.ts.map +0 -1
- package/types/site/sitepath-service.d.ts +0 -137
- package/types/site/sitepath-service.d.ts.map +0 -1
- package/types/site/utils.d.ts +0 -41
- package/types/site/utils.d.ts.map +0 -1
- package/types/sitecore-service-base.d.ts +0 -31
- package/types/sitecore-service-base.d.ts.map +0 -1
- package/types/tools/codegen/component-generation.d.ts +0 -50
- package/types/tools/codegen/component-generation.d.ts.map +0 -1
- package/types/tools/codegen/extract-files.d.ts +0 -24
- package/types/tools/codegen/extract-files.d.ts.map +0 -1
- package/types/tools/codegen/import-map.d.ts +0 -102
- package/types/tools/codegen/import-map.d.ts.map +0 -1
- package/types/tools/codegen/utils.d.ts +0 -76
- package/types/tools/codegen/utils.d.ts.map +0 -1
- package/types/tools/generate-map.d.ts +0 -36
- package/types/tools/generate-map.d.ts.map +0 -1
- package/types/tools/generateMetadata.d.ts.map +0 -1
- package/types/tools/generateSites.d.ts +0 -25
- package/types/tools/generateSites.d.ts.map +0 -1
- package/types/tools/scaffold.d.ts +0 -27
- package/types/tools/scaffold.d.ts.map +0 -1
- package/types/tools/templating/components.d.ts +0 -104
- package/types/tools/templating/components.d.ts.map +0 -1
- package/types/tools/templating/index.d.ts +0 -4
- package/types/tools/templating/index.d.ts.map +0 -1
- package/types/tools/templating/plugins.d.ts +0 -71
- package/types/tools/templating/plugins.d.ts.map +0 -1
- package/types/tools/templating/utils.d.ts +0 -42
- package/types/tools/templating/utils.d.ts.map +0 -1
- package/types/utils/ensurePath.d.ts.map +0 -1
- package/types/utils/env.d.ts +0 -9
- package/types/utils/env.d.ts.map +0 -1
- package/types/utils/index.d.ts +0 -5
- package/types/utils/index.d.ts.map +0 -1
- package/types/utils/is-server.d.ts.map +0 -1
- package/types/utils/normalize-url.d.ts +0 -2
- package/types/utils/normalize-url.d.ts.map +0 -1
- package/types/utils/utils.d.ts.map +0 -1
- package/utils.d.ts +0 -1
- /package/dist/cjs/{utils → tools}/globalCache.js +0 -0
- /package/dist/cjs/{utils → tools}/is-server.js +0 -0
- /package/dist/cjs/{utils → tools}/timeout-promise.js +0 -0
- /package/dist/esm/{utils → tools}/globalCache.js +0 -0
- /package/dist/esm/{utils → tools}/is-server.js +0 -0
- /package/dist/esm/{utils → tools}/timeout-promise.js +0 -0
- /package/types/{utils → tools}/globalCache.d.ts +0 -0
- /package/types/{utils → tools}/is-server.d.ts +0 -0
- /package/types/tools/{generateMetadata.d.ts → metadata/generateMetadata.d.ts} +0 -0
- /package/types/{utils → tools}/timeout-promise.d.ts +0 -0
|
@@ -1,135 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,EACL,iBAAiB,EACjB,IAAI,EACJ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,aAAa,EACb,aAAa,EACb,YAAY,EACZ,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAEjG,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { LayoutServiceData, RouteOptions } from './models';
|
|
2
|
-
import { SitecoreConfigInput } from '../config';
|
|
3
|
-
import { GraphQLServiceConfig, SitecoreServiceBase } from '../sitecore-service-base';
|
|
4
|
-
import { FetchOptions } from '../models';
|
|
5
|
-
/**
|
|
6
|
-
* GraphQL layout query name
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const GRAPHQL_LAYOUT_QUERY_NAME = "ContentSdkLayoutQuery";
|
|
10
|
-
/**
|
|
11
|
-
* Layout service configuration
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export type LayoutServiceConfig = GraphQLServiceConfig & Partial<SitecoreConfigInput['layout']>;
|
|
15
|
-
/**
|
|
16
|
-
* Service that fetch layout data using Sitecore's GraphQL API.
|
|
17
|
-
* @augments LayoutServiceBase
|
|
18
|
-
* @mixes GraphQLRequestClient
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare class LayoutService extends SitecoreServiceBase {
|
|
22
|
-
serviceConfig: LayoutServiceConfig;
|
|
23
|
-
/**
|
|
24
|
-
* Fetch layout data using the Sitecore GraphQL endpoint.
|
|
25
|
-
* @param {LayoutServiceConfig} serviceConfig configuration
|
|
26
|
-
*/
|
|
27
|
-
constructor(serviceConfig: LayoutServiceConfig);
|
|
28
|
-
/**
|
|
29
|
-
* Fetch layout data for an item.
|
|
30
|
-
* @param {string} itemPath item path to fetch layout data for.
|
|
31
|
-
* @param {RouteOptions} [routeOptions] Request options like language and site to retrieve data for
|
|
32
|
-
* @param {FetchOptions} [fetchOptions] Options to override graphQL client details like retries and fetch implementation
|
|
33
|
-
* @returns {Promise<LayoutServiceData>} layout service data
|
|
34
|
-
*/
|
|
35
|
-
fetchLayoutData(itemPath: string, routeOptions: RouteOptions, fetchOptions?: FetchOptions): Promise<LayoutServiceData>;
|
|
36
|
-
/**
|
|
37
|
-
* Returns GraphQL Layout query
|
|
38
|
-
* @param {string} itemPath page route
|
|
39
|
-
* @param {string} [site] site name
|
|
40
|
-
* @param {string} [language] language
|
|
41
|
-
* @returns {string} GraphQL query
|
|
42
|
-
*/
|
|
43
|
-
protected getLayoutQuery(itemPath: string, site: string, language?: string): string;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=layout-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-service.d.ts","sourceRoot":"","sources":["../../src/layout/layout-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,0BAA0B,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEhG;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,mBAAmB;IAKjC,aAAa,EAAE,mBAAmB;IAJrD;;;OAGG;gBACgB,aAAa,EAAE,mBAAmB;IAIrD;;;;;;OAMG;IACG,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,YAAY,EAC1B,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,iBAAiB,CAAC;IAgB7B;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAe3E"}
|
package/types/layout/models.d.ts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A reply from the Sitecore Layout Service
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export interface LayoutServiceData {
|
|
6
|
-
sitecore: LayoutServiceContextData & {
|
|
7
|
-
route: RouteData | null;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Layout Service page state enum
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare enum LayoutServicePageState {
|
|
15
|
-
Preview = "preview",
|
|
16
|
-
Edit = "edit",
|
|
17
|
-
Normal = "normal"
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Represents the edit mode for rendering content in Sitecore Editors
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export declare enum EditMode {
|
|
24
|
-
Metadata = "metadata"
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Shape of context data from the Sitecore Layout Service
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
export interface LayoutServiceContext {
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
pageEditing?: boolean;
|
|
33
|
-
language?: string;
|
|
34
|
-
itemPath?: string;
|
|
35
|
-
pageState?: LayoutServicePageState;
|
|
36
|
-
visitorIdentificationTimestamp?: number;
|
|
37
|
-
site?: {
|
|
38
|
-
name?: string;
|
|
39
|
-
};
|
|
40
|
-
renderingType?: RenderingType;
|
|
41
|
-
clientScripts?: string[];
|
|
42
|
-
clientData?: Record<string, Record<string, unknown>>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Context information from the Sitecore Layout Service
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export interface LayoutServiceContextData {
|
|
49
|
-
context: LayoutServiceContext;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Shape of route data returned from Sitecore Layout Service
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
export interface RouteData<Fields = Record<string, Field | Item | Item[]>> {
|
|
56
|
-
name: string;
|
|
57
|
-
displayName?: string;
|
|
58
|
-
fields?: Fields;
|
|
59
|
-
databaseName?: string;
|
|
60
|
-
deviceId?: string;
|
|
61
|
-
itemLanguage?: string;
|
|
62
|
-
itemVersion?: number;
|
|
63
|
-
layoutId?: string;
|
|
64
|
-
templateId?: string;
|
|
65
|
-
templateName?: string;
|
|
66
|
-
placeholders: PlaceholdersData;
|
|
67
|
-
itemId?: string;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Placeholder contents data (name: placeholder name, then array of components within that placeholder name)
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
export type PlaceholdersData<TYPEDNAME extends string = string> = {
|
|
74
|
-
[P in TYPEDNAME]: Array<ComponentRendering>;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Content field data passed to a component
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export interface ComponentFields {
|
|
81
|
-
[name: string]: Field | Item | Item[];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Component params
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
export interface ComponentParams {
|
|
88
|
-
[name: string]: string;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Definition of a component instance within a placeholder on a route
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export interface ComponentRendering<T = ComponentFields> {
|
|
95
|
-
componentName: string;
|
|
96
|
-
dataSource?: string;
|
|
97
|
-
uid?: string;
|
|
98
|
-
placeholders?: PlaceholdersData;
|
|
99
|
-
fields?: T;
|
|
100
|
-
params?: ComponentParams;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Field value data on a component
|
|
104
|
-
* @public
|
|
105
|
-
*/
|
|
106
|
-
export type GenericFieldValue = string | boolean | number | Date | {
|
|
107
|
-
[key: string]: unknown;
|
|
108
|
-
} | Array<{
|
|
109
|
-
[key: string]: unknown;
|
|
110
|
-
}>;
|
|
111
|
-
/**
|
|
112
|
-
* Field interface
|
|
113
|
-
* @public
|
|
114
|
-
*/
|
|
115
|
-
export interface Field<T = GenericFieldValue> extends FieldMetadata {
|
|
116
|
-
value: T;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Field metadata in editing mode
|
|
120
|
-
* @public
|
|
121
|
-
*/
|
|
122
|
-
export interface FieldMetadata {
|
|
123
|
-
metadata?: {
|
|
124
|
-
[key: string]: unknown;
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Content data returned from Layout Service
|
|
129
|
-
* @public
|
|
130
|
-
*/
|
|
131
|
-
export interface Item {
|
|
132
|
-
name: string;
|
|
133
|
-
displayName?: string;
|
|
134
|
-
id?: string;
|
|
135
|
-
url?: string;
|
|
136
|
-
fields: {
|
|
137
|
-
[name: string]: Field | Item | Item[] | undefined;
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Contents of a single placeholder returned from placeholder service
|
|
142
|
-
* @public
|
|
143
|
-
*/
|
|
144
|
-
export interface PlaceholderData {
|
|
145
|
-
name: string;
|
|
146
|
-
path: string;
|
|
147
|
-
elements: ComponentRendering[];
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Editing rendering type
|
|
151
|
-
* @public
|
|
152
|
-
*/
|
|
153
|
-
export declare enum RenderingType {
|
|
154
|
-
Component = "component"
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Contract for additional route options when requesting layout data
|
|
158
|
-
* @public
|
|
159
|
-
*/
|
|
160
|
-
export type RouteOptions = {
|
|
161
|
-
site: string;
|
|
162
|
-
locale?: string;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* Static placeholder name used for component rendering
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
168
|
-
export declare const EDITING_COMPONENT_PLACEHOLDER = "editing-componentmode-placeholder";
|
|
169
|
-
/**
|
|
170
|
-
* Id of wrapper for component rendering
|
|
171
|
-
* @internal
|
|
172
|
-
*/
|
|
173
|
-
export declare const EDITING_COMPONENT_ID = "editing-component";
|
|
174
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/layout/models.ts"],"names":[],"mappings":"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"}
|
package/types/layout/themes.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LayoutServiceData } from '.';
|
|
2
|
-
import { HTMLLink } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Walks through rendering tree and returns list of links of all FEAAS, BYOC or SXA Design Library Stylesheets that are used
|
|
5
|
-
* @param {LayoutServiceData} layoutData Layout service data
|
|
6
|
-
* @param {string} sitecoreEdgeContextId Sitecore Edge Context ID
|
|
7
|
-
* @param {string} [sitecoreEdgeUrl] Sitecore Edge Platform URL. Default is https://edge-platform.sitecorecloud.io
|
|
8
|
-
* @returns {HTMLLink[]} library stylesheet links
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare function getDesignLibraryStylesheetLinks(layoutData: LayoutServiceData, sitecoreEdgeContextId: string, sitecoreEdgeUrl?: string): HTMLLink[];
|
|
12
|
-
export declare const getStylesheetUrl: (id: string, sitecoreEdgeContextId: string, sitecoreEdgeUrl?: string) => string;
|
|
13
|
-
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/layout/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,iBAAiB,EAA4B,MAAM,GAAG,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAUrC;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,iBAAiB,EAC7B,qBAAqB,EAAE,MAAM,EAC7B,eAAe,SAA4B,GAC1C,QAAQ,EAAE,CAWZ;AAED,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,uBAAuB,MAAM,EAC7B,wBAA2C,WAK5C,CAAC"}
|
package/types/layout/utils.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ComponentRendering, ComponentFields, Field, GenericFieldValue } from './models';
|
|
2
|
-
/**
|
|
3
|
-
* Safely extracts a field value from a rendering or fields object.
|
|
4
|
-
* Null will be returned if the field is not defined.
|
|
5
|
-
* @param {ComponentRendering | Fields} renderingOrFields the rendering or fields object to extract the field from
|
|
6
|
-
* @param {string} fieldName the name of the field to extract
|
|
7
|
-
* @returns {T | undefined} the field value or null if the field is not defined
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare function getFieldValue<T>(renderingOrFields: ComponentRendering | ComponentFields, fieldName: string): T | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Safely extracts a field value from a rendering or fields object.
|
|
13
|
-
* @param {ComponentRendering | ComponentFields} renderingOrFields the rendering or fields object to extract the field from
|
|
14
|
-
* @param {string} fieldName the name of the field to extract
|
|
15
|
-
* @param {T} defaultValue the default value to return if the field is not defined
|
|
16
|
-
* @returns {T} the field value or the default value if the field is not defined
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare function getFieldValue<T>(renderingOrFields: ComponentRendering | ComponentFields, fieldName: string, defaultValue: T): T;
|
|
20
|
-
/**
|
|
21
|
-
* Gets rendering definitions in a given child placeholder under a current rendering.
|
|
22
|
-
* @param {ComponentRendering} rendering
|
|
23
|
-
* @param {string} placeholderName
|
|
24
|
-
* @returns {ComponentRendering[]} child placeholder
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export declare function getChildPlaceholder(rendering: ComponentRendering, placeholderName: string): ComponentRendering[];
|
|
28
|
-
/**
|
|
29
|
-
* Returns a regular expression pattern for a dynamic placeholder name.
|
|
30
|
-
* @param {string} placeholder Placeholder name with a dynamic segment (e.g. 'main-{*}')
|
|
31
|
-
* @returns Regular expression pattern for the dynamic segment
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare const getDynamicPlaceholderPattern: (placeholder: string) => RegExp;
|
|
35
|
-
/**
|
|
36
|
-
* Checks if the placeholder name is dynamic.
|
|
37
|
-
* @param {string} placeholder Placeholder name
|
|
38
|
-
* @returns True if the placeholder name is dynamic
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare const isDynamicPlaceholder: (placeholder: string) => boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The default value for an empty Date field.
|
|
44
|
-
* This value is defined as a default one by .NET
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
export declare const EMPTY_DATE_FIELD_VALUE = "0001-01-01T00:00:00Z";
|
|
48
|
-
/**
|
|
49
|
-
* Determines if the passed in field object's value is empty.
|
|
50
|
-
* @param {GenericFieldValue | Partial<Field>} field the field object.
|
|
51
|
-
* Partial<T> type is used here because _field.value_ could be required or optional for the different field types
|
|
52
|
-
* @returns True if the field value is empty
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
export declare function isFieldValueEmpty(field: GenericFieldValue | Partial<Field> | null | undefined): field is null | undefined;
|
|
56
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/layout/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,iBAAiB,EAAE,kBAAkB,GAAG,eAAe,EACvD,SAAS,EAAE,MAAM,GAChB,CAAC,GAAG,SAAS,CAAC;AACjB;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,iBAAiB,EAAE,kBAAkB,GAAG,eAAe,EACvD,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,CAAC,GACd,CAAC,CAAC;AAoCL;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,kBAAkB,EAC7B,eAAe,EAAE,MAAM,GACtB,kBAAkB,EAAE,CAWtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GAAI,aAAa,MAAM,WAE/D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM,YAAsC,CAAC;AAE/F;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3D,KAAK,IAAI,IAAI,GAAG,SAAS,CA8C3B"}
|
package/types/media/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get required query string params which should be merged with user params
|
|
3
|
-
* @param {object} qs layout service parsed query string
|
|
4
|
-
* @returns {object} requiredParams
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare const getRequiredParams: (qs: {
|
|
8
|
-
[key: string]: string | undefined;
|
|
9
|
-
}) => {
|
|
10
|
-
rev: string | undefined;
|
|
11
|
-
db: string | undefined;
|
|
12
|
-
la: string | undefined;
|
|
13
|
-
vs: string | undefined;
|
|
14
|
-
ts: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Replace `/~/media` or `/-/media` with `/~/jssmedia` or `/-/jssmedia`, respectively.
|
|
18
|
-
* Can use `mediaUrlPrefix` in order to use a custom prefix.
|
|
19
|
-
* @param {string} url The URL to replace the media URL prefix in
|
|
20
|
-
* @param {RegExp} [mediaUrlPrefix] The regex to match the media URL prefix
|
|
21
|
-
* @returns {string} The URL with the media URL prefix replaced
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export declare const replaceMediaUrlPrefix: (url: string, mediaUrlPrefix?: RegExp) => string;
|
|
25
|
-
/**
|
|
26
|
-
* Prepares a Sitecore media URL with `params` for use by the Content SDK media handler.
|
|
27
|
-
* This is done by replacing `/~/media` or `/-/media` with `/~/jssmedia` or `/-/jssmedia`, respectively.
|
|
28
|
-
* Provided `params` are used as the querystring parameters for the media URL.
|
|
29
|
-
* Can use `mediaUrlPrefix` in order to use a custom prefix.
|
|
30
|
-
* If no `params` are sent, the original media URL is returned.
|
|
31
|
-
* @param {string} url The URL to prepare
|
|
32
|
-
* @param {object} [params] The querystring parameters to use
|
|
33
|
-
* @param {RegExp} [mediaUrlPrefix] The regex to match the media URL prefix
|
|
34
|
-
* @returns {string} The prepared URL
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export declare const updateImageUrl: (url: string, params?: {
|
|
38
|
-
[key: string]: string | number | undefined;
|
|
39
|
-
} | null, mediaUrlPrefix?: RegExp) => string;
|
|
40
|
-
/**
|
|
41
|
-
* Receives an array of `srcSet` parameters that are iterated and used as parameters to generate
|
|
42
|
-
* a corresponding set of updated Sitecore media URLs via @see updateImageUrl. The result is a comma-delimited
|
|
43
|
-
* list of media URLs with respective dimension parameters.
|
|
44
|
-
* @example
|
|
45
|
-
* // returns '/ipsum.jpg?h=1000&w=1000 1000w, /ipsum.jpg?mh=250&mw=250 250w'
|
|
46
|
-
* getSrcSet('/ipsum.jpg', [{ h: 1000, w: 1000 }, { mh: 250, mw: 250 } ])
|
|
47
|
-
* More information about `srcSet`: {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img}
|
|
48
|
-
* @param {string} url The URL to prepare
|
|
49
|
-
* @param {Array} srcSet The array of parameters to use
|
|
50
|
-
* @param {object} [imageParams] The querystring parameters to use
|
|
51
|
-
* @param {RegExp} [mediaUrlPrefix] The regex to match the media URL prefix
|
|
52
|
-
* @returns {string} The prepared URL
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
export declare const getSrcSet: (url: string, srcSet: Array<{
|
|
56
|
-
[key: string]: string | number | undefined;
|
|
57
|
-
}>, imageParams?: {
|
|
58
|
-
[key: string]: string | number | undefined;
|
|
59
|
-
}, mediaUrlPrefix?: RegExp) => string;
|
|
60
|
-
//# sourceMappingURL=media-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media-api.d.ts","sourceRoot":"","sources":["../../src/media/media-api.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE;;;;;;CAI1E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,EACX,iBAAgB,MAA4B,KAC3C,MAUF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,EAC9D,iBAAgB,MAA4B,WA0B7C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,EACX,QAAQ,KAAK,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC,EAC7D,cAAc;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EAC5D,iBAAiB,MAAM,WAaxB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { personalizeLayout } from './layout-personalizer';
|
|
2
|
-
export { PersonalizeInfo, PersonalizeService, PersonalizeServiceConfig, } from './personalize-service';
|
|
3
|
-
export { getPersonalizedRewrite, getPersonalizedRewriteData, getGroomedVariantIds, normalizePersonalizedRewrite, PersonalizedRewriteData, CdpHelper, DEFAULT_VARIANT, VARIANT_PREFIX, } from './utils';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/personalize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { LayoutServiceData, ComponentRendering, PlaceholdersData } from '../layout/models';
|
|
2
|
-
export type ComponentRenderingWithExperiences = ComponentRendering & {
|
|
3
|
-
experiences: {
|
|
4
|
-
[name: string]: ComponentRenderingWithExperiences;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Apply personalization to layout data. This will recursively go through all placeholders/components, check experiences nodes and replace default with object from specific experience.
|
|
9
|
-
* @param {LayoutServiceData} layout Layout data
|
|
10
|
-
* @param {string} variantId variant id
|
|
11
|
-
* @param {string[]} [componentVariantIds] component variant ids
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare function personalizeLayout(layout: LayoutServiceData, variantId: string, componentVariantIds?: string[]): PlaceholdersData<string> | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* @param {Array} components components within placeholder
|
|
17
|
-
* @param {string[]} variantIds variant ids
|
|
18
|
-
* @param {boolean} isEditing indicates if page is rendered in metadata edit mode
|
|
19
|
-
* @returns {ComponentRendering[]} components with personalization applied
|
|
20
|
-
*/
|
|
21
|
-
export declare function personalizePlaceholder(components: ComponentRendering[], variantIds: string[], isEditing?: boolean): ComponentRendering[];
|
|
22
|
-
/**
|
|
23
|
-
* @param {ComponentRenderingWithExperiences} component component with experiences
|
|
24
|
-
* @param {string[]} variantIds variant ids
|
|
25
|
-
* @param {boolean} isEditing indicates if page is rendered in metadata edit mode
|
|
26
|
-
* @returns {ComponentRendering | null} component with personalization applied or null if hidden
|
|
27
|
-
*/
|
|
28
|
-
export declare function personalizeComponent(component: ComponentRenderingWithExperiences, variantIds: string[], isEditing?: boolean): ComponentRendering | null;
|
|
29
|
-
//# sourceMappingURL=layout-personalizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-personalizer.d.ts","sourceRoot":"","sources":["../../src/personalize/layout-personalizer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQ3F,MAAM,MAAM,iCAAiC,GAAG,kBAAkB,GAAG;IACnE,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,iCAAiC,CAAA;KAAE,CAAC;CACpE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,EACjB,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAC7B,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,CAkBtC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,kBAAkB,EAAE,EAChC,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,CAAC,EAAE,OAAO,GAClB,kBAAkB,EAAE,CA0BtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iCAAiC,EAC5C,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,CAAC,EAAE,OAAO,GAClB,kBAAkB,GAAG,IAAI,CA2C3B"}
|