@commercetools-frontend/application-shell 21.0.0-rc.1 → 21.0.0-rc.3
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 +1 -1
- package/dist/{application-entry-point-43e5d2d3.esm.js → application-entry-point-4ef2cd89.esm.js} +67 -23
- package/dist/{application-entry-point-58093e24.cjs.dev.js → application-entry-point-684d30f1.cjs.dev.js} +85 -41
- package/dist/{application-entry-point-b89a7e84.cjs.prod.js → application-entry-point-aeb8ef57.cjs.prod.js} +76 -41
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +7 -7
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +7 -7
- package/dist/commercetools-frontend-application-shell.esm.js +5 -5
- package/dist/declarations/src/components/application-entry-point/application-entry-point.d.ts +1 -0
- package/dist/declarations/src/components/application-shell/application-shell.d.ts +1 -0
- package/dist/declarations/src/components/application-shell-provider/use-coerced-environment-values.d.ts +1 -1
- package/dist/declarations/src/components/project-container/project-container.d.ts +1 -0
- package/dist/declarations/src/test-utils/test-utils.d.ts +2 -1
- package/dist/formatters-1c23c0a9.esm.js +93 -0
- package/dist/{oidc-7e7761de.cjs.dev.js → formatters-a5bb12eb.cjs.prod.js} +52 -38
- package/dist/{oidc-be09bd90.cjs.prod.js → formatters-e4b9b9dc.cjs.dev.js} +52 -38
- package/dist/{index-3a993fb5.cjs.dev.js → index-20accc34.cjs.dev.js} +60 -56
- package/dist/{index-a0f21c48.esm.js → index-2ed9e466.esm.js} +21 -17
- package/dist/{index-e270df38.cjs.prod.js → index-7a56bcf7.cjs.prod.js} +51 -49
- package/dist/oidc-0f5f3c40.esm.js +39 -0
- package/dist/oidc-96d1b0dd.cjs.dev.js +46 -0
- package/dist/oidc-f15b3576.cjs.prod.js +46 -0
- package/dist/{project-expired-a0171912.cjs.prod.js → project-expired-23986e27.cjs.prod.js} +8 -8
- package/dist/{project-expired-e68a5ca7.esm.js → project-expired-636492de.esm.js} +8 -8
- package/dist/{project-expired-1482bfa9.cjs.dev.js → project-expired-bf97d316.cjs.dev.js} +8 -8
- package/dist/{project-not-found-f34fa3de.cjs.dev.js → project-not-found-9cd66e2e.cjs.dev.js} +8 -8
- package/dist/{project-not-found-007518e8.cjs.prod.js → project-not-found-aed705a5.cjs.prod.js} +8 -8
- package/dist/{project-not-found-9c7c1af4.esm.js → project-not-found-f683495d.esm.js} +8 -8
- package/dist/{project-not-initialized-cdb93a84.esm.js → project-not-initialized-0dd0af36.esm.js} +8 -8
- package/dist/{project-not-initialized-70fd56de.cjs.prod.js → project-not-initialized-64d7c6c4.cjs.prod.js} +8 -8
- package/dist/{project-not-initialized-7d2cbb3c.cjs.dev.js → project-not-initialized-74b1d4f0.cjs.dev.js} +8 -8
- package/dist/{project-suspended-de520a33.esm.js → project-suspended-8613f5b0.esm.js} +8 -8
- package/dist/{project-suspended-9ec4ac13.cjs.prod.js → project-suspended-cbd838b6.cjs.prod.js} +8 -8
- package/dist/{project-suspended-01aa362c.cjs.dev.js → project-suspended-e25053f6.cjs.dev.js} +8 -8
- package/dist/{quick-access-eb5a65a4.cjs.dev.js → quick-access-099595d5.cjs.dev.js} +5 -5
- package/dist/{quick-access-72feb162.cjs.prod.js → quick-access-160ee728.cjs.prod.js} +5 -5
- package/dist/{quick-access-fb587f16.esm.js → quick-access-4ddb0aad.esm.js} +5 -5
- package/dist/{service-page-project-switcher-b5b1f738.cjs.prod.js → service-page-project-switcher-91dc2d6b.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-f0404bf1.esm.js → service-page-project-switcher-95af2b70.esm.js} +1 -1
- package/dist/{service-page-project-switcher-e4971c9c.cjs.dev.js → service-page-project-switcher-f4d306ff.cjs.dev.js} +1 -1
- package/package.json +12 -12
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +4 -4
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +4 -4
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -2
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +9 -5
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +9 -5
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +9 -5
- package/dist/constants-33a16227.esm.js +0 -46
- package/dist/constants-745aeeca.cjs.prod.js +0 -54
- package/dist/constants-fdbe0e9d.cjs.dev.js +0 -54
- package/dist/oidc-8e05c00e.esm.js +0 -84
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var SUPPORTED_HEADERS = {
|
|
4
|
-
ACCEPT_VERSION: 'Accept-version',
|
|
5
|
-
AUTHORIZATION: 'Authorization',
|
|
6
|
-
X_APPLICATION_ID: 'X-Application-Id',
|
|
7
|
-
X_CORRELATION_ID: 'X-Correlation-Id',
|
|
8
|
-
X_FEATURE_FLAG: 'X-Feature-Flag',
|
|
9
|
-
X_FORWARD_TO: 'X-Forward-To',
|
|
10
|
-
X_GRAPHQL_TARGET: 'X-Graphql-Target',
|
|
11
|
-
X_GRAPHQL_OPERATION_NAME: 'X-Graphql-Operation-Name',
|
|
12
|
-
X_PROJECT_KEY: 'X-Project-Key',
|
|
13
|
-
X_TEAM_ID: 'X-Team-Id',
|
|
14
|
-
X_TOKEN_RETRY: 'X-Force-Token'
|
|
15
|
-
};
|
|
16
|
-
var CONTAINERS = {
|
|
17
|
-
LOCALE_SWITCHER: 'locale-switcher-container'
|
|
18
|
-
};
|
|
19
|
-
var STORAGE_KEYS = {
|
|
20
|
-
NONCE: 'nonce',
|
|
21
|
-
IS_AUTHENTICATED: 'isAuthenticated',
|
|
22
|
-
SESSION_TOKEN: 'sessionToken',
|
|
23
|
-
SESSION_SCOPE: 'sessionScope',
|
|
24
|
-
ACTIVE_PROJECT_KEY: 'activeProjectKey',
|
|
25
|
-
ACTIVE_TEAM_ID: 'activeTeamId',
|
|
26
|
-
SELECTED_DATA_LOCALE: 'selectedDataLocale',
|
|
27
|
-
IS_FORCED_MENU_OPEN: 'isForcedMenuOpen',
|
|
28
|
-
LOGIN_STRATEGY: 'loginStrategy'
|
|
29
|
-
};
|
|
30
|
-
var SUSPENSION_REASONS = {
|
|
31
|
-
TEMPORARY_MAINTENANCE: 'TemporaryMaintenance',
|
|
32
|
-
PAYMENT: 'Payment',
|
|
33
|
-
OTHER: 'Other'
|
|
34
|
-
}; // SSO
|
|
35
|
-
var LOGIN_STRATEGY_OIDC = 'oidc';
|
|
36
|
-
|
|
37
|
-
var OIDC_RESPONSE_TYPES = {
|
|
38
|
-
ID_TOKEN: 'id_token'
|
|
39
|
-
};
|
|
40
|
-
var OIDC_CLAIMS = {
|
|
41
|
-
OPEN_ID: 'openid',
|
|
42
|
-
PROJECT_KEY: 'project_key',
|
|
43
|
-
TEAM_ID: 'team_id',
|
|
44
|
-
VIEW: 'view',
|
|
45
|
-
MANAGE: 'manage'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.CONTAINERS = CONTAINERS;
|
|
49
|
-
exports.LOGIN_STRATEGY_OIDC = LOGIN_STRATEGY_OIDC;
|
|
50
|
-
exports.OIDC_CLAIMS = OIDC_CLAIMS;
|
|
51
|
-
exports.OIDC_RESPONSE_TYPES = OIDC_RESPONSE_TYPES;
|
|
52
|
-
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
53
|
-
exports.SUPPORTED_HEADERS = SUPPORTED_HEADERS;
|
|
54
|
-
exports.SUSPENSION_REASONS = SUSPENSION_REASONS;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
2
|
-
import upperFirst from 'lodash/upperFirst';
|
|
3
|
-
import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
|
|
4
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
5
|
-
import { O as OIDC_CLAIMS } from './constants-33a16227.esm.js';
|
|
6
|
-
|
|
7
|
-
// removing special characters except underscore.
|
|
8
|
-
// It makes the first character of the string and the next character after a special character an uppercase.
|
|
9
|
-
// It replaces hyphen(-) with a forward slash(/) if the hyphen(-) is followed by a number.
|
|
10
|
-
// Examples:
|
|
11
|
-
// input: foo-bar result: FooBar
|
|
12
|
-
// input: foo_bar result: Foo_Bar
|
|
13
|
-
// input: foo-1bar result: Foo/1bar
|
|
14
|
-
|
|
15
|
-
var formatEntryPointUriPathToResourceAccessKey = function formatEntryPointUriPathToResourceAccessKey(entryPointUriPath) {
|
|
16
|
-
var _context, _context2;
|
|
17
|
-
|
|
18
|
-
return _mapInstanceProperty(_context = _mapInstanceProperty(_context2 = entryPointUriPath //Splits the string by underscore.
|
|
19
|
-
.split('_') // Uppercase the first character of each word split.
|
|
20
|
-
).call(_context2, function (word) {
|
|
21
|
-
return upperFirst(word);
|
|
22
|
-
}) // Join the words by an underscore.
|
|
23
|
-
.join('_') // Each word is split by a hyphen.
|
|
24
|
-
.split('-')).call(_context, function (word, i) {
|
|
25
|
-
// Regex below checking if the character is numeric.
|
|
26
|
-
// If the word after the hyphen is numeric, replace the hyphen with a forward slash.
|
|
27
|
-
// If not, omit the hyphen and uppercase the first character
|
|
28
|
-
if (i > 0 && /^-?\d+$/.test(word[0])) {
|
|
29
|
-
return '/' + word;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return upperFirst(word);
|
|
33
|
-
}).join('');
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var entryPointUriPathToResourceAccesses = function entryPointUriPathToResourceAccesses(entryPointUriPath) {
|
|
37
|
-
var convertedEntryPointUriPath = formatEntryPointUriPathToResourceAccessKey(entryPointUriPath);
|
|
38
|
-
return {
|
|
39
|
-
view: "view".concat(convertedEntryPointUriPath),
|
|
40
|
-
manage: "manage".concat(convertedEntryPointUriPath)
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
var entryPointUriPathToPermissionKeys = function entryPointUriPathToPermissionKeys(entryPointUriPath) {
|
|
44
|
-
var resourceAccesses = entryPointUriPathToResourceAccesses(entryPointUriPath);
|
|
45
|
-
return {
|
|
46
|
-
View: upperFirst(resourceAccesses.view),
|
|
47
|
-
Manage: upperFirst(resourceAccesses.manage)
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
var buildOidcScope = function buildOidcScope(options) {
|
|
52
|
-
var _context7;
|
|
53
|
-
|
|
54
|
-
var claims = [];
|
|
55
|
-
|
|
56
|
-
if (options.projectKey) {
|
|
57
|
-
var _context, _context2, _options$oAuthScopes$, _options$oAuthScopes, _context4, _options$oAuthScopes$2, _options$oAuthScopes2;
|
|
58
|
-
|
|
59
|
-
claims.push(_concatInstanceProperty(_context = "".concat(OIDC_CLAIMS.PROJECT_KEY, ":")).call(_context, options.projectKey));
|
|
60
|
-
claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty(_context2 = (_options$oAuthScopes$ = (_options$oAuthScopes = options.oAuthScopes) === null || _options$oAuthScopes === void 0 ? void 0 : _options$oAuthScopes.view) !== null && _options$oAuthScopes$ !== void 0 ? _options$oAuthScopes$ : []).call(_context2, function (scope) {
|
|
61
|
-
var _context3;
|
|
62
|
-
|
|
63
|
-
return _concatInstanceProperty(_context3 = "".concat(OIDC_CLAIMS.VIEW, ":")).call(_context3, scope);
|
|
64
|
-
})));
|
|
65
|
-
claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty(_context4 = (_options$oAuthScopes$2 = (_options$oAuthScopes2 = options.oAuthScopes) === null || _options$oAuthScopes2 === void 0 ? void 0 : _options$oAuthScopes2.manage) !== null && _options$oAuthScopes$2 !== void 0 ? _options$oAuthScopes$2 : []).call(_context4, function (scope) {
|
|
66
|
-
var _context5;
|
|
67
|
-
|
|
68
|
-
return _concatInstanceProperty(_context5 = "".concat(OIDC_CLAIMS.MANAGE, ":")).call(_context5, scope);
|
|
69
|
-
})));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var teamId = options.teamId;
|
|
73
|
-
|
|
74
|
-
if (teamId) {
|
|
75
|
-
var _context6;
|
|
76
|
-
|
|
77
|
-
claims.push(_concatInstanceProperty(_context6 = "".concat(OIDC_CLAIMS.TEAM_ID, ":")).call(_context6, teamId));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return _concatInstanceProperty(_context7 = [// This is required as per OIDC spec.
|
|
81
|
-
OIDC_CLAIMS.OPEN_ID]).call(_context7, claims).join(' ');
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export { entryPointUriPathToResourceAccesses as a, buildOidcScope as b, entryPointUriPathToPermissionKeys as e };
|