@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.
@@ -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: any], any, "set_instance", never, never>;
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: any], any, "set_instance", never, never>;
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>;
@@ -34,7 +34,7 @@ export declare const createReducer: (value: AppBundleStateInitial) => import("@e
34
34
  payload: string;
35
35
  type: "import_app::request";
36
36
  } | {
37
- payload: any;
37
+ payload: import("..").AppModulesInstance;
38
38
  type: "set_instance";
39
39
  } | {
40
40
  payload: null;
@@ -1,4 +1,4 @@
1
- type AppErrorType = 'not_found' | 'unauthorized' | 'unknown';
1
+ type AppErrorType = 'not_found' | 'unauthorized' | 'unknown' | 'deleted';
2
2
  /**
3
3
  * Represents an error that occurs when loading an application manifest.
4
4
  */
@@ -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 = {
@@ -1 +1 @@
1
- export declare const version = "6.1.17";
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.17",
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": "^9.0.16",
60
+ "immer": "^10.1.3",
61
61
  "rxjs": "^7.8.1",
62
- "uuid": "^11.0.3",
62
+ "uuid": "^13.0.0",
63
63
  "zod": "^3.25.76",
64
- "@equinor/fusion-query": "^5.2.11",
65
- "@equinor/fusion-observable": "^8.5.1"
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-service-discovery": "^8.0.18",
73
- "@equinor/fusion-framework-module-msal": "^4.0.8"
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 { HttpResponseError, type IHttpClient } from '@equinor/fusion-framework-module-http';
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
- /** extract cause, since error will be a `QueryError` */
160
- const { cause } = err;
163
+ const cause = err?.cause || err;
164
+
161
165
  if (cause instanceof AppManifestError) {
162
166
  throw cause;
163
167
  }
164
- if (cause instanceof HttpResponseError) {
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
- /** extract cause, since error will be a `QueryError` */
184
- const { cause } = err;
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
- /** extract cause, since error will be a `QueryError` */
201
- const { cause } = err;
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 = 'standalone' | 'report' | 'launcher' | 'template';
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.17';
2
+ export const version = '6.1.19';