@commercetools-frontend/constants 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.
@@ -3,7 +3,24 @@
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.14.2";
6
+ var version = "22.15.0";
7
+
8
+ /**
9
+ * The entryPointUriPath may be between 2 and 36 characters and only contain alphabetic lowercase characters,
10
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
11
+ */
12
+ const PROJECT_KEY_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,34}[^-_#]$/g;
13
+
14
+ /**
15
+ * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
16
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
17
+ */
18
+ const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
19
+
20
+ /**
21
+ * 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.
22
+ */
23
+ const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
7
24
 
8
25
  // DOM elements
9
26
  const PORTALS_CONTAINER_ID = 'portals-container';
@@ -127,11 +144,12 @@ const HTTP_SECURITY_HEADERS = {
127
144
  // Custom Views events (messages sent between the host application and the custom view)
128
145
  const CUSTOM_VIEWS_EVENTS_NAMES = {
129
146
  CUSTOM_VIEW_BOOTSTRAP: 'custom-view-bootstrap',
130
- CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization'
147
+ CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization',
148
+ CUSTOM_VIEW_CLOSE: 'custom-view-close'
131
149
  };
132
150
  const CUSTOM_VIEWS_EVENTS_META = {
133
- SOURCE: 'mc-host-application',
134
- DESTINATION_PREFIX: 'custom-view-'
151
+ HOST_APPLICATION_CODE: 'mc-host-application',
152
+ CUSTOM_VIEW_KEY_PREFIX: 'custom-view-'
135
153
  };
136
154
 
137
155
  // SSO
@@ -174,6 +192,7 @@ exports.CUSTOM_VIEWS_EVENTS_META = CUSTOM_VIEWS_EVENTS_META;
174
192
  exports.CUSTOM_VIEWS_EVENTS_NAMES = CUSTOM_VIEWS_EVENTS_NAMES;
175
193
  exports.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH = CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH;
176
194
  exports.DOMAINS = DOMAINS;
195
+ exports.ENTRY_POINT_URI_PATH_REGEX = ENTRY_POINT_URI_PATH_REGEX;
177
196
  exports.GRAPHQL_TARGETS = GRAPHQL_TARGETS;
178
197
  exports.HIDE_ALL_PAGE_NOTIFICATIONS = HIDE_ALL_PAGE_NOTIFICATIONS;
179
198
  exports.HIDE_LOADING = HIDE_LOADING;
@@ -189,8 +208,10 @@ exports.NOTIFICATION_KINDS_PAGE = NOTIFICATION_KINDS_PAGE;
189
208
  exports.NOTIFICATION_KINDS_SIDE = NOTIFICATION_KINDS_SIDE;
190
209
  exports.NO_VALUE_FALLBACK = NO_VALUE_FALLBACK;
191
210
  exports.ORGANIZATION_GENERAL_ERROR = ORGANIZATION_GENERAL_ERROR;
211
+ exports.PERMISSION_GROUP_NAME_REGEX = PERMISSION_GROUP_NAME_REGEX;
192
212
  exports.PORTALS_CONTAINER_ID = PORTALS_CONTAINER_ID;
193
213
  exports.PORTALS_CONTAINER_INDENTATION_SIZE = PORTALS_CONTAINER_INDENTATION_SIZE;
214
+ exports.PROJECT_KEY_REGEX = PROJECT_KEY_REGEX;
194
215
  exports.SHOW_LOADING = SHOW_LOADING;
195
216
  exports.STATUS_CODES = STATUS_CODES;
196
217
  exports.STORAGE_KEYS = STORAGE_KEYS;
@@ -3,7 +3,24 @@
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.14.2";
6
+ var version = "22.15.0";
7
+
8
+ /**
9
+ * The entryPointUriPath may be between 2 and 36 characters and only contain alphabetic lowercase characters,
10
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
11
+ */
12
+ const PROJECT_KEY_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,34}[^-_#]$/g;
13
+
14
+ /**
15
+ * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
16
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
17
+ */
18
+ const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
19
+
20
+ /**
21
+ * 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.
22
+ */
23
+ const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
7
24
 
8
25
  // DOM elements
9
26
  const PORTALS_CONTAINER_ID = 'portals-container';
@@ -127,11 +144,12 @@ const HTTP_SECURITY_HEADERS = {
127
144
  // Custom Views events (messages sent between the host application and the custom view)
128
145
  const CUSTOM_VIEWS_EVENTS_NAMES = {
129
146
  CUSTOM_VIEW_BOOTSTRAP: 'custom-view-bootstrap',
130
- CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization'
147
+ CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization',
148
+ CUSTOM_VIEW_CLOSE: 'custom-view-close'
131
149
  };
132
150
  const CUSTOM_VIEWS_EVENTS_META = {
133
- SOURCE: 'mc-host-application',
134
- DESTINATION_PREFIX: 'custom-view-'
151
+ HOST_APPLICATION_CODE: 'mc-host-application',
152
+ CUSTOM_VIEW_KEY_PREFIX: 'custom-view-'
135
153
  };
136
154
 
137
155
  // SSO
@@ -174,6 +192,7 @@ exports.CUSTOM_VIEWS_EVENTS_META = CUSTOM_VIEWS_EVENTS_META;
174
192
  exports.CUSTOM_VIEWS_EVENTS_NAMES = CUSTOM_VIEWS_EVENTS_NAMES;
175
193
  exports.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH = CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH;
176
194
  exports.DOMAINS = DOMAINS;
195
+ exports.ENTRY_POINT_URI_PATH_REGEX = ENTRY_POINT_URI_PATH_REGEX;
177
196
  exports.GRAPHQL_TARGETS = GRAPHQL_TARGETS;
178
197
  exports.HIDE_ALL_PAGE_NOTIFICATIONS = HIDE_ALL_PAGE_NOTIFICATIONS;
179
198
  exports.HIDE_LOADING = HIDE_LOADING;
@@ -189,8 +208,10 @@ exports.NOTIFICATION_KINDS_PAGE = NOTIFICATION_KINDS_PAGE;
189
208
  exports.NOTIFICATION_KINDS_SIDE = NOTIFICATION_KINDS_SIDE;
190
209
  exports.NO_VALUE_FALLBACK = NO_VALUE_FALLBACK;
191
210
  exports.ORGANIZATION_GENERAL_ERROR = ORGANIZATION_GENERAL_ERROR;
211
+ exports.PERMISSION_GROUP_NAME_REGEX = PERMISSION_GROUP_NAME_REGEX;
192
212
  exports.PORTALS_CONTAINER_ID = PORTALS_CONTAINER_ID;
193
213
  exports.PORTALS_CONTAINER_INDENTATION_SIZE = PORTALS_CONTAINER_INDENTATION_SIZE;
214
+ exports.PROJECT_KEY_REGEX = PROJECT_KEY_REGEX;
194
215
  exports.SHOW_LOADING = SHOW_LOADING;
195
216
  exports.STATUS_CODES = STATUS_CODES;
196
217
  exports.STORAGE_KEYS = STORAGE_KEYS;
@@ -1,5 +1,22 @@
1
1
  // NOTE: This string will be replaced on build time with the package version.
2
- var version = "22.14.2";
2
+ var version = "22.15.0";
3
+
4
+ /**
5
+ * The entryPointUriPath may be between 2 and 36 characters and only contain alphabetic lowercase characters,
6
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
7
+ */
8
+ const PROJECT_KEY_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,34}[^-_#]$/g;
9
+
10
+ /**
11
+ * The entryPointUriPath may be between 2 and 64 characters and only contain alphabetic lowercase characters,
12
+ * non-consecutive underscores and hyphens. Leading and trailing underscore and hyphens are also not allowed.
13
+ */
14
+ const ENTRY_POINT_URI_PATH_REGEX = /^[^-_#]([0-9a-z]|[-_](?![-_])){0,62}[^-_#]$/g;
15
+
16
+ /**
17
+ * 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.
18
+ */
19
+ const PERMISSION_GROUP_NAME_REGEX = /^[^-#]([a-z]|[-](?![-])){0,62}[^-#]$/g;
3
20
 
4
21
  // DOM elements
5
22
  const PORTALS_CONTAINER_ID = 'portals-container';
@@ -123,11 +140,12 @@ const HTTP_SECURITY_HEADERS = {
123
140
  // Custom Views events (messages sent between the host application and the custom view)
124
141
  const CUSTOM_VIEWS_EVENTS_NAMES = {
125
142
  CUSTOM_VIEW_BOOTSTRAP: 'custom-view-bootstrap',
126
- CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization'
143
+ CUSTOM_VIEW_INITIALIZATION: 'custom-view-initialization',
144
+ CUSTOM_VIEW_CLOSE: 'custom-view-close'
127
145
  };
128
146
  const CUSTOM_VIEWS_EVENTS_META = {
129
- SOURCE: 'mc-host-application',
130
- DESTINATION_PREFIX: 'custom-view-'
147
+ HOST_APPLICATION_CODE: 'mc-host-application',
148
+ CUSTOM_VIEW_KEY_PREFIX: 'custom-view-'
131
149
  };
132
150
 
133
151
  // SSO
@@ -166,4 +184,4 @@ var featureToggles = /*#__PURE__*/Object.freeze({
166
184
  FLAGS: FLAGS
167
185
  });
168
186
 
169
- export { CUSTOM_VIEWS_EVENTS_META, CUSTOM_VIEWS_EVENTS_NAMES, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH, DOMAINS, GRAPHQL_TARGETS, HIDE_ALL_PAGE_NOTIFICATIONS, HIDE_LOADING, HTTP_SECURITY_HEADERS, LOGIN_STRATEGY_DEFAULT, LOGIN_STRATEGY_OIDC, LOGIN_STRATEGY_SSO, LOGOUT_REASONS, MC_API_PROXY_TARGETS, NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_GLOBAL, NOTIFICATION_KINDS_PAGE, NOTIFICATION_KINDS_SIDE, NO_VALUE_FALLBACK, ORGANIZATION_GENERAL_ERROR, PORTALS_CONTAINER_ID, PORTALS_CONTAINER_INDENTATION_SIZE, SHOW_LOADING, STATUS_CODES, STORAGE_KEYS, SUPPORTED_HEADERS, SUPPORT_PORTAL_URL, featureToggles as featureFlags, version };
187
+ export { CUSTOM_VIEWS_EVENTS_META, CUSTOM_VIEWS_EVENTS_NAMES, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH, DOMAINS, ENTRY_POINT_URI_PATH_REGEX, GRAPHQL_TARGETS, HIDE_ALL_PAGE_NOTIFICATIONS, HIDE_LOADING, HTTP_SECURITY_HEADERS, LOGIN_STRATEGY_DEFAULT, LOGIN_STRATEGY_OIDC, LOGIN_STRATEGY_SSO, LOGOUT_REASONS, MC_API_PROXY_TARGETS, NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_GLOBAL, NOTIFICATION_KINDS_PAGE, NOTIFICATION_KINDS_SIDE, NO_VALUE_FALLBACK, ORGANIZATION_GENERAL_ERROR, PERMISSION_GROUP_NAME_REGEX, PORTALS_CONTAINER_ID, PORTALS_CONTAINER_INDENTATION_SIZE, PROJECT_KEY_REGEX, SHOW_LOADING, STATUS_CODES, STORAGE_KEYS, SUPPORTED_HEADERS, SUPPORT_PORTAL_URL, featureToggles as featureFlags, version };
@@ -1,4 +1,7 @@
1
1
  import type { TCustomView } from './types/generated/settings';
2
+ export declare const PROJECT_KEY_REGEX: RegExp;
3
+ export declare const ENTRY_POINT_URI_PATH_REGEX: RegExp;
4
+ export declare const PERMISSION_GROUP_NAME_REGEX: RegExp;
2
5
  export declare const PORTALS_CONTAINER_ID = "portals-container";
3
6
  export declare const PORTALS_CONTAINER_INDENTATION_SIZE = "48px";
4
7
  export declare const SUPPORT_PORTAL_URL = "https://support.commercetools.com";
@@ -227,10 +230,11 @@ export declare const HTTP_SECURITY_HEADERS: {
227
230
  export declare const CUSTOM_VIEWS_EVENTS_NAMES: {
228
231
  CUSTOM_VIEW_BOOTSTRAP: string;
229
232
  CUSTOM_VIEW_INITIALIZATION: string;
233
+ CUSTOM_VIEW_CLOSE: string;
230
234
  };
231
235
  export declare const CUSTOM_VIEWS_EVENTS_META: {
232
- SOURCE: string;
233
- DESTINATION_PREFIX: string;
236
+ HOST_APPLICATION_CODE: string;
237
+ CUSTOM_VIEW_KEY_PREFIX: string;
234
238
  };
235
239
  export declare const ORGANIZATION_GENERAL_ERROR = "organizationGeneralError";
236
240
  export declare const LOGIN_STRATEGY_DEFAULT = "default";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/constants",
3
- "version": "22.14.2",
3
+ "version": "22.15.0",
4
4
  "description": "Shared constants for MC applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {