@equinor/fusion-framework-app 10.3.2 → 10.4.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.
- package/CHANGELOG.md +23 -0
- package/dist/esm/AppConfigurator.js +19 -2
- package/dist/esm/AppConfigurator.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/AppConfigurator.d.ts +14 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -6
- package/src/AppConfigurator.ts +19 -2
- package/src/version.ts +1 -1
|
@@ -52,6 +52,20 @@ export declare class AppConfigurator<TModules extends Array<AnyModule> | unknown
|
|
|
52
52
|
protected configureHttpClientsFromAppConfig(): void;
|
|
53
53
|
configureHttp(...args: Parameters<typeof configureHttp>): void;
|
|
54
54
|
configureHttpClient(...args: Parameters<typeof configureHttpClient>): void;
|
|
55
|
+
/**
|
|
56
|
+
* Configures a http client for the service `serviceName`.
|
|
57
|
+
* The serviceName is looked up in ServiceDiscovery.
|
|
58
|
+
* User can override url and scopes with session values.
|
|
59
|
+
* App can override url and scopes with app config.
|
|
60
|
+
*
|
|
61
|
+
* Priority:
|
|
62
|
+
* 1. Session overrides
|
|
63
|
+
* 2. AppConfig
|
|
64
|
+
* 3. ServiceDiscovery
|
|
65
|
+
*
|
|
66
|
+
* @see modules/service-discovery/src/client.ts
|
|
67
|
+
* @see configureHttpClientsFromAppConfig()
|
|
68
|
+
*/
|
|
55
69
|
useFrameworkServiceClient(serviceName: string, options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>): void;
|
|
56
70
|
}
|
|
57
71
|
export default AppConfigurator;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "10.
|
|
1
|
+
export declare const version = "10.4.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-app",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"rxjs": "^7.8.1",
|
|
49
|
-
"@equinor/fusion-framework
|
|
50
|
-
"@equinor/fusion-framework": "7.4.4",
|
|
51
|
-
"@equinor/fusion-framework-module-app": "7.4.0",
|
|
49
|
+
"@equinor/fusion-framework": "7.4.5",
|
|
52
50
|
"@equinor/fusion-framework-module-event": "5.0.0",
|
|
53
|
-
"@equinor/fusion-framework-module-
|
|
51
|
+
"@equinor/fusion-framework-module-app": "7.4.0",
|
|
52
|
+
"@equinor/fusion-framework-module": "5.0.5",
|
|
53
|
+
"@equinor/fusion-framework-module-msal": "7.0.0",
|
|
54
54
|
"@equinor/fusion-framework-module-telemetry": "4.6.2",
|
|
55
|
-
"@equinor/fusion-framework-module-
|
|
55
|
+
"@equinor/fusion-framework-module-http": "7.0.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"typescript": "^5.8.2",
|
package/src/AppConfigurator.ts
CHANGED
|
@@ -106,6 +106,20 @@ export class AppConfigurator<
|
|
|
106
106
|
this.addConfig(configureHttpClient(...args));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Configures a http client for the service `serviceName`.
|
|
111
|
+
* The serviceName is looked up in ServiceDiscovery.
|
|
112
|
+
* User can override url and scopes with session values.
|
|
113
|
+
* App can override url and scopes with app config.
|
|
114
|
+
*
|
|
115
|
+
* Priority:
|
|
116
|
+
* 1. Session overrides
|
|
117
|
+
* 2. AppConfig
|
|
118
|
+
* 3. ServiceDiscovery
|
|
119
|
+
*
|
|
120
|
+
* @see modules/service-discovery/src/client.ts
|
|
121
|
+
* @see configureHttpClientsFromAppConfig()
|
|
122
|
+
*/
|
|
109
123
|
public useFrameworkServiceClient(
|
|
110
124
|
serviceName: string,
|
|
111
125
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -114,13 +128,16 @@ export class AppConfigurator<
|
|
|
114
128
|
this.addConfig({
|
|
115
129
|
module: http,
|
|
116
130
|
configure: async (config, ref) => {
|
|
131
|
+
// Service from serviceDiscovery with potential session override.
|
|
117
132
|
const service = await ref?.serviceDiscovery.resolveService(serviceName);
|
|
118
133
|
if (!service) {
|
|
119
134
|
throw Error(`failed to configure service [${serviceName}]`);
|
|
120
135
|
}
|
|
121
136
|
|
|
122
|
-
// Check if serviceName is already configured
|
|
123
|
-
|
|
137
|
+
// Check if serviceName is already configured (potentially with app-config)
|
|
138
|
+
// If the service is session overridden - we need the configuration to run
|
|
139
|
+
// as normal (the uri already updated).
|
|
140
|
+
if (config.hasClient(serviceName) && !service.overridden) {
|
|
124
141
|
console.warn(
|
|
125
142
|
`${serviceName} is already configured, possibly by app.config.[ENV].ts.
|
|
126
143
|
Overriding configurations may lead to unintended behaviour and should
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '10.
|
|
2
|
+
export const version = '10.4.0';
|