@commercetools-frontend/application-config 27.10.0 → 27.11.1
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/custom-application.schema.json +13 -0
- package/dist/commercetools-frontend-application-config.cjs.dev.js +44 -6
- package/dist/commercetools-frontend-application-config.cjs.prod.js +44 -6
- package/dist/commercetools-frontend-application-config.esm.js +45 -7
- package/dist/declarations/src/formatters.d.ts +2 -0
- package/dist/declarations/src/schemas/generated/custom-application.schema.d.ts +7 -0
- package/dist/{formatters-4515015b.cjs.prod.js → formatters-4e4336e9.cjs.prod.js} +4 -2
- package/dist/{formatters-5a68b5ac.cjs.dev.js → formatters-5bcaf776.cjs.dev.js} +4 -2
- package/dist/{formatters-5629a23b.esm.js → formatters-afa87119.esm.js} +4 -2
- package/package.json +3 -3
- package/ssr/dist/commercetools-frontend-application-config-ssr.cjs.dev.js +1 -1
- package/ssr/dist/commercetools-frontend-application-config-ssr.cjs.prod.js +1 -1
- package/ssr/dist/commercetools-frontend-application-config-ssr.esm.js +1 -1
|
@@ -116,6 +116,19 @@
|
|
|
116
116
|
"description": "Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies",
|
|
117
117
|
"type": "string",
|
|
118
118
|
"enum": ["legacy"]
|
|
119
|
+
},
|
|
120
|
+
"menuGroup": {
|
|
121
|
+
"description": "Optional navbar group header used when rendering menuLinks in local development",
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"label": {
|
|
125
|
+
"type": "string"
|
|
126
|
+
},
|
|
127
|
+
"isNew": {
|
|
128
|
+
"type": "boolean"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"additionalProperties": false
|
|
119
132
|
}
|
|
120
133
|
},
|
|
121
134
|
"additionalProperties": false,
|
|
@@ -37,7 +37,7 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
37
37
|
var path$1 = require('path');
|
|
38
38
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
39
|
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
40
|
-
var formatters = require('./formatters-
|
|
40
|
+
var formatters = require('./formatters-5bcaf776.cjs.dev.js');
|
|
41
41
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
42
42
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
43
43
|
var Ajv = require('ajv');
|
|
@@ -483,6 +483,19 @@ var customApplicationSchemaJson = {
|
|
|
483
483
|
"enum": [
|
|
484
484
|
"legacy"
|
|
485
485
|
]
|
|
486
|
+
},
|
|
487
|
+
menuGroup: {
|
|
488
|
+
description: "Optional navbar group header used when rendering menuLinks in local development",
|
|
489
|
+
type: "object",
|
|
490
|
+
properties: {
|
|
491
|
+
label: {
|
|
492
|
+
type: "string"
|
|
493
|
+
},
|
|
494
|
+
isNew: {
|
|
495
|
+
type: "boolean"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
additionalProperties: false
|
|
486
499
|
}
|
|
487
500
|
},
|
|
488
501
|
additionalProperties: false,
|
|
@@ -1045,9 +1058,33 @@ const validateConfig = (configType, config) => {
|
|
|
1045
1058
|
throw new Error(printErrors(validation.errors));
|
|
1046
1059
|
}
|
|
1047
1060
|
};
|
|
1061
|
+
const ENTRY_POINT_URI_PATH_ERROR_MESSAGE = 'Invalid "entryPointUriPath". The value may be between 2 and 64 characters and only contain alphanumeric lowercase characters, non-consecutive underscores and hyphens. Leading and trailing underscores and hyphens are also not allowed. Values under a project-keyless-in-project-context prefix (e.g. "agent-sphere/registry") must use that prefix followed by a single slash and a valid segment.';
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Resolves the segment that must match `ENTRY_POINT_URI_PATH_REGEX`.
|
|
1065
|
+
* Entry points under `PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT`
|
|
1066
|
+
* may be prefixed (e.g. `agent-sphere/registry`); only the right-hand segment is validated.
|
|
1067
|
+
*/
|
|
1068
|
+
const getEntryPointUriPathSegmentToValidate = entryPointUriPath => {
|
|
1069
|
+
if (!_includesInstanceProperty__default["default"](entryPointUriPath).call(entryPointUriPath, '/')) {
|
|
1070
|
+
return entryPointUriPath;
|
|
1071
|
+
}
|
|
1072
|
+
const segments = entryPointUriPath.split('/');
|
|
1073
|
+
if (segments.length !== 2 || !segments[1]) {
|
|
1074
|
+
return null;
|
|
1075
|
+
}
|
|
1076
|
+
const _segments = _slicedToArray(segments, 2),
|
|
1077
|
+
prefix = _segments[0],
|
|
1078
|
+
rightHandSegment = _segments[1];
|
|
1079
|
+
if (!constants.isProjectKeylessApplicationEntryPointInProjectContext(prefix)) {
|
|
1080
|
+
return null;
|
|
1081
|
+
}
|
|
1082
|
+
return rightHandSegment;
|
|
1083
|
+
};
|
|
1048
1084
|
const validateEntryPointUriPath = config => {
|
|
1049
|
-
|
|
1050
|
-
|
|
1085
|
+
const segmentToValidate = getEntryPointUriPathSegmentToValidate(config.entryPointUriPath);
|
|
1086
|
+
if (!segmentToValidate || !segmentToValidate.match(constants.ENTRY_POINT_URI_PATH_REGEX)) {
|
|
1087
|
+
throw new Error(ENTRY_POINT_URI_PATH_ERROR_MESSAGE);
|
|
1051
1088
|
}
|
|
1052
1089
|
};
|
|
1053
1090
|
const validateSubmenuLinks = config => {
|
|
@@ -1245,10 +1282,10 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1245
1282
|
authorizeUrl: [
|
|
1246
1283
|
// In case the MC API url points to localhost, we need to point
|
|
1247
1284
|
// to a local running dev login page to handle the workflow properly.
|
|
1248
|
-
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'),
|
|
1285
|
+
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'), `/${constants.STATIC_URL_PATHS.LOGIN}/authorize`].join(''),
|
|
1249
1286
|
initialProjectKey:
|
|
1250
|
-
// For
|
|
1251
|
-
entryPointUriPath
|
|
1287
|
+
// For project-keyless applications, we should unset the projectKey.
|
|
1288
|
+
constants.isProjectKeylessApplicationEntryPoint(entryPointUriPath) ? undefined : appConfig.env.development.initialProjectKey
|
|
1252
1289
|
}, appConfig.env.development?.teamId && _objectSpread({
|
|
1253
1290
|
teamId: appConfig.env.development.teamId
|
|
1254
1291
|
}, isCustomViewData(configurationData) ? {
|
|
@@ -1277,6 +1314,7 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1277
1314
|
}, configurationData.mainMenuLink), {}, {
|
|
1278
1315
|
submenuLinks: configurationData.submenuLinks
|
|
1279
1316
|
}),
|
|
1317
|
+
menuGroup: appConfig.env.development.menuGroup,
|
|
1280
1318
|
// @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
|
|
1281
1319
|
accountLinks: appConfig.accountLinks,
|
|
1282
1320
|
mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
|
|
@@ -37,7 +37,7 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
37
37
|
var path$1 = require('path');
|
|
38
38
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
39
|
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
40
|
-
var formatters = require('./formatters-
|
|
40
|
+
var formatters = require('./formatters-4e4336e9.cjs.prod.js');
|
|
41
41
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
42
42
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
43
43
|
var Ajv = require('ajv');
|
|
@@ -483,6 +483,19 @@ var customApplicationSchemaJson = {
|
|
|
483
483
|
"enum": [
|
|
484
484
|
"legacy"
|
|
485
485
|
]
|
|
486
|
+
},
|
|
487
|
+
menuGroup: {
|
|
488
|
+
description: "Optional navbar group header used when rendering menuLinks in local development",
|
|
489
|
+
type: "object",
|
|
490
|
+
properties: {
|
|
491
|
+
label: {
|
|
492
|
+
type: "string"
|
|
493
|
+
},
|
|
494
|
+
isNew: {
|
|
495
|
+
type: "boolean"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
additionalProperties: false
|
|
486
499
|
}
|
|
487
500
|
},
|
|
488
501
|
additionalProperties: false,
|
|
@@ -1045,9 +1058,33 @@ const validateConfig = (configType, config) => {
|
|
|
1045
1058
|
throw new Error(printErrors(validation.errors));
|
|
1046
1059
|
}
|
|
1047
1060
|
};
|
|
1061
|
+
const ENTRY_POINT_URI_PATH_ERROR_MESSAGE = 'Invalid "entryPointUriPath". The value may be between 2 and 64 characters and only contain alphanumeric lowercase characters, non-consecutive underscores and hyphens. Leading and trailing underscores and hyphens are also not allowed. Values under a project-keyless-in-project-context prefix (e.g. "agent-sphere/registry") must use that prefix followed by a single slash and a valid segment.';
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Resolves the segment that must match `ENTRY_POINT_URI_PATH_REGEX`.
|
|
1065
|
+
* Entry points under `PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT`
|
|
1066
|
+
* may be prefixed (e.g. `agent-sphere/registry`); only the right-hand segment is validated.
|
|
1067
|
+
*/
|
|
1068
|
+
const getEntryPointUriPathSegmentToValidate = entryPointUriPath => {
|
|
1069
|
+
if (!_includesInstanceProperty__default["default"](entryPointUriPath).call(entryPointUriPath, '/')) {
|
|
1070
|
+
return entryPointUriPath;
|
|
1071
|
+
}
|
|
1072
|
+
const segments = entryPointUriPath.split('/');
|
|
1073
|
+
if (segments.length !== 2 || !segments[1]) {
|
|
1074
|
+
return null;
|
|
1075
|
+
}
|
|
1076
|
+
const _segments = _slicedToArray(segments, 2),
|
|
1077
|
+
prefix = _segments[0],
|
|
1078
|
+
rightHandSegment = _segments[1];
|
|
1079
|
+
if (!constants.isProjectKeylessApplicationEntryPointInProjectContext(prefix)) {
|
|
1080
|
+
return null;
|
|
1081
|
+
}
|
|
1082
|
+
return rightHandSegment;
|
|
1083
|
+
};
|
|
1048
1084
|
const validateEntryPointUriPath = config => {
|
|
1049
|
-
|
|
1050
|
-
|
|
1085
|
+
const segmentToValidate = getEntryPointUriPathSegmentToValidate(config.entryPointUriPath);
|
|
1086
|
+
if (!segmentToValidate || !segmentToValidate.match(constants.ENTRY_POINT_URI_PATH_REGEX)) {
|
|
1087
|
+
throw new Error(ENTRY_POINT_URI_PATH_ERROR_MESSAGE);
|
|
1051
1088
|
}
|
|
1052
1089
|
};
|
|
1053
1090
|
const validateSubmenuLinks = config => {
|
|
@@ -1245,10 +1282,10 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1245
1282
|
authorizeUrl: [
|
|
1246
1283
|
// In case the MC API url points to localhost, we need to point
|
|
1247
1284
|
// to a local running dev login page to handle the workflow properly.
|
|
1248
|
-
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'),
|
|
1285
|
+
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'), `/${constants.STATIC_URL_PATHS.LOGIN}/authorize`].join(''),
|
|
1249
1286
|
initialProjectKey:
|
|
1250
|
-
// For
|
|
1251
|
-
entryPointUriPath
|
|
1287
|
+
// For project-keyless applications, we should unset the projectKey.
|
|
1288
|
+
constants.isProjectKeylessApplicationEntryPoint(entryPointUriPath) ? undefined : appConfig.env.development.initialProjectKey
|
|
1252
1289
|
}, appConfig.env.development?.teamId && _objectSpread({
|
|
1253
1290
|
teamId: appConfig.env.development.teamId
|
|
1254
1291
|
}, isCustomViewData(configurationData) ? {
|
|
@@ -1277,6 +1314,7 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1277
1314
|
}, configurationData.mainMenuLink), {}, {
|
|
1278
1315
|
submenuLinks: configurationData.submenuLinks
|
|
1279
1316
|
}),
|
|
1317
|
+
menuGroup: appConfig.env.development.menuGroup,
|
|
1280
1318
|
// @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
|
|
1281
1319
|
accountLinks: appConfig.accountLinks,
|
|
1282
1320
|
mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
|
|
@@ -13,7 +13,7 @@ import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
13
13
|
import fs$1 from 'node:fs';
|
|
14
14
|
import path, { parse } from 'node:path';
|
|
15
15
|
import omitEmpty from 'omit-empty-es';
|
|
16
|
-
import { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH } from '@commercetools-frontend/constants';
|
|
16
|
+
import { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX, isProjectKeylessApplicationEntryPointInProjectContext, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH, STATIC_URL_PATHS, isProjectKeylessApplicationEntryPoint } from '@commercetools-frontend/constants';
|
|
17
17
|
export { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX } from '@commercetools-frontend/constants';
|
|
18
18
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
19
19
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
@@ -34,7 +34,7 @@ import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringif
|
|
|
34
34
|
import path$1 from 'path';
|
|
35
35
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
36
36
|
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
37
|
-
import { f as formatEntryPointUriPathToResourceAccessKey, e as entryPointUriPathToResourceAccesses } from './formatters-
|
|
37
|
+
import { f as formatEntryPointUriPathToResourceAccessKey, e as entryPointUriPathToResourceAccesses } from './formatters-afa87119.esm.js';
|
|
38
38
|
import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
39
39
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
40
40
|
import Ajv from 'ajv';
|
|
@@ -447,6 +447,19 @@ var customApplicationSchemaJson = {
|
|
|
447
447
|
"enum": [
|
|
448
448
|
"legacy"
|
|
449
449
|
]
|
|
450
|
+
},
|
|
451
|
+
menuGroup: {
|
|
452
|
+
description: "Optional navbar group header used when rendering menuLinks in local development",
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
label: {
|
|
456
|
+
type: "string"
|
|
457
|
+
},
|
|
458
|
+
isNew: {
|
|
459
|
+
type: "boolean"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
additionalProperties: false
|
|
450
463
|
}
|
|
451
464
|
},
|
|
452
465
|
additionalProperties: false,
|
|
@@ -1009,9 +1022,33 @@ const validateConfig = (configType, config) => {
|
|
|
1009
1022
|
throw new Error(printErrors(validation.errors));
|
|
1010
1023
|
}
|
|
1011
1024
|
};
|
|
1025
|
+
const ENTRY_POINT_URI_PATH_ERROR_MESSAGE = 'Invalid "entryPointUriPath". The value may be between 2 and 64 characters and only contain alphanumeric lowercase characters, non-consecutive underscores and hyphens. Leading and trailing underscores and hyphens are also not allowed. Values under a project-keyless-in-project-context prefix (e.g. "agent-sphere/registry") must use that prefix followed by a single slash and a valid segment.';
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Resolves the segment that must match `ENTRY_POINT_URI_PATH_REGEX`.
|
|
1029
|
+
* Entry points under `PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT`
|
|
1030
|
+
* may be prefixed (e.g. `agent-sphere/registry`); only the right-hand segment is validated.
|
|
1031
|
+
*/
|
|
1032
|
+
const getEntryPointUriPathSegmentToValidate = entryPointUriPath => {
|
|
1033
|
+
if (!_includesInstanceProperty(entryPointUriPath).call(entryPointUriPath, '/')) {
|
|
1034
|
+
return entryPointUriPath;
|
|
1035
|
+
}
|
|
1036
|
+
const segments = entryPointUriPath.split('/');
|
|
1037
|
+
if (segments.length !== 2 || !segments[1]) {
|
|
1038
|
+
return null;
|
|
1039
|
+
}
|
|
1040
|
+
const _segments = _slicedToArray(segments, 2),
|
|
1041
|
+
prefix = _segments[0],
|
|
1042
|
+
rightHandSegment = _segments[1];
|
|
1043
|
+
if (!isProjectKeylessApplicationEntryPointInProjectContext(prefix)) {
|
|
1044
|
+
return null;
|
|
1045
|
+
}
|
|
1046
|
+
return rightHandSegment;
|
|
1047
|
+
};
|
|
1012
1048
|
const validateEntryPointUriPath = config => {
|
|
1013
|
-
|
|
1014
|
-
|
|
1049
|
+
const segmentToValidate = getEntryPointUriPathSegmentToValidate(config.entryPointUriPath);
|
|
1050
|
+
if (!segmentToValidate || !segmentToValidate.match(ENTRY_POINT_URI_PATH_REGEX)) {
|
|
1051
|
+
throw new Error(ENTRY_POINT_URI_PATH_ERROR_MESSAGE);
|
|
1015
1052
|
}
|
|
1016
1053
|
};
|
|
1017
1054
|
const validateSubmenuLinks = config => {
|
|
@@ -1209,10 +1246,10 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1209
1246
|
authorizeUrl: [
|
|
1210
1247
|
// In case the MC API url points to localhost, we need to point
|
|
1211
1248
|
// to a local running dev login page to handle the workflow properly.
|
|
1212
|
-
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'),
|
|
1249
|
+
mcApiUrl.hostname === 'localhost' ? mcApiUrl.origin.replace(mcApiUrl.port, String(developmentPort)) : mcApiUrl.origin.replace('mc-api', 'mc'), `/${STATIC_URL_PATHS.LOGIN}/authorize`].join(''),
|
|
1213
1250
|
initialProjectKey:
|
|
1214
|
-
// For
|
|
1215
|
-
entryPointUriPath
|
|
1251
|
+
// For project-keyless applications, we should unset the projectKey.
|
|
1252
|
+
isProjectKeylessApplicationEntryPoint(entryPointUriPath) ? undefined : appConfig.env.development.initialProjectKey
|
|
1216
1253
|
}, appConfig.env.development?.teamId && _objectSpread({
|
|
1217
1254
|
teamId: appConfig.env.development.teamId
|
|
1218
1255
|
}, isCustomViewData(configurationData) ? {
|
|
@@ -1241,6 +1278,7 @@ const getRuntimeEnvironmentConfigForDevelopment = _ref => {
|
|
|
1241
1278
|
}, configurationData.mainMenuLink), {}, {
|
|
1242
1279
|
submenuLinks: configurationData.submenuLinks
|
|
1243
1280
|
}),
|
|
1281
|
+
menuGroup: appConfig.env.development.menuGroup,
|
|
1244
1282
|
// @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
|
|
1245
1283
|
accountLinks: appConfig.accountLinks,
|
|
1246
1284
|
mcIdentityLoginModeOverride: appConfig.env.development.mcIdentityLoginModeOverride
|
|
@@ -6,6 +6,7 @@ type TImplicitCustomApplicationPermissionKeys<PermissionGroupName extends string
|
|
|
6
6
|
* The function formats the `entryPointUriPath` to a resource access key.
|
|
7
7
|
* It makes the first character of the string and the next character after a special character an uppercase.
|
|
8
8
|
* It replaces hyphen(-) with a forward slash(/) if the hyphen(-) is followed by a number.
|
|
9
|
+
* Path separators (`/`) are treated like hyphens (omitted, next segment PascalCased).
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
11
12
|
* - avengers --> Avengers
|
|
@@ -13,6 +14,7 @@ type TImplicitCustomApplicationPermissionKeys<PermissionGroupName extends string
|
|
|
13
14
|
* - the_avengers --> The_Avengers
|
|
14
15
|
* - avengers-01 --> Avengers/01
|
|
15
16
|
* - avengers_01 --> Avengers_01
|
|
17
|
+
* - new-avengers/team --> NewAvengersTeam
|
|
16
18
|
*/
|
|
17
19
|
declare const formatEntryPointUriPathToResourceAccessKey: (entryPointUriPath: string) => string;
|
|
18
20
|
/**
|
|
@@ -65,6 +65,13 @@ export interface JSONSchemaForCustomApplicationConfigurationFiles {
|
|
|
65
65
|
* Set to 'legacy' to use legacy login mode for development, sending x-mc-identity-login-mode-override header instead of cookies
|
|
66
66
|
*/
|
|
67
67
|
mcIdentityLoginModeOverride?: 'legacy';
|
|
68
|
+
/**
|
|
69
|
+
* Optional navbar group header used when rendering menuLinks in local development
|
|
70
|
+
*/
|
|
71
|
+
menuGroup?: {
|
|
72
|
+
label?: string;
|
|
73
|
+
isNew?: boolean;
|
|
74
|
+
};
|
|
68
75
|
};
|
|
69
76
|
production: {
|
|
70
77
|
/**
|
|
@@ -37,6 +37,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
37
37
|
* The function formats the `entryPointUriPath` to a resource access key.
|
|
38
38
|
* It makes the first character of the string and the next character after a special character an uppercase.
|
|
39
39
|
* It replaces hyphen(-) with a forward slash(/) if the hyphen(-) is followed by a number.
|
|
40
|
+
* Path separators (`/`) are treated like hyphens (omitted, next segment PascalCased).
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
42
43
|
* - avengers --> Avengers
|
|
@@ -44,6 +45,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
44
45
|
* - the_avengers --> The_Avengers
|
|
45
46
|
* - avengers-01 --> Avengers/01
|
|
46
47
|
* - avengers_01 --> Avengers_01
|
|
48
|
+
* - new-avengers/team --> NewAvengersTeam
|
|
47
49
|
*/
|
|
48
50
|
const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
49
51
|
var _context, _context2;
|
|
@@ -54,8 +56,8 @@ const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
|
54
56
|
).call(_context2, upperFirst__default["default"])
|
|
55
57
|
// Join the words by an underscore.
|
|
56
58
|
.join('_')
|
|
57
|
-
// Each word is split by a hyphen.
|
|
58
|
-
.split(
|
|
59
|
+
// Each word is split by a hyphen or path separator.
|
|
60
|
+
.split(/[-/]/)).call(_context, (word, i) => {
|
|
59
61
|
// Regex below checking if the character is numeric.
|
|
60
62
|
// If the word after the hyphen is numeric, replace the hyphen with a forward slash.
|
|
61
63
|
// If not, omit the hyphen and uppercase the first character
|
|
@@ -37,6 +37,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
37
37
|
* The function formats the `entryPointUriPath` to a resource access key.
|
|
38
38
|
* It makes the first character of the string and the next character after a special character an uppercase.
|
|
39
39
|
* It replaces hyphen(-) with a forward slash(/) if the hyphen(-) is followed by a number.
|
|
40
|
+
* Path separators (`/`) are treated like hyphens (omitted, next segment PascalCased).
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
42
43
|
* - avengers --> Avengers
|
|
@@ -44,6 +45,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
44
45
|
* - the_avengers --> The_Avengers
|
|
45
46
|
* - avengers-01 --> Avengers/01
|
|
46
47
|
* - avengers_01 --> Avengers_01
|
|
48
|
+
* - new-avengers/team --> NewAvengersTeam
|
|
47
49
|
*/
|
|
48
50
|
const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
49
51
|
var _context, _context2;
|
|
@@ -54,8 +56,8 @@ const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
|
54
56
|
).call(_context2, upperFirst__default["default"])
|
|
55
57
|
// Join the words by an underscore.
|
|
56
58
|
.join('_')
|
|
57
|
-
// Each word is split by a hyphen.
|
|
58
|
-
.split(
|
|
59
|
+
// Each word is split by a hyphen or path separator.
|
|
60
|
+
.split(/[-/]/)).call(_context, (word, i) => {
|
|
59
61
|
// Regex below checking if the character is numeric.
|
|
60
62
|
// If the word after the hyphen is numeric, replace the hyphen with a forward slash.
|
|
61
63
|
// If not, omit the hyphen and uppercase the first character
|
|
@@ -20,6 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
20
20
|
* The function formats the `entryPointUriPath` to a resource access key.
|
|
21
21
|
* It makes the first character of the string and the next character after a special character an uppercase.
|
|
22
22
|
* It replaces hyphen(-) with a forward slash(/) if the hyphen(-) is followed by a number.
|
|
23
|
+
* Path separators (`/`) are treated like hyphens (omitted, next segment PascalCased).
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
26
|
* - avengers --> Avengers
|
|
@@ -27,6 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
27
28
|
* - the_avengers --> The_Avengers
|
|
28
29
|
* - avengers-01 --> Avengers/01
|
|
29
30
|
* - avengers_01 --> Avengers_01
|
|
31
|
+
* - new-avengers/team --> NewAvengersTeam
|
|
30
32
|
*/
|
|
31
33
|
const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
32
34
|
var _context, _context2;
|
|
@@ -37,8 +39,8 @@ const formatEntryPointUriPathToResourceAccessKey = entryPointUriPath => {
|
|
|
37
39
|
).call(_context2, upperFirst)
|
|
38
40
|
// Join the words by an underscore.
|
|
39
41
|
.join('_')
|
|
40
|
-
// Each word is split by a hyphen.
|
|
41
|
-
.split(
|
|
42
|
+
// Each word is split by a hyphen or path separator.
|
|
43
|
+
.split(/[-/]/)).call(_context, (word, i) => {
|
|
42
44
|
// Regex below checking if the character is numeric.
|
|
43
45
|
// If the word after the hyphen is numeric, replace the hyphen with a forward slash.
|
|
44
46
|
// If not, omit the hyphen and uppercase the first character
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-config",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.11.1",
|
|
4
4
|
"description": "Configuration utilities for building Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"jsdom": "^21.1.2",
|
|
56
56
|
"lodash": "4.18.1",
|
|
57
57
|
"omit-empty-es": "1.2.0",
|
|
58
|
-
"@commercetools-frontend/constants": "^27.
|
|
58
|
+
"@commercetools-frontend/constants": "^27.11.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/jsdom": "^21.1.2",
|
|
62
62
|
"json-schema-to-typescript": "15.0.4",
|
|
63
|
-
"@commercetools-frontend/assets": "^27.
|
|
63
|
+
"@commercetools-frontend/assets": "^27.11.1"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": "18.x || 20.x || >=22.0.0"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var formatters = require('../../dist/formatters-
|
|
5
|
+
var formatters = require('../../dist/formatters-5bcaf776.cjs.dev.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var formatters = require('../../dist/formatters-
|
|
5
|
+
var formatters = require('../../dist/formatters-4e4336e9.cjs.prod.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as computeCustomViewPermissionsKeys, c as computeCustomViewResourceAccesses, a as entryPointUriPathToPermissionKeys, e as entryPointUriPathToResourceAccesses, f as formatEntryPointUriPathToResourceAccessKey, b as formatPermissionGroupNameToResourceAccessKey } from '../../dist/formatters-
|
|
1
|
+
export { d as computeCustomViewPermissionsKeys, c as computeCustomViewResourceAccesses, a as entryPointUriPathToPermissionKeys, e as entryPointUriPathToResourceAccesses, f as formatEntryPointUriPathToResourceAccessKey, b as formatPermissionGroupNameToResourceAccessKey } from '../../dist/formatters-afa87119.esm.js';
|
|
2
2
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
3
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
4
4
|
import '@babel/runtime-corejs3/core-js-stable/instance/filter';
|