@commercetools-frontend/application-config 22.14.2 → 22.15.0

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.
@@ -74,16 +74,6 @@ var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
74
74
  var uniq__default = /*#__PURE__*/_interopDefault(uniq);
75
75
  var createDOMPurify__default = /*#__PURE__*/_interopDefault(createDOMPurify);
76
76
 
77
- /**
78
- * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
79
- * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
80
- */
81
- const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
82
-
83
- /**
84
- * The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens. Leading and trailing hyphens are also not allowed.
85
- */
86
- const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
87
77
  const CLOUD_IDENTIFIERS = {
88
78
  GCP_AU: 'gcp-au',
89
79
  GCP_EU: 'gcp-eu',
@@ -952,7 +942,7 @@ const validateConfig = (configType, config) => {
952
942
  }
953
943
  };
954
944
  const validateEntryPointUriPath = config => {
955
- if (!config.entryPointUriPath.match(ENTRY_POINT_URI_PATH_REGEX)) {
945
+ if (!config.entryPointUriPath.match(constants.ENTRY_POINT_URI_PATH_REGEX)) {
956
946
  throw new Error('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.');
957
947
  }
958
948
  };
@@ -979,7 +969,7 @@ const validateAdditionalOAuthScopes = config => {
979
969
  } else if (additionalPermissionNames.has(name)) {
980
970
  throw new Error("Duplicate additional permission group name \"".concat(name, "\". Every additional permission must have a unique name"));
981
971
  }
982
- if (!name.match(PERMISSION_GROUP_NAME_REGEX)) {
972
+ if (!name.match(constants.PERMISSION_GROUP_NAME_REGEX)) {
983
973
  throw new Error("Additional permission group name \"".concat(name, "\" is invalid. The value may be between 2 and 64 characters and only contain alphabetic lowercase characters and non-consecutive hyphens. Leading and trailing hyphens are also not allowed"));
984
974
  }
985
975
  additionalPermissionNames.add(name);
@@ -1322,12 +1312,18 @@ function sanitizeSvg(data) {
1322
1312
  }).innerHTML;
1323
1313
  }
1324
1314
 
1315
+ Object.defineProperty(exports, 'ENTRY_POINT_URI_PATH_REGEX', {
1316
+ enumerable: true,
1317
+ get: function () { return constants.ENTRY_POINT_URI_PATH_REGEX; }
1318
+ });
1319
+ Object.defineProperty(exports, 'PERMISSION_GROUP_NAME_REGEX', {
1320
+ enumerable: true,
1321
+ get: function () { return constants.PERMISSION_GROUP_NAME_REGEX; }
1322
+ });
1325
1323
  exports.CLOUD_IDENTIFIERS = CLOUD_IDENTIFIERS;
1326
- exports.ENTRY_POINT_URI_PATH_REGEX = ENTRY_POINT_URI_PATH_REGEX;
1327
1324
  exports.LOADED_CONFIG_TYPES = LOADED_CONFIG_TYPES;
1328
1325
  exports.MC_API_URLS = MC_API_URLS;
1329
1326
  exports.MissingOrInvalidConfigError = MissingOrInvalidConfigError;
1330
- exports.PERMISSION_GROUP_NAME_REGEX = PERMISSION_GROUP_NAME_REGEX;
1331
1327
  exports.getConfigPath = getConfigPath;
1332
1328
  exports.processConfig = processConfig;
1333
1329
  exports.sanitizeSvg = sanitizeSvg;
@@ -74,16 +74,6 @@ var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
74
74
  var uniq__default = /*#__PURE__*/_interopDefault(uniq);
75
75
  var createDOMPurify__default = /*#__PURE__*/_interopDefault(createDOMPurify);
76
76
 
77
- /**
78
- * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
79
- * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
80
- */
81
- const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
82
-
83
- /**
84
- * The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens. Leading and trailing hyphens are also not allowed.
85
- */
86
- const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
87
77
  const CLOUD_IDENTIFIERS = {
88
78
  GCP_AU: 'gcp-au',
89
79
  GCP_EU: 'gcp-eu',
@@ -952,7 +942,7 @@ const validateConfig = (configType, config) => {
952
942
  }
953
943
  };
954
944
  const validateEntryPointUriPath = config => {
955
- if (!config.entryPointUriPath.match(ENTRY_POINT_URI_PATH_REGEX)) {
945
+ if (!config.entryPointUriPath.match(constants.ENTRY_POINT_URI_PATH_REGEX)) {
956
946
  throw new Error('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.');
957
947
  }
958
948
  };
@@ -979,7 +969,7 @@ const validateAdditionalOAuthScopes = config => {
979
969
  } else if (additionalPermissionNames.has(name)) {
980
970
  throw new Error("Duplicate additional permission group name \"".concat(name, "\". Every additional permission must have a unique name"));
981
971
  }
982
- if (!name.match(PERMISSION_GROUP_NAME_REGEX)) {
972
+ if (!name.match(constants.PERMISSION_GROUP_NAME_REGEX)) {
983
973
  throw new Error("Additional permission group name \"".concat(name, "\" is invalid. The value may be between 2 and 64 characters and only contain alphabetic lowercase characters and non-consecutive hyphens. Leading and trailing hyphens are also not allowed"));
984
974
  }
985
975
  additionalPermissionNames.add(name);
@@ -1322,12 +1312,18 @@ function sanitizeSvg(data) {
1322
1312
  }).innerHTML;
1323
1313
  }
1324
1314
 
1315
+ Object.defineProperty(exports, 'ENTRY_POINT_URI_PATH_REGEX', {
1316
+ enumerable: true,
1317
+ get: function () { return constants.ENTRY_POINT_URI_PATH_REGEX; }
1318
+ });
1319
+ Object.defineProperty(exports, 'PERMISSION_GROUP_NAME_REGEX', {
1320
+ enumerable: true,
1321
+ get: function () { return constants.PERMISSION_GROUP_NAME_REGEX; }
1322
+ });
1325
1323
  exports.CLOUD_IDENTIFIERS = CLOUD_IDENTIFIERS;
1326
- exports.ENTRY_POINT_URI_PATH_REGEX = ENTRY_POINT_URI_PATH_REGEX;
1327
1324
  exports.LOADED_CONFIG_TYPES = LOADED_CONFIG_TYPES;
1328
1325
  exports.MC_API_URLS = MC_API_URLS;
1329
1326
  exports.MissingOrInvalidConfigError = MissingOrInvalidConfigError;
1330
- exports.PERMISSION_GROUP_NAME_REGEX = PERMISSION_GROUP_NAME_REGEX;
1331
1327
  exports.getConfigPath = getConfigPath;
1332
1328
  exports.processConfig = processConfig;
1333
1329
  exports.sanitizeSvg = sanitizeSvg;
@@ -13,7 +13,8 @@ import _URL from '@babel/runtime-corejs3/core-js-stable/url';
13
13
  import fs from 'node:fs';
14
14
  import path, { parse } from 'node:path';
15
15
  import omitEmpty from 'omit-empty-es';
16
- import { CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH } from '@commercetools-frontend/constants';
16
+ import { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH } from '@commercetools-frontend/constants';
17
+ export { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX } from '@commercetools-frontend/constants';
17
18
  import { execFileSync } from 'node:child_process';
18
19
  import { cosmiconfigSync, defaultLoaders } from 'cosmiconfig';
19
20
  import _Reflect$construct from '@babel/runtime-corejs3/core-js-stable/reflect/construct';
@@ -41,16 +42,6 @@ import { JSDOM } from 'jsdom';
41
42
  import '@babel/runtime-corejs3/core-js-stable/object/entries';
42
43
  import 'lodash/upperFirst';
43
44
 
44
- /**
45
- * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
46
- * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
47
- */
48
- const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
49
-
50
- /**
51
- * The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens. Leading and trailing hyphens are also not allowed.
52
- */
53
- const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
54
45
  const CLOUD_IDENTIFIERS = {
55
46
  GCP_AU: 'gcp-au',
56
47
  GCP_EU: 'gcp-eu',
@@ -1289,4 +1280,4 @@ function sanitizeSvg(data) {
1289
1280
  }).innerHTML;
1290
1281
  }
1291
1282
 
1292
- export { CLOUD_IDENTIFIERS, ENTRY_POINT_URI_PATH_REGEX, LOADED_CONFIG_TYPES, MC_API_URLS, MissingOrInvalidConfigError, PERMISSION_GROUP_NAME_REGEX, getConfigPath, processConfig, sanitizeSvg };
1283
+ export { CLOUD_IDENTIFIERS, LOADED_CONFIG_TYPES, MC_API_URLS, MissingOrInvalidConfigError, getConfigPath, processConfig, sanitizeSvg };
@@ -1,5 +1,3 @@
1
- export declare const ENTRY_POINT_URI_PATH_REGEX: RegExp;
2
- export declare const PERMISSION_GROUP_NAME_REGEX: RegExp;
3
1
  export declare const CLOUD_IDENTIFIERS: {
4
2
  readonly GCP_AU: "gcp-au";
5
3
  readonly GCP_EU: "gcp-eu";
@@ -4,3 +4,4 @@ export { default as sanitizeSvg } from './sanitize-svg';
4
4
  export * from './constants';
5
5
  export * from './errors';
6
6
  export * from './types';
7
+ export { ENTRY_POINT_URI_PATH_REGEX, PERMISSION_GROUP_NAME_REGEX, } from '@commercetools-frontend/constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-config",
3
- "version": "22.14.2",
3
+ "version": "22.15.0",
4
4
  "description": "Configuration utilities for building Custom Applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -44,8 +44,8 @@
44
44
  "@babel/register": "^7.22.15",
45
45
  "@babel/runtime": "^7.22.15",
46
46
  "@babel/runtime-corejs3": "^7.22.15",
47
- "@commercetools-frontend/babel-preset-mc-app": "22.14.2",
48
- "@commercetools-frontend/constants": "22.14.2",
47
+ "@commercetools-frontend/babel-preset-mc-app": "22.15.0",
48
+ "@commercetools-frontend/constants": "22.15.0",
49
49
  "@types/dompurify": "^2.4.0",
50
50
  "@types/lodash": "^4.14.198",
51
51
  "@types/react": "^17.0.56",
@@ -61,7 +61,7 @@
61
61
  "@types/jsdom": "^21.1.2",
62
62
  "json-schema-to-typescript": "13.0.1",
63
63
  "shelljs": "0.8.5",
64
- "@commercetools-frontend/assets": "22.14.2"
64
+ "@commercetools-frontend/assets": "22.15.0"
65
65
  },
66
66
  "engines": {
67
67
  "node": "16.x || >=18.0.0"