@commercetools-frontend/application-shell 21.0.0-rc.0 → 21.0.0-rc.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/README.md +1 -1
- package/dist/{application-entry-point-b627328b.cjs.prod.js → application-entry-point-6a59e2c4.cjs.prod.js} +76 -41
- package/dist/{application-entry-point-c737344a.esm.js → application-entry-point-e2fd4f25.esm.js} +67 -23
- package/dist/{application-entry-point-a804b3d4.cjs.dev.js → application-entry-point-fdaa0c63.cjs.dev.js} +85 -41
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +7 -8
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +7 -8
- package/dist/commercetools-frontend-application-shell.esm.js +5 -6
- 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 +2 -1
- 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-603b598e.cjs.dev.js → index-25695804.cjs.dev.js} +67 -62
- package/dist/{index-64ee0fb3.cjs.prod.js → index-7199f587.cjs.prod.js} +57 -54
- package/dist/{index-9e98c47d.esm.js → index-fdebc39f.esm.js} +28 -23
- package/dist/oidc-cb5c92bd.esm.js +39 -0
- package/dist/oidc-d5829556.cjs.prod.js +46 -0
- package/dist/oidc-f43cd8da.cjs.dev.js +46 -0
- package/dist/{project-expired-69a9f8bb.cjs.dev.js → project-expired-663949c6.cjs.dev.js} +8 -9
- package/dist/{project-expired-40e3fc90.cjs.prod.js → project-expired-b6b7b868.cjs.prod.js} +8 -9
- package/dist/{project-expired-374d89b7.esm.js → project-expired-bc2dd11d.esm.js} +8 -9
- package/dist/{project-not-found-516009ae.esm.js → project-not-found-34a53bbf.esm.js} +8 -9
- package/dist/{project-not-found-883f0dc8.cjs.dev.js → project-not-found-55f5b3f9.cjs.prod.js} +8 -9
- package/dist/{project-not-found-1456109d.cjs.prod.js → project-not-found-8855ea12.cjs.dev.js} +8 -9
- package/dist/{project-not-initialized-b9ae0d13.esm.js → project-not-initialized-144cdc9f.esm.js} +8 -9
- package/dist/{project-not-initialized-a5df8c78.cjs.dev.js → project-not-initialized-76e84997.cjs.dev.js} +8 -9
- package/dist/{project-not-initialized-5ca81ae8.cjs.prod.js → project-not-initialized-c1d7d868.cjs.prod.js} +8 -9
- package/dist/{project-suspended-40039731.cjs.dev.js → project-suspended-6c1a8081.cjs.prod.js} +8 -9
- package/dist/{project-suspended-fc33a971.esm.js → project-suspended-908e50e3.esm.js} +8 -9
- package/dist/{project-suspended-8ed251b2.cjs.prod.js → project-suspended-dec52392.cjs.dev.js} +8 -9
- package/dist/{quick-access-c5fdf402.cjs.dev.js → quick-access-99232516.cjs.dev.js} +5 -6
- package/dist/{quick-access-e436397a.cjs.prod.js → quick-access-e91dcf86.cjs.prod.js} +5 -6
- package/dist/{quick-access-62077068.esm.js → quick-access-fec42a16.esm.js} +5 -6
- package/dist/{service-page-project-switcher-83de4c79.cjs.prod.js → service-page-project-switcher-92c227cb.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-02903d80.cjs.dev.js → service-page-project-switcher-a3c48bb9.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-1ebc3f88.esm.js → service-page-project-switcher-edb4667c.esm.js} +1 -1
- package/package.json +18 -18
- 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
|
@@ -35,7 +35,7 @@ var applicationShellConnectors = require('@commercetools-frontend/application-sh
|
|
|
35
35
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
36
36
|
var constants = require('@commercetools-frontend/constants');
|
|
37
37
|
var testUtils = require('@commercetools-frontend/sdk/test-utils');
|
|
38
|
-
var applicationEntryPoint = require('../../dist/application-entry-point-
|
|
38
|
+
var applicationEntryPoint = require('../../dist/application-entry-point-6a59e2c4.cjs.prod.js');
|
|
39
39
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
40
40
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
41
41
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
@@ -46,7 +46,8 @@ require('redux-thunk');
|
|
|
46
46
|
require('omit-empty-es');
|
|
47
47
|
require('@commercetools-frontend/notifications');
|
|
48
48
|
require('@commercetools-frontend/sdk');
|
|
49
|
-
require('../../dist/
|
|
49
|
+
require('../../dist/formatters-a5bb12eb.cjs.prod.js');
|
|
50
|
+
require('lodash/upperFirst');
|
|
50
51
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
51
52
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
52
53
|
require('redux-logger');
|
|
@@ -56,7 +57,6 @@ require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
|
56
57
|
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
57
58
|
require('@commercetools-frontend/sentry');
|
|
58
59
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
59
|
-
require('lodash/upperFirst');
|
|
60
60
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
61
61
|
require('@apollo/client');
|
|
62
62
|
require('@commercetools/http-user-agent');
|
|
@@ -71,6 +71,7 @@ require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
|
71
71
|
require('uuid');
|
|
72
72
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
73
73
|
require('@apollo/client/link/retry');
|
|
74
|
+
require('@commercetools-frontend/permissions');
|
|
74
75
|
require('@commercetools-frontend/application-components');
|
|
75
76
|
|
|
76
77
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -312,6 +313,10 @@ ApolloProviderWrapper.propTypes = {};
|
|
|
312
313
|
|
|
313
314
|
function createApplicationProviders() {
|
|
314
315
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
316
|
+
_ref$disableAutomatic = _ref.disableAutomaticEntryPointRoutes,
|
|
317
|
+
disableAutomaticEntryPointRoutes = _ref$disableAutomatic === void 0 ? false : _ref$disableAutomatic,
|
|
318
|
+
_ref$disableRoutePerm = _ref.disableRoutePermissionCheck,
|
|
319
|
+
disableRoutePermissionCheck = _ref$disableRoutePerm === void 0 ? false : _ref$disableRoutePerm,
|
|
315
320
|
_ref$locale = _ref.locale,
|
|
316
321
|
locale = _ref$locale === void 0 ? 'en' : _ref$locale,
|
|
317
322
|
_ref$mocks = _ref.mocks,
|
|
@@ -320,8 +325,6 @@ function createApplicationProviders() {
|
|
|
320
325
|
_ref$enableApolloMock = _ref.enableApolloMocks,
|
|
321
326
|
enableApolloMocks = _ref$enableApolloMock === void 0 ? false : _ref$enableApolloMock,
|
|
322
327
|
route = _ref.route,
|
|
323
|
-
_ref$disableAutomatic = _ref.disableAutomaticEntryPointRoutes,
|
|
324
|
-
disableAutomaticEntryPointRoutes = _ref$disableAutomatic === void 0 ? false : _ref$disableAutomatic,
|
|
325
328
|
history$2 = _ref.history,
|
|
326
329
|
_ref$flags = _flagsInstanceProperty__default["default"](_ref),
|
|
327
330
|
flags = _ref$flags === void 0 ? {} : _ref$flags,
|
|
@@ -368,6 +371,7 @@ function createApplicationProviders() {
|
|
|
368
371
|
fallback: jsxRuntime.jsx(LoadingFallback, {}),
|
|
369
372
|
children: jsxRuntime.jsx(applicationEntryPoint.ApplicationEntryPoint, {
|
|
370
373
|
environment: mergedEnvironment,
|
|
374
|
+
disableRoutePermissionCheck: disableRoutePermissionCheck,
|
|
371
375
|
render: disableAutomaticEntryPointRoutes ? // eslint-disable-next-line testing-library/no-node-access
|
|
372
376
|
function () {
|
|
373
377
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -32,7 +32,7 @@ import { ApplicationContextProvider } from '@commercetools-frontend/application-
|
|
|
32
32
|
import { NotificationProviderForCustomComponent, NotificationsList } from '@commercetools-frontend/react-notifications';
|
|
33
33
|
import { DOMAINS } from '@commercetools-frontend/constants';
|
|
34
34
|
import { createTestMiddleware } from '@commercetools-frontend/sdk/test-utils';
|
|
35
|
-
import { A as ApplicationEntryPoint, w as createReduxStore, f as createApolloClient } from '../../dist/application-entry-point-
|
|
35
|
+
import { A as ApplicationEntryPoint, w as createReduxStore, f as createApolloClient } from '../../dist/application-entry-point-e2fd4f25.esm.js';
|
|
36
36
|
import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
|
|
37
37
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
38
38
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
@@ -43,7 +43,8 @@ import 'redux-thunk';
|
|
|
43
43
|
import 'omit-empty-es';
|
|
44
44
|
import '@commercetools-frontend/notifications';
|
|
45
45
|
import '@commercetools-frontend/sdk';
|
|
46
|
-
import '../../dist/
|
|
46
|
+
import '../../dist/formatters-1c23c0a9.esm.js';
|
|
47
|
+
import 'lodash/upperFirst';
|
|
47
48
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
48
49
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
49
50
|
import 'redux-logger';
|
|
@@ -53,7 +54,6 @@ import '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
|
53
54
|
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
54
55
|
import '@commercetools-frontend/sentry';
|
|
55
56
|
import '@babel/runtime-corejs3/core-js-stable/url';
|
|
56
|
-
import 'lodash/upperFirst';
|
|
57
57
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
58
58
|
import '@apollo/client';
|
|
59
59
|
import '@commercetools/http-user-agent';
|
|
@@ -68,6 +68,7 @@ import '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
|
68
68
|
import 'uuid';
|
|
69
69
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
70
70
|
import '@apollo/client/link/retry';
|
|
71
|
+
import '@commercetools-frontend/permissions';
|
|
71
72
|
import '@commercetools-frontend/application-components';
|
|
72
73
|
|
|
73
74
|
var _excluded = ["children"],
|
|
@@ -277,6 +278,10 @@ ApolloProviderWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
277
278
|
|
|
278
279
|
function createApplicationProviders() {
|
|
279
280
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
281
|
+
_ref$disableAutomatic = _ref.disableAutomaticEntryPointRoutes,
|
|
282
|
+
disableAutomaticEntryPointRoutes = _ref$disableAutomatic === void 0 ? false : _ref$disableAutomatic,
|
|
283
|
+
_ref$disableRoutePerm = _ref.disableRoutePermissionCheck,
|
|
284
|
+
disableRoutePermissionCheck = _ref$disableRoutePerm === void 0 ? false : _ref$disableRoutePerm,
|
|
280
285
|
_ref$locale = _ref.locale,
|
|
281
286
|
locale = _ref$locale === void 0 ? 'en' : _ref$locale,
|
|
282
287
|
_ref$mocks = _ref.mocks,
|
|
@@ -285,8 +290,6 @@ function createApplicationProviders() {
|
|
|
285
290
|
_ref$enableApolloMock = _ref.enableApolloMocks,
|
|
286
291
|
enableApolloMocks = _ref$enableApolloMock === void 0 ? false : _ref$enableApolloMock,
|
|
287
292
|
route = _ref.route,
|
|
288
|
-
_ref$disableAutomatic = _ref.disableAutomaticEntryPointRoutes,
|
|
289
|
-
disableAutomaticEntryPointRoutes = _ref$disableAutomatic === void 0 ? false : _ref$disableAutomatic,
|
|
290
293
|
history = _ref.history,
|
|
291
294
|
_ref$flags = _flagsInstanceProperty(_ref),
|
|
292
295
|
flags = _ref$flags === void 0 ? {} : _ref$flags,
|
|
@@ -333,6 +336,7 @@ function createApplicationProviders() {
|
|
|
333
336
|
fallback: jsx(LoadingFallback, {}),
|
|
334
337
|
children: jsx(ApplicationEntryPoint, {
|
|
335
338
|
environment: mergedEnvironment,
|
|
339
|
+
disableRoutePermissionCheck: disableRoutePermissionCheck,
|
|
336
340
|
render: disableAutomaticEntryPointRoutes ? // eslint-disable-next-line testing-library/no-node-access
|
|
337
341
|
function () {
|
|
338
342
|
return jsx(Fragment, {
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var SUPPORTED_HEADERS = {
|
|
2
|
-
ACCEPT_VERSION: 'Accept-version',
|
|
3
|
-
AUTHORIZATION: 'Authorization',
|
|
4
|
-
X_APPLICATION_ID: 'X-Application-Id',
|
|
5
|
-
X_CORRELATION_ID: 'X-Correlation-Id',
|
|
6
|
-
X_FEATURE_FLAG: 'X-Feature-Flag',
|
|
7
|
-
X_FORWARD_TO: 'X-Forward-To',
|
|
8
|
-
X_GRAPHQL_TARGET: 'X-Graphql-Target',
|
|
9
|
-
X_GRAPHQL_OPERATION_NAME: 'X-Graphql-Operation-Name',
|
|
10
|
-
X_PROJECT_KEY: 'X-Project-Key',
|
|
11
|
-
X_TEAM_ID: 'X-Team-Id',
|
|
12
|
-
X_TOKEN_RETRY: 'X-Force-Token'
|
|
13
|
-
};
|
|
14
|
-
var CONTAINERS = {
|
|
15
|
-
LOCALE_SWITCHER: 'locale-switcher-container'
|
|
16
|
-
};
|
|
17
|
-
var STORAGE_KEYS = {
|
|
18
|
-
NONCE: 'nonce',
|
|
19
|
-
IS_AUTHENTICATED: 'isAuthenticated',
|
|
20
|
-
SESSION_TOKEN: 'sessionToken',
|
|
21
|
-
SESSION_SCOPE: 'sessionScope',
|
|
22
|
-
ACTIVE_PROJECT_KEY: 'activeProjectKey',
|
|
23
|
-
ACTIVE_TEAM_ID: 'activeTeamId',
|
|
24
|
-
SELECTED_DATA_LOCALE: 'selectedDataLocale',
|
|
25
|
-
IS_FORCED_MENU_OPEN: 'isForcedMenuOpen',
|
|
26
|
-
LOGIN_STRATEGY: 'loginStrategy'
|
|
27
|
-
};
|
|
28
|
-
var SUSPENSION_REASONS = {
|
|
29
|
-
TEMPORARY_MAINTENANCE: 'TemporaryMaintenance',
|
|
30
|
-
PAYMENT: 'Payment',
|
|
31
|
-
OTHER: 'Other'
|
|
32
|
-
}; // SSO
|
|
33
|
-
var LOGIN_STRATEGY_OIDC = 'oidc';
|
|
34
|
-
|
|
35
|
-
var OIDC_RESPONSE_TYPES = {
|
|
36
|
-
ID_TOKEN: 'id_token'
|
|
37
|
-
};
|
|
38
|
-
var OIDC_CLAIMS = {
|
|
39
|
-
OPEN_ID: 'openid',
|
|
40
|
-
PROJECT_KEY: 'project_key',
|
|
41
|
-
TEAM_ID: 'team_id',
|
|
42
|
-
VIEW: 'view',
|
|
43
|
-
MANAGE: 'manage'
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { CONTAINERS as C, LOGIN_STRATEGY_OIDC as L, OIDC_CLAIMS as O, STORAGE_KEYS as S, SUSPENSION_REASONS as a, OIDC_RESPONSE_TYPES as b, SUPPORTED_HEADERS as c };
|
|
@@ -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,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 };
|