@equinor/fusion-framework-module-app 7.4.1 → 8.0.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +57 -33
  2. package/README.md +118 -11
  3. package/dist/esm/AppClient.js +16 -3
  4. package/dist/esm/AppClient.js.map +1 -1
  5. package/dist/esm/AppConfig.js +7 -1
  6. package/dist/esm/AppConfig.js.map +1 -1
  7. package/dist/esm/AppConfigurator.js +7 -0
  8. package/dist/esm/AppConfigurator.js.map +1 -1
  9. package/dist/esm/AppModuleProvider.js +80 -17
  10. package/dist/esm/AppModuleProvider.js.map +1 -1
  11. package/dist/esm/app/App.js +17 -1
  12. package/dist/esm/app/App.js.map +1 -1
  13. package/dist/esm/app/actions.js +13 -0
  14. package/dist/esm/app/actions.js.map +1 -1
  15. package/dist/esm/app/create-reducer.js +9 -0
  16. package/dist/esm/app/create-reducer.js.map +1 -1
  17. package/dist/esm/app/create-state.js +11 -0
  18. package/dist/esm/app/create-state.js.map +1 -1
  19. package/dist/esm/app/flows.js +3 -2
  20. package/dist/esm/app/flows.js.map +1 -1
  21. package/dist/esm/app/index.js +7 -0
  22. package/dist/esm/app/index.js.map +1 -1
  23. package/dist/esm/enable-app-module.js +19 -2
  24. package/dist/esm/enable-app-module.js.map +1 -1
  25. package/dist/esm/errors.js.map +1 -1
  26. package/dist/esm/index.js +18 -0
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/module.js +1 -0
  29. package/dist/esm/module.js.map +1 -1
  30. package/dist/esm/version.js +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/dist/types/AppClient.d.ts +52 -10
  33. package/dist/types/AppConfig.d.ts +8 -0
  34. package/dist/types/AppConfigurator.d.ts +32 -0
  35. package/dist/types/AppModuleProvider.d.ts +80 -17
  36. package/dist/types/app/App.d.ts +28 -3
  37. package/dist/types/app/actions.d.ts +16 -0
  38. package/dist/types/app/create-reducer.d.ts +9 -0
  39. package/dist/types/app/create-state.d.ts +11 -0
  40. package/dist/types/app/events.d.ts +17 -1
  41. package/dist/types/app/index.d.ts +7 -0
  42. package/dist/types/enable-app-module.d.ts +19 -2
  43. package/dist/types/errors.d.ts +8 -0
  44. package/dist/types/index.d.ts +18 -0
  45. package/dist/types/module.d.ts +6 -0
  46. package/dist/types/types.d.ts +92 -3
  47. package/dist/types/version.d.ts +1 -1
  48. package/package.json +10 -10
  49. package/src/AppClient.ts +54 -11
  50. package/src/AppConfig.ts +15 -1
  51. package/src/AppConfigurator.ts +33 -1
  52. package/src/AppModuleProvider.ts +80 -17
  53. package/src/app/App.ts +29 -4
  54. package/src/app/actions.ts +16 -0
  55. package/src/app/create-reducer.ts +9 -0
  56. package/src/app/create-state.ts +11 -0
  57. package/src/app/events.ts +17 -1
  58. package/src/app/flows.ts +6 -2
  59. package/src/app/index.ts +7 -0
  60. package/src/enable-app-module.ts +19 -2
  61. package/src/errors.ts +8 -0
  62. package/src/index.ts +19 -0
  63. package/src/module.ts +6 -0
  64. package/src/types.ts +94 -7
  65. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - abffa53: Major version bump for Fusion Framework React 19 release.
8
+
9
+ All packages are bumped to the next major version as part of the React 19 upgrade. This release drops support for React versions below 18 and includes breaking changes across the framework.
10
+
11
+ **Breaking changes:**
12
+ - Peer dependencies now require React 18 or 19 (`^18.0.0 || ^19.0.0`)
13
+ - React Router upgraded from v6 to v7
14
+ - Navigation module refactored with new history API
15
+ - `renderComponent` and `renderApp` now use `createRoot` API
16
+
17
+ **Migration:**
18
+ - Update your React version to 18.0.0 or higher before upgrading
19
+ - Replace `NavigationProvider.createRouter()` with `@equinor/fusion-framework-react-router`
20
+ - See individual package changelogs for package-specific migration steps
21
+
22
+ ### Minor Changes
23
+
24
+ - abffa53: Add route schema support to app manifests for documentation and API schema generation.
25
+
26
+ **New Features:**
27
+ - **module-app**: Added `RouteSchemaEntry` type and `routes` field to `AppManifest` interface
28
+ - **cli**: Added `RouteSchemaEntry` type export for app manifest generation
29
+
30
+ Route schemas allow applications to document their routes in app manifests, enabling automatic API documentation and schema generation. The `RouteSchemaEntry` type represents a route with its path, description, and optional parameter/search schemas.
31
+
32
+ ```typescript
33
+ import type {
34
+ RouteSchemaEntry,
35
+ AppManifest,
36
+ } from "@equinor/fusion-framework-module-app";
37
+
38
+ const manifest: AppManifest = {
39
+ appKey: "my-app",
40
+ displayName: "My App",
41
+ description: "My app description",
42
+ type: "standalone",
43
+ routes: [
44
+ ["/", "Home page"],
45
+ ["/products", "Products listing page"],
46
+ ["/products/:id", "Product detail page", { id: "Product ID" }],
47
+ ],
48
+ };
49
+ ```
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies [abffa53]
54
+ - Updated dependencies [abffa53]
55
+ - Updated dependencies [abffa53]
56
+ - Updated dependencies [abffa53]
57
+ - @equinor/fusion-observable@9.0.0
58
+ - @equinor/fusion-query@7.0.0
59
+
3
60
  ## 7.4.1
4
61
 
5
62
  ### Patch Changes
@@ -98,20 +155,17 @@
98
155
  ## New Features
99
156
 
100
157
  ### App Tag/Version Support
101
-
102
158
  - **App Client**: Added `getAppBuild` method to fetch build manifests by app key and tag
103
159
  - **App Module Provider**: Enhanced `getAppManifest` to accept optional tag parameter
104
160
  - **App Loading**: Modified `setCurrentApp` to support `AppReference` objects with tag specification
105
161
  - **URL Integration**: Added `getAppTagFromUrl` utility to extract app tags from URL parameters
106
162
 
107
163
  ### Enhanced Type System
108
-
109
164
  - Added `AppReference` type for specifying app key and optional tag
110
165
  - Extended `AppBundleState` to include optional `tag` property
111
166
  - Updated `AppBuildManifest` type definition for build-specific metadata
112
167
 
113
168
  ### API Improvements
114
-
115
169
  - **AppClient**: Updated interface to support tag-based manifest and build fetching
116
170
  - **App Class**: Added `tag` getter property for accessing current app tag
117
171
  - **Action System**: Enhanced `fetchManifest` action to handle tag parameters
@@ -119,7 +173,6 @@
119
173
  ## Changes by Package
120
174
 
121
175
  ### `@equinor/fusion-framework-module-app`
122
-
123
176
  - **AppClient.ts**: Added `getAppBuild` method with tag support and updated `getAppManifest` signature
124
177
  - **AppModuleProvider.ts**: Enhanced `setCurrentApp` method to handle `AppReference` objects with tags
125
178
  - **App.ts**: Added `tag` getter and improved error handling in initialization
@@ -128,7 +181,6 @@
128
181
  - **flows.ts**: Modified manifest fetching flow to handle tag-based requests
129
182
 
130
183
  ### `@equinor/fusion-framework-dev-portal`
131
-
132
184
  - **AppLoader.tsx**: Added `getAppTagFromUrl` utility function and integrated tag-based app loading
133
185
 
134
186
  ## Usage Examples
@@ -161,17 +213,14 @@
161
213
  ## Migration Guide
162
214
 
163
215
  ### For App Consumers
164
-
165
216
  - No breaking changes - existing code continues to work
166
217
  - Optionally use new tag-based loading for version-specific deployments
167
218
 
168
219
  ### For App Developers
169
-
170
220
  - Consider adding `&tag` URL parameter support for testing different versions
171
221
  - Use new `AppReference` type when programmatically setting current apps with tags
172
222
 
173
223
  ## Technical Details
174
-
175
224
  - **Backward Compatibility**: All changes are backward compatible
176
225
  - **Caching**: Tag-based manifests and builds are cached separately
177
226
  - **Error Handling**: Enhanced error handling for build and manifest loading failures
@@ -205,7 +254,6 @@
205
254
  ### Patch Changes
206
255
 
207
256
  - [#3428](https://github.com/equinor/fusion-framework/pull/3428) [`1700ca8`](https://github.com/equinor/fusion-framework/commit/1700ca8851fa108e55e9729fd24f595272766e63) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update zod from 4.1.9 to 4.1.11
208
-
209
257
  - **v4.1.10**: Fixed shape caching issue (#5263) improving validation performance for complex schemas
210
258
  - **v4.1.11**: Maintenance release with general improvements
211
259
 
@@ -224,7 +272,6 @@
224
272
  Updated source code to migrate from zod v3 to v4. Updated zod dependency from v3.25.76 to v4.1.8 and modified schema definitions in the app module to use explicit key and value types for records and updated error message format from `description` to `message` for zod v4 compatibility.
225
273
 
226
274
  Key changes in source code:
227
-
228
275
  - Fixed record schema definitions to use explicit key and value types (`z.record(z.string(), z.any())`)
229
276
  - Updated error message options format (replaced `description` with `message`)
230
277
  - Enhanced `ApiAppConfigSchema` with proper record type definitions for environment and endpoints
@@ -233,7 +280,6 @@
233
280
  Breaking changes: Record schemas must specify both key and value types explicitly. Error message format has changed from zod v3 to v4 format. Function schema definitions now require explicit typing.
234
281
 
235
282
  Links:
236
-
237
283
  - [Zod v4 Migration Guide](https://github.com/colinhacks/zod/releases/tag/v4.0.0)
238
284
  - [Zod v4.1.8 Release Notes](https://github.com/colinhacks/zod/releases/tag/v4.1.8)
239
285
 
@@ -246,19 +292,16 @@
246
292
  - [#3395](https://github.com/equinor/fusion-framework/pull/3395) [`29f6710`](https://github.com/equinor/fusion-framework/commit/29f6710238baf9b29f42394b30cb8b97f25462c3) Thanks [@odinr](https://github.com/odinr)! - Updated immer from 9.0.16 to 10.1.3 across all packages.
247
293
 
248
294
  ### Breaking Changes
249
-
250
295
  - Immer 10.x introduces stricter TypeScript types for draft functions
251
296
  - `ValidRecipeReturnType` type constraints have changed
252
297
  - Promise return types in draft functions are no longer automatically handled
253
298
 
254
299
  ### Fixes Applied
255
-
256
300
  - Updated BookmarkProvider to handle new immer type constraints
257
301
  - Fixed ObservableInput type assignments in mergeScan operations
258
302
  - Removed async/await from immer draft functions to comply with new type requirements
259
303
 
260
304
  ### Links
261
-
262
305
  - [Immer 10.0.0 Release Notes](https://github.com/immerjs/immer/releases/tag/v10.0.0)
263
306
  - [Immer Migration Guide](https://github.com/immerjs/immer/blob/main/MIGRATION.md)
264
307
 
@@ -269,18 +312,15 @@
269
312
  - [#3347](https://github.com/equinor/fusion-framework/pull/3347) [`11143fa`](https://github.com/equinor/fusion-framework/commit/11143fa3002fb8a6c095052a04c7e596c56bafa8) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: bump uuid from 11.0.3 to 13.0.0
270
313
 
271
314
  ### Breaking Changes
272
-
273
315
  - v13.0.0: Make browser exports the default
274
316
  - v12.0.0: Update to TypeScript 5.2, remove CommonJS support, drop Node 16 support
275
317
 
276
318
  ### New Features
277
-
278
319
  - Improved v4() performance
279
320
  - Added Node 24 to CI matrix
280
321
  - Restored node: prefix support
281
322
 
282
323
  ### Links
283
-
284
324
  - [GitHub releases](https://github.com/uuidjs/uuid/releases/tag/v13.0.0)
285
325
  - [npm changelog](https://www.npmjs.com/package/uuid?activeTab=versions)
286
326
 
@@ -293,7 +333,6 @@
293
333
  ### Patch Changes
294
334
 
295
335
  - [#3315](https://github.com/equinor/fusion-framework/pull/3315) [`2ea9fb6`](https://github.com/equinor/fusion-framework/commit/2ea9fb63bdf967e0d010ddae2af9f6fb32077240) Thanks [@Noggling](https://github.com/Noggling)! - Improve error handling in AppClient
296
-
297
336
  - Add support for HTTP 410 (Gone) status code handling across all error types
298
337
  - Import and use `HttpJsonResponseError` for more specific error handling in `getAppManifest`
299
338
  - Add 'deleted' error type to handle when application resources have been deleted
@@ -311,7 +350,6 @@
311
350
  ### Patch Changes
312
351
 
313
352
  - [#3088](https://github.com/equinor/fusion-framework/pull/3088) [`7441b13`](https://github.com/equinor/fusion-framework/commit/7441b13aa50dd7362d1629086a27b6b4e571575d) Thanks [@eikeland](https://github.com/eikeland)! - chore: update package typesVersions
314
-
315
353
  - Updated package.json typesVersions.
316
354
  - Ensures backward compatibility with older node versions.
317
355
  - Ensured consistency with workspace and repository configuration.
@@ -424,7 +462,6 @@
424
462
  ### Patch Changes
425
463
 
426
464
  - [#2519](https://github.com/equinor/fusion-framework/pull/2519) [`83a7ee9`](https://github.com/equinor/fusion-framework/commit/83a7ee971785343bccedc2d72cc02486193615af) Thanks [@eikeland](https://github.com/eikeland)! - ### Changes:
427
-
428
465
  - Updated `AppClient` class to improve the query for fetching app manifests:
429
466
  - Adjusted the query path manifests method to include `$expand=category,admins,owners,keywords` when `filterByCurrentUser` is not specified.
430
467
  - Minor formatting changes for better readability.
@@ -436,11 +473,9 @@
436
473
  - [#2685](https://github.com/equinor/fusion-framework/pull/2685) [`add2e98`](https://github.com/equinor/fusion-framework/commit/add2e98d23e683a801729e9af543cfa15c574e27) Thanks [@eikeland](https://github.com/eikeland)! - Added versioning support to `AppModuleProvider`.
437
474
 
438
475
  **Modified files:**
439
-
440
476
  - `packages/modules/app/src/AppModuleProvider.ts`
441
477
 
442
478
  **Changes:**
443
-
444
479
  - Imported `SemanticVersion` from `@equinor/fusion-framework-module`.
445
480
  - Imported `version` from `./version`.
446
481
  - Added a `version` getter to `AppModuleProvider` that returns a `SemanticVersion` instance.
@@ -455,11 +490,9 @@
455
490
  - [#2654](https://github.com/equinor/fusion-framework/pull/2654) [`59ab642`](https://github.com/equinor/fusion-framework/commit/59ab6424f3ce80649f42ddb6804b46f6789607ba) Thanks [@eikeland](https://github.com/eikeland)! - Reverting update to the `manifests` call `selector` function in `AppClient` to use `jsonSelector` and parse the response with `ApplicationSchema`.
456
491
 
457
492
  **Modified files:**
458
-
459
493
  - `packages/modules/app/src/AppClient.ts`
460
494
 
461
495
  **Changes:**
462
-
463
496
  - Replaced `res.json()` with `jsonSelector(res)`
464
497
  - Parsed the response using `ApplicationSchema.array().parse(response.value)`
465
498
 
@@ -494,7 +527,6 @@
494
527
  ```
495
528
 
496
529
  - [#2577](https://github.com/equinor/fusion-framework/pull/2577) [`c3ba9f1`](https://github.com/equinor/fusion-framework/commit/c3ba9f109d9f96d6dc6ee2f0ddac00c8b3090982) Thanks [@eikeland](https://github.com/eikeland)! - #### Changes:
497
-
498
530
  1. **AppClient.ts**
499
531
  - Added `updateAppSettings` method to set app settings by appKey.
500
532
  2. **AppModuleProvider.ts**
@@ -555,12 +587,10 @@
555
587
  > This will introduce breaking changes to the configuration of `AppConfigurator.client`.
556
588
 
557
589
  **Added**
558
-
559
590
  - Introduced `AppClient` class to handle application manifest and configuration queries.
560
591
  - Added `zod` to validate the application manifest.
561
592
 
562
593
  **Changed**
563
-
564
594
  - Updated `AppModuleProvider` to use `AppClient` for fetching application manifests and configurations.
565
595
  - Modified `AppConfigurator` to utilize `AppClient` for client configuration.
566
596
  - Updated `useApps` hook with new input parameter for `filterByCurrentUser` in `fusion-framework-react`.
@@ -639,7 +669,6 @@
639
669
  - [#2320](https://github.com/equinor/fusion-framework/pull/2320) [`1dd85f3`](https://github.com/equinor/fusion-framework/commit/1dd85f3a408a73df556d1812a5f280945cc100ee) Thanks [@odinr](https://github.com/odinr)! - Removed the `removeComments` option from the `tsconfig.base.json` file.
640
670
 
641
671
  Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
642
-
643
672
  1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
644
673
  2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
645
674
  3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
@@ -688,7 +717,6 @@
688
717
  ### Patch Changes
689
718
 
690
719
  - [#2235](https://github.com/equinor/fusion-framework/pull/2235) [`97e41a5`](https://github.com/equinor/fusion-framework/commit/97e41a55d05644b6684c6cb165b65b115bd416eb) Thanks [@odinr](https://github.com/odinr)! - - **Refactored**: The `actionBaseType` function has been renamed to `getBaseType` and its implementation has been updated.
691
-
692
720
  - **Added**: New utility types and functions for handling action types and payloads in a more type-safe manner.
693
721
 
694
722
  - [#2248](https://github.com/equinor/fusion-framework/pull/2248) [`da9dd83`](https://github.com/equinor/fusion-framework/commit/da9dd83c9352def5365b6c962dc8443589ac9526) Thanks [@asbjornhaland](https://github.com/asbjornhaland)! - #2235 renamed a method and changed type. This PR forgot to change to the correct param when using this method. Fixes typo - update to use actions `type` in the reducer.
@@ -764,7 +792,6 @@
764
792
  ### Patch Changes
765
793
 
766
794
  - [#1763](https://github.com/equinor/fusion-framework/pull/1763) [`1ca8264`](https://github.com/equinor/fusion-framework/commit/1ca826489a0d1dd755324344a12bbf6659a3be12) Thanks [@odinr](https://github.com/odinr)! - improve type of current application
767
-
768
795
  - result will be `undefined` if current application has never been set
769
796
  - result will be `IApplication` if current application is set
770
797
  - result will be `null` if current application is cleared
@@ -881,7 +908,6 @@
881
908
  ### Minor Changes
882
909
 
883
910
  - [#927](https://github.com/equinor/fusion-framework/pull/927) [`8bc4c5d6`](https://github.com/equinor/fusion-framework/commit/8bc4c5d6ed900e424efcab5572047c106d7ec04a) Thanks [@odinr](https://github.com/odinr)! - Create and expose interface for App
884
-
885
911
  - deprecate [AppModuleProvider.createApp](https://github.com/equinor/fusion-framework/blob/cf08d5ae3cef473e5025fd973a2a7a45a3b22dee/packages/modules/app/src/AppModuleProvider.ts#L171)
886
912
 
887
913
  this should not create any breaking changes since apps was only created from provider.
@@ -892,7 +918,6 @@
892
918
  ```
893
919
 
894
920
  - [#927](https://github.com/equinor/fusion-framework/pull/927) [`8bc4c5d6`](https://github.com/equinor/fusion-framework/commit/8bc4c5d6ed900e424efcab5572047c106d7ec04a) Thanks [@odinr](https://github.com/odinr)! - Allow updating manifest of application
895
-
896
921
  - add meta data for `setManifest` action to flag if `merge` or `replace`
897
922
  - add method on `App` to update manifest, _default flag `merge`_
898
923
  - check in state reducer if `setManifest` action is `update` or `merge`
@@ -903,7 +928,6 @@
903
928
  ### Patch Changes
904
929
 
905
930
  - [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
906
-
907
931
  - align all versions of typescript
908
932
  - update types to build
909
933
  - a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
package/README.md CHANGED
@@ -1,23 +1,130 @@
1
+ # @equinor/fusion-framework-module-app
1
2
 
2
- ## Concept
3
+ Framework module for loading, configuring, and managing Fusion applications at runtime.
3
4
 
4
- Module for loading applications _(primary for initiators of the framework, ex a portal)_
5
+ Primarily used by **portal hosts** and other framework initiators that need to discover, load, and switch between applications dynamically. The module handles manifest fetching, build resolution, configuration loading, per-user app settings, and script import of application bundles.
5
6
 
6
- The enabler will optionally configure the client for fetching manifests, configuration and load application entrypoint (script)
7
+ ## When to Use
7
8
 
8
- ### Limitations
9
+ - You are building a portal or shell that hosts multiple Fusion applications.
10
+ - You need to fetch application manifests and configurations from the Fusion app service.
11
+ - You need to dynamically import an application's JavaScript bundle at runtime.
12
+ - You need to read or write per-user application settings.
9
13
 
10
- By design this module only allows having one active application as current
14
+ > [!NOTE]
15
+ > By design this module only allows **one active application** at a time (`currentApp`).
16
+ > If you need multiple concurrent app instances, use the Widgets module instead.
11
17
 
12
- > [!TIP]
13
- > By enabling `Widgets` _(almost the same as app)_, multiple instances can be initiated
18
+ ## Quick Start
14
19
 
15
- ## Usage
20
+ Enable the module in your framework configurator:
16
21
 
17
22
  ```ts
18
23
  import { enableAppModule } from '@equinor/fusion-framework-module-app';
19
24
 
20
- export const configure = async (config: FrameworkConfigurator) => {
21
- enableAppModule(config);
25
+ export const configure = async (configurator: FrameworkConfigurator) => {
26
+ enableAppModule(configurator);
22
27
  };
23
- ```
28
+ ```
29
+
30
+ Once enabled, the `AppModuleProvider` is available on the framework instance:
31
+
32
+ ```ts
33
+ const appProvider = framework.modules.app;
34
+
35
+ // Set the current application by key
36
+ appProvider.setCurrentApp('my-app');
37
+
38
+ // React to current app changes
39
+ appProvider.current$.subscribe((app) => {
40
+ if (app) {
41
+ console.log('Current app:', app.appKey);
42
+ }
43
+ });
44
+ ```
45
+
46
+ ## Core Concepts
47
+
48
+ ### AppModuleProvider
49
+
50
+ The main runtime entry point. Provides methods to:
51
+
52
+ - **Fetch manifests** – `getAppManifest(appKey)` and `getAppManifests()` return observable streams of `AppManifest` objects.
53
+ - **Fetch configuration** – `getAppConfig(appKey)` returns the app's environment and endpoint configuration.
54
+ - **Manage settings** – `getAppSettings(appKey)` and `updateAppSettings(appKey, settings)` read and write per-user settings.
55
+ - **Set/clear current app** – `setCurrentApp(appKey)` creates an `App` instance and emits it on `current$`. `clearCurrentApp()` disposes the current app.
56
+
57
+ ### App
58
+
59
+ Represents a single loaded application. Manages internal state for the manifest, config, settings, and imported script module via a reactive state machine (`FlowSubject`). Key observables:
60
+
61
+ | Observable | Emits |
62
+ |---------------|--------------------------------------|
63
+ | `manifest$` | `AppManifest` when resolved |
64
+ | `config$` | `AppConfig` when resolved |
65
+ | `settings$` | `AppSettings` (fetched on subscribe) |
66
+ | `modules$` | Imported `AppScriptModule` |
67
+ | `instance$` | Initialized `AppModulesInstance` |
68
+ | `status$` | Set of in-progress action types |
69
+
70
+ Call `app.initialize()` to load manifest, config, and script in parallel and receive them as a combined observable.
71
+
72
+ ### AppClient
73
+
74
+ Low-level HTTP client that communicates with the Fusion app service API. Handles caching (via `Query`), response parsing (via Zod schemas), and error mapping to typed error classes (`AppManifestError`, `AppConfigError`, `AppBuildError`, `AppSettingsError`).
75
+
76
+ ### AppConfig
77
+
78
+ Immutable, deeply frozen configuration object with `environment` (arbitrary key-value data) and `endpoints` (named URLs with OAuth scopes). Use `config.getEndpoint('api')` to retrieve a specific endpoint.
79
+
80
+ ### AppConfigurator
81
+
82
+ Configuration builder used during module initialization. Allows overriding the default HTTP client and asset URI:
83
+
84
+ ```ts
85
+ enableAppModule(configurator, (builder) => {
86
+ builder.setClient(async (args) => {
87
+ const http = await args.requireInstance('http');
88
+ return new AppClient(http.createClient('my-custom-apps'));
89
+ });
90
+ builder.setAssetUri('/custom-proxy');
91
+ });
92
+ ```
93
+
94
+ ## Events
95
+
96
+ When the `EventModule` is available, the app module dispatches lifecycle events on manifest, config, settings, and script loading. Key events include:
97
+
98
+ - `onCurrentAppChanged` – fired when `setCurrentApp` or `clearCurrentApp` is called
99
+ - `onAppManifestLoad` / `onAppManifestLoaded` / `onAppManifestFailure`
100
+ - `onAppConfigLoad` / `onAppConfigLoaded` / `onAppConfigFailure`
101
+ - `onAppSettingsLoad` / `onAppSettingsLoaded` / `onAppSettingsFailure`
102
+ - `onAppScriptLoad` / `onAppScriptLoaded` / `onAppScriptFailure`
103
+ - `onAppInitialize` / `onAppInitialized` / `onAppInitializeFailure`
104
+ - `onAppDispose`
105
+
106
+ ## Error Handling
107
+
108
+ All API requests map HTTP status codes to typed error classes:
109
+
110
+ | Error Class | When Thrown |
111
+ |---------------------|--------------------------------------|
112
+ | `AppManifestError` | Manifest fetch fails (404, 401, 410) |
113
+ | `AppConfigError` | Config fetch fails |
114
+ | `AppBuildError` | Build metadata fetch fails |
115
+ | `AppSettingsError` | Settings fetch or update fails |
116
+ | `AppScriptModuleError` | Script import fails |
117
+
118
+ Each error includes a `type` property (`'not_found'`, `'unauthorized'`, `'deleted'`, or `'unknown'`) for programmatic handling.
119
+
120
+ ## Main Exports
121
+
122
+ | Export | Description |
123
+ |----------------------|--------------------------------------------------|
124
+ | `enableAppModule` | Registers the module with a framework configurator |
125
+ | `AppModuleProvider` | Runtime provider with app lifecycle methods |
126
+ | `AppClient` | Low-level HTTP client for the app service |
127
+ | `AppConfigurator` | Configuration builder for module setup |
128
+ | `AppConfig` | Immutable app configuration (env + endpoints) |
129
+ | `App` / `IApp` | Application instance with reactive state |
130
+ | `AppModule` | Module definition for the framework |
@@ -7,7 +7,8 @@ import { ApiApplicationBuildSchema, ApiApplicationSchema } from './schemas';
7
7
  import { AppBuildError, AppConfigError, AppManifestError, AppSettingsError } from './errors';
8
8
  import { AppConfigSelector } from './AppClient.Selectors';
9
9
  /**
10
- * Transforms an ApiApplicationSchema object into an AppManifest object.
10
+ * Transforms a raw API application response into an {@link AppManifest},
11
+ * adding backwards-compatible `key` and `name` getters.
11
12
  *
12
13
  * @returns An object conforming to the AppManifest interface.
13
14
  */
@@ -28,8 +29,20 @@ const ApplicationSchema = ApiApplicationSchema.transform((x) => {
28
29
  };
29
30
  });
30
31
  /**
31
- * The `AppClient` class implements the `IAppClient` interface and provides methods to query
32
- * application manifests and configurations from a backend service.
32
+ * Default implementation of {@link IAppClient} that communicates with the
33
+ * Fusion app service API over HTTP.
34
+ *
35
+ * Uses {@link Query} internally for request deduplication and caching
36
+ * (1-minute expiry by default). Responses are validated against Zod schemas
37
+ * ({@link ApiApplicationSchema}, {@link ApiApplicationBuildSchema}) and
38
+ * HTTP errors are mapped to typed error classes.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const httpClient = await http.createClient('apps');
43
+ * const appClient = new AppClient(httpClient);
44
+ * appClient.getAppManifest({ appKey: 'my-app' }).subscribe(console.log);
45
+ * ```
33
46
  */
34
47
  export class AppClient {
35
48
  #manifest;
@@ -1 +1 @@
1
- {"version":3,"file":"AppClient.js","sourceRoot":"","sources":["../../src/AppClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAyC,GAAG,EAAE,MAAM,MAAM,CAAC;AAEnF,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAElB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAS5E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AA0C1D;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAe,EAAE;IAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,OAAO;QACL,GAAG,KAAK;QACR,iCAAiC;QACjC,IAAI,GAAG;YACL,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QACD,+BAA+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QAAQ,EAAE,GAAG,IAAI,CAAC;QAClC,OAAO,CACL,IAAI,CAAC,OAAO;YACV,yCAAyC;aACxC,KAAK,CAAc,oBAAoB,MAAM,WAAW,EAAE;YACzD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,KAAK;aACrB;SACF,CAAC;aACD,IAAI,CACH,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACZ,iCAAiC;YACjC,IAAI,CAAC,SAAS,CAAC,MAAM,CACnB,EAAE,MAAM,EAAE,EACV;gBACE,KAAK;gBACL,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;aACpB,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CACJ,CAAC;IACJ,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF;AAED,eAAe,SAAS,CAAC"}
@@ -1,4 +1,10 @@
1
- // todo: move to utils
1
+ /**
2
+ * Recursively freezes an object and all of its nested properties.
3
+ *
4
+ * @template T - Object type being frozen.
5
+ * @param obj - The object to deep-freeze.
6
+ * @returns The same object, deeply frozen.
7
+ */
2
8
  const deepFreeze = (obj) => {
3
9
  for (const property of Object.keys(obj)) {
4
10
  if (typeof obj[property] === 'object' &&
@@ -1 +1 @@
1
- {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../../src/AppConfig.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,UAAU,GAAG,CAAoC,GAAM,EAAK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CAAC,KAAK,QAAQ;YACjC,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI;YACtB,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAC/B,CAAC;YACD,UAAU,CAAC,GAAG,CAAC,QAAQ,CAA4B,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,SAAS;IACpB,UAAU,CAAiC;IAC3C,YAAY,CAAe;IAE3B;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,YAAY,MAGX;QACC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAiB,CAAC;QACzE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,GAAW;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACF"}
@@ -1,5 +1,12 @@
1
1
  import { BaseConfigBuilder, } from '@equinor/fusion-framework-module';
2
2
  import AppClient from './AppClient';
3
+ /**
4
+ * Configuration builder for the app module.
5
+ *
6
+ * Extends {@link BaseConfigBuilder} to assemble an {@link AppModuleConfig} during
7
+ * framework initialization. If no explicit client is set, a default one is created
8
+ * via service discovery. The default `assetUri` is `'/apps-proxy'`.
9
+ */
3
10
  export class AppConfigurator extends BaseConfigBuilder {
4
11
  defaultExpireTime = 1 * 60 * 1000;
5
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AppConfigurator.js","sourceRoot":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