@equinor/fusion-framework-app 7.0.16 → 7.1.2

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,6 +1,6 @@
1
- import { FusionModulesInstance } from '@equinor/fusion-framework';
2
- import { AnyModule, IModulesConfigurator, ModulesConfigurator } from '@equinor/fusion-framework-module';
3
- import { configureHttpClient, configureHttp } from '@equinor/fusion-framework-module-http';
1
+ import { type FusionModulesInstance } from '@equinor/fusion-framework';
2
+ import { type AnyModule, type IModulesConfigurator, ModulesConfigurator } from '@equinor/fusion-framework-module';
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 { AppModules } from './types';
6
6
  export interface IAppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance> extends IModulesConfigurator<AppModules<TModules>, TRef> {
@@ -13,7 +13,7 @@ export declare class AppConfigurator<TModules extends Array<AnyModule> | unknown
13
13
  constructor();
14
14
  configureHttp(...args: Parameters<typeof configureHttp>): void;
15
15
  configureHttpClient(...args: Parameters<typeof configureHttpClient>): void;
16
- useFrameworkServiceClient(serviceName: string): void;
16
+ useFrameworkServiceClient(serviceName: string, options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>): void;
17
17
  configureMsal(...args: Parameters<typeof configureMsal>): void;
18
18
  }
19
19
  export default AppConfigurator;
@@ -0,0 +1 @@
1
+ export declare const version = "7.1.2";
package/package.json CHANGED
@@ -1,45 +1,44 @@
1
1
  {
2
- "name": "@equinor/fusion-framework-app",
3
- "version": "7.0.16",
4
- "description": "",
5
- "main": "dist/esm/index.js",
6
- "exports": {
7
- ".": "./dist/esm/index.js"
8
- },
9
- "types": "./dist/types/index.d.ts",
10
- "scripts": {
11
- "build": "tsc -b",
12
- "prepack": "yarn build"
13
- },
14
- "keywords": [
15
- "fusion",
16
- "fusion-framework",
17
- "utility"
18
- ],
19
- "homepage": "https://equinor.github.io/fusion-framework/",
20
- "author": {
21
- "name": "Odin thomas Rochmann",
22
- "email": "oroc@equinor.com",
23
- "url": "https://github.com/odinr"
24
- },
25
- "license": "ISC",
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://github.com/equinor/fusion-framework.git",
32
- "directory": "packages/app"
33
- },
34
- "dependencies": {
35
- "@equinor/fusion-framework": "^7.0.15",
36
- "@equinor/fusion-framework-module": "^4.2.1",
37
- "@equinor/fusion-framework-module-app": "^5.2.1",
38
- "@equinor/fusion-framework-module-event": "^4.0.2",
39
- "@equinor/fusion-framework-module-http": "^5.0.4",
40
- "@equinor/fusion-framework-module-msal": "^3.0.4"
41
- },
42
- "devDependencies": {
43
- "typescript": "^5.1.3"
44
- }
45
- }
2
+ "name": "@equinor/fusion-framework-app",
3
+ "version": "7.1.2",
4
+ "description": "",
5
+ "main": "dist/esm/index.js",
6
+ "exports": {
7
+ ".": "./dist/esm/index.js"
8
+ },
9
+ "types": "./dist/types/index.d.ts",
10
+ "keywords": [
11
+ "fusion",
12
+ "fusion-framework",
13
+ "utility"
14
+ ],
15
+ "homepage": "https://equinor.github.io/fusion-framework/",
16
+ "author": {
17
+ "name": "Odin thomas Rochmann",
18
+ "email": "oroc@equinor.com",
19
+ "url": "https://github.com/odinr"
20
+ },
21
+ "license": "ISC",
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/equinor/fusion-framework.git",
28
+ "directory": "packages/app"
29
+ },
30
+ "dependencies": {
31
+ "@equinor/fusion-framework": "^7.0.17",
32
+ "@equinor/fusion-framework-module": "^4.2.3",
33
+ "@equinor/fusion-framework-module-app": "^5.2.3",
34
+ "@equinor/fusion-framework-module-event": "^4.0.4",
35
+ "@equinor/fusion-framework-module-http": "^5.0.5",
36
+ "@equinor/fusion-framework-module-msal": "^3.0.5"
37
+ },
38
+ "devDependencies": {
39
+ "typescript": "^5.1.3"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc -b"
43
+ }
44
+ }
@@ -1,13 +1,20 @@
1
- import { FusionModulesInstance } from '@equinor/fusion-framework';
1
+ import { type FusionModulesInstance } from '@equinor/fusion-framework';
2
+
2
3
  import {
3
- AnyModule,
4
- IModulesConfigurator,
4
+ type AnyModule,
5
+ type IModulesConfigurator,
5
6
  ModuleConsoleLogger,
6
7
  ModulesConfigurator,
7
8
  } from '@equinor/fusion-framework-module';
8
9
 
9
10
  import event from '@equinor/fusion-framework-module-event';
10
- import http, { configureHttpClient, configureHttp } from '@equinor/fusion-framework-module-http';
11
+
12
+ import http, {
13
+ configureHttpClient,
14
+ configureHttp,
15
+ type HttpClientOptions,
16
+ } from '@equinor/fusion-framework-module-http';
17
+
11
18
  import auth, { configureMsal } from '@equinor/fusion-framework-module-msal';
12
19
 
13
20
  import { AppModules } from './types';
@@ -20,7 +27,7 @@ import { AppModules } from './types';
20
27
  */
21
28
  export interface IAppConfigurator<
22
29
  TModules extends Array<AnyModule> | unknown = unknown,
23
- TRef extends FusionModulesInstance = FusionModulesInstance
30
+ TRef extends FusionModulesInstance = FusionModulesInstance,
24
31
  > extends IModulesConfigurator<AppModules<TModules>, TRef> {
25
32
  /**
26
33
  * [optional]
@@ -74,7 +81,7 @@ export interface IAppConfigurator<
74
81
 
75
82
  export class AppConfigurator<
76
83
  TModules extends Array<AnyModule> | unknown = unknown,
77
- TRef extends FusionModulesInstance = FusionModulesInstance
84
+ TRef extends FusionModulesInstance = FusionModulesInstance,
78
85
  >
79
86
  extends ModulesConfigurator<AppModules<TModules>, TRef>
80
87
  implements IAppConfigurator<TModules, TRef>
@@ -92,7 +99,11 @@ export class AppConfigurator<
92
99
  this.addConfig(configureHttpClient(...args));
93
100
  }
94
101
 
95
- public useFrameworkServiceClient(serviceName: string): void {
102
+ public useFrameworkServiceClient(
103
+ serviceName: string,
104
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
+ options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>,
106
+ ): void {
96
107
  this.addConfig({
97
108
  module: http,
98
109
  configure: async (config, ref) => {
@@ -101,6 +112,7 @@ export class AppConfigurator<
101
112
  throw Error(`failed to configure service [${serviceName}]`);
102
113
  }
103
114
  config.configureClient(serviceName, {
115
+ ...options,
104
116
  baseUri: service.uri,
105
117
  defaultScopes: service.defaultScopes,
106
118
  });
@@ -27,9 +27,9 @@ export const configureModules =
27
27
  <
28
28
  TModules extends Array<AnyModule> | never,
29
29
  TRef extends Fusion = Fusion,
30
- TEnv extends AppEnv = AppEnv
30
+ TEnv extends AppEnv = AppEnv,
31
31
  >(
32
- cb?: AppModuleInitiator<TModules, TRef, TEnv>
32
+ cb?: AppModuleInitiator<TModules, TRef, TEnv>,
33
33
  ): ((args: { fusion: TRef; env: TEnv }) => Promise<AppModulesInstance<TModules>>) =>
34
34
  /**
35
35
  *
@@ -44,7 +44,7 @@ export const configureModules =
44
44
  await Promise.resolve(cb(configurator, args));
45
45
  }
46
46
  const modules = (await configurator.initialize(
47
- args.fusion.modules
47
+ args.fusion.modules,
48
48
  // TODO
49
49
  )) as unknown as AppModulesInstance<TModules>;
50
50
 
package/src/types.ts CHANGED
@@ -42,10 +42,10 @@ export type AppEnv<TConfig = unknown, TProps = unknown> = {
42
42
  export type AppModuleInitiator<
43
43
  TModules extends Array<AnyModule> | unknown = unknown,
44
44
  TRef extends Fusion = Fusion,
45
- TEnv = AppEnv
45
+ TEnv = AppEnv,
46
46
  > = (
47
47
  configurator: IAppConfigurator<TModules, TRef['modules']>,
48
- args: { fusion: TRef; env: TEnv }
48
+ args: { fusion: TRef; env: TEnv },
49
49
  ) => void | Promise<void>;
50
50
 
51
51
  /**
@@ -58,7 +58,7 @@ export type AppModuleInitiator<
58
58
  export type AppModuleInit<
59
59
  TModules extends Array<AnyModule> | unknown,
60
60
  TRef extends Fusion = Fusion,
61
- TEnv = AppEnv
61
+ TEnv = AppEnv,
62
62
  > = (
63
- cb: AppModuleInitiator<TModules, TRef, TEnv>
63
+ cb: AppModuleInitiator<TModules, TRef, TEnv>,
64
64
  ) => (args: { fusion: TRef; env: TEnv }) => Promise<AppModulesInstance<TModules>>;
package/src/version.ts ADDED
@@ -0,0 +1,2 @@
1
+ // Generated by genversion.
2
+ export const version = '7.1.2';
package/tsconfig.json CHANGED
@@ -4,8 +4,7 @@
4
4
  "outDir": "dist/esm",
5
5
  "rootDir": "src",
6
6
  "declarationDir": "./dist/types",
7
- "baseUrl": "src",
8
- "jsx": "react-jsx"
7
+
9
8
  },
10
9
  "references": [
11
10
  {