@equinor/fusion-framework-module-app 7.4.0 → 7.4.2-next.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/CHANGELOG.md +20 -33
- package/dist/esm/AppConfig.js +8 -24
- package/dist/esm/AppConfig.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/AppConfig.d.ts +3 -15
- package/dist/types/types.d.ts +14 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +8 -8
- package/src/AppConfig.ts +9 -26
- package/src/types.ts +16 -2
- package/src/version.ts +1 -1
|
@@ -27,18 +27,12 @@ export declare class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEn
|
|
|
27
27
|
#private;
|
|
28
28
|
/**
|
|
29
29
|
* The environment configuration for the application.
|
|
30
|
-
* This property is read-only and is of type `TEnvironment`.
|
|
31
30
|
*/
|
|
32
|
-
|
|
31
|
+
get environment(): TEnvironment;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* Retrieves the endpoints as a record of strings. This method returns a proxy
|
|
37
|
-
* that maps the endpoint names to their respective URLs.
|
|
38
|
-
*
|
|
39
|
-
* @returns {Record<string, string | undefined>} A record where the keys are endpoint names and the values are their URLs.
|
|
33
|
+
* The configuration endpoints for the application,.
|
|
40
34
|
*/
|
|
41
|
-
get endpoints(): Record<string,
|
|
35
|
+
get endpoints(): Record<string, ConfigEndPoint>;
|
|
42
36
|
constructor(config: {
|
|
43
37
|
environment?: TEnvironment | null;
|
|
44
38
|
endpoints?: Record<string, ConfigEndPoint>;
|
|
@@ -50,10 +44,4 @@ export declare class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEn
|
|
|
50
44
|
* @returns The configuration endpoint if found, otherwise `undefined`.
|
|
51
45
|
*/
|
|
52
46
|
getEndpoint(key: string): ConfigEndPoint | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Retrieve all configuration endpoints associated with the app.
|
|
55
|
-
*
|
|
56
|
-
* @returns The configuration endpoints found.
|
|
57
|
-
*/
|
|
58
|
-
getEndpoints(): Record<string, ConfigEndPoint>;
|
|
59
47
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -40,6 +40,18 @@ type AppPerson = {
|
|
|
40
40
|
};
|
|
41
41
|
export type AppAdmin = AppPerson;
|
|
42
42
|
export type AppOwner = AppPerson;
|
|
43
|
+
/**
|
|
44
|
+
* Schema entry format for route documentation in app manifests.
|
|
45
|
+
* Each entry represents a route with its path, description, and optional parameter/search schemas.
|
|
46
|
+
*/
|
|
47
|
+
export type RouteSchemaEntry = [
|
|
48
|
+
path: string,
|
|
49
|
+
description: string,
|
|
50
|
+
options?: {
|
|
51
|
+
params?: Record<string, string>;
|
|
52
|
+
search?: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
];
|
|
43
55
|
export type AppBuildManifest = {
|
|
44
56
|
version: string;
|
|
45
57
|
entryPoint: string;
|
|
@@ -83,6 +95,8 @@ export interface AppManifest {
|
|
|
83
95
|
admins?: Nullable<AppAdmin[]>;
|
|
84
96
|
owners?: Nullable<AppOwner[]>;
|
|
85
97
|
build?: Nullable<AppBuildManifest>;
|
|
98
|
+
/** Route schema entries for documentation and API schema generation */
|
|
99
|
+
routes?: Nullable<RouteSchemaEntry[]>;
|
|
86
100
|
}
|
|
87
101
|
/**
|
|
88
102
|
* @template TEnvironment - name of hosted environment
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "7.4.0";
|
|
1
|
+
export declare const version = "7.4.2-next.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-app",
|
|
3
|
-
"version": "7.4.0",
|
|
3
|
+
"version": "7.4.2-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
"rxjs": "^7.8.1",
|
|
62
62
|
"uuid": "^13.0.0",
|
|
63
63
|
"zod": "^4.1.8",
|
|
64
|
-
"@equinor/fusion-observable": "^8.5.
|
|
65
|
-
"@equinor/fusion-query": "^6.0.
|
|
64
|
+
"@equinor/fusion-observable": "^8.5.9-next.0",
|
|
65
|
+
"@equinor/fusion-query": "^6.0.5-next.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"typescript": "^5.8.2",
|
|
69
|
-
"@equinor/fusion-framework-module
|
|
70
|
-
"@equinor/fusion-framework-module-
|
|
71
|
-
"@equinor/fusion-framework-module-
|
|
72
|
-
"@equinor/fusion-framework-module-msal": "^
|
|
73
|
-
"@equinor/fusion-framework-module": "^
|
|
69
|
+
"@equinor/fusion-framework-module": "^5.0.7-next.0",
|
|
70
|
+
"@equinor/fusion-framework-module-event": "^5.0.2-next.0",
|
|
71
|
+
"@equinor/fusion-framework-module-http": "^7.0.9-next.0",
|
|
72
|
+
"@equinor/fusion-framework-module-msal": "^7.3.2-next.0",
|
|
73
|
+
"@equinor/fusion-framework-module-service-discovery": "^9.1.2-next.0"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsc -b"
|
package/src/AppConfig.ts
CHANGED
|
@@ -41,36 +41,28 @@ export type ConfigEndPoint = {
|
|
|
41
41
|
*/
|
|
42
42
|
export class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEnvironment> {
|
|
43
43
|
#endpoints: Record<string, ConfigEndPoint>;
|
|
44
|
+
#environment: TEnvironment;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* The environment configuration for the application.
|
|
47
|
-
* This property is read-only and is of type `TEnvironment`.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
get environment(): TEnvironment {
|
|
50
|
+
return this.#environment;
|
|
51
|
+
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* Retrieves the endpoints as a record of strings. This method returns a proxy
|
|
55
|
-
* that maps the endpoint names to their respective URLs.
|
|
56
|
-
*
|
|
57
|
-
* @returns {Record<string, string | undefined>} A record where the keys are endpoint names and the values are their URLs.
|
|
54
|
+
* The configuration endpoints for the application,.
|
|
58
55
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return new Proxy(this.#endpoints, {
|
|
62
|
-
get(target, prop): string | undefined {
|
|
63
|
-
return target[prop as string]?.url;
|
|
64
|
-
},
|
|
65
|
-
}) as unknown as Record<string, string>;
|
|
56
|
+
get endpoints(): Record<string, ConfigEndPoint> {
|
|
57
|
+
return this.#endpoints;
|
|
66
58
|
}
|
|
67
59
|
|
|
68
60
|
constructor(config: {
|
|
69
61
|
environment?: TEnvironment | null;
|
|
70
62
|
endpoints?: Record<string, ConfigEndPoint>;
|
|
71
63
|
}) {
|
|
72
|
-
this
|
|
73
|
-
this.#endpoints = config.endpoints ?? {};
|
|
64
|
+
this.#environment = deepFreeze(config.environment ?? {}) as TEnvironment;
|
|
65
|
+
this.#endpoints = deepFreeze(config.endpoints ?? {});
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
/**
|
|
@@ -82,13 +74,4 @@ export class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEnvironmen
|
|
|
82
74
|
getEndpoint(key: string): ConfigEndPoint | undefined {
|
|
83
75
|
return this.#endpoints[key];
|
|
84
76
|
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Retrieve all configuration endpoints associated with the app.
|
|
88
|
-
*
|
|
89
|
-
* @returns The configuration endpoints found.
|
|
90
|
-
*/
|
|
91
|
-
getEndpoints(): Record<string, ConfigEndPoint> {
|
|
92
|
-
return this.#endpoints;
|
|
93
|
-
}
|
|
94
77
|
}
|
package/src/types.ts
CHANGED
|
@@ -9,8 +9,7 @@ import type IApp from './app';
|
|
|
9
9
|
export type ConfigEnvironment = Record<string, unknown>;
|
|
10
10
|
export type { AppConfig } from './AppConfig';
|
|
11
11
|
|
|
12
|
-
// TODO
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
// biome-ignore lint/suspicious/noExplicitAny: TODO - needs proper type definition
|
|
14
13
|
type Fusion = any;
|
|
15
14
|
|
|
16
15
|
export type AppEnv<TEnv extends ConfigEnvironment = ConfigEnvironment, TProps = unknown> = {
|
|
@@ -66,6 +65,19 @@ export type AppAdmin = AppPerson;
|
|
|
66
65
|
|
|
67
66
|
export type AppOwner = AppPerson;
|
|
68
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Schema entry format for route documentation in app manifests.
|
|
70
|
+
* Each entry represents a route with its path, description, and optional parameter/search schemas.
|
|
71
|
+
*/
|
|
72
|
+
export type RouteSchemaEntry = [
|
|
73
|
+
path: string,
|
|
74
|
+
description: string,
|
|
75
|
+
options?: {
|
|
76
|
+
params?: Record<string, string>;
|
|
77
|
+
search?: Record<string, string>;
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
|
|
69
81
|
export type AppBuildManifest = {
|
|
70
82
|
version: string;
|
|
71
83
|
entryPoint: string;
|
|
@@ -110,6 +122,8 @@ export interface AppManifest {
|
|
|
110
122
|
admins?: Nullable<AppAdmin[]>;
|
|
111
123
|
owners?: Nullable<AppOwner[]>;
|
|
112
124
|
build?: Nullable<AppBuildManifest>;
|
|
125
|
+
/** Route schema entries for documentation and API schema generation */
|
|
126
|
+
routes?: Nullable<RouteSchemaEntry[]>;
|
|
113
127
|
}
|
|
114
128
|
|
|
115
129
|
/**
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '7.4.0';
|
|
2
|
+
export const version = '7.4.2-next.0';
|