@equinor/fusion-framework-module-app 6.1.16 → 6.1.17
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 +6 -0
- package/dist/esm/AppConfig.js +0 -10
- package/dist/esm/AppConfig.js.map +1 -1
- package/dist/esm/AppConfigurator.js +8 -10
- package/dist/esm/AppConfigurator.js.map +1 -1
- package/dist/esm/app/App.js.map +1 -1
- package/dist/esm/app/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/AppConfig.d.ts +0 -10
- package/dist/types/app/App.d.ts +6 -5
- package/dist/types/app/actions.d.ts +3 -3
- package/dist/types/app/create-reducer.d.ts +1 -1
- package/dist/types/app/index.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -9
- package/src/AppConfig.ts +0 -10
- package/src/AppConfigurator.ts +10 -9
- package/src/app/App.ts +7 -5
- package/src/app/index.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -22,16 +22,6 @@ export type ConfigEndPoint = {
|
|
|
22
22
|
*
|
|
23
23
|
* console.log(config.getEndpoint('api')); // { url: 'https://api.example.com' }
|
|
24
24
|
* ```
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} config - The configuration object.
|
|
27
|
-
* @param {TEnvironment} [config.environment] - The environment configuration.
|
|
28
|
-
* @param {Record<string, ConfigEndPoint>} [config.endpoints] - The endpoints configuration.
|
|
29
|
-
*
|
|
30
|
-
* @property {TEnvironment} [environment] - The environment configuration.
|
|
31
|
-
* @property {Record<string, string | undefined>} endpoints - The endpoints configuration (deprecated).
|
|
32
|
-
*
|
|
33
|
-
* @method getEndpoint
|
|
34
|
-
* @param {string} key - The key of the endpoint to retrieve.
|
|
35
25
|
*/
|
|
36
26
|
export declare class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEnvironment> {
|
|
37
27
|
#private;
|
package/dist/types/app/App.d.ts
CHANGED
|
@@ -181,6 +181,11 @@ export interface IApp<TEnv extends ConfigEnvironment = ConfigEnvironment, TModul
|
|
|
181
181
|
*/
|
|
182
182
|
getAppModuleAsync(allow_cache?: boolean): Promise<AppScriptModule>;
|
|
183
183
|
}
|
|
184
|
+
export type AppInitializeResult = {
|
|
185
|
+
manifest: AppManifest;
|
|
186
|
+
script: AppScriptModule;
|
|
187
|
+
config: AppConfig;
|
|
188
|
+
};
|
|
184
189
|
export declare class App<TEnv extends ConfigEnvironment = ConfigEnvironment, TModules extends Array<AnyModule> | unknown = unknown> implements IApp<TEnv, TModules> {
|
|
185
190
|
#private;
|
|
186
191
|
get manifest$(): Observable<AppManifest>;
|
|
@@ -200,11 +205,7 @@ export declare class App<TEnv extends ConfigEnvironment = ConfigEnvironment, TMo
|
|
|
200
205
|
provider: AppModuleProvider;
|
|
201
206
|
event?: ModuleType<EventModule>;
|
|
202
207
|
});
|
|
203
|
-
initialize(): Observable<
|
|
204
|
-
manifest: AppManifest;
|
|
205
|
-
script: AppScriptModule;
|
|
206
|
-
config: AppConfig;
|
|
207
|
-
}>;
|
|
208
|
+
initialize(): Observable<AppInitializeResult>;
|
|
208
209
|
loadConfig(): void;
|
|
209
210
|
loadManifest(update?: boolean): void;
|
|
210
211
|
updateManifest(manifest: AppManifest, replace?: false): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ActionInstanceMap, type ActionTypes } from '@equinor/fusion-observable';
|
|
2
|
-
import type { AppConfig, AppManifest,
|
|
2
|
+
import type { AppConfig, AppManifest, AppScriptModule, AppSettings } from '../types';
|
|
3
3
|
declare const createActions: () => {
|
|
4
4
|
/** Manifest loading */
|
|
5
5
|
setManifest: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[manifest: AppManifest, update?: boolean | undefined], AppManifest, "set_manifest", never, {
|
|
@@ -42,7 +42,7 @@ declare const createActions: () => {
|
|
|
42
42
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: AppScriptModule], AppScriptModule, "import_app::success", never, never>;
|
|
43
43
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "import_app::failure", never, never>;
|
|
44
44
|
};
|
|
45
|
-
setInstance: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[instance:
|
|
45
|
+
setInstance: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[instance: any], any, "set_instance", never, never>;
|
|
46
46
|
initialize: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[], null, "initialize_app::request", never, never> & {
|
|
47
47
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[], null, "initialize_app::success", never, never>;
|
|
48
48
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "initialize_app::failure", never, never>;
|
|
@@ -90,7 +90,7 @@ export declare const actions: {
|
|
|
90
90
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: AppScriptModule], AppScriptModule, "import_app::success", never, never>;
|
|
91
91
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "import_app::failure", never, never>;
|
|
92
92
|
};
|
|
93
|
-
setInstance: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[instance:
|
|
93
|
+
setInstance: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[instance: any], any, "set_instance", never, never>;
|
|
94
94
|
initialize: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[], null, "initialize_app::request", never, never> & {
|
|
95
95
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[], null, "initialize_app::success", never, never>;
|
|
96
96
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "initialize_app::failure", never, never>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { App, IApp } from './App';
|
|
1
|
+
export { App, IApp, type AppInitializeResult } from './App';
|
|
2
2
|
export { default } from './App';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.1.
|
|
1
|
+
export declare const version = "6.1.17";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-app",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
"immer": "^9.0.16",
|
|
61
61
|
"rxjs": "^7.8.1",
|
|
62
62
|
"uuid": "^11.0.3",
|
|
63
|
-
"zod": "^3.
|
|
64
|
-
"@equinor/fusion-
|
|
65
|
-
"@equinor/fusion-
|
|
63
|
+
"zod": "^3.25.76",
|
|
64
|
+
"@equinor/fusion-query": "^5.2.11",
|
|
65
|
+
"@equinor/fusion-observable": "^8.5.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"typescript": "^5.8.2",
|
|
69
|
-
"@equinor/fusion-framework-module": "^
|
|
70
|
-
"@equinor/fusion-framework-module-http": "^6.3.
|
|
71
|
-
"@equinor/fusion-framework-module-event": "^4.3.
|
|
72
|
-
"@equinor/fusion-framework-module-
|
|
73
|
-
"@equinor/fusion-framework-module-
|
|
69
|
+
"@equinor/fusion-framework-module": "^5.0.0",
|
|
70
|
+
"@equinor/fusion-framework-module-http": "^6.3.4",
|
|
71
|
+
"@equinor/fusion-framework-module-event": "^4.3.7",
|
|
72
|
+
"@equinor/fusion-framework-module-service-discovery": "^8.0.18",
|
|
73
|
+
"@equinor/fusion-framework-module-msal": "^4.0.8"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsc -b"
|
package/src/AppConfig.ts
CHANGED
|
@@ -38,16 +38,6 @@ export type ConfigEndPoint = {
|
|
|
38
38
|
*
|
|
39
39
|
* console.log(config.getEndpoint('api')); // { url: 'https://api.example.com' }
|
|
40
40
|
* ```
|
|
41
|
-
*
|
|
42
|
-
* @param {Object} config - The configuration object.
|
|
43
|
-
* @param {TEnvironment} [config.environment] - The environment configuration.
|
|
44
|
-
* @param {Record<string, ConfigEndPoint>} [config.endpoints] - The endpoints configuration.
|
|
45
|
-
*
|
|
46
|
-
* @property {TEnvironment} [environment] - The environment configuration.
|
|
47
|
-
* @property {Record<string, string | undefined>} endpoints - The endpoints configuration (deprecated).
|
|
48
|
-
*
|
|
49
|
-
* @method getEndpoint
|
|
50
|
-
* @param {string} key - The key of the endpoint to retrieve.
|
|
51
41
|
*/
|
|
52
42
|
export class AppConfig<TEnvironment extends ConfigEnvironment = ConfigEnvironment> {
|
|
53
43
|
#endpoints: Record<string, ConfigEndPoint>;
|
package/src/AppConfigurator.ts
CHANGED
|
@@ -38,17 +38,18 @@ export class AppConfigurator
|
|
|
38
38
|
init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]>,
|
|
39
39
|
): Promise<IHttpClient> {
|
|
40
40
|
const http = await init.requireInstance('http');
|
|
41
|
+
const serviceName = 'apps';
|
|
41
42
|
/** check if the http provider has configure a client */
|
|
42
|
-
if (http.hasClient(
|
|
43
|
-
return http.createClient(
|
|
44
|
-
} else {
|
|
45
|
-
/** load service discovery module */
|
|
46
|
-
const serviceDiscovery = await init.requireInstance('serviceDiscovery');
|
|
47
|
-
|
|
48
|
-
// TODO - remove when refactor portal service!
|
|
49
|
-
/** resolve and create a client from discovery */
|
|
50
|
-
return await serviceDiscovery.createClient('apps');
|
|
43
|
+
if (http.hasClient(serviceName)) {
|
|
44
|
+
return http.createClient(serviceName);
|
|
51
45
|
}
|
|
46
|
+
|
|
47
|
+
/** load service discovery module */
|
|
48
|
+
const serviceDiscovery = await init.requireInstance('serviceDiscovery');
|
|
49
|
+
|
|
50
|
+
// TODO - remove when refactor portal service!
|
|
51
|
+
/** resolve and create a client from discovery */
|
|
52
|
+
return await serviceDiscovery.createClient(serviceName);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
public setClient(
|
package/src/app/App.ts
CHANGED
|
@@ -248,6 +248,12 @@ export interface IApp<
|
|
|
248
248
|
|
|
249
249
|
const fallbackSettings: AppSettings = {};
|
|
250
250
|
|
|
251
|
+
export type AppInitializeResult = {
|
|
252
|
+
manifest: AppManifest;
|
|
253
|
+
script: AppScriptModule;
|
|
254
|
+
config: AppConfig;
|
|
255
|
+
};
|
|
256
|
+
|
|
251
257
|
// TODO make streams distinct until changed from state
|
|
252
258
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
253
259
|
export class App<
|
|
@@ -542,11 +548,7 @@ export class App<
|
|
|
542
548
|
});
|
|
543
549
|
}
|
|
544
550
|
|
|
545
|
-
public initialize(): Observable<{
|
|
546
|
-
manifest: AppManifest;
|
|
547
|
-
script: AppScriptModule;
|
|
548
|
-
config: AppConfig;
|
|
549
|
-
}> {
|
|
551
|
+
public initialize(): Observable<AppInitializeResult> {
|
|
550
552
|
return new Observable((subscriber) => {
|
|
551
553
|
// dispatch initialize action to indicate that the application is initializing
|
|
552
554
|
this.#state.next(actions.initialize());
|
package/src/app/index.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '6.1.
|
|
2
|
+
export const version = '6.1.17';
|