@equinor/fusion-framework-module-app 5.3.7 → 5.3.9
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 +61 -0
- package/dist/esm/AppConfigBuilder.js +3 -0
- package/dist/esm/AppConfigBuilder.js.map +1 -1
- package/dist/esm/AppConfigurator.js +10 -0
- package/dist/esm/AppConfigurator.js.map +1 -1
- package/dist/esm/AppModuleProvider.js +29 -0
- package/dist/esm/AppModuleProvider.js.map +1 -1
- package/dist/esm/app/App.js +102 -12
- package/dist/esm/app/App.js.map +1 -1
- package/dist/esm/app/actions.js +6 -0
- package/dist/esm/app/actions.js.map +1 -1
- package/dist/esm/app/create-reducer.js +3 -0
- package/dist/esm/app/create-reducer.js.map +1 -1
- package/dist/esm/app/create-state.js +4 -0
- package/dist/esm/app/create-state.js.map +1 -1
- package/dist/esm/app/flows.js +59 -8
- package/dist/esm/app/flows.js.map +1 -1
- package/dist/esm/enable-app-module.js +7 -1
- package/dist/esm/enable-app-module.js.map +1 -1
- package/dist/esm/errors.js +39 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/helpers.js +10 -0
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/module.js +21 -0
- package/dist/esm/module.js.map +1 -1
- package/dist/esm/version.js +2 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/AppConfigurator.d.ts +3 -0
- package/dist/types/AppModuleProvider.d.ts +26 -0
- package/dist/types/app/App.d.ts +100 -0
- package/dist/types/app/actions.d.ts +6 -0
- package/dist/types/app/events.d.ts +20 -2
- package/dist/types/app/flows.d.ts +18 -0
- package/dist/types/enable-app-module.d.ts +4 -0
- package/dist/types/errors.d.ts +39 -0
- package/dist/types/events.d.ts +3 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/types/module.d.ts +5 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -9
- package/src/version.ts +1 -1
|
@@ -23,6 +23,9 @@ export declare class AppConfigurator implements IAppConfigurator {
|
|
|
23
23
|
#private;
|
|
24
24
|
defaultExpireTime: number;
|
|
25
25
|
addConfigBuilder(init: AppConfigBuilderCallback): void;
|
|
26
|
+
/**
|
|
27
|
+
* WARNING: this function will be remove in future
|
|
28
|
+
*/
|
|
26
29
|
protected _createHttpClient(init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]>): Promise<IHttpClient>;
|
|
27
30
|
createConfig(init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]>): Promise<AppModuleConfig>;
|
|
28
31
|
}
|
|
@@ -12,17 +12,43 @@ export declare class AppModuleProvider {
|
|
|
12
12
|
appClient: Query<AppManifest, {
|
|
13
13
|
appKey: string;
|
|
14
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* fetch an application by key
|
|
17
|
+
* @param appKey - application key
|
|
18
|
+
* @remarks
|
|
19
|
+
* - null when current app is cleared
|
|
20
|
+
* - undefined if application never set
|
|
21
|
+
*/
|
|
15
22
|
get current(): CurrentApp | null | undefined;
|
|
16
23
|
get current$(): Observable<CurrentApp | null>;
|
|
17
24
|
constructor(args: {
|
|
18
25
|
config: AppModuleConfig;
|
|
19
26
|
event?: ModuleType<EventModule>;
|
|
20
27
|
});
|
|
28
|
+
/**
|
|
29
|
+
* fetch an application by key
|
|
30
|
+
* @param appKey - application key
|
|
31
|
+
*/
|
|
21
32
|
getAppManifest(appKey: string): Observable<AppManifest>;
|
|
33
|
+
/**
|
|
34
|
+
* fetch all applications
|
|
35
|
+
*/
|
|
22
36
|
getAllAppManifests(): Observable<AppManifest[]>;
|
|
37
|
+
/**
|
|
38
|
+
* fetch configuration for an application
|
|
39
|
+
* @param appKey - application key
|
|
40
|
+
*/
|
|
23
41
|
getAppConfig<TType = unknown>(appKey: string, tag?: string): Observable<AppConfig<TType>>;
|
|
42
|
+
/**
|
|
43
|
+
* set the current application, will internally resolve manifest
|
|
44
|
+
* @param appKey - application key
|
|
45
|
+
*/
|
|
24
46
|
setCurrentApp(appKeyOrApp: string | IApp): void;
|
|
25
47
|
clearCurrentApp(): void;
|
|
48
|
+
/**
|
|
49
|
+
* This should not be used, only for legacy creation backdoor
|
|
50
|
+
* @deprecated
|
|
51
|
+
*/
|
|
26
52
|
createApp(value: AppBundleStateInitial): App;
|
|
27
53
|
dispose(): void;
|
|
28
54
|
}
|
package/dist/types/app/App.d.ts
CHANGED
|
@@ -7,30 +7,130 @@ import { AnyModule, ModuleType } from '@equinor/fusion-framework-module';
|
|
|
7
7
|
import { AppBundleState, AppBundleStateInitial } from './types';
|
|
8
8
|
import './events';
|
|
9
9
|
export declare function filterEmpty<T>(): OperatorFunction<T | null | undefined, T>;
|
|
10
|
+
/**
|
|
11
|
+
* Represents an application in the framework.
|
|
12
|
+
* @template TEnv The type of the environment.
|
|
13
|
+
* @template TModules The type of the app modules.
|
|
14
|
+
*/
|
|
10
15
|
export interface IApp<TEnv = any, TModules extends Array<AnyModule> | unknown = unknown> {
|
|
16
|
+
/**
|
|
17
|
+
* Returns an observable that emits the app manifest.
|
|
18
|
+
* @returns An observable of type AppManifest.
|
|
19
|
+
*/
|
|
11
20
|
get manifest$(): Observable<AppManifest>;
|
|
21
|
+
/**
|
|
22
|
+
* Observable that emits the configuration of the app.
|
|
23
|
+
* @returns An Observable that emits the app configuration.
|
|
24
|
+
*/
|
|
12
25
|
get config$(): Observable<AppConfig<TEnv>>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns an observable stream of the loaded app script instance.
|
|
28
|
+
* @returns {Observable<AppScriptModule>} The observable stream of app script modules.
|
|
29
|
+
*/
|
|
13
30
|
get modules$(): Observable<AppScriptModule>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns an observable that emits the instance of the app modules.
|
|
33
|
+
* @returns An observable that emits the instance of the app modules.
|
|
34
|
+
*/
|
|
14
35
|
get instance$(): Observable<AppModulesInstance<TModules>>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the current state of the Application.
|
|
38
|
+
* @returns The current state of the Application.
|
|
39
|
+
*/
|
|
15
40
|
get state(): AppBundleState;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the app key.
|
|
43
|
+
* @returns The app key.
|
|
44
|
+
*/
|
|
16
45
|
get appKey(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Gets the manifest of the app.
|
|
48
|
+
* @returns The manifest of the app, or undefined if it doesn't exist.
|
|
49
|
+
*/
|
|
17
50
|
get manifest(): AppManifest | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the manifest asynchronously.
|
|
53
|
+
* @returns A promise that resolves to the AppManifest.
|
|
54
|
+
*/
|
|
18
55
|
get manifestAsync(): Promise<AppManifest>;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the configuration of the app.
|
|
58
|
+
* @returns The configuration object or undefined if no configuration is set.
|
|
59
|
+
*/
|
|
19
60
|
get config(): AppConfig<TEnv> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves the configuration asynchronously.
|
|
63
|
+
* @returns A promise that resolves to the AppConfig.
|
|
64
|
+
*/
|
|
20
65
|
get instance(): AppModulesInstance<TModules> | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Initializes the application container.
|
|
68
|
+
* @returns An observable that emits an object containing the manifest, script, and config.
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* app.initialize().subscribe({
|
|
72
|
+
* next: ({ manifest, script, config }) => {
|
|
73
|
+
* // Use the manifest, script, and config to initialize the application
|
|
74
|
+
* script.render(el, ...);
|
|
75
|
+
* },
|
|
76
|
+
* error: (err) => console.error('Failed to load application', err),
|
|
77
|
+
* complete: () => setInitializingApp(false)
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
21
81
|
initialize(): Observable<{
|
|
22
82
|
manifest: AppManifest;
|
|
23
83
|
script: AppScriptModule;
|
|
24
84
|
config: AppConfig;
|
|
25
85
|
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Loads the app configuration.
|
|
88
|
+
*/
|
|
26
89
|
loadConfig(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Loads the app manifest.
|
|
92
|
+
*/
|
|
27
93
|
loadManifest(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Loads the app module.
|
|
96
|
+
* @param allow_cache Whether to allow loading from cache.
|
|
97
|
+
*/
|
|
28
98
|
loadAppModule(allow_cache?: boolean): void;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the app configuration.
|
|
101
|
+
* @param force_refresh Whether to force refreshing the configuration.
|
|
102
|
+
* @returns An observable that emits the app configuration.
|
|
103
|
+
*/
|
|
29
104
|
getConfig(force_refresh?: boolean): Observable<AppConfig>;
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves the app configuration asynchronously.
|
|
107
|
+
* @param allow_cache Whether to allow loading from cache.
|
|
108
|
+
* @returns A promise that resolves to the AppConfig.
|
|
109
|
+
*/
|
|
30
110
|
getConfigAsync(allow_cache?: boolean): Promise<AppConfig>;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the app manifest.
|
|
113
|
+
* @param force_refresh Whether to force refreshing the manifest.
|
|
114
|
+
* @returns An observable that emits the app manifest.
|
|
115
|
+
*/
|
|
31
116
|
getManifest(force_refresh?: boolean): Observable<AppManifest>;
|
|
117
|
+
/**
|
|
118
|
+
* Retrieves the app manifest asynchronously.
|
|
119
|
+
* @param allow_cache Whether to allow loading from cache.
|
|
120
|
+
* @returns A promise that resolves to the AppManifest.
|
|
121
|
+
*/
|
|
32
122
|
getManifestAsync(allow_cache?: boolean): Promise<AppManifest>;
|
|
123
|
+
/**
|
|
124
|
+
* Gets the app module.
|
|
125
|
+
* @param force_refresh Whether to force refreshing the app module.
|
|
126
|
+
* @returns An observable that emits the app module.
|
|
127
|
+
*/
|
|
33
128
|
getAppModule(force_refresh?: boolean): Observable<AppScriptModule>;
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves the app module asynchronously.
|
|
131
|
+
* @param allow_cache Whether to allow loading from cache.
|
|
132
|
+
* @returns A promise that resolves to the AppScriptModule.
|
|
133
|
+
*/
|
|
34
134
|
getAppModuleAsync(allow_cache?: boolean): Promise<AppScriptModule>;
|
|
35
135
|
}
|
|
36
136
|
export declare class App<TEnv = any, TModules extends Array<AnyModule> | unknown = unknown> implements IApp<TEnv, TModules> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ActionInstanceMap, ActionTypes } from '@equinor/fusion-observable';
|
|
2
2
|
import { AppConfig, AppManifest, AppModulesInstance, AppScriptModule } from '../types';
|
|
3
3
|
declare const createActions: () => {
|
|
4
|
+
/** Manifest loading */
|
|
4
5
|
setManifest: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[manifest: AppManifest, update?: boolean | undefined], AppManifest, "set_manifest", never, {
|
|
5
6
|
created: number;
|
|
6
7
|
update: boolean | undefined;
|
|
@@ -11,11 +12,13 @@ declare const createActions: () => {
|
|
|
11
12
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[manifest: AppManifest], AppManifest, "fetch_manifest::success", never, never>;
|
|
12
13
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "fetch_manifest::failure", never, never>;
|
|
13
14
|
};
|
|
15
|
+
/** Config loading */
|
|
14
16
|
setConfig: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[config: AppConfig], AppConfig, "set_config", never, never>;
|
|
15
17
|
fetchConfig: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[key: string], string, "fetch_config::request", never, never> & {
|
|
16
18
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[config: AppConfig], AppConfig, "fetch_config::success", never, never>;
|
|
17
19
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "fetch_config::failure", never, never>;
|
|
18
20
|
};
|
|
21
|
+
/** App loading */
|
|
19
22
|
setModule: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: any], any, "set_module", never, never>;
|
|
20
23
|
importApp: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[entrypoint: string], string, "import_app::request", never, never> & {
|
|
21
24
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: AppScriptModule], AppScriptModule, "import_app::success", never, never>;
|
|
@@ -28,6 +31,7 @@ declare const createActions: () => {
|
|
|
28
31
|
};
|
|
29
32
|
};
|
|
30
33
|
export declare const actions: {
|
|
34
|
+
/** Manifest loading */
|
|
31
35
|
setManifest: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[manifest: AppManifest, update?: boolean | undefined], AppManifest, "set_manifest", never, {
|
|
32
36
|
created: number;
|
|
33
37
|
update: boolean | undefined;
|
|
@@ -38,11 +42,13 @@ export declare const actions: {
|
|
|
38
42
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[manifest: AppManifest], AppManifest, "fetch_manifest::success", never, never>;
|
|
39
43
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "fetch_manifest::failure", never, never>;
|
|
40
44
|
};
|
|
45
|
+
/** Config loading */
|
|
41
46
|
setConfig: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[config: AppConfig], AppConfig, "set_config", never, never>;
|
|
42
47
|
fetchConfig: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[key: string], string, "fetch_config::request", never, never> & {
|
|
43
48
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[config: AppConfig], AppConfig, "fetch_config::success", never, never>;
|
|
44
49
|
failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: unknown], unknown, "fetch_config::failure", never, never>;
|
|
45
50
|
};
|
|
51
|
+
/** App loading */
|
|
46
52
|
setModule: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: any], any, "set_module", never, never>;
|
|
47
53
|
importApp: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[entrypoint: string], string, "import_app::request", never, never> & {
|
|
48
54
|
success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[module: AppScriptModule], AppScriptModule, "import_app::success", never, never>;
|
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
2
2
|
import type { App } from './App';
|
|
3
3
|
import type { AppConfig, AppManifest, AppModulesInstance, AppScriptModule } from '../types';
|
|
4
|
-
|
|
4
|
+
/** base event type for applications */
|
|
5
|
+
export type AppEventEventInit<TDetail extends Record<string, unknown> | unknown = unknown> = FrameworkEventInit<
|
|
6
|
+
/** additional event details and key of target event */
|
|
7
|
+
TDetail & {
|
|
5
8
|
appKey: string;
|
|
6
|
-
},
|
|
9
|
+
},
|
|
10
|
+
/** source of the event */
|
|
11
|
+
App>;
|
|
7
12
|
export type AppEvent<TDetail extends Record<string, unknown> | unknown = unknown> = FrameworkEvent<AppEventEventInit<TDetail>>;
|
|
8
13
|
export type AppEventFailure = FrameworkEvent<AppEventEventInit<{
|
|
9
14
|
error: AppConfig;
|
|
10
15
|
}>>;
|
|
11
16
|
declare module '@equinor/fusion-framework-module-event' {
|
|
12
17
|
interface FrameworkEventMap {
|
|
18
|
+
/** fired when the application has initiated its modules */
|
|
13
19
|
onAppModulesLoaded: AppEvent<{
|
|
20
|
+
/** initiated modules for application */
|
|
14
21
|
modules: AppModulesInstance;
|
|
15
22
|
}>;
|
|
16
23
|
onAppManifestLoad: AppEvent;
|
|
24
|
+
/** fired when the application has loaded corresponding manifest */
|
|
17
25
|
onAppManifestLoaded: AppEvent<{
|
|
18
26
|
manifest: AppManifest;
|
|
19
27
|
}>;
|
|
20
28
|
onAppManifestFailure: AppEventFailure;
|
|
21
29
|
onAppConfigLoad: AppEvent;
|
|
30
|
+
/** fired when the application has loaded corresponding config */
|
|
22
31
|
onAppConfigLoaded: AppEvent<{
|
|
23
32
|
config: AppConfig;
|
|
24
33
|
}>;
|
|
25
34
|
onAppConfigFailure: AppEventFailure;
|
|
35
|
+
/** fired when the application has loaded corresponding javascript module */
|
|
26
36
|
onAppScriptLoad: AppEvent;
|
|
27
37
|
onAppScriptLoaded: AppEvent<{
|
|
28
38
|
script: AppScriptModule;
|
|
29
39
|
}>;
|
|
30
40
|
onAppScriptFailure: AppEventFailure;
|
|
41
|
+
/** fired before application loads manifest, config and script */
|
|
31
42
|
onAppInitialize: AppEvent;
|
|
43
|
+
/**
|
|
44
|
+
* fired after application has loaded manifest, config and script
|
|
45
|
+
*
|
|
46
|
+
* __note:__ not fired until all loaders has settled (last emit)
|
|
47
|
+
*/
|
|
32
48
|
onAppInitialized: AppEvent;
|
|
49
|
+
/** fired when application fails to load either manifest, config and script */
|
|
33
50
|
onAppInitializeFailure: AppEventFailure;
|
|
51
|
+
/** fired when the application is disposed (unmounts) */
|
|
34
52
|
onAppDispose: FrameworkEvent<AppEventEventInit>;
|
|
35
53
|
}
|
|
36
54
|
}
|
|
@@ -2,6 +2,24 @@ import type { Flow } from '@equinor/fusion-observable';
|
|
|
2
2
|
import type { AppModuleProvider } from '../AppModuleProvider';
|
|
3
3
|
import type { Actions } from './actions';
|
|
4
4
|
import type { AppBundleState } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Handles the fetch manifest action by fetching the app manifest from the provider,
|
|
7
|
+
* dispatching success or failure actions based on the result.
|
|
8
|
+
*
|
|
9
|
+
* @param provider The AppModuleProvider used to fetch the app manifest.
|
|
10
|
+
* @returns A Flow function that takes an Observable of actions and returns an Observable of actions.
|
|
11
|
+
*/
|
|
5
12
|
export declare const handleFetchManifest: (provider: AppModuleProvider) => Flow<Actions, AppBundleState>;
|
|
13
|
+
/**
|
|
14
|
+
* Handles the fetch config action by fetching the app configuration from the provider,
|
|
15
|
+
* filtering out null values, and dispatching success or failure actions accordingly.
|
|
16
|
+
*
|
|
17
|
+
* @param provider The AppModuleProvider used to fetch the app configuration.
|
|
18
|
+
* @returns A Flow function that takes an Observable of actions and returns an Observable of actions.
|
|
19
|
+
*/
|
|
6
20
|
export declare const handleFetchConfig: (provider: AppModuleProvider) => Flow<Actions, AppBundleState>;
|
|
21
|
+
/**
|
|
22
|
+
* Handles the import application flow.
|
|
23
|
+
* @returns A flow that takes in actions and returns an observable of AppBundleState.
|
|
24
|
+
*/
|
|
7
25
|
export declare const handleImportApplication: () => Flow<Actions, AppBundleState>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { IModulesConfigurator } from '@equinor/fusion-framework-module';
|
|
2
2
|
import type { AppConfigBuilderCallback } from './AppConfigBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Method for enabling the Service module
|
|
5
|
+
* @param configurator - configuration object
|
|
6
|
+
*/
|
|
3
7
|
export declare const enableAppModule: (configurator: IModulesConfigurator<any, any>, builder?: AppConfigBuilderCallback) => void;
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
type AppErrorType = 'not_found' | 'unauthorized' | 'unknown';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error that occurs when loading an application manifest.
|
|
4
|
+
*/
|
|
2
5
|
export declare class AppManifestError extends Error {
|
|
3
6
|
readonly type: AppErrorType;
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of AppManifestError based on the HTTP response status.
|
|
9
|
+
* @param response The HTTP response.
|
|
10
|
+
* @param options Optional error options.
|
|
11
|
+
* @returns An instance of AppManifestError.
|
|
12
|
+
*/
|
|
4
13
|
static fromHttpResponse(response: Response, options?: ErrorOptions): AppManifestError;
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of AppManifestError.
|
|
16
|
+
* @param type The type of the error.
|
|
17
|
+
* @param message The error message.
|
|
18
|
+
* @param options Optional error options.
|
|
19
|
+
*/
|
|
5
20
|
constructor(type: AppErrorType, message?: string, options?: ErrorOptions);
|
|
6
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Represents an error that occurs in the application configuration.
|
|
24
|
+
*/
|
|
7
25
|
export declare class AppConfigError extends Error {
|
|
8
26
|
readonly type: AppErrorType;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of `AppConfigError` based on the HTTP response status.
|
|
29
|
+
* @param response The HTTP response.
|
|
30
|
+
* @param options Additional error options.
|
|
31
|
+
* @returns An instance of `AppConfigError` based on the HTTP response status.
|
|
32
|
+
*/
|
|
9
33
|
static fromHttpResponse(response: Response, options?: ErrorOptions): AppConfigError;
|
|
34
|
+
/**
|
|
35
|
+
* Creates an instance of `AppConfigError`.
|
|
36
|
+
* @param type The type of the application error.
|
|
37
|
+
* @param message The error message.
|
|
38
|
+
* @param options Additional error options.
|
|
39
|
+
*/
|
|
10
40
|
constructor(type: AppErrorType, message?: string, options?: ErrorOptions);
|
|
11
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Represents an error that occurs when loading the application script.
|
|
44
|
+
*/
|
|
12
45
|
export declare class AppScriptModuleError extends Error {
|
|
13
46
|
readonly type: AppErrorType;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new instance of the AppScriptModuleError class.
|
|
49
|
+
* @param type The type of the error.
|
|
50
|
+
* @param message The error message.
|
|
51
|
+
* @param options Additional options for the error.
|
|
52
|
+
*/
|
|
14
53
|
constructor(type: AppErrorType, message?: string, options?: ErrorOptions);
|
|
15
54
|
}
|
|
16
55
|
export {};
|
package/dist/types/events.d.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { App } from './app/App';
|
|
|
3
3
|
import './app/events';
|
|
4
4
|
declare module '@equinor/fusion-framework-module-event' {
|
|
5
5
|
interface FrameworkEventMap {
|
|
6
|
+
/** fired when the current selected application changes */
|
|
6
7
|
onCurrentAppChanged: FrameworkEvent<FrameworkEventInit<{
|
|
8
|
+
/** current application */
|
|
7
9
|
next?: App;
|
|
10
|
+
/** previous application */
|
|
8
11
|
previous?: App;
|
|
9
12
|
}>>;
|
|
10
13
|
}
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { AppManifest } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two app manifests for equality.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of the app manifest.
|
|
6
|
+
* @param a - The first app manifest.
|
|
7
|
+
* @param b - The second app manifest.
|
|
8
|
+
* @returns True if the app manifests are equal, false otherwise.
|
|
9
|
+
*/
|
|
2
10
|
export declare const compareAppManifest: <T extends AppManifest>(a?: T, b?: T) => boolean;
|
package/dist/types/module.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ import { IAppConfigurator } from './AppConfigurator';
|
|
|
4
4
|
import { AppModuleProvider } from './AppModuleProvider';
|
|
5
5
|
export declare const moduleKey = "app";
|
|
6
6
|
export type AppModule = Module<typeof moduleKey, AppModuleProvider, IAppConfigurator, ModuleDeps>;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a module for handling applications.
|
|
9
|
+
* Responsible for loading applications, configurations and manifests.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
7
12
|
export declare const module: AppModule;
|
|
8
13
|
export default module;
|
|
9
14
|
declare module '@equinor/fusion-framework-module' {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ export type AppConfig<TEnvironment = unknown> = {
|
|
|
51
51
|
environment: TEnvironment;
|
|
52
52
|
endpoints: Record<string, string | Endpoint>;
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* @template TEnvironment - name of hosted environment
|
|
56
|
+
* @template TModule - ES module type (import return type)
|
|
57
|
+
*/
|
|
54
58
|
export type AppBundle<TEnvironment = unknown, TModule = unknown> = {
|
|
55
59
|
manifest: AppManifest;
|
|
56
60
|
config: AppConfig<TEnvironment>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.3.
|
|
1
|
+
export declare const version = "5.3.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-app",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"immer": "^9.0.16",
|
|
50
50
|
"rxjs": "^7.8.1",
|
|
51
|
-
"@equinor/fusion-observable": "^8.
|
|
52
|
-
"@equinor/fusion-query": "^5.
|
|
51
|
+
"@equinor/fusion-observable": "^8.4.0",
|
|
52
|
+
"@equinor/fusion-query": "^5.1.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"typescript": "^5.
|
|
56
|
-
"@equinor/fusion-framework-module": "^4.
|
|
57
|
-
"@equinor/fusion-framework-module-
|
|
58
|
-
"@equinor/fusion-framework-module-
|
|
59
|
-
"@equinor/fusion-framework-module-
|
|
60
|
-
"@equinor/fusion-framework-module
|
|
55
|
+
"typescript": "^5.5.3",
|
|
56
|
+
"@equinor/fusion-framework-module-event": "^4.2.2",
|
|
57
|
+
"@equinor/fusion-framework-module-http": "^6.0.2",
|
|
58
|
+
"@equinor/fusion-framework-module-msal": "^3.1.3",
|
|
59
|
+
"@equinor/fusion-framework-module-service-discovery": "^7.1.11",
|
|
60
|
+
"@equinor/fusion-framework-module": "^4.3.3"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsc -b"
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '5.3.
|
|
2
|
+
export const version = '5.3.9';
|