@commercetools-frontend/application-config 22.7.0 → 22.8.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.
@@ -16,3 +16,7 @@ export declare const MC_API_URLS: {
16
16
  readonly AWS_OHIO: "https://mc-api.us-east-2.aws.commercetools.com";
17
17
  readonly AWS_CN: "https://mc-api.cn-northwest-1.aws.commercetools.cn";
18
18
  };
19
+ export declare const LOADED_CONFIG_TYPES: {
20
+ readonly CUSTOM_APPLICATION: "custom-application";
21
+ readonly CUSTOM_VIEW: "custom-view";
22
+ };
@@ -1,4 +1,8 @@
1
- import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schema';
2
- export declare const getConfigPath: () => string;
3
- declare const loadConfig: (applicationPath: string) => JSONSchemaForCustomApplicationConfigurationFiles;
1
+ import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schemas/generated/custom-application.schema';
2
+ import type { JSONSchemaForCustomViewConfigurationFiles } from './schemas/generated/custom-view.schema';
3
+ export declare const getConfigPath: () => string | undefined;
4
+ declare const loadConfig: (applicationPath: string) => {
5
+ filepath: string;
6
+ config: JSONSchemaForCustomApplicationConfigurationFiles | JSONSchemaForCustomViewConfigurationFiles;
7
+ };
4
8
  export default loadConfig;
@@ -0,0 +1,56 @@
1
+ export type CspDirective = string[];
2
+ export interface JSONSchemaForCustomViewConfigurationFiles {
3
+ name: string;
4
+ description?: string;
5
+ cloudIdentifier: string;
6
+ mcApiUrl?: string;
7
+ oAuthScopes: {
8
+ view: string[];
9
+ manage: string[];
10
+ };
11
+ additionalOAuthScopes?: {
12
+ name: string;
13
+ view: string[];
14
+ manage: string[];
15
+ }[];
16
+ env: {
17
+ development: {
18
+ initialProjectKey: string;
19
+ teamId?: string;
20
+ hostUriPath?: string;
21
+ };
22
+ production: {
23
+ customViewId: string;
24
+ url: string;
25
+ cdnUrl?: string;
26
+ };
27
+ };
28
+ additionalEnv?: {
29
+ [k: string]: unknown;
30
+ };
31
+ headers?: {
32
+ csp?: {
33
+ 'connect-src': CspDirective;
34
+ 'font-src'?: CspDirective;
35
+ 'img-src'?: CspDirective;
36
+ 'script-src'?: CspDirective;
37
+ 'style-src'?: CspDirective;
38
+ 'frame-src'?: CspDirective;
39
+ };
40
+ permissionsPolicies?: {
41
+ [k: string]: unknown;
42
+ };
43
+ strictTransportSecurity?: ('includeSubDomains' | 'preload')[];
44
+ };
45
+ labelAllLocales: {
46
+ locale: 'en' | 'de' | 'es' | 'fr-FR' | 'pt-BR' | 'zh-CN';
47
+ value: string;
48
+ }[];
49
+ type: 'CustomPanel';
50
+ typeSettings?: {
51
+ size?: 'SMALL' | 'LARGE';
52
+ [k: string]: unknown;
53
+ };
54
+ locators: string[];
55
+ [k: string]: unknown;
56
+ }
@@ -1,4 +1,4 @@
1
- import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schema';
2
- import type { CustomApplicationData } from './types';
3
- declare function transformCustomApplicationConfigToData(appConfig: JSONSchemaForCustomApplicationConfigurationFiles): CustomApplicationData;
4
- export { transformCustomApplicationConfigToData };
1
+ import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schemas/generated/custom-application.schema';
2
+ import type { JSONSchemaForCustomViewConfigurationFiles } from './schemas/generated/custom-view.schema';
3
+ import type { LoadedConfigType, CustomApplicationData, CustomViewData } from './types';
4
+ export declare function transformConfigurationToData(configType: LoadedConfigType, configuration: JSONSchemaForCustomApplicationConfigurationFiles | JSONSchemaForCustomViewConfigurationFiles): CustomApplicationData | CustomViewData;