@commercetools-frontend/constants 22.23.3 → 22.25.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.
package/README.md
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
<a href="https://www.npmjs.com/package/@commercetools-frontend/constants"><img src="https://badgen.net/npm/v/@commercetools-frontend/constants" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-frontend/constants"><img src="https://badgen.net/npm/v/@commercetools-frontend/constants/next" alt="Latest release (next dist-tag)" /></a> <a href="https://bundlephobia.com/result?p=@commercetools-frontend/constants"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-frontend/constants" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/merchant-center-application-kit/blob/main/LICENSE"><img src="https://badgen.net/github/license/commercetools/merchant-center-application-kit" alt="GitHub license" /></a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
Check out the [documentation](https://docs.commercetools.com/
|
|
7
|
+
Check out the [documentation](https://docs.commercetools.com/merchant-center-customizations/api-reference/commercetools-frontend-constants) for more information.
|
|
@@ -3,24 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
// NOTE: This string will be replaced on build time with the package version.
|
|
6
|
-
var version = "22.
|
|
6
|
+
var version = "22.25.0";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The
|
|
10
|
-
*
|
|
9
|
+
* The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
|
|
10
|
+
* up to two consecutive underscores (_) and hyphens (-). Leading and trailing underscore and hyphens are also not allowed.
|
|
11
|
+
*
|
|
12
|
+
* This regular expression has been generated using ChatGPT.
|
|
13
|
+
* Explanation of the regular expression:
|
|
14
|
+
* 1. ^: Asserts the start of the string.
|
|
15
|
+
* 2. (?!.*(?:[-_]{3}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no three consecutive hyphens or underscores ([-_]{3}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
16
|
+
* 3. (?=.{2,36}$): Positive lookahead assertion ensures that the length of the string is between 2 and 36 characters.
|
|
17
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
18
|
+
* 5. (?:[-_]{0,2}[a-z0-9]+)*: Non-capturing group matches zero, one, or two hyphens or underscores followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
19
|
+
* 6. $: Asserts the end of the string.
|
|
11
20
|
*/
|
|
12
|
-
const PROJECT_KEY_REGEX = /^[
|
|
21
|
+
const PROJECT_KEY_REGEX = /^(?!.*(?:[-_]{3}|^[-_]|[-_]$))(?=.{2,36}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,2}[a-z0-9]+)*$/;
|
|
13
22
|
|
|
14
23
|
/**
|
|
15
24
|
* The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
|
|
16
25
|
* non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
|
|
26
|
+
*
|
|
27
|
+
* This regular expression has been generated using ChatGPT.
|
|
28
|
+
* Explanation of the regular expression:
|
|
29
|
+
* 1. ^: Asserts the start of the string.
|
|
30
|
+
* 2. (?!.*(?:[-_]{2}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no two consecutive hyphens or underscores ([-_]{2}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
31
|
+
* 3. (?=.{2,64}$): Positive lookahead assertion ensures that the length of the string is between 2 and 64 characters.
|
|
32
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
33
|
+
* 5. (?:[-_]{0,1}[a-z0-9]+)*: Non-capturing group matches zero, or one hyphen or underscore followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
34
|
+
* 6. $: Asserts the end of the string.
|
|
17
35
|
*/
|
|
18
|
-
const ENTRY_POINT_URI_PATH_REGEX = /^[
|
|
36
|
+
const ENTRY_POINT_URI_PATH_REGEX = /^(?!.*(?:[-_]{2}|^[-_]|[-_]$))(?=.{2,64}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,1}[a-z0-9]+)*$/;
|
|
19
37
|
|
|
20
38
|
/**
|
|
21
|
-
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
39
|
+
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
40
|
+
* Leading and trailing hyphens are also not allowed.
|
|
22
41
|
*/
|
|
23
|
-
const PERMISSION_GROUP_NAME_REGEX = /^[
|
|
42
|
+
const PERMISSION_GROUP_NAME_REGEX = /^[^-#\W]([a-z]|[-](?![-])){0,62}[^-#\W]$/;
|
|
24
43
|
|
|
25
44
|
// DOM elements
|
|
26
45
|
const PORTALS_CONTAINER_ID = 'portals-container';
|
|
@@ -3,24 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
// NOTE: This string will be replaced on build time with the package version.
|
|
6
|
-
var version = "22.
|
|
6
|
+
var version = "22.25.0";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The
|
|
10
|
-
*
|
|
9
|
+
* The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
|
|
10
|
+
* up to two consecutive underscores (_) and hyphens (-). Leading and trailing underscore and hyphens are also not allowed.
|
|
11
|
+
*
|
|
12
|
+
* This regular expression has been generated using ChatGPT.
|
|
13
|
+
* Explanation of the regular expression:
|
|
14
|
+
* 1. ^: Asserts the start of the string.
|
|
15
|
+
* 2. (?!.*(?:[-_]{3}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no three consecutive hyphens or underscores ([-_]{3}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
16
|
+
* 3. (?=.{2,36}$): Positive lookahead assertion ensures that the length of the string is between 2 and 36 characters.
|
|
17
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
18
|
+
* 5. (?:[-_]{0,2}[a-z0-9]+)*: Non-capturing group matches zero, one, or two hyphens or underscores followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
19
|
+
* 6. $: Asserts the end of the string.
|
|
11
20
|
*/
|
|
12
|
-
const PROJECT_KEY_REGEX = /^[
|
|
21
|
+
const PROJECT_KEY_REGEX = /^(?!.*(?:[-_]{3}|^[-_]|[-_]$))(?=.{2,36}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,2}[a-z0-9]+)*$/;
|
|
13
22
|
|
|
14
23
|
/**
|
|
15
24
|
* The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
|
|
16
25
|
* non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
|
|
26
|
+
*
|
|
27
|
+
* This regular expression has been generated using ChatGPT.
|
|
28
|
+
* Explanation of the regular expression:
|
|
29
|
+
* 1. ^: Asserts the start of the string.
|
|
30
|
+
* 2. (?!.*(?:[-_]{2}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no two consecutive hyphens or underscores ([-_]{2}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
31
|
+
* 3. (?=.{2,64}$): Positive lookahead assertion ensures that the length of the string is between 2 and 64 characters.
|
|
32
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
33
|
+
* 5. (?:[-_]{0,1}[a-z0-9]+)*: Non-capturing group matches zero, or one hyphen or underscore followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
34
|
+
* 6. $: Asserts the end of the string.
|
|
17
35
|
*/
|
|
18
|
-
const ENTRY_POINT_URI_PATH_REGEX = /^[
|
|
36
|
+
const ENTRY_POINT_URI_PATH_REGEX = /^(?!.*(?:[-_]{2}|^[-_]|[-_]$))(?=.{2,64}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,1}[a-z0-9]+)*$/;
|
|
19
37
|
|
|
20
38
|
/**
|
|
21
|
-
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
39
|
+
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
40
|
+
* Leading and trailing hyphens are also not allowed.
|
|
22
41
|
*/
|
|
23
|
-
const PERMISSION_GROUP_NAME_REGEX = /^[
|
|
42
|
+
const PERMISSION_GROUP_NAME_REGEX = /^[^-#\W]([a-z]|[-](?![-])){0,62}[^-#\W]$/;
|
|
24
43
|
|
|
25
44
|
// DOM elements
|
|
26
45
|
const PORTALS_CONTAINER_ID = 'portals-container';
|
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
// NOTE: This string will be replaced on build time with the package version.
|
|
2
|
-
var version = "22.
|
|
2
|
+
var version = "22.25.0";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
5
|
+
* The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
|
|
6
|
+
* up to two consecutive underscores (_) and hyphens (-). Leading and trailing underscore and hyphens are also not allowed.
|
|
7
|
+
*
|
|
8
|
+
* This regular expression has been generated using ChatGPT.
|
|
9
|
+
* Explanation of the regular expression:
|
|
10
|
+
* 1. ^: Asserts the start of the string.
|
|
11
|
+
* 2. (?!.*(?:[-_]{3}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no three consecutive hyphens or underscores ([-_]{3}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
12
|
+
* 3. (?=.{2,36}$): Positive lookahead assertion ensures that the length of the string is between 2 and 36 characters.
|
|
13
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
14
|
+
* 5. (?:[-_]{0,2}[a-z0-9]+)*: Non-capturing group matches zero, one, or two hyphens or underscores followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
15
|
+
* 6. $: Asserts the end of the string.
|
|
7
16
|
*/
|
|
8
|
-
const PROJECT_KEY_REGEX = /^[
|
|
17
|
+
const PROJECT_KEY_REGEX = /^(?!.*(?:[-_]{3}|^[-_]|[-_]$))(?=.{2,36}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,2}[a-z0-9]+)*$/;
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
20
|
* The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
|
|
12
21
|
* non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
|
|
22
|
+
*
|
|
23
|
+
* This regular expression has been generated using ChatGPT.
|
|
24
|
+
* Explanation of the regular expression:
|
|
25
|
+
* 1. ^: Asserts the start of the string.
|
|
26
|
+
* 2. (?!.*(?:[-_]{2}|^[-_]|[-_]$)): Negative lookahead assertion ensures that there are no two consecutive hyphens or underscores ([-_]{2}), no leading hyphen or underscore (^[-_]), and no trailing hyphen or underscore ([-_]$).
|
|
27
|
+
* 3. (?=.{2,64}$): Positive lookahead assertion ensures that the length of the string is between 2 and 64 characters.
|
|
28
|
+
* 4. (?:[a-z1-9][a-z0-9]*)?: Non-capturing group matches an optional first character that cannot be '0' ([a-z1-9]) followed by zero or more lowercase alphanumeric characters ([a-z0-9]*).
|
|
29
|
+
* 5. (?:[-_]{0,1}[a-z0-9]+)*: Non-capturing group matches zero, or one hyphen or underscore followed by one or more lowercase alphanumeric characters. This group can repeat zero or more times.
|
|
30
|
+
* 6. $: Asserts the end of the string.
|
|
13
31
|
*/
|
|
14
|
-
const ENTRY_POINT_URI_PATH_REGEX = /^[
|
|
32
|
+
const ENTRY_POINT_URI_PATH_REGEX = /^(?!.*(?:[-_]{2}|^[-_]|[-_]$))(?=.{2,64}$)(?:[a-z1-9][a-z0-9]*)?(?:[-_]{0,1}[a-z0-9]+)*$/;
|
|
15
33
|
|
|
16
34
|
/**
|
|
17
|
-
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
35
|
+
* The permission group name may be between 2 and 64 characters and only contain alphanumeric lowercase characters and non-consecutive hyphens.
|
|
36
|
+
* Leading and trailing hyphens are also not allowed.
|
|
18
37
|
*/
|
|
19
|
-
const PERMISSION_GROUP_NAME_REGEX = /^[
|
|
38
|
+
const PERMISSION_GROUP_NAME_REGEX = /^[^-#\W]([a-z]|[-](?![-])){0,62}[^-#\W]$/;
|
|
20
39
|
|
|
21
40
|
// DOM elements
|
|
22
41
|
const PORTALS_CONTAINER_ID = 'portals-container';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/constants",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.25.0",
|
|
4
4
|
"description": "Shared constants for MC applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://github.com/commercetools/merchant-center-application-kit.git",
|
|
9
9
|
"directory": "packages/constants"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://docs.commercetools.com/
|
|
11
|
+
"homepage": "https://docs.commercetools.com/merchant-center-customizations/api-reference/commercetools-frontend-constants",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"javascript",
|
|
14
14
|
"frontend",
|
|
@@ -30,5 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.22.15",
|
|
32
32
|
"@babel/runtime-corejs3": "^7.22.15"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/jest": "^29.5.4",
|
|
36
|
+
"jest": "29.7.0"
|
|
33
37
|
}
|
|
34
38
|
}
|