@equinor/fusion-framework-module-app 8.1.0-next.0 → 8.1.1

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 (47) hide show
  1. package/dist/esm/schemas.js +2 -0
  2. package/dist/esm/schemas.js.map +1 -1
  3. package/dist/esm/version.js +1 -1
  4. package/dist/esm/version.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/dist/types/version.d.ts +1 -1
  7. package/package.json +12 -9
  8. package/CHANGELOG.md +0 -1478
  9. package/src/AppClient.ts +0 -409
  10. package/src/AppConfig.ts +0 -99
  11. package/src/AppConfigSelector.ts +0 -25
  12. package/src/AppConfigurator.ts +0 -145
  13. package/src/AppModuleProvider.ts +0 -283
  14. package/src/__tests__/AppModuleProvider.test.ts +0 -47
  15. package/src/__tests__/MockAppClient.test.ts +0 -97
  16. package/src/app/App.ts +0 -984
  17. package/src/app/actions.ts +0 -112
  18. package/src/app/create-reducer.ts +0 -62
  19. package/src/app/create-state.ts +0 -52
  20. package/src/app/events.ts +0 -108
  21. package/src/app/filter-empty.ts +0 -11
  22. package/src/app/flows/handle-fetch-config.ts +0 -48
  23. package/src/app/flows/handle-fetch-manifest.ts +0 -53
  24. package/src/app/flows/handle-fetch-settings.ts +0 -50
  25. package/src/app/flows/handle-import-application.ts +0 -37
  26. package/src/app/flows/handle-update-settings.ts +0 -39
  27. package/src/app/flows/index.ts +0 -5
  28. package/src/app/index.ts +0 -10
  29. package/src/app/types.ts +0 -51
  30. package/src/enable-app-module.ts +0 -40
  31. package/src/errors/AppBuildError.ts +0 -47
  32. package/src/errors/AppConfigError.ts +0 -47
  33. package/src/errors/AppManifestError.ts +0 -47
  34. package/src/errors/AppScriptModuleError.ts +0 -20
  35. package/src/errors/AppSettingsError.ts +0 -47
  36. package/src/errors/app-error-type.ts +0 -9
  37. package/src/errors.ts +0 -6
  38. package/src/events.ts +0 -18
  39. package/src/index.ts +0 -40
  40. package/src/mock/MockAppClient.ts +0 -77
  41. package/src/mock/index.ts +0 -13
  42. package/src/module.ts +0 -59
  43. package/src/schemas.ts +0 -179
  44. package/src/types.ts +0 -263
  45. package/src/version.ts +0 -2
  46. package/tsconfig.json +0 -30
  47. package/vitest.config.ts +0 -11
package/src/types.ts DELETED
@@ -1,263 +0,0 @@
1
- import type { AnyModule, CombinedModules, ModulesInstance } from '@equinor/fusion-framework-module';
2
- import type { EventModule } from '@equinor/fusion-framework-module-event';
3
- import type { HttpModule } from '@equinor/fusion-framework-module-http';
4
- import type { MsalModule } from '@equinor/fusion-framework-module-msal';
5
- import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery';
6
- import type { AppConfig } from './AppConfig';
7
- import type IApp from './app';
8
-
9
- /**
10
- * Re-export of {@link ConfigEnvironment} from AppConfig.
11
- */
12
- export type ConfigEnvironment = Record<string, unknown>;
13
- export type { AppConfig } from './AppConfig';
14
-
15
- // biome-ignore lint/suspicious/noExplicitAny: TODO(#5123) - needs proper type definition
16
- type Fusion = any;
17
-
18
- /**
19
- * Environment bindings passed to an application at render time,
20
- * including its manifest, configuration, base path, and custom props.
21
- *
22
- * @template TEnv - Shape of the environment configuration record.
23
- * @template TProps - Shape of custom properties passed to the app.
24
- */
25
- export type AppEnv<TEnv extends ConfigEnvironment = ConfigEnvironment, TProps = unknown> = {
26
- basename?: string;
27
- manifest?: AppManifest;
28
- config?: AppConfig<TEnv>;
29
- props?: TProps;
30
- };
31
-
32
- /**
33
- * Reference to an application, used to fetch the app manifest from the app service.
34
- * The `tag` defaults to `'latest'` when omitted.
35
- */
36
- export type AppReference = {
37
- appKey: string;
38
- tag?: string; // defaults to 'latest'
39
- };
40
-
41
- /**
42
- * Required module dependencies for the app module.
43
- *
44
- * The app module depends on HTTP (for API calls), service discovery
45
- * (for resolving the apps service URL), and events (for lifecycle notifications).
46
- */
47
- export type ModuleDeps = [HttpModule, ServiceDiscoveryModule, EventModule];
48
-
49
- /**
50
- * Per-user application settings, stored as an arbitrary key-value record.
51
- * Read via `getAppSettings` and written via `updateAppSettings` on the provider.
52
- */
53
- export interface AppSettings {
54
- [key: string]: unknown;
55
- }
56
-
57
- /**
58
- * Discriminant union of supported application types.
59
- *
60
- * - `'standalone'` – A full standalone application.
61
- * - `'template'` / `'template-app'` – Template-based apps.
62
- * - `'landing-page'` – Portal landing pages.
63
- * - `'report'` / `'launcher'` – Legacy types (will be removed).
64
- */
65
- export type AppType =
66
- | 'standalone'
67
- | 'report'
68
- | 'launcher'
69
- | 'template'
70
- | 'template-app'
71
- | 'landing-page';
72
-
73
- /**
74
- * The currently active application, or `null` when cleared, or `undefined`
75
- * when no application has been set yet.
76
- *
77
- * @template TModules - Additional framework modules the app depends on.
78
- * @template TEnv - Shape of the environment configuration record.
79
- */
80
- export type CurrentApp<
81
- TModules extends Array<AnyModule> = [],
82
- TEnv extends ConfigEnvironment = ConfigEnvironment,
83
- > = IApp<TEnv, TModules> | null | undefined;
84
-
85
- type Nullable<T> = T | null | undefined;
86
-
87
- /**
88
- * Represents a person associated with an application (admin or owner).
89
- */
90
- type AppPerson = {
91
- id: string;
92
- azureUniqueId: string;
93
- displayName: string;
94
- mail?: Nullable<string>;
95
- upn?: Nullable<string>;
96
- accountType: string;
97
- accountClassification?: Nullable<string>;
98
- isExpired?: Nullable<boolean>;
99
- };
100
-
101
- /** An application administrator. */
102
- export type AppAdmin = AppPerson;
103
-
104
- /** An application owner. */
105
- export type AppOwner = AppPerson;
106
-
107
- /**
108
- * Schema entry format for route documentation in app manifests.
109
- * Each entry represents a route with its path, description, and optional parameter/search schemas.
110
- */
111
- export type RouteSchemaEntry = [
112
- path: string,
113
- description: string,
114
- options?: {
115
- params?: Record<string, string>;
116
- search?: Record<string, string>;
117
- },
118
- ];
119
-
120
- /**
121
- * Typed representation of the options object.
122
- *
123
- * Only known keys are declared in the type — additional properties are
124
- * handled by the Zod schema at runtime. Keeping the type narrow avoids
125
- * structural incompatibilities with `RecursivePartial<AppManifest>`.
126
- */
127
- export type FrameworkOptions = {
128
- /**
129
- * Declares how the portal should encode this app's active context into the URL.
130
- *
131
- * Read by the `@equinor/fusion-framework-plugin-context-navigation` plugin
132
- * to select the correct adapter at runtime.
133
- *
134
- * - `'path'` — context id as a path segment: `/apps/{appKey}/{contextId}/...`
135
- * - `'query'` — context id as a query parameter: `/apps/{appKey}/...?$contextId={id}`
136
- * - `null` — explicitly opt out of automatic context-to-URL encoding
137
- * - `undefined` (omitted) — falls back to `'path'` (the default adapter)
138
- *
139
- * Apps with custom URL shapes should omit this field and register
140
- * `setContextPathExtractor` / `setContextPathGenerator` hooks instead —
141
- * the custom adapter picks those up automatically.
142
- *
143
- * Set this in the app manifest's `build.options.contextRouting` field,
144
- * either in `app.manifest.config.ts` or via the app service manifest.
145
- *
146
- * @default undefined (falls back to path adapter)
147
- */
148
- contextRouting?: 'path' | 'query' | null;
149
- };
150
-
151
- /**
152
- * Build metadata returned by the app service for a specific application version.
153
- * Contains the script entry point, asset path, tags, and optional CI metadata.
154
- */
155
- export type AppBuildManifest = {
156
- version: string;
157
- entryPoint: string;
158
- tags?: Nullable<string[]>;
159
- tag?: Nullable<string>;
160
- assetPath?: Nullable<string>;
161
- configUrl?: Nullable<string>;
162
- timestamp?: Nullable<string>;
163
- commitSha?: Nullable<string>;
164
- githubRepo?: Nullable<string>;
165
- projectPage?: Nullable<string>;
166
- annotations?: Nullable<Record<string, string>>;
167
- options?: Nullable<FrameworkOptions>;
168
- allowedExtensions?: Nullable<string[]>;
169
- uploadedBy?: Nullable<AppOwner>;
170
- };
171
-
172
- /**
173
- * Full manifest describing a registered Fusion application, including
174
- * display metadata, category, admins/owners, build info, and optional route schemas.
175
- */
176
- export interface AppManifest {
177
- /** @deprecated will be removed, use appKey */
178
- key?: string;
179
- appKey: string;
180
- /** @deprecated will be removed, use displayName */
181
- name?: string;
182
- displayName: string;
183
- description: string;
184
- type: AppType;
185
- isPinned?: Nullable<boolean>;
186
- templateSource?: Nullable<string>;
187
- category?: Nullable<{
188
- id: string;
189
- name: string;
190
- displayName: string;
191
- color: string;
192
- defaultIcon: string;
193
- sortOrder: number;
194
- }>;
195
- visualization?: Nullable<{
196
- color?: Nullable<string>;
197
- icon?: Nullable<string>;
198
- sortOrder: number;
199
- }>;
200
- keywords?: Nullable<string[]>;
201
- admins?: Nullable<AppAdmin[]>;
202
- owners?: Nullable<AppOwner[]>;
203
- build?: Nullable<AppBuildManifest>;
204
- /** Route schema entries for documentation and API schema generation */
205
- routes?: Nullable<RouteSchemaEntry[]>;
206
- }
207
-
208
- /**
209
- * A loaded application bundle containing its manifest, config, and imported script module.
210
- *
211
- * @template TEnvironment - Shape of the environment config record.
212
- * @template TModule - Type of the dynamically imported ES module.
213
- */
214
- export type AppBundle<
215
- TEnvironment extends ConfigEnvironment = ConfigEnvironment,
216
- TModule = unknown,
217
- > = {
218
- manifest: AppManifest;
219
- config: AppConfig<TEnvironment>;
220
- module: TModule;
221
- };
222
-
223
- /**
224
- * Combined module type merging the app's own modules with base framework modules
225
- * (Event, HTTP, MSAL).
226
- *
227
- * @template TModules - Additional modules contributed by the application.
228
- */
229
- export type AppModules<TModules extends Array<AnyModule> | unknown = unknown> = CombinedModules<
230
- TModules,
231
- [EventModule, HttpModule, MsalModule]
232
- >;
233
-
234
- /**
235
- * Arguments passed to an application's `renderApp` or default export function
236
- * when mounting the application into a DOM element.
237
- *
238
- * @template TFusion - Type of the Fusion framework instance.
239
- * @template TEnv - Type of the environment bindings.
240
- */
241
- export type ComponentRenderArgs<TFusion extends Fusion = Fusion, TEnv = AppEnv> = {
242
- fusion: TFusion;
243
- env: TEnv;
244
- };
245
-
246
- /**
247
- * Shape of the ES module exported by an application's script bundle.
248
- *
249
- * Must expose either a `default` export or a `renderApp` function (or both)
250
- * that mounts the application into a host DOM element.
251
- */
252
- export type AppScriptModule = {
253
- default: (el: HTMLElement, args: ComponentRenderArgs) => VoidFunction;
254
- renderApp: (el: HTMLElement, args: ComponentRenderArgs) => VoidFunction;
255
- };
256
-
257
- /**
258
- * Instantiated module collection for a running application.
259
- *
260
- * @template TModules - Additional modules contributed by the application.
261
- */
262
- export type AppModulesInstance<TModules extends Array<AnyModule> | unknown = unknown> =
263
- ModulesInstance<AppModules<TModules>>;
package/src/version.ts DELETED
@@ -1,2 +0,0 @@
1
- // Generated by genversion.
2
- export const version = '8.1.0-next.0';
package/tsconfig.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "dist/esm",
5
- "rootDir": "src",
6
- "declarationDir": "./dist/types"
7
- },
8
- "references": [
9
- {
10
- "path": "../../utils/query"
11
- },
12
- {
13
- "path": "../../framework"
14
- },
15
- {
16
- "path": "../module"
17
- },
18
- {
19
- "path": "../http"
20
- },
21
- {
22
- "path": "../event"
23
- },
24
- {
25
- "path": "../service-discovery"
26
- }
27
- ],
28
- "include": ["src/**/*"],
29
- "exclude": ["node_modules", "lib"]
30
- }
package/vitest.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { defineProject } from 'vitest/config';
2
-
3
- import { name, version } from './package.json' with { type: 'json' };
4
-
5
- export default defineProject({
6
- test: {
7
- environment: 'node',
8
- include: ['src/__tests__/**/*.test.ts'],
9
- name: `${name}@${version}`,
10
- },
11
- });