@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,137 +0,0 @@
|
|
|
1
|
-
import { FetchOptions, GraphQLClient, GraphQLRequestClientFactory, PageInfo } from '../client';
|
|
2
|
-
import { StaticPath } from '../models';
|
|
3
|
-
/** @private */
|
|
4
|
-
export declare const languageError = "The list of languages cannot be empty";
|
|
5
|
-
export declare const siteError = "The service needs a site name";
|
|
6
|
-
export declare const sitesError = "The list of sites cannot be empty";
|
|
7
|
-
/**
|
|
8
|
-
* @param {string} siteName to inject into error text
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare function getSiteEmptyError(siteName: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* type for input variables for the site routes query
|
|
14
|
-
*/
|
|
15
|
-
interface SiteRouteQueryVariables {
|
|
16
|
-
/**
|
|
17
|
-
* Required. Name of a site to fetch sitemap for
|
|
18
|
-
*/
|
|
19
|
-
siteName: string;
|
|
20
|
-
/**
|
|
21
|
-
* Required. The language to return routes/pages for.
|
|
22
|
-
*/
|
|
23
|
-
language: string;
|
|
24
|
-
/**
|
|
25
|
-
* Optional. Only paths starting with these provided prefixes will be returned.
|
|
26
|
-
*/
|
|
27
|
-
includedPaths?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Optional. Paths starting with these provided prefixes will be excluded from returned results.
|
|
30
|
-
*/
|
|
31
|
-
excludedPaths?: string[];
|
|
32
|
-
/**
|
|
33
|
-
* common variable for all GraphQL queries
|
|
34
|
-
* it will be used for every type of query to regulate result batch size
|
|
35
|
-
* Optional. How many result items to fetch in each GraphQL call. This is needed for pagination.
|
|
36
|
-
* @default 100
|
|
37
|
-
*/
|
|
38
|
-
pageSize?: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Schema of data returned in response to a "site" query request
|
|
42
|
-
* @template T The type of objects being requested.
|
|
43
|
-
*/
|
|
44
|
-
export interface SiteRouteQueryResult<T> {
|
|
45
|
-
site: {
|
|
46
|
-
siteInfo: {
|
|
47
|
-
routes: {
|
|
48
|
-
/**
|
|
49
|
-
* Data needed to paginate the site results
|
|
50
|
-
*/
|
|
51
|
-
pageInfo: PageInfo;
|
|
52
|
-
results: T[];
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* The schema of data returned in response to a routes list query request
|
|
59
|
-
*/
|
|
60
|
-
export type RouteListQueryResult = {
|
|
61
|
-
path: string;
|
|
62
|
-
route?: {
|
|
63
|
-
personalization?: {
|
|
64
|
-
variantIds: string[];
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Configuration options for @see SitePathService instances
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
72
|
-
export interface SitePathServiceConfig extends Omit<SiteRouteQueryVariables, 'language' | 'siteName'> {
|
|
73
|
-
/**
|
|
74
|
-
* A flag for whether to include personalized routes in service output.
|
|
75
|
-
* Only works on XM Cloud for pages using Embedded Personalization (not Component A/B testing).
|
|
76
|
-
* Turned off by default.
|
|
77
|
-
*/
|
|
78
|
-
includePersonalizedRoutes?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
|
|
81
|
-
* This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
|
|
82
|
-
*/
|
|
83
|
-
clientFactory: GraphQLRequestClientFactory;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Service that fetches the list of site pages using Sitecore's GraphQL API.
|
|
87
|
-
* Used to handle a single site
|
|
88
|
-
* This list is used for SSG and Export functionality.
|
|
89
|
-
* @mixes SearchQueryService<PageListQueryResult>
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
|
-
export declare class SitePathService {
|
|
93
|
-
options: SitePathServiceConfig;
|
|
94
|
-
private _graphQLClient;
|
|
95
|
-
/**
|
|
96
|
-
* Creates an instance of graphQL sitemap service with the provided options
|
|
97
|
-
* @param {SitePathServiceConfig} options instance
|
|
98
|
-
*/
|
|
99
|
-
constructor(options: SitePathServiceConfig);
|
|
100
|
-
/**
|
|
101
|
-
* GraphQL client accessible by descendant classes when needed
|
|
102
|
-
*/
|
|
103
|
-
protected get graphQLClient(): GraphQLClient;
|
|
104
|
-
/**
|
|
105
|
-
* Gets the default query used for fetching the list of site pages
|
|
106
|
-
*/
|
|
107
|
-
protected get query(): string;
|
|
108
|
-
/**
|
|
109
|
-
* Fetch a flat list of all pages that belong to all the requested sites and have a
|
|
110
|
-
* version in the specified language(s).
|
|
111
|
-
* @param {string[]} sites Fetch pages for these sites.
|
|
112
|
-
* @param {string[]} languages Fetch pages that have versions in this language(s).
|
|
113
|
-
* @param {FetchOptions} fetchOptions Options to override graphQL client details like retries and fetch implementation
|
|
114
|
-
* @returns list of pages
|
|
115
|
-
* @throws {RangeError} if the list of languages is empty.
|
|
116
|
-
* @throws {RangeError} if the any of the languages is an empty string.
|
|
117
|
-
*/
|
|
118
|
-
fetchSiteRoutes(sites: string[], languages: string[], fetchOptions?: FetchOptions): Promise<StaticPath[]>;
|
|
119
|
-
protected transformLanguageSitePaths(sitePaths: RouteListQueryResult[], formatStaticPath: (path: string[], language: string) => StaticPath, language: string): Promise<StaticPath[]>;
|
|
120
|
-
/**
|
|
121
|
-
* Gets a GraphQL client that can make requests to the API. Uses graphql-request as the default
|
|
122
|
-
* library for fetching graphql data (@see GraphQLRequestClient). Override this method if you
|
|
123
|
-
* want to use something else.
|
|
124
|
-
* @returns {GraphQLClient} implementation
|
|
125
|
-
*/
|
|
126
|
-
protected getGraphQLClient(): GraphQLClient;
|
|
127
|
-
/**
|
|
128
|
-
* Fetch and return site paths for multisite implementation, with prefixes included
|
|
129
|
-
* @param {string} language path language
|
|
130
|
-
* @param {string} siteName site name
|
|
131
|
-
* @param {FetchOptions} fetchOptions Options to override graphQL client details like retries and fetch implementation
|
|
132
|
-
* @returns modified paths
|
|
133
|
-
*/
|
|
134
|
-
protected fetchLanguageSitePaths(language: string, siteName: string, fetchOptions?: FetchOptions): Promise<RouteListQueryResult[]>;
|
|
135
|
-
}
|
|
136
|
-
export {};
|
|
137
|
-
//# sourceMappingURL=sitepath-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sitepath-service.d.ts","sourceRoot":"","sources":["../../src/site/sitepath-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvC,eAAe;AACf,eAAO,MAAM,aAAa,0CAA0C,CAAC;AACrE,eAAO,MAAM,SAAS,kCAAkC,CAAC;AACzD,eAAO,MAAM,UAAU,sCAAsC,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,UAEjD;AAgDD;;GAEG;AACH,UAAU,uBAAuB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,MAAM,EAAE;gBACN;;mBAEG;gBACH,QAAQ,EAAE,QAAQ,CAAC;gBACnB,OAAO,EAAE,CAAC,EAAE,CAAC;aACd,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE;YAChB,UAAU,EAAE,MAAM,EAAE,CAAC;SACtB,CAAC;KACH,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9D;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAOP,OAAO,EAAE,qBAAqB;IANjD,OAAO,CAAC,cAAc,CAAgB;IAEtC;;;OAGG;gBACgB,OAAO,EAAE,qBAAqB;IAIjD;;OAEG;IACH,SAAS,KAAK,aAAa,kBAE1B;IAED;;OAEG;IACH,SAAS,KAAK,KAAK,IAAI,MAAM,CAE5B;IAED;;;;;;;;;OASG;IACG,eAAe,CACnB,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,UAAU,EAAE,CAAC;cAkCR,0BAA0B,CACxC,SAAS,EAAE,oBAAoB,EAAE,EACjC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,EAClE,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,EAAE,CAAC;IA6BxB;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAU3C;;;;;;OAMG;cACa,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAwCnC"}
|
package/types/site/utils.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Site prefix for rewrite path
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export declare const SITE_PREFIX = "_site_";
|
|
6
|
-
/**
|
|
7
|
-
* Site key for cookie and query string parameter access
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare const SITE_KEY = "sc_site";
|
|
11
|
-
/**
|
|
12
|
-
* Object model of site rewrite data
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export type SiteRewriteData = {
|
|
16
|
-
siteName: string;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Get a site rewrite path for given pathname
|
|
20
|
-
* @param {string} pathname the pathname
|
|
21
|
-
* @param {SiteRewriteData} data the site data to include in the rewrite
|
|
22
|
-
* @returns {string} the rewrite path
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export declare function getSiteRewrite(pathname: string, data: SiteRewriteData): string;
|
|
26
|
-
/**
|
|
27
|
-
* Get site data from the rewrite path
|
|
28
|
-
* @param {string} pathname the pathname
|
|
29
|
-
* @param {string} defaultSiteName the default site name
|
|
30
|
-
* @returns {SiteRewriteData} the site data from the rewrite
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
33
|
-
export declare function getSiteRewriteData(pathname: string, defaultSiteName: string): SiteRewriteData;
|
|
34
|
-
/**
|
|
35
|
-
* Normalize a site rewrite path (remove site data)
|
|
36
|
-
* @param {string} pathname the pathname
|
|
37
|
-
* @returns {string} the pathname with site data removed
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
export declare function normalizeSiteRewrite(pathname: string): string;
|
|
41
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/site/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,CAI9E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,eAAe,CAa7F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI7D"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { GraphQLClient, GraphQLRequestClientFactory } from './graphql-request-client';
|
|
2
|
-
import { SitecoreConfigInput } from './config';
|
|
3
|
-
export type GraphQLServiceConfig = Pick<SitecoreConfigInput, 'retries'> & {
|
|
4
|
-
/**
|
|
5
|
-
* A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
|
|
6
|
-
* This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
|
|
7
|
-
*/
|
|
8
|
-
clientFactory: GraphQLRequestClientFactory;
|
|
9
|
-
/**
|
|
10
|
-
* Optional debug logger override
|
|
11
|
-
*/
|
|
12
|
-
debugger?: debug.Debugger;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Base abstraction to implement custom layout service
|
|
16
|
-
*/
|
|
17
|
-
export declare abstract class SitecoreServiceBase {
|
|
18
|
-
serviceConfig: GraphQLServiceConfig;
|
|
19
|
-
protected graphQLClient: GraphQLClient;
|
|
20
|
-
/**
|
|
21
|
-
* Fetch layout data using the Sitecore GraphQL endpoint.
|
|
22
|
-
* @param {GraphQLServiceConfig} serviceConfig configuration
|
|
23
|
-
*/
|
|
24
|
-
constructor(serviceConfig: GraphQLServiceConfig);
|
|
25
|
-
/**
|
|
26
|
-
* Gets a GraphQL client that can make requests to the API.
|
|
27
|
-
* @returns {GraphQLClient} implementation
|
|
28
|
-
*/
|
|
29
|
-
protected getGraphQLClient(): GraphQLClient;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=sitecore-service-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sitecore-service-base.d.ts","sourceRoot":"","sources":["../src/sitecore-service-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAAG;IACxE;;;OAGG;IACH,aAAa,EAAE,2BAA2B,CAAC;IAC3C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,8BAAsB,mBAAmB;IAOpB,aAAa,EAAE,oBAAoB;IANtD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEvC;;;OAGG;gBACgB,aAAa,EAAE,oBAAoB;IAItD;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;CAW5C"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The parameters for fetching the component spec.
|
|
3
|
-
*/
|
|
4
|
-
type GetComponentSpecParams = {
|
|
5
|
-
/**
|
|
6
|
-
* The Edge URL.
|
|
7
|
-
* @default
|
|
8
|
-
*/
|
|
9
|
-
edgeUrl?: string;
|
|
10
|
-
/**
|
|
11
|
-
* The component target path.
|
|
12
|
-
* @example './components/promo-block/PromoBlock.ts'
|
|
13
|
-
*/
|
|
14
|
-
targetPath?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The component id.
|
|
17
|
-
*/
|
|
18
|
-
componentId: string;
|
|
19
|
-
/**
|
|
20
|
-
* The authentication token.
|
|
21
|
-
*/
|
|
22
|
-
token: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* The component spec.
|
|
26
|
-
*/
|
|
27
|
-
export interface ComponentSpec {
|
|
28
|
-
title: string;
|
|
29
|
-
meta: {
|
|
30
|
-
'contentsdk-component-type': string;
|
|
31
|
-
'contentsdk-component-name': string;
|
|
32
|
-
'contentsdk-component-variant-name': string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Gets the component spec url.
|
|
37
|
-
* @param {GetComponentSpecParams} params - The parameters for getting the component spec url.
|
|
38
|
-
* @returns {string} The component spec url.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare const getComponentSpecUrl: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => string;
|
|
42
|
-
/**
|
|
43
|
-
* Fetches the component spec.
|
|
44
|
-
* @param {GetComponentSpecParams} params - The parameters for fetching the component spec.
|
|
45
|
-
* @returns {Promise<ComponentSpec>} The component spec.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare const getComponentSpec: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => Promise<ComponentSpec>;
|
|
49
|
-
export {};
|
|
50
|
-
//# sourceMappingURL=component-generation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-generation.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/component-generation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QACJ,2BAA2B,EAAE,MAAM,CAAC;QACpC,2BAA2B,EAAE,MAAM,CAAC;QACpC,mCAAmC,EAAE,MAAM,CAAC;KAC7C,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,8CAKjC,sBAAsB,WAQxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAU,8CAKpC,sBAAsB,2BA8BxB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SitecoreConfig } from './../../config';
|
|
2
|
-
export type ExtractFilesConfig = {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
|
|
5
|
-
*/
|
|
6
|
-
scConfig?: SitecoreConfig;
|
|
7
|
-
componentMapPath?: string;
|
|
8
|
-
clientComponentMapPath?: string;
|
|
9
|
-
customValidateDeployContext?: () => boolean;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Extracts components from the app folder and sends them to XMCloud.
|
|
13
|
-
* @param {ExtractFilesConfig} args - Config for components extraction
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export declare let extractFiles: typeof _extractFiles;
|
|
17
|
-
export declare const unitMocks: {
|
|
18
|
-
extractFiles: typeof _extractFiles;
|
|
19
|
-
};
|
|
20
|
-
declare function _extractFiles(args?: ExtractFilesConfig): ({ scConfig }?: {
|
|
21
|
-
scConfig?: SitecoreConfig;
|
|
22
|
-
}) => Promise<void>;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=extract-files.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-files.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/extract-files.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,2BAA2B,CAAC,EAAE,MAAM,OAAO,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,IAAI,YAAY,sBAAgB,CAAC;AAKxC,eAAO,MAAM,SAAS;;CAOrB,CAAC;AAEF,iBAAS,aAAa,CAAC,IAAI,GAAE,kBAAuB,IASpC,eAAc;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAO,mBAiG/D"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
|
-
import { getComponentList } from './../templating';
|
|
3
|
-
import { SitecoreConfig } from './../../config';
|
|
4
|
-
export declare const unitMocks: ({ getComponentListStub, }: {
|
|
5
|
-
getComponentListStub?: typeof getComponentList;
|
|
6
|
-
}) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Gets a Map object with import modules and their respective exports present throughout the paths specified
|
|
9
|
-
* @param {string} paths paths to files to be processed for import-map
|
|
10
|
-
* @returns {Map<string, ImportModule>} collection of keys and values, where keys refer to modules being processed and values are collections of exports for each module
|
|
11
|
-
*/
|
|
12
|
-
export declare let getImportMap: typeof _getImportMap;
|
|
13
|
-
/**
|
|
14
|
-
* Builds file contents for component map based on the default template
|
|
15
|
-
* @param {Map<string, ImportModule>} indexedImportMap map to be processed into final component-map.ts file
|
|
16
|
-
* @returns {string} file code for component-map.ts
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare let defaultMapTemplate: typeof _defaultMapTemplate;
|
|
20
|
-
export declare const importUnitMocks: {
|
|
21
|
-
getImportMap: typeof _getImportMap;
|
|
22
|
-
defaultMapTemplate: (indexedImportMap: Map<string, ModuleExports>) => string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Args for import map generation
|
|
26
|
-
* Specifies paths to include and exclude when generating imports
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export type WriteImportMapArgs = {
|
|
30
|
-
paths: string[];
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
|
|
33
|
-
*/
|
|
34
|
-
scConfig?: SitecoreConfig;
|
|
35
|
-
exclude?: string[];
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Internal args for import map generation
|
|
39
|
-
* Extends WriteImportMapArgs with additional settings for templates and server/client maps applied within Content SDK
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
export type WriteImportMapArgsInternal = WriteImportMapArgs & {
|
|
43
|
-
/**
|
|
44
|
-
* generate separate import map for server/client components
|
|
45
|
-
* when true, generates import-map.server.ts and import-map.client.ts
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
separateServerClientMaps?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Function to return custom template for import map file.
|
|
51
|
-
* @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.ts or import-map.server.ts file
|
|
52
|
-
* @returns {string} contents for resulting import map file
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
defaultTemplate?: (indexedImportMap: Map<string, ModuleExports>) => string;
|
|
56
|
-
/**
|
|
57
|
-
* Function to return custom template for client import map file when separateServerClientMaps is true.
|
|
58
|
-
* @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.client.ts file
|
|
59
|
-
* @returns {string} contents for resulting import map file
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
clientTemplate?: (indexedImportMap: Map<string, ModuleExports>) => string;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Import names definition
|
|
66
|
-
* @typedef ImportName
|
|
67
|
-
* @property {string} name - the original name of the import
|
|
68
|
-
* @property {boolean} [isWildcard] - if import is a wildcard import (import * as name from 'module')
|
|
69
|
-
*/
|
|
70
|
-
export type ImportNames = {
|
|
71
|
-
named: string[];
|
|
72
|
-
namespace: string | null;
|
|
73
|
-
default: string | null;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Import module definition, specifying all the imports for a given import path
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export type ModuleExports = {
|
|
80
|
-
namedExports: Map<string, string>;
|
|
81
|
-
defaultExport: string | null;
|
|
82
|
-
namespaceExport: string | null;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Parses and AST import node and extracts all imported values from it
|
|
86
|
-
* @param {ts.ImportDeclaration} importNode import node to be parsed
|
|
87
|
-
* @returns {ImportNames | null} object with named, default and namespace imported values, or null if import node is not valid
|
|
88
|
-
*/
|
|
89
|
-
export declare const getImportedValues: (importNode: ts.ImportDeclaration) => ImportNames | null;
|
|
90
|
-
export declare const getImportValueAlias: (importValue: string, moduleName: string, importType: "named" | "default" | "namespace") => string;
|
|
91
|
-
declare function _getImportMap(paths: string[]): Map<string, ModuleExports>;
|
|
92
|
-
/**
|
|
93
|
-
* Entry point function for generating import-map. Parses provided paths and outputs the modules and imports from those files into .sitecore/import-map.ts
|
|
94
|
-
* @param {WriteImportMapArgsInternal} args include/exclude paths settings to be processed for import-map, and the Sitecore configuration.
|
|
95
|
-
* @public
|
|
96
|
-
*/
|
|
97
|
-
export declare const writeImportMap: (args: WriteImportMapArgsInternal) => ({ scConfig }?: {
|
|
98
|
-
scConfig?: SitecoreConfig;
|
|
99
|
-
}) => Promise<void>;
|
|
100
|
-
declare function _defaultMapTemplate(indexedImportMap: Map<string, ModuleExports>, framework?: string, defaultImportEntriesImport?: string): string;
|
|
101
|
-
export {};
|
|
102
|
-
//# sourceMappingURL=import-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQhD,eAAO,MAAM,SAAS,GAAI,2BAEvB;IACD,oBAAoB,CAAC,EAAE,OAAO,gBAAgB,CAAC;CAChD,SAEA,CAAC;AAEF;;;;GAIG;AACH,eAAO,IAAI,YAAY,sBAAgB,CAAC;AAExC;;;;;GAKG;AACH,eAAO,IAAI,kBAAkB,4BAAsB,CAAC;AAEpD,eAAO,MAAM,eAAe;;wBASJ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM;CAO/E,CAAC;AAmBF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC;IAC3E;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC;CAC3E,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAE1B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,EAAE,CAAC,iBAAiB,KAAG,WAAW,GAAG,IA4BlF,CAAC;AAIF,eAAO,MAAM,mBAAmB,GAC9B,aAAa,MAAM,EACnB,YAAY,MAAM,EAClB,YAAY,OAAO,GAAG,SAAS,GAAG,WAAW,WAQ9C,CAAC;AAGF,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,8BAkKrC;AAyCD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,0BAA0B,MAC/C,eAAc;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAO,kBA0C/D,CAAC;AAGF,iBAAS,mBAAmB,CAC1B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAC5C,SAAS,SAAS,EAClB,0BAA0B,GAAE,MAA+B,UAuF5D"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse the generated component-map file and return all referenced modules
|
|
3
|
-
* per map entry (handles both single identifiers and spread objects).
|
|
4
|
-
* @param {string} appRoot path to the JSS app root
|
|
5
|
-
* @param {string} componentMapPath path to the component map file
|
|
6
|
-
* @returns map of component names and their respective import strings
|
|
7
|
-
*/
|
|
8
|
-
export declare let resolveComponentImportFiles: typeof _resolveComponentImportFiles;
|
|
9
|
-
/**
|
|
10
|
-
* Reads the named exports from a TypeScript file.
|
|
11
|
-
* @param {ExtractedFile} filePath absolute path to a .ts/.tsx file
|
|
12
|
-
* @returns {string[]} list of named exports found in the file
|
|
13
|
-
*/
|
|
14
|
-
export declare let readNamedExports: typeof _readNamedExports;
|
|
15
|
-
/**
|
|
16
|
-
* Sends the extracted code to the specified target URL.
|
|
17
|
-
* @param {object} params - The parameters object.
|
|
18
|
-
* @param {ExtractedFile} params.file - The file to be sent.
|
|
19
|
-
* @param {string} params.token - The access token for authentication.
|
|
20
|
-
* @param {string} params.targetUrl - The target URL to send the file to.
|
|
21
|
-
* @param {Record<string, unknown>} [params.extraLabels] - Additional labels to include in the payload.
|
|
22
|
-
* @returns {Promise<string | null>} - The path of the sent file or null if sending failed.
|
|
23
|
-
*/
|
|
24
|
-
export declare let sendCode: typeof _sendCode;
|
|
25
|
-
export declare const utilsUnitMocks: {
|
|
26
|
-
xmCloudDeploy: () => boolean;
|
|
27
|
-
resolveComponentImportFiles: typeof _resolveComponentImportFiles;
|
|
28
|
-
readNamedExports: typeof _readNamedExports;
|
|
29
|
-
sendCode: typeof _sendCode;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Description properties for the files sent to the mesh endpoint
|
|
33
|
-
*/
|
|
34
|
-
export type ExtractedFile = {
|
|
35
|
-
name: string;
|
|
36
|
-
path: string;
|
|
37
|
-
type: ExtractedFileType;
|
|
38
|
-
labels?: Record<string, unknown>;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Type of file to be sent to the mesh endpoint
|
|
42
|
-
*/
|
|
43
|
-
export declare enum ExtractedFileType {
|
|
44
|
-
Component = "component",
|
|
45
|
-
Variant = "variant",
|
|
46
|
-
Json = "json",
|
|
47
|
-
PackageJson = "package.json"
|
|
48
|
-
}
|
|
49
|
-
export type ResolvedImport = {
|
|
50
|
-
componentKey: string;
|
|
51
|
-
filePath: string;
|
|
52
|
-
fileType: ExtractedFileType;
|
|
53
|
-
};
|
|
54
|
-
export declare const utils: {
|
|
55
|
-
xmCloudDeploy: () => boolean;
|
|
56
|
-
};
|
|
57
|
-
export declare const _xmCloudDeploy: () => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Validates if the current operation is done in Vercel, Netlify or XMCloud
|
|
60
|
-
* deploy context
|
|
61
|
-
* @returns {boolean} - true if in deploy context, false otherwise
|
|
62
|
-
*/
|
|
63
|
-
export declare function validateDeployContext(): boolean;
|
|
64
|
-
declare function _resolveComponentImportFiles(appRoot: string, componentMapPath?: string): ResolvedImport[];
|
|
65
|
-
declare function _readNamedExports(filePath: string): string[];
|
|
66
|
-
declare function _sendCode({ file, token, targetUrl, }: {
|
|
67
|
-
file: ExtractedFile;
|
|
68
|
-
token: string;
|
|
69
|
-
targetUrl: string;
|
|
70
|
-
}): Promise<string | null>;
|
|
71
|
-
export declare function toPosixPath(p: string): string;
|
|
72
|
-
export declare const stripExtension: (p: string) => string;
|
|
73
|
-
export declare const getRelativeImportPath: (absFile: string, appPath: string) => string;
|
|
74
|
-
export declare const isNodeModuleImport: (name: string) => boolean;
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/utils.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,eAAO,IAAI,2BAA2B,qCAA+B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,IAAI,gBAAgB,0BAAoB,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,IAAI,QAAQ,kBAAY,CAAC;AAEhC,eAAO,MAAM,cAAc;mBACG,MAAM,OAAO;;;;CAwB1C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,WAAW,iBAAiB;CAC7B;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE;IAClB,aAAa,EAAE,MAAM,OAAO,CAAC;CAG9B,CAAC;AAEF,eAAO,MAAM,cAAc,eAA+D,CAAC;AAM3F;;;;GAIG;AACH,wBAAgB,qBAAqB,YAEpC;AAwDD,iBAAS,4BAA4B,CACnC,OAAO,EAAE,MAAM,EACf,gBAAgB,GAAE,MAAuC,GACxD,cAAc,EAAE,CA+KlB;AAED,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCrD;AAED,iBAAe,SAAS,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,SAAS,GACV,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,0BAqDA;AAiBD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,UAGpC;AAED,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,WAA4C,CAAC;AAGrF,eAAO,MAAM,qBAAqB,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,WAGrE,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,YAC6B,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ComponentImport, ComponentMapTemplate, EnhancedComponentMapTemplate } from './templating';
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export type GenerateMapFunction = (args: GenerateMapArgs) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Arguments for the generateMap function.
|
|
8
|
-
* This type defines all configuration options for generating Sitecore component maps.
|
|
9
|
-
* Component maps can be generated as a single file or split into server/client variants.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export type GenerateMapArgs = {
|
|
13
|
-
/** Array of component paths to include in component map. */
|
|
14
|
-
paths: string[];
|
|
15
|
-
/** Destination folder path for the generated map. @defaultValue 'src/.sitecore' */
|
|
16
|
-
destination?: string;
|
|
17
|
-
/** Optional array of package definitions for component imports to include in the map. */
|
|
18
|
-
componentImports?: ComponentImport[];
|
|
19
|
-
/** Optional array of glob paths to exclude from the map. */
|
|
20
|
-
exclude?: string[];
|
|
21
|
-
/** Optional custom template function to generate the main component map content. */
|
|
22
|
-
mapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
|
|
23
|
-
/**
|
|
24
|
-
* Optional custom template function to generate the client component map content (only used when clientComponentMap is true).
|
|
25
|
-
*/
|
|
26
|
-
clientMapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
|
|
27
|
-
/**
|
|
28
|
-
* Optional flag to generate separate client and server component maps. When true,
|
|
29
|
-
* generates both component-map.ts (all components) and component-map.client.ts (client + universal only).
|
|
30
|
-
* When false or undefined, generates single component-map.ts (traditional behavior).
|
|
31
|
-
*/
|
|
32
|
-
clientComponentMap?: boolean;
|
|
33
|
-
/** Optional flag to include component's variants path in the component map. */
|
|
34
|
-
includeVariants?: boolean;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=generate-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../src/tools/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,oFAAoF;IACpF,WAAW,CAAC,EAAE,oBAAoB,GAAG,4BAA4B,CAAC;IAClE;;OAEG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,GAAG,4BAA4B,CAAC;IACxE;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateMetadata.d.ts","sourceRoot":"","sources":["../../src/tools/generateMetadata.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,sBAAsB,KAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAKtF,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SitecoreConfig } from '../config';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration object for generating sites.
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export type GenerateSitesConfig = {
|
|
7
|
-
/**
|
|
8
|
-
* The Sitecore configuration used at build and run time.
|
|
9
|
-
* @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
|
|
10
|
-
*/
|
|
11
|
-
scConfig?: SitecoreConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Optional path where the generated sites will be saved.
|
|
14
|
-
* If not provided, the default '.sitecore/sites.json' will be used.
|
|
15
|
-
*/
|
|
16
|
-
destinationPath?: string;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Generates site information and writes it to a specified destination path.
|
|
20
|
-
* @param {GenerateSitesConfig} config - The configuration for generating site info.
|
|
21
|
-
* @returns {Promise<Function>} - A promise that resolves to an asynchronous function that fetches site information and writes it to a file.
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export declare const generateSites: ({ scConfig: deprecatedScConfig, destinationPath, }?: GenerateSitesConfig) => (() => Promise<void>);
|
|
25
|
-
//# sourceMappingURL=generateSites.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateSites.d.ts","sourceRoot":"","sources":["../../src/tools/generateSites.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAK3C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,qDAG3B,mBAAwB,KAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CA8CjD,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ScaffoldTemplate } from '../config';
|
|
2
|
-
/**
|
|
3
|
-
* Force to use `crlf` line endings, we are using `crlf` across the project.
|
|
4
|
-
* Replace: `lf` (\n), `cr` (\r)
|
|
5
|
-
* @param {string} content
|
|
6
|
-
*/
|
|
7
|
-
export declare function editLineEndings(content: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Creates a file relative to the specified path if the file doesn't exist.
|
|
10
|
-
* Creates directories as needed.
|
|
11
|
-
* Does not overwrite existing files.
|
|
12
|
-
* @param {string} filePath - the file path
|
|
13
|
-
* @param {string} fileContent - the file content
|
|
14
|
-
* @returns {string} the file path if the file was created, otherwise null
|
|
15
|
-
*/
|
|
16
|
-
export declare function scaffoldFile(filePath: string, fileContent: string): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Scaffolds a new component based on the provided template.
|
|
19
|
-
* @param {string} outputFolderPath - The file path where the component will be created.
|
|
20
|
-
* @param {string} componentName - The name of the component to be created.
|
|
21
|
-
* @param {string} templateName - The name of the template to use for scaffolding. If not provided, defaults to 'byoc' if `byoc` is true, otherwise 'default'.
|
|
22
|
-
* @param {ScaffoldTemplate[]} templates - An array of template objects, each containing a name, a template function, and a getNextSteps function.
|
|
23
|
-
* @throws Will throw an error if the specified template is not found.
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export declare function scaffoldComponent(outputFolderPath: string, componentName: string, templateName: string, templates: ScaffoldTemplate[]): void;
|
|
27
|
-
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/tools/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,UAE9C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAajF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,gBAAgB,EAAE,GAC5B,IAAI,CAwBN"}
|