-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.ts
75 lines (64 loc) · 2.44 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { enableAppModule } from '@equinor/fusion-framework-module-app';
import { ConsoleLogger } from '@equinor/fusion-framework-module-msal/client';
import { enableBookmark } from '@equinor/fusion-framework-module-bookmark';
import { FrameworkConfigurator } from '@equinor/fusion-framework';
import { enableNavigation } from '@equinor/fusion-framework-module-navigation';
import { enableServices } from '@equinor/fusion-framework-module-services';
import { enableFeatureFlagging } from '@equinor/fusion-framework-module-feature-flag';
import {
createLocalStoragePlugin,
createUrlPlugin,
} from '@equinor/fusion-framework-module-feature-flag/plugins';
export const configure = async (config: FrameworkConfigurator) => {
config.logger.level = 0;
config.configureServiceDiscovery({
client: {
baseUri: String(new URL('/_discovery/environments/current', import.meta.url)),
defaultScopes: ['5a842df8-3238-415d-b168-9f16a6a6031b/.default'],
},
});
config.configureMsal(
{
tenantId: '3aa4a235-b6e2-48d5-9195-7fcf05b459b0',
clientId: '9b707e3a-3e90-41ed-a47e-652a1e3b53d0',
redirectUri: '/authentication/login-callback',
},
{ requiresAuth: true },
);
enableAppModule(config);
enableNavigation(config);
enableServices(config);
enableBookmark(config, (builder) => {
builder.setSourceSystem({
subSystem: 'CLI',
identifier: 'fusion-cli',
name: 'Fusion CLI',
});
});
/* Adds demo portal features to cli */
enableFeatureFlagging(config, (builder) => {
builder.addPlugin(
createLocalStoragePlugin([
{
key: 'fusionDebug',
title: 'Fusion debug log',
description: 'Show Fusion debug log in console',
},
{
key: 'pinkBg',
title: 'Use pink bg?',
description: 'When enabled the background should be pink',
},
]),
);
builder.addPlugin(createUrlPlugin(['fusionDebug']));
});
config.onConfigured(() => {
console.log('framework config done');
});
config.onInitialized(async (fusion) => {
fusion.auth.defaultClient.setLogger(new ConsoleLogger(0));
console.debug('📒 subscribing to all events');
});
};
export default configure;