@equinor/fusion-framework-app 9.1.2 → 9.1.4

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.
@@ -3,10 +3,56 @@ import { type AnyModule, type IModulesConfigurator, ModulesConfigurator } from '
3
3
  import { configureHttpClient, configureHttp, type HttpClientOptions } from '@equinor/fusion-framework-module-http';
4
4
  import { configureMsal } from '@equinor/fusion-framework-module-msal';
5
5
  import { AppEnv, AppModules } from './types';
6
+ /**
7
+ * Configurator for configuring application modules
8
+ *
9
+ * @template TModules Addition modules
10
+ * @template TRef usually undefined, optional references
11
+ */
6
12
  export interface IAppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance> extends IModulesConfigurator<AppModules<TModules>, TRef> {
13
+ /**
14
+ * [optional]
15
+ * enable/configure the http module
16
+ */
7
17
  configureHttp(...args: Parameters<typeof configureHttp>): void;
18
+ /**
19
+ * [optional]
20
+ * Configure a named http client.
21
+ * @example
22
+ * ```ts
23
+ configurator.configureHttpClient(
24
+ 'myClient',
25
+ {
26
+ baseUri: 'https://foo.bar',
27
+ defaultScopes: ['client-id/.default']
28
+ }
29
+ );
30
+ * ```
31
+ */
8
32
  configureHttpClient(...args: Parameters<typeof configureHttpClient>): void;
33
+ /**
34
+ * [required]
35
+ * Setup of MSAL auth module
36
+ * @example
37
+ * ```ts
38
+ configurator.configureMsal(
39
+ {
40
+ tenantId: '{TENANT_ID}',
41
+ clientId: '{CLIENT_ID}',
42
+ redirectUri: '/authentication/login-callback',
43
+ },
44
+ { requiresAuth: true }
45
+ );
46
+ * ```
47
+ */
9
48
  configureMsal(...args: Parameters<typeof configureMsal>): void;
49
+ /**
50
+ * [optional]
51
+ *
52
+ * configure a http client which is resolved by service discovery
53
+ *
54
+ * @param serviceName - name of the service to use
55
+ */
10
56
  useFrameworkServiceClient(serviceName: string, options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>): void;
11
57
  }
12
58
  export declare class AppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance, TEnv extends AppEnv = AppEnv> extends ModulesConfigurator<AppModules<TModules>, TRef> implements IAppConfigurator<TModules, TRef> {
@@ -1,8 +1,27 @@
1
1
  import { Fusion } from '@equinor/fusion-framework';
2
2
  import type { AnyModule } from '@equinor/fusion-framework-module';
3
3
  import type { AppModulesInstance, AppModuleInitiator, AppEnv } from './types';
4
- export declare const configureModules: <TModules extends AnyModule[], TRef extends Fusion<unknown> = Fusion<unknown>, TEnv extends AppEnv = AppEnv>(cb?: AppModuleInitiator<TModules, TRef, TEnv>) => (args: {
4
+ /**
5
+ *
6
+ * Creates a callback for initializing configuration of application modules
7
+ *
8
+ * @example
9
+ ```ts
10
+ const initialize = configureModules((configurator, args) => {
11
+ configurator.configure(someModule);
12
+ });
13
+ await initialize({ fusion, { manifest, config }});
14
+ ```
15
+ * @template TModules Addition modules
16
+ * @template TRef usually undefined, optional references
17
+ * @template TEnv environment object for configuring modules
18
+ *
19
+ * @param cb configuration callback
20
+ *
21
+ * @returns initialize function, executes configurator
22
+ */
23
+ export declare const configureModules: <TModules extends Array<AnyModule> | never, TRef extends Fusion = Fusion<unknown>, TEnv extends AppEnv = AppEnv>(cb?: AppModuleInitiator<TModules, TRef, TEnv>) => ((args: {
5
24
  fusion: TRef;
6
25
  env: TEnv;
7
- }) => Promise<AppModulesInstance<TModules>>;
26
+ }) => Promise<AppModulesInstance<TModules>>);
8
27
  export default configureModules;
@@ -3,19 +3,57 @@ import type { AnyModule } from '@equinor/fusion-framework-module';
3
3
  import type { AppConfig, AppManifest, AppModulesInstance, ComponentRenderArgs } from '@equinor/fusion-framework-module-app';
4
4
  import type { IAppConfigurator } from './AppConfigurator';
5
5
  export type { AppModules, AppManifest, AppConfig, AppModulesInstance, } from '@equinor/fusion-framework-module-app';
6
+ /**
7
+ * Application environment args
8
+ * Arguments provided when initializing/configuring application modules
9
+ *
10
+ * @template TConfig config value type
11
+ * @template TProps [__not in use__] properties for application component
12
+ */
6
13
  export type AppEnv<TConfig = unknown, TProps = unknown> = {
14
+ /** base routing path of the application */
7
15
  basename?: string;
8
16
  manifest: AppManifest;
9
17
  config?: AppConfig<TConfig>;
10
18
  props?: TProps;
11
19
  };
20
+ /**
21
+ * Blueprint for initializing application modules
22
+ *
23
+ * @template TModules Addition modules
24
+ * @template TRef usually undefined, optional references
25
+ * @template TEnv environment object for configuring modules
26
+ */
12
27
  export type AppModuleInitiator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends Fusion = Fusion, TEnv = AppEnv> = (configurator: IAppConfigurator<TModules, TRef['modules']>, args: {
13
28
  fusion: TRef;
14
29
  env: TEnv;
15
30
  }) => void | Promise<void>;
31
+ /**
32
+ * Blueprint for creating application initialization
33
+ *
34
+ * @template TModules Addition modules
35
+ * @template TRef usually undefined, optional references
36
+ * @template TEnv environment object for configuring modules
37
+ */
16
38
  export type AppModuleInit<TModules extends Array<AnyModule> | unknown = [], TRef extends Fusion = Fusion, TEnv = AppEnv> = (cb: AppModuleInitiator<TModules, TRef, TEnv>) => (args: AppModuleInitArgs<TRef, TEnv>) => Promise<AppModulesInstance<TModules>>;
17
39
  export type AppModuleInitArgs<TRef extends Fusion = Fusion, TEnv = AppEnv> = {
18
40
  fusion: TRef;
19
41
  env: TEnv;
20
42
  };
43
+ /**
44
+ * Type definition for AppRenderFn.
45
+ * This type is responsible for rendering the application within a given environment.
46
+ * It takes a generic `TFusion` type parameter extending `Fusion` for the Fusion instance,
47
+ * and an optional `TEnv` type parameter for the application environment, defaulting to `AppEnv`.
48
+ *
49
+ * @param el - The root document element where the application will be rendered.
50
+ * @param args - An object containing arguments required for component rendering, including the Fusion instance and environment-specific configurations.
51
+ * @returns A function that can be invoked to perform cleanup operations, or `void` if no cleanup is necessary.
52
+ *
53
+ * @example
54
+ * const renderMyApp: AppRenderFn = (el, args) => {
55
+ * // Implementation for rendering the application
56
+ * // Optionally return a cleanup function
57
+ * };
58
+ */
21
59
  export type AppRenderFn<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (el: HTMLHtmlElement, args: ComponentRenderArgs<TFusion, TEnv>) => VoidFunction | void;
@@ -1 +1 @@
1
- export declare const version = "9.1.2";
1
+ export declare const version = "9.1.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-app",
3
- "version": "9.1.2",
3
+ "version": "9.1.4",
4
4
  "description": "",
5
5
  "main": "dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -31,18 +31,18 @@
31
31
  "directory": "packages/app"
32
32
  },
33
33
  "dependencies": {
34
- "@equinor/fusion-framework": "^7.2.1",
35
- "@equinor/fusion-framework-module": "^4.3.1",
36
- "@equinor/fusion-framework-module-app": "^5.3.7",
37
- "@equinor/fusion-framework-module-event": "^4.1.2",
38
- "@equinor/fusion-framework-module-msal": "^3.1.1",
39
- "@equinor/fusion-framework-module-http": "^6.0.0"
34
+ "@equinor/fusion-framework": "^7.2.3",
35
+ "@equinor/fusion-framework-module-app": "^5.3.8",
36
+ "@equinor/fusion-framework-module": "^4.3.2",
37
+ "@equinor/fusion-framework-module-event": "^4.2.1",
38
+ "@equinor/fusion-framework-module-http": "^6.0.1",
39
+ "@equinor/fusion-framework-module-msal": "^3.1.2"
40
40
  },
41
41
  "devDependencies": {
42
- "typescript": "^5.4.2"
42
+ "typescript": "^5.5.3"
43
43
  },
44
44
  "peerDependencies": {
45
- "@equinor/fusion-framework-module-feature-flag": "^1.1.4"
45
+ "@equinor/fusion-framework-module-feature-flag": "^1.1.5"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "@equinor/fusion-framework-module-feature-flag": {
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '9.1.2';
2
+ export const version = '9.1.4';