@commercetools-frontend/application-config 21.23.6 → 21.23.7
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CamelCase } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type TImplicitCustomApplicationResourceAccesses<PermissionGroupName extends string = ''> = Record<`view` | `manage` | `view${Capitalize<CamelCase<PermissionGroupName>>}` | `manage${Capitalize<CamelCase<PermissionGroupName>>}`, string>;
|
|
3
|
+
type TImplicitCustomApplicationPermissionKeys<PermissionGroupName extends string = ''> = Record<`View` | `Manage` | `View${Capitalize<CamelCase<PermissionGroupName>>}` | `Manage${Capitalize<CamelCase<PermissionGroupName>>}`, string>;
|
|
4
4
|
declare const formatEntryPointUriPathToResourceAccessKey: (entryPointUriPath: string) => string;
|
|
5
5
|
declare const formatPermissionGroupNameToResourceAccessKey: (permissionGroupName: string) => string;
|
|
6
6
|
declare function entryPointUriPathToResourceAccesses(entryPointUriPath: string): TImplicitCustomApplicationResourceAccesses<''>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ApplicationRuntimeConfig, LoadingConfigOptions } from './types';
|
|
2
|
-
|
|
2
|
+
type ProcessConfigOptions = Partial<LoadingConfigOptions> & {
|
|
3
3
|
disableCache?: boolean;
|
|
4
4
|
};
|
|
5
5
|
declare const processConfig: ({ disableCache, processEnv, applicationPath, }?: ProcessConfigOptions) => ApplicationRuntimeConfig;
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import type { ApplicationWindow } from '@commercetools-frontend/constants';
|
|
3
3
|
import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schema';
|
|
4
4
|
import { CLOUD_IDENTIFIERS } from './constants';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
|
|
5
|
+
export type ConfigOptions = JSONSchemaForCustomApplicationConfigurationFiles;
|
|
6
|
+
export type CloudIdentifier = (typeof CLOUD_IDENTIFIERS)[keyof typeof CLOUD_IDENTIFIERS];
|
|
7
|
+
type LocalizedFieldData = {
|
|
8
8
|
locale: string;
|
|
9
9
|
value: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type CustomApplicationPermissionData = {
|
|
12
12
|
name: string;
|
|
13
13
|
oAuthScopes: string[];
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type CustomApplicationMenuLinkData = {
|
|
16
16
|
defaultLabel: string;
|
|
17
17
|
labelAllLocales: LocalizedFieldData[];
|
|
18
18
|
permissions: string[];
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type CustomApplicationSubmenuLinkData = {
|
|
21
21
|
uriPath: string;
|
|
22
22
|
defaultLabel: string;
|
|
23
23
|
labelAllLocales: LocalizedFieldData[];
|
|
24
24
|
permissions: string[];
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type CustomApplicationData = {
|
|
27
27
|
id: string;
|
|
28
28
|
entryPointUriPath: string;
|
|
29
29
|
name: string;
|
|
@@ -34,21 +34,21 @@ export declare type CustomApplicationData = {
|
|
|
34
34
|
mainMenuLink: CustomApplicationMenuLinkData;
|
|
35
35
|
submenuLinks: CustomApplicationSubmenuLinkData[];
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type ApplicationRuntimeConfig<AdditionalEnvironmentProperties extends {} = {}> = {
|
|
38
38
|
data: CustomApplicationData;
|
|
39
39
|
env: AdditionalEnvironmentProperties & ApplicationWindow['app'];
|
|
40
40
|
headers: JSONSchemaForCustomApplicationConfigurationFiles['headers'];
|
|
41
41
|
};
|
|
42
|
-
export
|
|
42
|
+
export type LoadingConfigOptions = {
|
|
43
43
|
processEnv: NodeJS.ProcessEnv;
|
|
44
44
|
applicationPath: string;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
export type WordSeparators = '-';
|
|
47
|
+
export type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [Head, ...Split<Tail, Delimiter>] : S extends Delimiter ? [] : [S];
|
|
48
|
+
type InnerCamelCaseStringArray<Parts extends readonly unknown[], PreviousPart> = Parts extends [`${infer FirstPart}`, ...infer RemainingParts] ? FirstPart extends undefined ? '' : FirstPart extends '' ? InnerCamelCaseStringArray<RemainingParts, PreviousPart> : `${PreviousPart extends '' ? FirstPart : Capitalize<FirstPart>}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}` : '';
|
|
49
|
+
type CamelCaseStringArray<Parts extends readonly string[]> = Parts extends [
|
|
50
50
|
`${infer FirstPart}`,
|
|
51
51
|
...infer RemainingParts
|
|
52
52
|
] ? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`> : never;
|
|
53
|
-
export
|
|
53
|
+
export type CamelCase<K> = K extends string ? CamelCaseStringArray<Split<K extends Uppercase<K> ? Uppercase<K> : K, WordSeparators>> : K;
|
|
54
54
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-config",
|
|
3
|
-
"version": "21.23.
|
|
3
|
+
"version": "21.23.7",
|
|
4
4
|
"description": "Configuration utilities for building Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/register": "^7.18.9",
|
|
38
|
-
"@babel/runtime": "^7.
|
|
39
|
-
"@babel/runtime-corejs3": "^7.
|
|
40
|
-
"@commercetools-frontend/babel-preset-mc-app": "21.23.
|
|
41
|
-
"ajv": "8.
|
|
42
|
-
"core-js": "^3.
|
|
43
|
-
"cosmiconfig": "7.0
|
|
44
|
-
"dompurify": "^2.4.
|
|
38
|
+
"@babel/runtime": "^7.20.13",
|
|
39
|
+
"@babel/runtime-corejs3": "^7.20.13",
|
|
40
|
+
"@commercetools-frontend/babel-preset-mc-app": "21.23.7",
|
|
41
|
+
"ajv": "8.12.0",
|
|
42
|
+
"core-js": "^3.28.0",
|
|
43
|
+
"cosmiconfig": "7.1.0",
|
|
44
|
+
"dompurify": "^2.4.4",
|
|
45
45
|
"jsdom": "^16.7.0",
|
|
46
46
|
"lodash": "4.17.21",
|
|
47
47
|
"omit-empty-es": "1.1.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/jsdom": "^16.2.15",
|
|
51
|
-
"json-schema-to-typescript": "11.0.
|
|
51
|
+
"json-schema-to-typescript": "11.0.3",
|
|
52
52
|
"shelljs": "0.8.5"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|