@lwrjs/shared-utils 0.6.1 → 0.6.5
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/build/cjs/identity.cjs +5 -5
- package/build/cjs/urls.cjs +5 -5
- package/build/es/identity.d.ts +2 -2
- package/build/es/identity.js +5 -5
- package/build/es/urls.d.ts +2 -2
- package/build/es/urls.js +5 -5
- package/package.json +4 -5
- package/LICENSE +0 -10
package/build/cjs/identity.cjs
CHANGED
|
@@ -184,18 +184,18 @@ function slugify(name) {
|
|
|
184
184
|
lower: true
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
function getModuleUriPrefix({apiVersion, bundle, format, compat}, {locale, environment} = {}) {
|
|
187
|
+
function getModuleUriPrefix({apiVersion, bundle, format, compat, basePath}, {locale, environment} = {}) {
|
|
188
188
|
const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : "";
|
|
189
189
|
const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : "";
|
|
190
190
|
if (bundle) {
|
|
191
|
-
return
|
|
191
|
+
return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/bi/0/module/mi/`;
|
|
192
192
|
} else {
|
|
193
|
-
return
|
|
193
|
+
return `${basePath}/${apiVersion}/module/${format}/${compat}${localePart}${environmentPart}/mi/`;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function getMappingUriPrefix({apiVersion, format, compat}, {locale} = {}) {
|
|
196
|
+
function getMappingUriPrefix({apiVersion, format, compat, basePath}, {locale} = {}) {
|
|
197
197
|
const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : "";
|
|
198
|
-
return
|
|
198
|
+
return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}/mp/`;
|
|
199
199
|
}
|
|
200
200
|
var REGEX_URL_SCHEMA_PREFIX = /^(https?|\/\/)/;
|
|
201
201
|
function isExternalUrl(url) {
|
package/build/cjs/urls.cjs
CHANGED
|
@@ -40,18 +40,18 @@ function getClientBootstrapConfigurationUri(routeInfo, runtimeEnvironment, runti
|
|
|
40
40
|
return `${configUrlPrefix}/${encodeUrl}${signatureSegment}${CONFIG_SUFFIX}`;
|
|
41
41
|
}
|
|
42
42
|
function getClientBootstrapConfigurationUriPrefix(routeInfo, runtimeEnvironment, runtimeParams) {
|
|
43
|
-
const {apiVersion, format} = runtimeEnvironment;
|
|
43
|
+
const {apiVersion, format, basePath} = runtimeEnvironment;
|
|
44
44
|
const {id} = routeInfo;
|
|
45
45
|
const locale = runtimeParams?.locale;
|
|
46
46
|
const environment = runtimeParams?.environment;
|
|
47
47
|
if (locale && environment) {
|
|
48
|
-
return
|
|
48
|
+
return `${basePath}/${apiVersion}/application/${format}/l/${locale}/e/${environment}/ai/${id}/configuration/ci`;
|
|
49
49
|
} else if (locale) {
|
|
50
|
-
return
|
|
50
|
+
return `${basePath}/${apiVersion}/application/${format}/l/${locale}/ai/${id}/configuration/ci`;
|
|
51
51
|
} else if (environment) {
|
|
52
|
-
return
|
|
52
|
+
return `${basePath}/${apiVersion}/application/${format}/e/${environment}/ai/${id}/configuration/ci`;
|
|
53
53
|
} else {
|
|
54
|
-
return
|
|
54
|
+
return `${basePath}/${apiVersion}/application/${format}/ai/${id}/configuration/ci`;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function removeClientBootstrapConfigurationSuffix(url) {
|
package/build/es/identity.d.ts
CHANGED
|
@@ -148,13 +148,13 @@ export declare function slugify(name: string): string;
|
|
|
148
148
|
* @param param0 - URI props from the Runtime Environment
|
|
149
149
|
* @param param1 - URI props from the Runtime Params
|
|
150
150
|
*/
|
|
151
|
-
export declare function getModuleUriPrefix({ apiVersion, bundle, format, compat }: RuntimeEnvironment, { locale, environment }?: RuntimeParams): string;
|
|
151
|
+
export declare function getModuleUriPrefix({ apiVersion, bundle, format, compat, basePath }: RuntimeEnvironment, { locale, environment }?: RuntimeParams): string;
|
|
152
152
|
/**
|
|
153
153
|
* Create a URI Mapping API URI prefix, stopping where the specifiers would be (at "mp/")
|
|
154
154
|
* @param param0 - URI props from the Runtime Environment
|
|
155
155
|
* @param param1 - URI props from the Runtime Params
|
|
156
156
|
*/
|
|
157
|
-
export declare function getMappingUriPrefix({ apiVersion, format, compat }: RuntimeEnvironment, { locale }?: RuntimeParams): string;
|
|
157
|
+
export declare function getMappingUriPrefix({ apiVersion, format, compat, basePath }: RuntimeEnvironment, { locale }?: RuntimeParams): string;
|
|
158
158
|
export { getCacheKeyFromJson };
|
|
159
159
|
export declare function isExternalUrl(url: string): boolean;
|
|
160
160
|
export declare function isBundleDefinition(definition: ModuleDefinition | BundleDefinition): definition is BundleDefinition;
|
package/build/es/identity.js
CHANGED
|
@@ -240,14 +240,14 @@ export function slugify(name) {
|
|
|
240
240
|
* @param param0 - URI props from the Runtime Environment
|
|
241
241
|
* @param param1 - URI props from the Runtime Params
|
|
242
242
|
*/
|
|
243
|
-
export function getModuleUriPrefix({ apiVersion, bundle, format, compat }, { locale, environment } = {}) {
|
|
243
|
+
export function getModuleUriPrefix({ apiVersion, bundle, format, compat, basePath }, { locale, environment } = {}) {
|
|
244
244
|
const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : '';
|
|
245
245
|
const environmentPart = environment ? `/${ENVIRONMENT_SIGIL}/${environment}` : '';
|
|
246
246
|
if (bundle) {
|
|
247
|
-
return
|
|
247
|
+
return `${basePath}/${apiVersion}/bundle/${format}${localePart}${environmentPart}/bi/0/module/mi/`;
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
|
-
return
|
|
250
|
+
return `${basePath}/${apiVersion}/module/${format}/${compat}${localePart}${environmentPart}/mi/`;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
@@ -255,9 +255,9 @@ export function getModuleUriPrefix({ apiVersion, bundle, format, compat }, { loc
|
|
|
255
255
|
* @param param0 - URI props from the Runtime Environment
|
|
256
256
|
* @param param1 - URI props from the Runtime Params
|
|
257
257
|
*/
|
|
258
|
-
export function getMappingUriPrefix({ apiVersion, format, compat }, { locale } = {}) {
|
|
258
|
+
export function getMappingUriPrefix({ apiVersion, format, compat, basePath }, { locale } = {}) {
|
|
259
259
|
const localePart = locale ? `/${LOCALE_SIGIL}/${locale}` : '';
|
|
260
|
-
return
|
|
260
|
+
return `${basePath}/${apiVersion}/mapping/${format}/${compat}${localePart}/mp/`;
|
|
261
261
|
}
|
|
262
262
|
export { getCacheKeyFromJson };
|
|
263
263
|
const REGEX_URL_SCHEMA_PREFIX = /^(https?|\/\/)/;
|
package/build/es/urls.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { RuntimeEnvironment, RuntimeParams } from '@lwrjs/types';
|
|
|
2
2
|
export declare function getClientBootstrapConfigurationUri(routeInfo: {
|
|
3
3
|
id: string;
|
|
4
4
|
url: string;
|
|
5
|
-
}, runtimeEnvironment:
|
|
5
|
+
}, runtimeEnvironment: RuntimeEnvironment, runtimeParams?: RuntimeParams, signature?: string): string;
|
|
6
6
|
export declare function getClientBootstrapConfigurationUriPrefix(routeInfo: {
|
|
7
7
|
id: string;
|
|
8
|
-
}, runtimeEnvironment:
|
|
8
|
+
}, runtimeEnvironment: RuntimeEnvironment, runtimeParams?: RuntimeParams): string;
|
|
9
9
|
/**
|
|
10
10
|
* Remove the suffix from config
|
|
11
11
|
*/
|
package/build/es/urls.js
CHANGED
|
@@ -8,21 +8,21 @@ export function getClientBootstrapConfigurationUri(routeInfo, runtimeEnvironment
|
|
|
8
8
|
return `${configUrlPrefix}/${encodeUrl}${signatureSegment}${CONFIG_SUFFIX}`;
|
|
9
9
|
}
|
|
10
10
|
export function getClientBootstrapConfigurationUriPrefix(routeInfo, runtimeEnvironment, runtimeParams) {
|
|
11
|
-
const { apiVersion, format } = runtimeEnvironment;
|
|
11
|
+
const { apiVersion, format, basePath } = runtimeEnvironment;
|
|
12
12
|
const { id } = routeInfo;
|
|
13
13
|
const locale = runtimeParams?.locale;
|
|
14
14
|
const environment = runtimeParams?.environment;
|
|
15
15
|
if (locale && environment) {
|
|
16
|
-
return
|
|
16
|
+
return `${basePath}/${apiVersion}/application/${format}/l/${locale}/e/${environment}/ai/${id}/configuration/ci`;
|
|
17
17
|
}
|
|
18
18
|
else if (locale) {
|
|
19
|
-
return
|
|
19
|
+
return `${basePath}/${apiVersion}/application/${format}/l/${locale}/ai/${id}/configuration/ci`;
|
|
20
20
|
}
|
|
21
21
|
else if (environment) {
|
|
22
|
-
return
|
|
22
|
+
return `${basePath}/${apiVersion}/application/${format}/e/${environment}/ai/${id}/configuration/ci`;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
-
return
|
|
25
|
+
return `${basePath}/${apiVersion}/application/${format}/ai/${id}/configuration/ci`;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/**
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.6.
|
|
7
|
+
"version": "0.6.5",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,13 +43,12 @@
|
|
|
43
43
|
"slugify": "^1.4.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@lwrjs/diagnostics": "0.6.
|
|
47
|
-
"@lwrjs/types": "0.6.
|
|
46
|
+
"@lwrjs/diagnostics": "0.6.5",
|
|
47
|
+
"@lwrjs/types": "0.6.5",
|
|
48
48
|
"@types/mime-types": "2.1.1",
|
|
49
49
|
"@types/path-to-regexp": "^1.7.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=14.15.4 <17"
|
|
53
|
-
}
|
|
54
|
-
"gitHead": "4d7c44dfae958fe24ef1c94b0f60aa2b15e12f24"
|
|
53
|
+
}
|
|
55
54
|
}
|
package/LICENSE
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
MIT LICENSE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
|
-
|
|
8
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
-
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|