@sitecore-content-sdk/core 1.3.0-canary.9 → 1.4.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/cjs/cache-client.js +55 -54
- package/dist/cjs/client/constants.js +7 -7
- package/dist/cjs/client/edge-proxy.js +24 -22
- package/dist/cjs/client/index.js +15 -15
- package/dist/cjs/client/models.js +2 -2
- package/dist/cjs/client/sitecore-client.js +421 -419
- package/dist/cjs/client/utils.js +47 -46
- package/dist/cjs/config/define-config.js +194 -193
- package/dist/cjs/config/index.js +7 -7
- package/dist/cjs/config/models.js +12 -11
- package/dist/cjs/config-cli/define-cli-config.js +23 -22
- package/dist/cjs/config-cli/index.js +7 -7
- package/dist/cjs/config-cli/models.js +8 -7
- package/dist/cjs/constants.js +49 -17
- package/dist/cjs/debug.js +48 -46
- package/dist/cjs/editing/codegen/index.js +14 -9
- package/dist/cjs/editing/codegen/preview.js +277 -193
- package/dist/cjs/editing/component-layout-service.js +62 -61
- package/dist/cjs/editing/design-library.js +183 -126
- package/dist/cjs/editing/editing-service.js +75 -74
- package/dist/cjs/editing/index.js +33 -27
- package/dist/cjs/editing/metadata.js +42 -42
- package/dist/cjs/editing/models.js +44 -38
- package/dist/cjs/editing/utils.js +108 -90
- package/dist/cjs/form/form.js +81 -78
- package/dist/cjs/form/index.js +7 -7
- package/dist/cjs/graphql-request-client.js +108 -107
- package/dist/cjs/i18n/dictionary-service.js +122 -121
- package/dist/cjs/i18n/index.js +7 -7
- package/dist/cjs/i18n/utils.js +16 -15
- package/dist/cjs/index.js +60 -60
- package/dist/cjs/layout/content-styles.js +72 -71
- package/dist/cjs/layout/index.js +24 -24
- package/dist/cjs/layout/layout-service.js +62 -57
- package/dist/cjs/layout/models.js +39 -34
- package/dist/cjs/layout/themes.js +76 -75
- package/dist/cjs/layout/utils.js +117 -110
- package/dist/cjs/media/index.js +38 -38
- package/dist/cjs/media/media-api.js +100 -96
- package/dist/cjs/models.js +2 -2
- package/dist/cjs/native-fetcher.js +194 -179
- package/dist/cjs/personalize/index.js +15 -15
- package/dist/cjs/personalize/layout-personalizer.js +98 -97
- package/dist/cjs/personalize/personalize-service.js +98 -94
- package/dist/cjs/personalize/utils.js +143 -136
- package/dist/cjs/retries.js +43 -42
- package/dist/cjs/site/error-pages-service.js +65 -64
- package/dist/cjs/site/index.js +26 -26
- package/dist/cjs/site/models.js +2 -2
- package/dist/cjs/site/redirects-service.js +94 -81
- package/dist/cjs/site/robots-service.js +66 -65
- package/dist/cjs/site/site-resolver.js +73 -72
- package/dist/cjs/site/siteinfo-service.js +84 -80
- package/dist/cjs/site/sitemap-xml-service.js +84 -83
- package/dist/cjs/site/sitepath-service.js +165 -164
- package/dist/cjs/site/utils.js +55 -47
- package/dist/cjs/sitecore-service-base.js +36 -36
- package/dist/cjs/tools/auth/flow.js +65 -64
- package/dist/cjs/tools/auth/index.js +5 -5
- package/dist/cjs/tools/auth/models.js +2 -2
- package/dist/cjs/tools/auth/tenant-store.js +38 -38
- package/dist/cjs/tools/codegen/component-generation.js +52 -50
- package/dist/cjs/tools/codegen/extract-files.js +105 -107
- package/dist/cjs/tools/codegen/import-map.js +401 -349
- package/dist/cjs/tools/codegen/utils.js +418 -418
- package/dist/cjs/tools/generate-map.js +2 -2
- package/dist/cjs/tools/generateMetadata.js +36 -35
- package/dist/cjs/tools/generateSites.js +59 -58
- package/dist/cjs/tools/index.js +75 -73
- package/dist/cjs/tools/scaffold.js +60 -59
- package/dist/cjs/tools/templating/components.js +96 -266
- package/dist/cjs/tools/templating/index.js +11 -14
- package/dist/cjs/tools/templating/plugins.js +80 -78
- package/dist/cjs/tools/templating/utils.js +67 -66
- package/dist/cjs/utils/ensurePath.js +20 -20
- package/dist/cjs/utils/env.js +28 -27
- package/dist/cjs/utils/globalCache.js +55 -0
- package/dist/cjs/utils/index.js +26 -21
- package/dist/cjs/utils/is-server.js +11 -10
- package/dist/cjs/utils/normalize-url.js +5 -5
- package/dist/cjs/utils/timeout-promise.js +31 -31
- package/dist/cjs/utils/utils.js +254 -229
- package/dist/esm/cache-client.js +51 -50
- package/dist/esm/client/constants.js +4 -4
- package/dist/esm/client/edge-proxy.js +19 -17
- package/dist/esm/client/index.js +5 -5
- package/dist/esm/client/models.js +1 -1
- package/dist/esm/client/sitecore-client.js +414 -412
- package/dist/esm/client/utils.js +43 -42
- package/dist/esm/config/define-config.js +188 -187
- package/dist/esm/config/index.js +2 -2
- package/dist/esm/config/models.js +9 -8
- package/dist/esm/config-cli/define-cli-config.js +19 -18
- package/dist/esm/config-cli/index.js +2 -2
- package/dist/esm/config-cli/models.js +5 -4
- package/dist/esm/constants.js +46 -14
- package/dist/esm/debug.js +41 -39
- package/dist/esm/editing/codegen/index.js +1 -1
- package/dist/esm/editing/codegen/preview.js +263 -185
- package/dist/esm/editing/component-layout-service.js +55 -54
- package/dist/esm/editing/design-library.js +171 -117
- package/dist/esm/editing/editing-service.js +68 -67
- package/dist/esm/editing/index.js +6 -5
- package/dist/esm/editing/metadata.js +39 -39
- package/dist/esm/editing/models.js +41 -35
- package/dist/esm/editing/utils.js +98 -80
- package/dist/esm/form/form.js +72 -69
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/graphql-request-client.js +101 -100
- package/dist/esm/i18n/dictionary-service.js +115 -114
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/i18n/utils.js +13 -12
- package/dist/esm/index.js +13 -13
- package/dist/esm/layout/content-styles.js +64 -63
- package/dist/esm/layout/index.js +6 -6
- package/dist/esm/layout/layout-service.js +55 -50
- package/dist/esm/layout/models.js +36 -31
- package/dist/esm/layout/themes.js +71 -70
- package/dist/esm/layout/utils.js +109 -102
- package/dist/esm/media/index.js +2 -2
- package/dist/esm/media/media-api.js +90 -86
- package/dist/esm/models.js +1 -1
- package/dist/esm/native-fetcher.js +187 -172
- package/dist/esm/personalize/index.js +3 -3
- package/dist/esm/personalize/layout-personalizer.js +93 -92
- package/dist/esm/personalize/personalize-service.js +91 -87
- package/dist/esm/personalize/utils.js +135 -128
- package/dist/esm/retries.js +39 -38
- package/dist/esm/site/error-pages-service.js +58 -57
- package/dist/esm/site/index.js +8 -8
- package/dist/esm/site/models.js +1 -1
- package/dist/esm/site/redirects-service.js +87 -74
- package/dist/esm/site/robots-service.js +59 -58
- package/dist/esm/site/site-resolver.js +69 -68
- package/dist/esm/site/siteinfo-service.js +77 -73
- package/dist/esm/site/sitemap-xml-service.js +77 -76
- package/dist/esm/site/sitepath-service.js +157 -156
- package/dist/esm/site/utils.js +49 -41
- package/dist/esm/sitecore-service-base.js +29 -29
- package/dist/esm/tools/auth/flow.js +62 -61
- package/dist/esm/tools/auth/index.js +1 -1
- package/dist/esm/tools/auth/models.js +1 -1
- package/dist/esm/tools/auth/tenant-store.js +35 -35
- package/dist/esm/tools/codegen/component-generation.js +44 -42
- package/dist/esm/tools/codegen/extract-files.js +99 -101
- package/dist/esm/tools/codegen/import-map.js +358 -306
- package/dist/esm/tools/codegen/utils.js +373 -373
- package/dist/esm/tools/generate-map.js +1 -1
- package/dist/esm/tools/generateMetadata.js +29 -28
- package/dist/esm/tools/generateSites.js +52 -51
- package/dist/esm/tools/index.js +28 -27
- package/dist/esm/tools/scaffold.js +52 -51
- package/dist/esm/tools/templating/components.js +59 -223
- package/dist/esm/tools/templating/index.js +3 -3
- package/dist/esm/tools/templating/plugins.js +72 -70
- package/dist/esm/tools/templating/utils.js +59 -58
- package/dist/esm/utils/ensurePath.js +13 -13
- package/dist/esm/utils/env.js +24 -23
- package/dist/esm/utils/globalCache.js +49 -0
- package/dist/esm/utils/index.js +4 -3
- package/dist/esm/utils/is-server.js +9 -8
- package/dist/esm/utils/normalize-url.js +1 -1
- package/dist/esm/utils/timeout-promise.js +28 -28
- package/dist/esm/utils/utils.js +238 -213
- package/package.json +73 -5
- package/types/cache-client.d.ts +68 -64
- package/types/cache-client.d.ts.map +1 -0
- package/types/client/constants.d.ts +5 -4
- package/types/client/constants.d.ts.map +1 -0
- package/types/client/edge-proxy.d.ts +18 -15
- package/types/client/edge-proxy.d.ts.map +1 -0
- package/types/client/index.d.ts +8 -7
- package/types/client/index.d.ts.map +1 -0
- package/types/client/models.d.ts +21 -19
- package/types/client/models.d.ts.map +1 -0
- package/types/client/sitecore-client.d.ts +338 -327
- package/types/client/sitecore-client.d.ts.map +1 -0
- package/types/client/utils.d.ts +15 -9
- package/types/client/utils.d.ts.map +1 -0
- package/types/config/define-config.d.ts +20 -18
- package/types/config/define-config.d.ts.map +1 -0
- package/types/config/index.d.ts +3 -2
- package/types/config/index.d.ts.map +1 -0
- package/types/config/models.d.ts +287 -268
- package/types/config/models.d.ts.map +1 -0
- package/types/config-cli/define-cli-config.d.ts +9 -7
- package/types/config-cli/define-cli-config.d.ts.map +1 -0
- package/types/config-cli/index.d.ts +3 -2
- package/types/config-cli/index.d.ts.map +1 -0
- package/types/config-cli/models.d.ts +6 -4
- package/types/config-cli/models.d.ts.map +1 -0
- package/types/constants.d.ts +44 -11
- package/types/constants.d.ts.map +1 -0
- package/types/debug.d.ts +35 -28
- package/types/debug.d.ts.map +1 -0
- package/types/editing/codegen/index.d.ts +2 -1
- package/types/editing/codegen/index.d.ts.map +1 -0
- package/types/editing/codegen/preview.d.ts +256 -195
- package/types/editing/codegen/preview.d.ts.map +1 -0
- package/types/editing/component-layout-service.d.ts +84 -80
- package/types/editing/component-layout-service.d.ts.map +1 -0
- package/types/editing/design-library.d.ts +111 -63
- package/types/editing/design-library.d.ts.map +1 -0
- package/types/editing/editing-service.d.ts +72 -62
- package/types/editing/editing-service.d.ts.map +1 -0
- package/types/editing/index.d.ts +7 -6
- package/types/editing/index.d.ts.map +1 -0
- package/types/editing/metadata.d.ts +8 -7
- package/types/editing/metadata.d.ts.map +1 -0
- package/types/editing/models.d.ts +103 -92
- package/types/editing/models.d.ts.map +1 -0
- package/types/editing/utils.d.ts +91 -74
- package/types/editing/utils.d.ts.map +1 -0
- package/types/form/form.d.ts +25 -21
- package/types/form/form.d.ts.map +1 -0
- package/types/form/index.d.ts +2 -1
- package/types/form/index.d.ts.map +1 -0
- package/types/graphql-request-client.d.ts +112 -105
- package/types/graphql-request-client.d.ts.map +1 -0
- package/types/i18n/dictionary-service.d.ts +135 -131
- package/types/i18n/dictionary-service.d.ts.map +1 -0
- package/types/i18n/index.d.ts +3 -2
- package/types/i18n/index.d.ts.map +1 -0
- package/types/i18n/utils.d.ts +9 -7
- package/types/i18n/utils.d.ts.map +1 -0
- package/types/index.d.ts +13 -12
- package/types/index.d.ts.map +1 -0
- package/types/layout/content-styles.d.ts +20 -18
- package/types/layout/content-styles.d.ts.map +1 -0
- package/types/layout/index.d.ts +6 -5
- package/types/layout/index.d.ts.map +1 -0
- package/types/layout/layout-service.d.ts +45 -35
- package/types/layout/layout-service.d.ts.map +1 -0
- package/types/layout/models.d.ts +174 -151
- package/types/layout/models.d.ts.map +1 -0
- package/types/layout/themes.d.ts +13 -11
- package/types/layout/themes.d.ts.map +1 -0
- package/types/layout/utils.d.ts +56 -41
- package/types/layout/utils.d.ts.map +1 -0
- package/types/media/index.d.ts +3 -2
- package/types/media/index.d.ts.map +1 -0
- package/types/media/media-api.d.ts +60 -55
- package/types/media/media-api.d.ts.map +1 -0
- package/types/models.d.ts +94 -84
- package/types/models.d.ts.map +1 -0
- package/types/native-fetcher.d.ts +124 -114
- package/types/native-fetcher.d.ts.map +1 -0
- package/types/personalize/index.d.ts +4 -3
- package/types/personalize/index.d.ts.map +1 -0
- package/types/personalize/layout-personalizer.d.ts +29 -27
- package/types/personalize/layout-personalizer.d.ts.map +1 -0
- package/types/personalize/personalize-service.d.ts +90 -80
- package/types/personalize/personalize-service.d.ts.map +1 -0
- package/types/personalize/utils.d.ts +78 -69
- package/types/personalize/utils.d.ts.map +1 -0
- package/types/retries.d.ts +26 -24
- package/types/retries.d.ts.map +1 -0
- package/types/site/error-pages-service.d.ts +64 -57
- package/types/site/error-pages-service.d.ts.map +1 -0
- package/types/site/index.d.ts +10 -9
- package/types/site/index.d.ts.map +1 -0
- package/types/site/models.d.ts +23 -18
- package/types/site/models.d.ts.map +1 -0
- package/types/site/redirects-service.d.ts +92 -69
- package/types/site/redirects-service.d.ts.map +1 -0
- package/types/site/robots-service.d.ts +57 -50
- package/types/site/robots-service.d.ts.map +1 -0
- package/types/site/site-resolver.d.ts +28 -26
- package/types/site/site-resolver.d.ts.map +1 -0
- package/types/site/siteinfo-service.d.ts +65 -52
- package/types/site/siteinfo-service.d.ts.map +1 -0
- package/types/site/sitemap-xml-service.d.ts +63 -56
- package/types/site/sitemap-xml-service.d.ts.map +1 -0
- package/types/site/sitepath-service.d.ts +137 -134
- package/types/site/sitepath-service.d.ts.map +1 -0
- package/types/site/utils.d.ts +41 -28
- package/types/site/utils.d.ts.map +1 -0
- package/types/sitecore-service-base.d.ts +31 -30
- package/types/sitecore-service-base.d.ts.map +1 -0
- package/types/tools/auth/flow.d.ts +29 -27
- package/types/tools/auth/flow.d.ts.map +1 -0
- package/types/tools/auth/index.d.ts +2 -1
- package/types/tools/auth/index.d.ts.map +1 -0
- package/types/tools/auth/models.d.ts +35 -33
- package/types/tools/auth/models.d.ts.map +1 -0
- package/types/tools/auth/tenant-store.d.ts +12 -11
- package/types/tools/auth/tenant-store.d.ts.map +1 -0
- package/types/tools/codegen/component-generation.d.ts +50 -47
- package/types/tools/codegen/component-generation.d.ts.map +1 -0
- package/types/tools/codegen/extract-files.d.ts +24 -22
- package/types/tools/codegen/extract-files.d.ts.map +1 -0
- package/types/tools/codegen/import-map.d.ts +103 -70
- package/types/tools/codegen/import-map.d.ts.map +1 -0
- package/types/tools/codegen/utils.d.ts +76 -75
- package/types/tools/codegen/utils.d.ts.map +1 -0
- package/types/tools/generate-map.d.ts +36 -26
- package/types/tools/generate-map.d.ts.map +1 -0
- package/types/tools/generateMetadata.d.ts +24 -22
- package/types/tools/generateMetadata.d.ts.map +1 -0
- package/types/tools/generateSites.d.ts +25 -22
- package/types/tools/generateSites.d.ts.map +1 -0
- package/types/tools/index.d.ts +22 -20
- package/types/tools/index.d.ts.map +1 -0
- package/types/tools/scaffold.d.ts +27 -25
- package/types/tools/scaffold.d.ts.map +1 -0
- package/types/tools/templating/components.d.ts +104 -103
- package/types/tools/templating/components.d.ts.map +1 -0
- package/types/tools/templating/index.d.ts +4 -3
- package/types/tools/templating/index.d.ts.map +1 -0
- package/types/tools/templating/plugins.d.ts +71 -67
- package/types/tools/templating/plugins.d.ts.map +1 -0
- package/types/tools/templating/utils.d.ts +42 -40
- package/types/tools/templating/utils.d.ts.map +1 -0
- package/types/utils/ensurePath.d.ts +7 -6
- package/types/utils/ensurePath.d.ts.map +1 -0
- package/types/utils/env.d.ts +9 -7
- package/types/utils/env.d.ts.map +1 -0
- package/types/utils/globalCache.d.ts +37 -0
- package/types/utils/globalCache.d.ts.map +1 -0
- package/types/utils/index.d.ts +5 -3
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/is-server.d.ts +8 -6
- package/types/utils/is-server.d.ts.map +1 -0
- package/types/utils/normalize-url.d.ts +2 -1
- package/types/utils/normalize-url.d.ts.map +1 -0
- package/types/utils/timeout-promise.d.ts +18 -17
- package/types/utils/timeout-promise.d.ts.map +1 -0
- package/types/utils/utils.d.ts +104 -79
- package/types/utils/utils.d.ts.map +1 -0
- package/client.js +0 -1
- package/codegen.js +0 -1
- package/config-cli.js +0 -1
- package/config.js +0 -1
- package/editing.js +0 -1
- package/i18n.js +0 -1
- package/layout.js +0 -1
- package/media.js +0 -1
- package/personalize.js +0 -1
- package/site.js +0 -1
- package/tools.js +0 -1
- package/utils.js +0 -1
|
@@ -1,134 +1,137 @@
|
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @param {
|
|
112
|
-
* @
|
|
113
|
-
* @
|
|
114
|
-
* @
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
* @
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
* @param {
|
|
130
|
-
* @
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
14
|
-
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,30 +1,31 @@
|
|
|
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
|
-
}
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,27 +1,29 @@
|
|
|
1
|
-
import { TenantArgs } from './models';
|
|
2
|
-
/**
|
|
3
|
-
* Performs the OAuth 2.0 client credentials flow to obtain a JWT access token
|
|
4
|
-
* from the Sitecore Identity Provider using the provided client credentials.
|
|
5
|
-
* @param {object} [args] - The arguments for client credentials flow
|
|
6
|
-
* @param {string} [args.clientId] - The client ID registered with Sitecore Identity
|
|
7
|
-
* @param {string} [args.clientSecret] - The client secret associated with the client ID
|
|
8
|
-
* @param {string} [args.organizationId] - The ID of the organization the client belongs to
|
|
9
|
-
* @param {string} [args.tenantId] - The tenant ID representing the specific Sitecore environment
|
|
10
|
-
* @param {string} [args.audience] - The API audience the token is intended for. Defaults to `constants.DEFAULT_SITECORE_AUTH_AUDIENCE`
|
|
11
|
-
* @param {string} [args.authority] - The auth server base URL. Defaults to `constants.DEFAULT_SITECORE_AUTH_DOMAIN`
|
|
12
|
-
* @param {string} [args.baseUrl] - The base URL for the API, used to construct the audience. Defaults to `constants.DEFAULT_SITECORE_AUTH_BASE_URL`
|
|
13
|
-
* @returns A Promise that resolves to the access token response (including access token, token type, expiry, etc.)
|
|
14
|
-
* @throws Will log and exit the process if the request fails or returns a non-OK status
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { TenantArgs } from './models';
|
|
2
|
+
/**
|
|
3
|
+
* Performs the OAuth 2.0 client credentials flow to obtain a JWT access token
|
|
4
|
+
* from the Sitecore Identity Provider using the provided client credentials.
|
|
5
|
+
* @param {object} [args] - The arguments for client credentials flow
|
|
6
|
+
* @param {string} [args.clientId] - The client ID registered with Sitecore Identity
|
|
7
|
+
* @param {string} [args.clientSecret] - The client secret associated with the client ID
|
|
8
|
+
* @param {string} [args.organizationId] - The ID of the organization the client belongs to
|
|
9
|
+
* @param {string} [args.tenantId] - The tenant ID representing the specific Sitecore environment
|
|
10
|
+
* @param {string} [args.audience] - The API audience the token is intended for. Defaults to `constants.DEFAULT_SITECORE_AUTH_AUDIENCE`
|
|
11
|
+
* @param {string} [args.authority] - The auth server base URL. Defaults to `constants.DEFAULT_SITECORE_AUTH_DOMAIN`
|
|
12
|
+
* @param {string} [args.baseUrl] - The base URL for the API, used to construct the audience. Defaults to `constants.DEFAULT_SITECORE_AUTH_BASE_URL`
|
|
13
|
+
* @returns A Promise that resolves to the access token response (including access token, token type, expiry, etc.)
|
|
14
|
+
* @throws Will log and exit the process if the request fails or returns a non-OK status
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare let clientCredentialsFlow: typeof _clientCredentialsFlow;
|
|
18
|
+
export declare const unitMocks: {
|
|
19
|
+
clientCredentialsFlow: typeof _clientCredentialsFlow;
|
|
20
|
+
};
|
|
21
|
+
declare function _clientCredentialsFlow({ clientId, clientSecret, organizationId, tenantId, audience, authority, baseUrl, }: TenantArgs): Promise<{
|
|
22
|
+
data: any;
|
|
23
|
+
tokenOrgId: any;
|
|
24
|
+
tokenTenantId: any;
|
|
25
|
+
tokenTenantName: any;
|
|
26
|
+
accessToken: any;
|
|
27
|
+
}>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAUtC;;;;;;;;;;;;;;GAcG;AACH,eAAO,IAAI,qBAAqB,+BAAyB,CAAC;AAK1D,eAAO,MAAM,SAAS;;CAOrB,CAAC;AAEF,iBAAe,sBAAsB,CAAC,EACpC,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,QAAyC,EACzC,SAAwC,EACxC,OAAwC,GACzC,EAAE,UAAU;;;;;;GAwCZ"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { clientCredentialsFlow } from './flow';
|
|
1
|
+
export { clientCredentialsFlow } from './flow';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI arguments used for authentication and tenant identification.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
/**
|
|
2
|
+
* CLI arguments used for authentication and tenant identification.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface TenantArgs {
|
|
6
|
+
/**
|
|
7
|
+
* OAuth2 client ID used to identify the application
|
|
8
|
+
*/
|
|
9
|
+
clientId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Client secret used for client credentials flow
|
|
12
|
+
*/
|
|
13
|
+
clientSecret?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Organization ID associated with the tenant
|
|
16
|
+
*/
|
|
17
|
+
organizationId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Tenant ID used for scoping the login
|
|
20
|
+
*/
|
|
21
|
+
tenantId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* OAuth2 audience (e.g., API base URL the token is intended for)
|
|
24
|
+
*/
|
|
25
|
+
audience?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Auth authority/issuer URL (e.g., Sitecore identity endpoint)
|
|
28
|
+
*/
|
|
29
|
+
authority?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Base URL for the target Sitecore Content Management API
|
|
32
|
+
*/
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decodes a JWT without verifying its signature.
|
|
3
|
-
* @param {string} token - The access token string.
|
|
4
|
-
* @returns Decoded payload object or null if invalid.
|
|
5
|
-
*/
|
|
6
|
-
export declare let decodeJwtPayload: typeof _decodeJwtPayload;
|
|
7
|
-
export declare const unitMocks: {
|
|
8
|
-
decodeJwtPayload: typeof _decodeJwtPayload;
|
|
9
|
-
};
|
|
10
|
-
declare function _decodeJwtPayload(token: string): Record<string, any> | null;
|
|
11
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Decodes a JWT without verifying its signature.
|
|
3
|
+
* @param {string} token - The access token string.
|
|
4
|
+
* @returns Decoded payload object or null if invalid.
|
|
5
|
+
*/
|
|
6
|
+
export declare let decodeJwtPayload: typeof _decodeJwtPayload;
|
|
7
|
+
export declare const unitMocks: {
|
|
8
|
+
decodeJwtPayload: typeof _decodeJwtPayload;
|
|
9
|
+
};
|
|
10
|
+
declare function _decodeJwtPayload(token: string): Record<string, any> | null;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=tenant-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-store.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/tenant-store.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,IAAI,gBAAgB,0BAAoB,CAAC;AAKhD,eAAO,MAAM,SAAS;;CAOrB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAcpE"}
|