@equinor/fusion-framework-module-app 6.1.17 → 6.1.19
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 +63 -0
- package/dist/esm/AppClient.js +9 -10
- package/dist/esm/AppClient.js.map +1 -1
- package/dist/esm/errors.js +6 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/app/actions.d.ts +3 -3
- package/dist/types/app/create-reducer.d.ts +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -9
- package/src/AppClient.ts +18 -10
- package/src/errors.ts +7 -1
- package/src/types.ts +7 -1
- package/src/version.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ActionInstanceMap, type ActionTypes } from '@equinor/fusion-observable';
|
|
2
|
-
import type { AppConfig, AppManifest, AppScriptModule, AppSettings } from '../types';
|
|
2
|
+
import type { AppConfig, AppManifest, AppModulesInstance, 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: AppModulesInstance], AppModulesInstance, "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: AppModulesInstance], AppModulesInstance, "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>;
|
package/dist/types/errors.d.ts
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ModuleDeps = [HttpModule, ServiceDiscoveryModule, EventModule];
|
|
|
18
18
|
export interface AppSettings {
|
|
19
19
|
[key: string]: unknown;
|
|
20
20
|
}
|
|
21
|
-
export type AppType = 'standalone' | 'report' | 'launcher' | 'template';
|
|
21
|
+
export type AppType = 'standalone' | 'report' | 'launcher' | 'template' | 'template-app' | 'landing-page';
|
|
22
22
|
export type CurrentApp<TModules extends Array<AnyModule> = [], TEnv extends ConfigEnvironment = ConfigEnvironment> = IApp<TEnv, TModules> | null | undefined;
|
|
23
23
|
type Nullable<T> = T | null | undefined;
|
|
24
24
|
type AppPerson = {
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.1.
|
|
1
|
+
export declare const version = "6.1.19";
|
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.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -57,20 +57,20 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"fast-deep-equal": "^3.1.3",
|
|
60
|
-
"immer": "^
|
|
60
|
+
"immer": "^10.1.3",
|
|
61
61
|
"rxjs": "^7.8.1",
|
|
62
|
-
"uuid": "^
|
|
62
|
+
"uuid": "^13.0.0",
|
|
63
63
|
"zod": "^3.25.76",
|
|
64
|
-
"@equinor/fusion-
|
|
65
|
-
"@equinor/fusion-
|
|
64
|
+
"@equinor/fusion-observable": "^8.5.3",
|
|
65
|
+
"@equinor/fusion-query": "^5.2.13"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"typescript": "^5.8.2",
|
|
69
|
-
"@equinor/fusion-framework-module": "^5.0.0",
|
|
70
|
-
"@equinor/fusion-framework-module-http": "^6.3.4",
|
|
71
69
|
"@equinor/fusion-framework-module-event": "^4.3.7",
|
|
72
|
-
"@equinor/fusion-framework-module
|
|
73
|
-
"@equinor/fusion-framework-module-
|
|
70
|
+
"@equinor/fusion-framework-module": "^5.0.1",
|
|
71
|
+
"@equinor/fusion-framework-module-http": "^6.3.5",
|
|
72
|
+
"@equinor/fusion-framework-module-msal": "^4.1.0",
|
|
73
|
+
"@equinor/fusion-framework-module-service-discovery": "^8.0.18"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsc -b"
|
package/src/AppClient.ts
CHANGED
|
@@ -3,7 +3,11 @@ import { catchError, map, type Observable, type ObservableInput, tap } from 'rxj
|
|
|
3
3
|
import { Query } from '@equinor/fusion-query';
|
|
4
4
|
import { queryValue } from '@equinor/fusion-query/operators';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
HttpJsonResponseError,
|
|
8
|
+
HttpResponseError,
|
|
9
|
+
type IHttpClient,
|
|
10
|
+
} from '@equinor/fusion-framework-module-http';
|
|
7
11
|
import { jsonSelector } from '@equinor/fusion-framework-module-http/selectors';
|
|
8
12
|
|
|
9
13
|
import { ApiApplicationSchema } from './schemas';
|
|
@@ -156,14 +160,16 @@ export class AppClient implements IAppClient {
|
|
|
156
160
|
return this.#manifest.query(args).pipe(
|
|
157
161
|
queryValue,
|
|
158
162
|
catchError((err) => {
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
const cause = err?.cause || err;
|
|
164
|
+
|
|
161
165
|
if (cause instanceof AppManifestError) {
|
|
162
166
|
throw cause;
|
|
163
167
|
}
|
|
164
|
-
|
|
168
|
+
|
|
169
|
+
if (cause instanceof HttpJsonResponseError || cause instanceof HttpResponseError) {
|
|
165
170
|
throw AppManifestError.fromHttpResponse(cause.response, { cause });
|
|
166
171
|
}
|
|
172
|
+
|
|
167
173
|
throw new AppManifestError('unknown', 'failed to load manifest', { cause });
|
|
168
174
|
}),
|
|
169
175
|
);
|
|
@@ -180,12 +186,13 @@ export class AppClient implements IAppClient {
|
|
|
180
186
|
return this.#config.query(args).pipe(
|
|
181
187
|
map((res) => res.value as AppConfig<TType>),
|
|
182
188
|
catchError((err) => {
|
|
183
|
-
/**
|
|
184
|
-
const
|
|
189
|
+
/** handle both direct errors and errors wrapped in a `cause` property */
|
|
190
|
+
const cause = err?.cause || err;
|
|
191
|
+
|
|
185
192
|
if (cause instanceof AppConfigError) {
|
|
186
193
|
throw cause;
|
|
187
194
|
}
|
|
188
|
-
if (cause instanceof HttpResponseError) {
|
|
195
|
+
if (cause instanceof HttpJsonResponseError || cause instanceof HttpResponseError) {
|
|
189
196
|
throw AppConfigError.fromHttpResponse(cause.response, { cause });
|
|
190
197
|
}
|
|
191
198
|
throw new AppConfigError('unknown', 'failed to load config', { cause });
|
|
@@ -197,12 +204,13 @@ export class AppClient implements IAppClient {
|
|
|
197
204
|
return this.#settings.query(args).pipe(
|
|
198
205
|
queryValue,
|
|
199
206
|
catchError((err) => {
|
|
200
|
-
/**
|
|
201
|
-
const
|
|
207
|
+
/** handle both direct errors and errors wrapped in a `cause` property */
|
|
208
|
+
const cause = err?.cause || err;
|
|
209
|
+
|
|
202
210
|
if (cause instanceof AppSettingsError) {
|
|
203
211
|
throw cause;
|
|
204
212
|
}
|
|
205
|
-
if (cause instanceof HttpResponseError) {
|
|
213
|
+
if (cause instanceof HttpJsonResponseError || cause instanceof HttpResponseError) {
|
|
206
214
|
throw AppSettingsError.fromHttpResponse(cause.response, { cause });
|
|
207
215
|
}
|
|
208
216
|
throw new AppSettingsError('unknown', 'failed to load settings', { cause });
|
package/src/errors.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type AppErrorType = 'not_found' | 'unauthorized' | 'unknown';
|
|
1
|
+
type AppErrorType = 'not_found' | 'unauthorized' | 'unknown' | 'deleted';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents an error that occurs when loading an application manifest.
|
|
@@ -20,6 +20,8 @@ export class AppManifestError extends Error {
|
|
|
20
20
|
);
|
|
21
21
|
case 404:
|
|
22
22
|
return new AppManifestError('not_found', 'application manifest not found', options);
|
|
23
|
+
case 410:
|
|
24
|
+
return new AppManifestError('deleted', 'application manifest deleted', options);
|
|
23
25
|
}
|
|
24
26
|
return new AppManifestError(
|
|
25
27
|
'unknown',
|
|
@@ -63,6 +65,8 @@ export class AppConfigError extends Error {
|
|
|
63
65
|
);
|
|
64
66
|
case 404:
|
|
65
67
|
return new AppConfigError('not_found', 'application config not found', options);
|
|
68
|
+
case 410:
|
|
69
|
+
return new AppConfigError('deleted', 'application config deleted', options);
|
|
66
70
|
}
|
|
67
71
|
return new AppConfigError(
|
|
68
72
|
'unknown',
|
|
@@ -106,6 +110,8 @@ export class AppSettingsError extends Error {
|
|
|
106
110
|
);
|
|
107
111
|
case 404:
|
|
108
112
|
return new AppSettingsError('not_found', 'application not found', options);
|
|
113
|
+
case 410:
|
|
114
|
+
return new AppSettingsError('deleted', 'application settings deleted', options);
|
|
109
115
|
}
|
|
110
116
|
return new AppSettingsError(
|
|
111
117
|
'unknown',
|
package/src/types.ts
CHANGED
|
@@ -28,7 +28,13 @@ export interface AppSettings {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// TODO: remove `report` and `launcher` when legacy apps are removed
|
|
31
|
-
export type AppType =
|
|
31
|
+
export type AppType =
|
|
32
|
+
| 'standalone'
|
|
33
|
+
| 'report'
|
|
34
|
+
| 'launcher'
|
|
35
|
+
| 'template'
|
|
36
|
+
| 'template-app'
|
|
37
|
+
| 'landing-page';
|
|
32
38
|
|
|
33
39
|
export type CurrentApp<
|
|
34
40
|
TModules extends Array<AnyModule> = [],
|
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.19';
|