@onecx/angular-integration-interface 6.0.0-rc.9 → 6.0.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/fesm2022/onecx-angular-integration-interface-mocks.mjs +41 -40
- package/fesm2022/onecx-angular-integration-interface-mocks.mjs.map +1 -1
- package/fesm2022/onecx-angular-integration-interface.mjs +49 -150
- package/fesm2022/onecx-angular-integration-interface.mjs.map +1 -1
- package/index.d.ts +0 -3
- package/lib/api/injection-tokens.d.ts +0 -7
- package/lib/model/config-key.model.d.ts +6 -1
- package/lib/services/app-state.service.d.ts +0 -5
- package/lib/services/user.service.d.ts +3 -7
- package/migrations.json +27 -1
- package/mocks/app-state-service-mock.d.ts +0 -7
- package/mocks/configuration-service-mock.d.ts +2 -2
- package/mocks/user-service-mock.d.ts +2 -2
- package/package.json +9 -4
- package/lib/api/iauth.service.d.ts +0 -17
- package/lib/services/initialize-module-guard.service.d.ts +0 -21
- package/lib/utils/add-initialize-module-guard.utils.d.ts +0 -3
@@ -30,19 +30,13 @@ class AppConfigServiceMock {
|
|
30
30
|
getConfig() {
|
31
31
|
return this.config$.getValue();
|
32
32
|
}
|
33
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
34
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
34
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigServiceMock }); }
|
35
35
|
}
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigServiceMock, decorators: [{
|
37
37
|
type: Injectable
|
38
38
|
}] });
|
39
39
|
|
40
|
-
/**
|
41
|
-
* @deprecated use provideAppStateServiceMock()
|
42
|
-
*/
|
43
|
-
function provideAppServiceMock() {
|
44
|
-
return provideAppStateServiceMock();
|
45
|
-
}
|
46
40
|
function provideAppStateServiceMock() {
|
47
41
|
return [AppStateServiceMock, { provide: AppStateService, useExisting: AppStateServiceMock }];
|
48
42
|
}
|
@@ -50,7 +44,14 @@ class AppStateServiceMock {
|
|
50
44
|
constructor() {
|
51
45
|
this.globalError$ = new FakeTopic();
|
52
46
|
this.globalLoading$ = new FakeTopic(false);
|
53
|
-
this.currentMfe$ = new FakeTopic({
|
47
|
+
this.currentMfe$ = new FakeTopic({
|
48
|
+
mountPath: '/',
|
49
|
+
remoteBaseUrl: '.',
|
50
|
+
baseHref: '/',
|
51
|
+
shellName: 'test',
|
52
|
+
appId: 'test',
|
53
|
+
productName: 'test',
|
54
|
+
});
|
54
55
|
this.currentPage$ = new FakeTopic(undefined);
|
55
56
|
this.currentPortal$ = new FakeTopic({
|
56
57
|
baseUrl: '/',
|
@@ -70,10 +71,10 @@ class AppStateServiceMock {
|
|
70
71
|
});
|
71
72
|
this.isAuthenticated$ = new FakeTopic(null);
|
72
73
|
}
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
74
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
75
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateServiceMock }); }
|
75
76
|
}
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateServiceMock, decorators: [{
|
77
78
|
type: Injectable
|
78
79
|
}] });
|
79
80
|
|
@@ -82,7 +83,7 @@ function provideConfigurationServiceMock() {
|
|
82
83
|
}
|
83
84
|
class ConfigurationServiceMock {
|
84
85
|
constructor() {
|
85
|
-
this.config$ = new FakeTopic();
|
86
|
+
this.config$ = new FakeTopic({});
|
86
87
|
this.isInitializedPromise = new Promise((resolve) => {
|
87
88
|
this.resolveInitPromise = resolve;
|
88
89
|
});
|
@@ -97,11 +98,7 @@ class ConfigurationServiceMock {
|
|
97
98
|
return this.isInitializedPromise;
|
98
99
|
}
|
99
100
|
getProperty(key) {
|
100
|
-
|
101
|
-
if (config && typeof config[key] === 'string') {
|
102
|
-
return config[key];
|
103
|
-
}
|
104
|
-
return undefined;
|
101
|
+
return firstValueFrom(this.config$.asObservable()).then((config) => config[key]);
|
105
102
|
}
|
106
103
|
async setProperty(key, val) {
|
107
104
|
const currentValues = await firstValueFrom(this.config$.asObservable());
|
@@ -109,12 +106,12 @@ class ConfigurationServiceMock {
|
|
109
106
|
await this.config$.publish(currentValues);
|
110
107
|
}
|
111
108
|
getConfig() {
|
112
|
-
return this.config$.
|
109
|
+
return firstValueFrom(this.config$.asObservable());
|
113
110
|
}
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
115
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
112
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationServiceMock, providedIn: 'root' }); }
|
116
113
|
}
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationServiceMock, decorators: [{
|
118
115
|
type: Injectable,
|
119
116
|
args: [{ providedIn: 'root' }]
|
120
117
|
}], ctorParameters: () => [] });
|
@@ -145,10 +142,10 @@ class PortalMessageServiceMock {
|
|
145
142
|
severity: severity,
|
146
143
|
});
|
147
144
|
}
|
148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
149
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
146
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageServiceMock, providedIn: 'any' }); }
|
150
147
|
}
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageServiceMock, decorators: [{
|
152
149
|
type: Injectable,
|
153
150
|
args: [{ providedIn: 'any' }]
|
154
151
|
}] });
|
@@ -160,10 +157,10 @@ class RemoteComponentsServiceMock {
|
|
160
157
|
constructor() {
|
161
158
|
this.remoteComponents$ = new FakeTopic();
|
162
159
|
}
|
163
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
164
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
161
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsServiceMock, providedIn: 'root' }); }
|
165
162
|
}
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsServiceMock, decorators: [{
|
167
164
|
type: Injectable,
|
168
165
|
args: [{ providedIn: 'root' }]
|
169
166
|
}] });
|
@@ -174,14 +171,18 @@ function provideUserServiceMock() {
|
|
174
171
|
class UserServiceMock {
|
175
172
|
constructor() {
|
176
173
|
this.profile$ = new FakeTopic();
|
177
|
-
this.
|
174
|
+
this.permissionsTopic$ = new FakeTopic(['mocked-permission']);
|
178
175
|
this.lang$ = new BehaviorSubject('en');
|
179
176
|
}
|
180
|
-
hasPermission(permissionKey) {
|
177
|
+
async hasPermission(permissionKey) {
|
181
178
|
if (Array.isArray(permissionKey)) {
|
182
|
-
return permissionKey.every((key) => this.
|
179
|
+
return permissionKey.every(async (key) => await this.hasPermission(key));
|
180
|
+
}
|
181
|
+
const result = this.permissionsTopic$.getValue()?.includes(permissionKey);
|
182
|
+
if (!result) {
|
183
|
+
console.log(`👮♀️ No permission for: ${permissionKey}`);
|
183
184
|
}
|
184
|
-
return
|
185
|
+
return !!result;
|
185
186
|
}
|
186
187
|
determineLanguage() {
|
187
188
|
return 'mocked-lang';
|
@@ -193,10 +194,10 @@ class UserServiceMock {
|
|
193
194
|
get isInitialized() {
|
194
195
|
return Promise.resolve();
|
195
196
|
}
|
196
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
197
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
197
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
198
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserServiceMock, providedIn: 'root' }); }
|
198
199
|
}
|
199
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserServiceMock, decorators: [{
|
200
201
|
type: Injectable,
|
201
202
|
args: [{ providedIn: 'root' }]
|
202
203
|
}] });
|
@@ -212,10 +213,10 @@ class ShellCapabilityServiceMock {
|
|
212
213
|
hasCapability(capability) {
|
213
214
|
return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false;
|
214
215
|
}
|
215
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
216
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
216
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
217
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityServiceMock }); }
|
217
218
|
}
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityServiceMock, decorators: [{
|
219
220
|
type: Injectable
|
220
221
|
}] });
|
221
222
|
|
@@ -223,5 +224,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
223
224
|
* Generated bundle index. Do not edit.
|
224
225
|
*/
|
225
226
|
|
226
|
-
export { AppConfigServiceMock, AppStateServiceMock, ConfigurationServiceMock, PortalMessageServiceMock, RemoteComponentsServiceMock, ShellCapabilityServiceMock, UserServiceMock, provideAppConfigServiceMock,
|
227
|
+
export { AppConfigServiceMock, AppStateServiceMock, ConfigurationServiceMock, PortalMessageServiceMock, RemoteComponentsServiceMock, ShellCapabilityServiceMock, UserServiceMock, provideAppConfigServiceMock, provideAppStateServiceMock, provideConfigurationServiceMock, providePortalMessageServiceMock, provideRemoteComponentsServiceMock, provideShellCapabilityServiceMock, provideUserServiceMock };
|
227
228
|
//# sourceMappingURL=onecx-angular-integration-interface-mocks.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/app-config-service-mock.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/configuration-service-mock.ts","../../../../libs/angular-integration-interface/mocks/portal-message-service-mock.ts","../../../../libs/angular-integration-interface/mocks/remote-components-service-mock.ts","../../../../libs/angular-integration-interface/mocks/user-service-mock.ts","../../../../libs/angular-integration-interface/mocks/shell-capability-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { Config } from '@onecx/integration-interface'\nimport { AppConfigService } from '@onecx/angular-integration-interface'\n\nexport function provideAppConfigServiceMock() {\n return [AppConfigServiceMock, { provide: AppConfigService, useExisting: AppConfigServiceMock }]\n}\n@Injectable()\nexport class AppConfigServiceMock {\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve) => {\n const mockConfig: Config = { key: 'config' }\n this.config$.next(mockConfig)\n resolve()\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { CurrentLocationTopicPayload, MfeInfo, PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\n/**\n * @deprecated use provideAppStateServiceMock()\n */\nexport function provideAppServiceMock() {\n return provideAppStateServiceMock()\n}\n\nexport function provideAppStateServiceMock() {\n return [AppStateServiceMock, { provide: AppStateService, useExisting: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic<MfeInfo>({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test', appId: 'test', productName: 'test' })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test portal',\n workspaceName: 'Test portal',\n })\n currentWorkspace$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test workspace',\n workspaceName: 'Test workspace',\n })\n currentLocation$ = new FakeTopic<CurrentLocationTopicPayload>({\n url: '/',\n isFirst: true,\n })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","import { Injectable } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { CONFIG_KEY } from '@onecx/angular-integration-interface'\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom'\nimport { ConfigurationService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideConfigurationServiceMock() {\n return [ConfigurationServiceMock, { provide: ConfigurationService, useExisting: ConfigurationServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationServiceMock {\n config$ = new FakeTopic<Config>()\n\n private resolveInitPromise!: (value: void | PromiseLike<void>) => void\n private isInitializedPromise: Promise<void>\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveInitPromise = resolve\n })\n }\n\n public init(config?: Config): Promise<boolean> {\n return this.config$.publish(config ?? {}).then(() => {\n this.resolveInitPromise()\n return true\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.isInitializedPromise\n }\n\n public getProperty(key: CONFIG_KEY): string | undefined {\n const config = this.config$.getValue()\n if (config && typeof config[key] === 'string') {\n return config[key]\n }\n return undefined\n }\n\n public async setProperty(key: string, val: string): Promise<void> {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n }\n\n public getConfig(): Config | undefined {\n return this.config$.getValue()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { Message as PortalMessage, PortalMessageService } from '@onecx/angular-integration-interface'\nimport { Message } from '@onecx/integration-interface'\n\nexport function providePortalMessageServiceMock() {\n return [PortalMessageServiceMock, { provide: PortalMessageService, useExisting: PortalMessageServiceMock }]\n}\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageServiceMock {\n message$ = new FakeTopic<Message>()\n\n success(msg: PortalMessage) {\n this.addTranslated('success', msg)\n }\n\n info(msg: PortalMessage) {\n this.addTranslated('info', msg)\n }\n\n error(msg: PortalMessage) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: PortalMessage) {\n this.addTranslated('warning', msg)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private addTranslated(severity: string, msg: PortalMessage) {\n this.message$.publish({\n ...msg,\n severity: severity,\n })\n }\n}\n","import { Injectable } from '@angular/core'\nimport { RemoteComponentsInfo } from '@onecx/integration-interface'\nimport { RemoteComponentsService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideRemoteComponentsServiceMock() {\n return [RemoteComponentsServiceMock, { provide: RemoteComponentsService, useExisting: RemoteComponentsServiceMock }]\n}\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsServiceMock {\n remoteComponents$ = new FakeTopic<RemoteComponentsInfo>()\n}\n","import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { UserProfile } from '@onecx/integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { UserService } from '@onecx/angular-integration-interface'\n\nexport function provideUserServiceMock() {\n return [UserServiceMock, { provide: UserService, useExisting: UserServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UserServiceMock {\n profile$ = new FakeTopic<UserProfile>()\n permissions$ = new BehaviorSubject<string[]>(['mocked-permission'])\n lang$ = new BehaviorSubject('en')\n\n hasPermission(permissionKey: string | string[]): boolean {\n if (Array.isArray(permissionKey)) {\n return permissionKey.every((key) => this.permissions$.getValue().includes(key))\n }\n return this.permissions$.getValue().includes(permissionKey)\n }\n\n determineLanguage(): string | undefined {\n return 'mocked-lang'\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n extractPermissions(userProfile: UserProfile): string[] | null {\n return ['mocked-permission']\n }\n\n get isInitialized(): Promise<void> {\n return Promise.resolve()\n }\n}\n\nexport type MockUserService = UserServiceMock\n","import { Injectable } from '@angular/core'\nimport { Capability, ShellCapabilityService } from '@onecx/angular-integration-interface'\n\nexport function provideShellCapabilityServiceMock() {\n return [ShellCapabilityServiceMock, { provide: ShellCapabilityService, useExisting: ShellCapabilityServiceMock }]\n}\n\n@Injectable()\nexport class ShellCapabilityServiceMock {\n static capabilities: Capability[] = []\n\n static setCapabilities(capabilities: Capability[]): void {\n ShellCapabilityServiceMock.capabilities = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;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iB,EAAjB,CAAmB;IAEtC,OAAO,eAAe,CAAC,YAA0B,EAAA;AAC/C,QAAA,0BAA0B,CAAC,YAAY,GAAG,YAAY;;AAGxD,IAAA,aAAa,CAAC,UAAsB,EAAA;QAClC,OAAO,0BAA0B,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK;;8GARpE,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1B,0BAA0B,EAAA,CAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;;ACPD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/app-config-service-mock.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/configuration-service-mock.ts","../../../../libs/angular-integration-interface/mocks/portal-message-service-mock.ts","../../../../libs/angular-integration-interface/mocks/remote-components-service-mock.ts","../../../../libs/angular-integration-interface/mocks/user-service-mock.ts","../../../../libs/angular-integration-interface/mocks/shell-capability-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { Config } from '@onecx/integration-interface'\nimport { AppConfigService } from '@onecx/angular-integration-interface'\n\nexport function provideAppConfigServiceMock() {\n return [AppConfigServiceMock, { provide: AppConfigService, useExisting: AppConfigServiceMock }]\n}\n@Injectable()\nexport class AppConfigServiceMock {\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve) => {\n const mockConfig: Config = { key: 'config' }\n this.config$.next(mockConfig)\n resolve()\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { CurrentLocationTopicPayload, MfeInfo, PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideAppStateServiceMock() {\n return [AppStateServiceMock, { provide: AppStateService, useExisting: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic<MfeInfo>({\n mountPath: '/',\n remoteBaseUrl: '.',\n baseHref: '/',\n shellName: 'test',\n appId: 'test',\n productName: 'test',\n })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test portal',\n workspaceName: 'Test portal',\n })\n currentWorkspace$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test workspace',\n workspaceName: 'Test workspace',\n })\n currentLocation$ = new FakeTopic<CurrentLocationTopicPayload>({\n url: '/',\n isFirst: true,\n })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","import { Injectable } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { CONFIG_KEY } from '@onecx/angular-integration-interface'\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom'\nimport { ConfigurationService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideConfigurationServiceMock() {\n return [ConfigurationServiceMock, { provide: ConfigurationService, useExisting: ConfigurationServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationServiceMock {\n config$ = new FakeTopic<Config>({})\n\n private resolveInitPromise!: (value: void | PromiseLike<void>) => void\n private isInitializedPromise: Promise<void>\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveInitPromise = resolve\n })\n }\n\n public init(config?: Config): Promise<boolean> {\n return this.config$.publish(config ?? {}).then(() => {\n this.resolveInitPromise()\n return true\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.isInitializedPromise\n }\n\n public getProperty(key: CONFIG_KEY): Promise<string | undefined> {\n return firstValueFrom(this.config$.asObservable()).then((config) => config[key])\n }\n\n public async setProperty(key: string, val: string): Promise<void> {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n }\n\n public getConfig(): Promise<Config | undefined> {\n return firstValueFrom(this.config$.asObservable())\n }\n}\n","import { Injectable } from '@angular/core'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { Message as PortalMessage, PortalMessageService } from '@onecx/angular-integration-interface'\nimport { Message } from '@onecx/integration-interface'\n\nexport function providePortalMessageServiceMock() {\n return [PortalMessageServiceMock, { provide: PortalMessageService, useExisting: PortalMessageServiceMock }]\n}\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageServiceMock {\n message$ = new FakeTopic<Message>()\n\n success(msg: PortalMessage) {\n this.addTranslated('success', msg)\n }\n\n info(msg: PortalMessage) {\n this.addTranslated('info', msg)\n }\n\n error(msg: PortalMessage) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: PortalMessage) {\n this.addTranslated('warning', msg)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private addTranslated(severity: string, msg: PortalMessage) {\n this.message$.publish({\n ...msg,\n severity: severity,\n })\n }\n}\n","import { Injectable } from '@angular/core'\nimport { RemoteComponentsInfo } from '@onecx/integration-interface'\nimport { RemoteComponentsService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideRemoteComponentsServiceMock() {\n return [RemoteComponentsServiceMock, { provide: RemoteComponentsService, useExisting: RemoteComponentsServiceMock }]\n}\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsServiceMock {\n remoteComponents$ = new FakeTopic<RemoteComponentsInfo>()\n}\n","import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { UserProfile } from '@onecx/integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { UserService } from '@onecx/angular-integration-interface'\n\nexport function provideUserServiceMock() {\n return [UserServiceMock, { provide: UserService, useExisting: UserServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UserServiceMock {\n profile$ = new FakeTopic<UserProfile>()\n permissionsTopic$ = new FakeTopic<string[]>(['mocked-permission'])\n lang$ = new BehaviorSubject('en')\n\n async hasPermission(permissionKey: string | string[]): Promise<boolean> {\n if (Array.isArray(permissionKey)) {\n return permissionKey.every(async (key) => await this.hasPermission(key))\n }\n\n const result = this.permissionsTopic$.getValue()?.includes(permissionKey)\n if (!result) {\n console.log(`👮♀️ No permission for: ${permissionKey}`)\n }\n return !!result\n }\n\n determineLanguage(): string | undefined {\n return 'mocked-lang'\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n extractPermissions(userProfile: UserProfile): string[] | null {\n return ['mocked-permission']\n }\n\n get isInitialized(): Promise<void> {\n return Promise.resolve()\n }\n}\n\nexport type MockUserService = UserServiceMock\n","import { Injectable } from '@angular/core'\nimport { Capability, ShellCapabilityService } from '@onecx/angular-integration-interface'\n\nexport function provideShellCapabilityServiceMock() {\n return [ShellCapabilityServiceMock, { provide: ShellCapabilityService, useExisting: ShellCapabilityServiceMock }]\n}\n\n@Injectable()\nexport class ShellCapabilityServiceMock {\n static capabilities: Capability[] = []\n\n static setCapabilities(capabilities: Capability[]): void {\n ShellCapabilityServiceMock.capabilities = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;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nH;MAGa,0BAA0B,CAAA;aAC9B,IAAY,CAAA,YAAA,GAAiB,EAAjB,CAAmB;IAEtC,OAAO,eAAe,CAAC,YAA0B,EAAA;AAC/C,QAAA,0BAA0B,CAAC,YAAY,GAAG,YAAY;;AAGxD,IAAA,aAAa,CAAC,UAAsB,EAAA;QAClC,OAAO,0BAA0B,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK;;+GARpE,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAA1B,0BAA0B,EAAA,CAAA,CAAA;;4FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;;ACPD;;AAEG;;;;"}
|
@@ -2,7 +2,7 @@ import { Location } from '@angular/common';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { inject, Injectable, InjectionToken } from '@angular/core';
|
5
|
-
import { BehaviorSubject, firstValueFrom, map,
|
5
|
+
import { BehaviorSubject, firstValueFrom, map, combineLatest, of, first } from 'rxjs';
|
6
6
|
import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentLocationTopic, CurrentPageTopic, CurrentWorkspaceTopic, IsAuthenticatedTopic, ConfigurationTopic, UserProfileTopic, PermissionsTopic, MessageTopic, CurrentThemeTopic, RemoteComponentsTopic } from '@onecx/integration-interface';
|
7
7
|
import Semaphore from 'ts-semaphore';
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
@@ -37,10 +37,10 @@ class AppConfigService {
|
|
37
37
|
getConfig() {
|
38
38
|
return this.config$.getValue();
|
39
39
|
}
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
41
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
41
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService }); }
|
42
42
|
}
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService, decorators: [{
|
44
44
|
type: Injectable
|
45
45
|
}] });
|
46
46
|
|
@@ -61,40 +61,24 @@ class AppStateService {
|
|
61
61
|
*/
|
62
62
|
this.isAuthenticated$ = new IsAuthenticatedTopic();
|
63
63
|
}
|
64
|
-
/**
|
65
|
-
* @deprecated Will be replaced by currentWorkspace$
|
66
|
-
*/
|
67
|
-
get currentPortal$() {
|
68
|
-
return this.currentWorkspace$;
|
69
|
-
}
|
70
|
-
set currentPortal$(value) {
|
71
|
-
this.currentWorkspace$ = value;
|
72
|
-
}
|
73
64
|
ngOnDestroy() {
|
74
65
|
this.globalError$.destroy();
|
75
66
|
this.globalLoading$.destroy();
|
76
67
|
this.currentMfe$.destroy();
|
77
68
|
this.currentPage$.destroy();
|
78
|
-
this.currentPortal$.destroy();
|
79
69
|
this.currentLocation$.destroy();
|
80
70
|
this.currentWorkspace$.destroy();
|
81
71
|
this.isAuthenticated$.destroy();
|
82
72
|
}
|
83
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
84
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
74
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateService, providedIn: 'root' }); }
|
85
75
|
}
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppStateService, decorators: [{
|
87
77
|
type: Injectable,
|
88
78
|
args: [{ providedIn: 'root' }]
|
89
79
|
}] });
|
90
80
|
|
91
81
|
const APP_CONFIG = new InjectionToken('APP_CONFIG');
|
92
|
-
/**
|
93
|
-
* @deprecated
|
94
|
-
* Please do not inject the auth service at all.
|
95
|
-
* There are better ways to achieve what you want. Please use permission service or user service.
|
96
|
-
*/
|
97
|
-
const AUTH_SERVICE = new InjectionToken('AUTH_SERVICE');
|
98
82
|
const SANITY_CHECK = new InjectionToken('OCXSANITY_CHECK');
|
99
83
|
const APPLICATION_NAME = new InjectionToken('APPLICATION_NAME');
|
100
84
|
|
@@ -127,7 +111,13 @@ var CONFIG_KEY;
|
|
127
111
|
CONFIG_KEY["AUTH_SERVICE"] = "AUTH_SERVICE";
|
128
112
|
CONFIG_KEY["AUTH_SERVICE_CUSTOM_URL"] = "AUTH_SERVICE_CUSTOM_URL";
|
129
113
|
CONFIG_KEY["AUTH_SERVICE_CUSTOM_MODULE_NAME"] = "AUTH_SERVICE_CUSTOM_MODULE_NAME";
|
114
|
+
CONFIG_KEY["POLYFILL_SCOPE_MODE"] = "POLYFILL_SCOPE_MODE";
|
130
115
|
})(CONFIG_KEY || (CONFIG_KEY = {}));
|
116
|
+
var POLYFILL_SCOPE_MODE;
|
117
|
+
(function (POLYFILL_SCOPE_MODE) {
|
118
|
+
POLYFILL_SCOPE_MODE["PERFORMANCE"] = "PERFORMANCE";
|
119
|
+
POLYFILL_SCOPE_MODE["PRECISION"] = "PRECISION";
|
120
|
+
})(POLYFILL_SCOPE_MODE || (POLYFILL_SCOPE_MODE = {}));
|
131
121
|
|
132
122
|
class ConfigurationService {
|
133
123
|
constructor() {
|
@@ -188,10 +178,10 @@ class ConfigurationService {
|
|
188
178
|
async getConfig() {
|
189
179
|
return firstValueFrom(this.config$.asObservable());
|
190
180
|
}
|
191
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
192
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
181
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
182
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationService, providedIn: 'root' }); }
|
193
183
|
}
|
194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfigurationService, decorators: [{
|
195
185
|
type: Injectable,
|
196
186
|
args: [{ providedIn: 'root' }]
|
197
187
|
}] });
|
@@ -202,38 +192,32 @@ const DEFAULT_LANG = 'en';
|
|
202
192
|
class UserService {
|
203
193
|
constructor() {
|
204
194
|
this.profile$ = new UserProfileTopic();
|
205
|
-
this.permissions$ = new BehaviorSubject([]);
|
206
195
|
this.lang$ = new BehaviorSubject(this.determineLanguage() ?? DEFAULT_LANG);
|
207
196
|
this.permissionsTopic$ = new PermissionsTopic();
|
208
197
|
this.profile$
|
209
198
|
.pipe(map((profile) => profile.accountSettings?.localeAndTimeSettings?.locale ?? this.determineLanguage() ?? DEFAULT_LANG))
|
210
199
|
.subscribe(this.lang$);
|
211
|
-
this.oldStylePermissionsInitialized = firstValueFrom(this.permissions$.pipe(skip(1)));
|
212
|
-
this.effectivePermissions$ = merge(this.permissions$.pipe(skip(1)), this.permissionsTopic$.asObservable());
|
213
|
-
this.profile$
|
214
|
-
.pipe(map((profile) => this.extractPermissions(profile)), filter((permissions) => !!permissions))
|
215
|
-
.subscribe(this.permissions$);
|
216
200
|
}
|
217
201
|
ngOnDestroy() {
|
218
202
|
this.profile$.destroy();
|
219
203
|
}
|
220
204
|
getPermissions() {
|
221
|
-
return this.
|
205
|
+
return this.permissionsTopic$.asObservable();
|
222
206
|
}
|
223
|
-
hasPermission(permissionKey) {
|
207
|
+
async hasPermission(permissionKey) {
|
208
|
+
if (!permissionKey)
|
209
|
+
return true;
|
224
210
|
if (Array.isArray(permissionKey)) {
|
225
|
-
|
226
|
-
|
227
|
-
const oldConceptResult = this.permissions$.getValue()
|
228
|
-
? this.permissions$.getValue()?.includes(permissionKey)
|
229
|
-
: false;
|
230
|
-
const result = this.permissionsTopic$.getValue()
|
231
|
-
? this.permissionsTopic$.getValue()?.includes(permissionKey)
|
232
|
-
: oldConceptResult;
|
233
|
-
if (!result) {
|
234
|
-
console.log(`👮♀️ No permission for: ${permissionKey}`);
|
211
|
+
const permissions = await Promise.all(permissionKey.map((key) => this.hasPermission(key)));
|
212
|
+
return permissions.every((hasPermission) => hasPermission);
|
235
213
|
}
|
236
|
-
return
|
214
|
+
return firstValueFrom(this.permissionsTopic$.pipe(map((permissions) => {
|
215
|
+
const result = permissions.includes(permissionKey);
|
216
|
+
if (!result) {
|
217
|
+
console.log(`👮♀️ No permission for: ${permissionKey}`);
|
218
|
+
}
|
219
|
+
return !!result;
|
220
|
+
})));
|
237
221
|
}
|
238
222
|
determineLanguage() {
|
239
223
|
if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {
|
@@ -252,37 +236,17 @@ class UserService {
|
|
252
236
|
}
|
253
237
|
return browserLang;
|
254
238
|
}
|
255
|
-
extractPermissions(userProfile) {
|
256
|
-
if (userProfile) {
|
257
|
-
if (userProfile.memberships) {
|
258
|
-
const permissions = [];
|
259
|
-
userProfile.memberships.forEach((m) => {
|
260
|
-
m.roleMemberships?.forEach((r) => {
|
261
|
-
r.permissions?.forEach((p) => {
|
262
|
-
if (p) {
|
263
|
-
if (p.key !== undefined) {
|
264
|
-
permissions.push(p.key);
|
265
|
-
}
|
266
|
-
}
|
267
|
-
});
|
268
|
-
});
|
269
|
-
});
|
270
|
-
return permissions;
|
271
|
-
}
|
272
|
-
}
|
273
|
-
return null;
|
274
|
-
}
|
275
239
|
get isInitialized() {
|
276
240
|
return Promise.all([
|
277
|
-
|
241
|
+
this.permissionsTopic$.isInitialized,
|
278
242
|
this.profile$.isInitialized,
|
279
243
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
280
244
|
]).then(() => { });
|
281
245
|
}
|
282
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
283
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
247
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserService, providedIn: 'root' }); }
|
284
248
|
}
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserService, decorators: [{
|
286
250
|
type: Injectable,
|
287
251
|
args: [{ providedIn: 'root' }]
|
288
252
|
}], ctorParameters: () => [] });
|
@@ -322,10 +286,10 @@ class PortalMessageService {
|
|
322
286
|
ngOnDestroy() {
|
323
287
|
this.message$.destroy();
|
324
288
|
}
|
325
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
326
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
290
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageService, providedIn: 'any' }); }
|
327
291
|
}
|
328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PortalMessageService, decorators: [{
|
329
293
|
type: Injectable,
|
330
294
|
args: [{ providedIn: 'any' }]
|
331
295
|
}] });
|
@@ -337,10 +301,10 @@ class ThemeService {
|
|
337
301
|
ngOnDestroy() {
|
338
302
|
this.currentTheme$.destroy();
|
339
303
|
}
|
340
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
341
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
304
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
305
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
342
306
|
}
|
343
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ThemeService, decorators: [{
|
344
308
|
type: Injectable,
|
345
309
|
args: [{ providedIn: 'root' }]
|
346
310
|
}] });
|
@@ -352,63 +316,14 @@ class RemoteComponentsService {
|
|
352
316
|
ngOnDestroy() {
|
353
317
|
this.remoteComponents$.destroy();
|
354
318
|
}
|
355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
356
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
319
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
320
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' }); }
|
357
321
|
}
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RemoteComponentsService, decorators: [{
|
359
323
|
type: Injectable,
|
360
324
|
args: [{ providedIn: 'root' }]
|
361
325
|
}] });
|
362
326
|
|
363
|
-
class InitializeModuleGuard {
|
364
|
-
constructor() {
|
365
|
-
this.translateService = inject(TranslateService);
|
366
|
-
this.configService = inject(ConfigurationService);
|
367
|
-
this.appStateService = inject(AppStateService);
|
368
|
-
this.userService = inject(UserService);
|
369
|
-
this.SUPPORTED_LANGS = ['en', 'de'];
|
370
|
-
this.DEFAULT_LANG = 'en';
|
371
|
-
}
|
372
|
-
canActivate(_route, _state) {
|
373
|
-
console.time('InitializeModuleGuard');
|
374
|
-
return zip([
|
375
|
-
this.loadTranslations(),
|
376
|
-
from(this.configService.isInitialized),
|
377
|
-
from(this.userService.isInitialized),
|
378
|
-
from(this.appStateService.currentWorkspace$.isInitialized),
|
379
|
-
]).pipe(tap(() => {
|
380
|
-
console.timeEnd('InitializeModuleGuard');
|
381
|
-
}), map(() => true));
|
382
|
-
}
|
383
|
-
getBestMatchLanguage(lang) {
|
384
|
-
if (this.SUPPORTED_LANGS.includes(lang)) {
|
385
|
-
return lang;
|
386
|
-
}
|
387
|
-
else {
|
388
|
-
console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
|
389
|
-
}
|
390
|
-
return this.DEFAULT_LANG;
|
391
|
-
}
|
392
|
-
loadTranslations() {
|
393
|
-
return this.userService.lang$.pipe(filter((v) => v !== undefined), mergeMap((lang) => {
|
394
|
-
const bestMatchLang = this.getBestMatchLanguage(lang);
|
395
|
-
return this.translateService.use(bestMatchLang);
|
396
|
-
}), mergeMap(() => of(true)));
|
397
|
-
}
|
398
|
-
toObservable(canActivateResult) {
|
399
|
-
if (isObservable(canActivateResult)) {
|
400
|
-
return canActivateResult;
|
401
|
-
}
|
402
|
-
return from(Promise.resolve(canActivateResult));
|
403
|
-
}
|
404
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InitializeModuleGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
405
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' }); }
|
406
|
-
}
|
407
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InitializeModuleGuard, decorators: [{
|
408
|
-
type: Injectable,
|
409
|
-
args: [{ providedIn: 'any' }]
|
410
|
-
}] });
|
411
|
-
|
412
327
|
class WorkspaceService {
|
413
328
|
constructor() {
|
414
329
|
this.appStateService = inject(AppStateService);
|
@@ -539,10 +454,10 @@ class WorkspaceService {
|
|
539
454
|
return String(value);
|
540
455
|
}
|
541
456
|
}
|
542
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
543
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WorkspaceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
458
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WorkspaceService, providedIn: 'root' }); }
|
544
459
|
}
|
545
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WorkspaceService, decorators: [{
|
546
461
|
type: Injectable,
|
547
462
|
args: [{
|
548
463
|
providedIn: 'root',
|
@@ -561,35 +476,19 @@ class ShellCapabilityService {
|
|
561
476
|
hasCapability(capability) {
|
562
477
|
return window['onecx-shell-capabilities']?.includes(capability) ?? false;
|
563
478
|
}
|
564
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
565
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
479
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
480
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityService, providedIn: 'root' }); }
|
566
481
|
}
|
567
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ShellCapabilityService, decorators: [{
|
568
483
|
type: Injectable,
|
569
484
|
args: [{ providedIn: 'root' }]
|
570
485
|
}] });
|
571
486
|
|
572
|
-
function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
|
573
|
-
return routes.map((r) => {
|
574
|
-
if (r.redirectTo) {
|
575
|
-
return r;
|
576
|
-
}
|
577
|
-
const route = {
|
578
|
-
canActivate: [],
|
579
|
-
...r,
|
580
|
-
};
|
581
|
-
if (!route.canActivate.includes(initializeModuleGuard)) {
|
582
|
-
route.canActivate.push(initializeModuleGuard);
|
583
|
-
}
|
584
|
-
return route;
|
585
|
-
});
|
586
|
-
}
|
587
|
-
|
588
487
|
// services
|
589
488
|
|
590
489
|
/**
|
591
490
|
* Generated bundle index. Do not edit.
|
592
491
|
*/
|
593
492
|
|
594
|
-
export { APPLICATION_NAME, APP_CONFIG,
|
493
|
+
export { APPLICATION_NAME, APP_CONFIG, AppConfigService, AppStateService, CONFIG_KEY, Capability, ConfigurationService, POLYFILL_SCOPE_MODE, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ShellCapabilityService, ThemeService, UserService, WorkspaceService };
|
595
494
|
//# sourceMappingURL=onecx-angular-integration-interface.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"onecx-angular-integration-interface.mjs","sources":["../../../../libs/angular-integration-interface/src/lib/services/app-config-service.ts","../../../../libs/angular-integration-interface/src/lib/services/app-state.service.ts","../../../../libs/angular-integration-interface/src/lib/api/injection-tokens.ts","../../../../libs/angular-integration-interface/src/lib/model/config-key.model.ts","../../../../libs/angular-integration-interface/src/lib/services/configuration.service.ts","../../../../libs/angular-integration-interface/src/lib/api/constants.ts","../../../../libs/angular-integration-interface/src/lib/services/user.service.ts","../../../../libs/angular-integration-interface/src/lib/services/portal-message.service.ts","../../../../libs/angular-integration-interface/src/lib/services/theme.service.ts","../../../../libs/angular-integration-interface/src/lib/services/remote-components.service.ts","../../../../libs/angular-integration-interface/src/lib/services/initialize-module-guard.service.ts","../../../../libs/angular-integration-interface/src/lib/services/workspace.service.ts","../../../../libs/angular-integration-interface/src/lib/services/shell-capability.service.ts","../../../../libs/angular-integration-interface/src/lib/utils/add-initialize-module-guard.utils.ts","../../../../libs/angular-integration-interface/src/index.ts","../../../../libs/angular-integration-interface/src/onecx-angular-integration-interface.ts"],"sourcesContent":["import { Location } from '@angular/common'\nimport { HttpClient } from '@angular/common/http'\nimport { Injectable, inject } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { BehaviorSubject, firstValueFrom } from 'rxjs'\n\n@Injectable()\nexport class AppConfigService {\n private http = inject(HttpClient)\n\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const loadConfigPromise: Promise<Config> = firstValueFrom(\n this.http.get<Config>(Location.joinWithSlash(baseUrl, 'assets/env.json'))\n )\n\n loadConfigPromise\n .then(async (config) => {\n if (config) {\n this.config$.next(config)\n resolve()\n }\n })\n .catch((e) => {\n console.log(`Failed to load env configuration`)\n reject(e)\n })\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport {\n GlobalErrorTopic,\n GlobalLoadingTopic,\n CurrentMfeTopic,\n CurrentPageTopic,\n CurrentWorkspaceTopic,\n IsAuthenticatedTopic,\n CurrentLocationTopic,\n} from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class AppStateService implements OnDestroy {\n globalError$ = new GlobalErrorTopic()\n globalLoading$ = new GlobalLoadingTopic()\n currentMfe$ = new CurrentMfeTopic()\n currentLocation$ = new CurrentLocationTopic()\n\n /**\n * This topic will only fire when pageInfo.path matches document.location.pathname,\n * if not it will fire undefined.\n */\n currentPage$ = new CurrentPageTopic()\n currentWorkspace$ = new CurrentWorkspaceTopic()\n \n /**\n * @deprecated Will be replaced by currentWorkspace$\n */\n get currentPortal$() {\n return this.currentWorkspace$\n }\n set currentPortal$(value: CurrentWorkspaceTopic) {\n this.currentWorkspace$ = value\n }\n\n /**\n * This Topic is initialized as soon as the authentication is done\n */\n isAuthenticated$ = new IsAuthenticatedTopic()\n\n ngOnDestroy(): void {\n this.globalError$.destroy()\n this.globalLoading$.destroy()\n this.currentMfe$.destroy()\n this.currentPage$.destroy()\n this.currentPortal$.destroy()\n this.currentLocation$.destroy()\n this.currentWorkspace$.destroy()\n this.isAuthenticated$.destroy()\n }\n}\n","import { InjectionToken } from '@angular/core'\nimport { IAuthService } from './iauth.service'\n\nexport interface LibConfig {\n appId: string\n portalId: string\n /**\n * If true, the tkit-module will not try to load remote env values from server(GET /assets/env.json)\n */\n skipRemoteConfigLoad: boolean\n /**\n * URL from which the remote config will be loaded, default: '/assets/env.json'\n */\n remoteConfigURL: string\n}\nexport const APP_CONFIG = new InjectionToken<LibConfig>('APP_CONFIG')\n\n/**\n * @deprecated\n * Please do not inject the auth service at all.\n * There are better ways to achieve what you want. Please use permission service or user service.\n */\nexport const AUTH_SERVICE = new InjectionToken<IAuthService>('AUTH_SERVICE')\n\nexport const SANITY_CHECK = new InjectionToken<string>('OCXSANITY_CHECK')\n\nexport const APPLICATION_NAME = new InjectionToken<string>('APPLICATION_NAME')\n","export enum CONFIG_KEY {\n TKIT_PORTAL_DEFAULT_THEME = 'TKIT_PORTAL_DEFAULT_THEME',\n TKIT_PORTAL_DISABLE_THEME_MANAGEMENT = 'TKIT_PORTAL_DISABLE_THEME_MANAGEMENT',\n TKIT_PORTAL_THEME_SERVER_URL = 'TKIT_PORTAL_THEME_SERVER_URL',\n TKIT_TOKEN_ROLE_CLAIM_NAME = 'TKIT_TOKEN_ROLE_CLAIM_NAME',\n TKIT_PORTAL_ID = 'TKIT_PORTAL_ID',\n TKIT_SUPPORTED_LANGUAGES = 'TKIT_SUPPORTED_LANGUAGES',\n TKIT_SEARCH_BASE_URL = 'TKIT_SEARCH_BASE_URL',\n APP_BASE_HREF = 'APP_BASE_HREF',\n KEYCLOAK_REALM = 'KEYCLOAK_REALM',\n KEYCLOAK_ENABLE_SILENT_SSO = 'KEYCLOAK_ENABLE_SILENT_SSO',\n KEYCLOAK_URL = 'KEYCLOAK_URL',\n KEYCLOAK_CLIENT_ID = 'KEYCLOAK_CLIENT_ID',\n ONECX_PORTAL_FAVORITES_DISABLED = 'ONECX_PORTAL_FAVORITES_DISABLED',\n ONECX_PORTAL_FEEDBACK_DISABLED = 'ONECX_PORTAL_FEEDBACK_DISABLED',\n ONECX_PORTAL_SEARCH_DISABLED = 'ONECX_PORTAL_SEARCH_DISABLED',\n ONECX_PORTAL_SUPPORT_TICKET_DISABLED = 'ONECX_PORTAL_SUPPORT_TICKET_DISABLED',\n ONECX_PORTAL_ANNOUNCEMENTS_DISABLED = 'ONECX_PORTAL_ANNOUNCEMENTS_DISABLED',\n ONECX_PORTAL_PASSWORD_CHANGE_DISABLED = 'ONECX_PORTAL_PASSWORD_CHANGE_DISABLED',\n ONECX_PORTAL_SETTINGS_DISABLED = 'ONECX_PORTAL_SETTINGS_DISABLED',\n ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED = 'ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED',\n ONECX_PORTAL_HELP_DISABLED = 'ONECX_PORTAL_HELP_DISABLED',\n ONECX_PORTAL_SEARCH_BUTTONS_REVERSED = 'ONECX_PORTAL_SEARCH_BUTTONS_REVERSED',\n APP_VERSION = 'APP_VERSION',\n IS_SHELL = 'IS_SHELL',\n AUTH_SERVICE = 'AUTH_SERVICE',\n AUTH_SERVICE_CUSTOM_URL = 'AUTH_SERVICE_CUSTOM_URL',\n AUTH_SERVICE_CUSTOM_MODULE_NAME = 'AUTH_SERVICE_CUSTOM_MODULE_NAME',\n}\n","import { HttpClient } from '@angular/common/http'\nimport { Injectable, OnDestroy, inject } from '@angular/core'\nimport { firstValueFrom, map } from 'rxjs'\nimport { Config, ConfigurationTopic } from '@onecx/integration-interface'\nimport { APP_CONFIG } from '../api/injection-tokens'\nimport { CONFIG_KEY } from '../model/config-key.model'\nimport Semaphore from 'ts-semaphore'\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationService implements OnDestroy {\n private http = inject(HttpClient)\n private defaultConfig = inject<{\n [key: string]: string\n }>(APP_CONFIG, { optional: true })\n\n private config$ = new ConfigurationTopic()\n private semaphore = new Semaphore(1)\n\n ngOnDestroy(): void {\n this.config$.destroy()\n }\n\n public init(): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const skipRemoteConfigLoad = this.defaultConfig && this.defaultConfig['skipRemoteConfigLoad']\n let loadConfigPromise: Promise<Config>\n\n const inlinedConfig = (window as typeof window & { APP_CONFIG: Config })['APP_CONFIG']\n if (inlinedConfig) {\n console.log(`ENV resolved from injected config`)\n loadConfigPromise = Promise.resolve(inlinedConfig)\n } else {\n if (skipRemoteConfigLoad) {\n console.log(\n '📢 TKA001: Remote config load is disabled. To enable it, remove the \"skipRemoteConfigLoad\" key in your environment.json'\n )\n loadConfigPromise = Promise.resolve(this.defaultConfig || {})\n } else {\n loadConfigPromise = firstValueFrom(\n this.http.get<Config>((this.defaultConfig && this.defaultConfig['remoteConfigURL']) || 'assets/env.json')\n )\n }\n }\n\n loadConfigPromise\n .then(async (config) => {\n await this.config$.publish({ ...this.defaultConfig, ...(config ?? {}) }).then(() => {\n resolve(true)\n })\n })\n .catch((e) => {\n console.log(`Failed to load env configuration`)\n reject(e)\n })\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.config$.isInitialized\n }\n\n public async getProperty(key: CONFIG_KEY): Promise<string | undefined> {\n if (!Object.values(CONFIG_KEY).includes(key)) {\n console.error('Invalid config key ', key)\n }\n return firstValueFrom(this.config$.pipe(map((config) => config[key])))\n }\n\n public async setProperty(key: string, val: string) {\n return this.semaphore.use(async () => {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n })\n }\n\n public async getConfig(): Promise<Config | undefined> {\n return firstValueFrom(this.config$.asObservable())\n }\n}\n","export const API_PREFIX = 'portal-api'\n\nexport const DEFAULT_LANG = 'en'\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { BehaviorSubject, map, filter, firstValueFrom, skip, Observable, merge } from 'rxjs'\nimport { PermissionsTopic, UserProfile, UserProfileTopic } from '@onecx/integration-interface'\nimport { DEFAULT_LANG } from '../api/constants'\n\n@Injectable({ providedIn: 'root' })\nexport class UserService implements OnDestroy {\n profile$ = new UserProfileTopic()\n permissions$ = new BehaviorSubject<string[]>([])\n lang$ = new BehaviorSubject(this.determineLanguage() ?? DEFAULT_LANG)\n\n private effectivePermissions$: Observable<string[]>\n private permissionsTopic$ = new PermissionsTopic()\n private oldStylePermissionsInitialized: Promise<string[]>\n\n constructor() {\n this.profile$\n .pipe(\n map(\n (profile) =>\n profile.accountSettings?.localeAndTimeSettings?.locale ?? this.determineLanguage() ?? DEFAULT_LANG\n )\n )\n .subscribe(this.lang$)\n\n this.oldStylePermissionsInitialized = firstValueFrom(this.permissions$.pipe(skip(1)))\n this.effectivePermissions$ = merge(this.permissions$.pipe(skip(1)), this.permissionsTopic$.asObservable())\n this.profile$\n .pipe(\n map((profile) => this.extractPermissions(profile)),\n filter((permissions): permissions is string[] => !!permissions)\n )\n .subscribe(this.permissions$)\n }\n\n ngOnDestroy(): void {\n this.profile$.destroy()\n }\n\n getPermissions() {\n return this.effectivePermissions$\n }\n\n hasPermission(permissionKey: string | string[]): boolean {\n if (Array.isArray(permissionKey)) {\n return permissionKey.every((key) => this.hasPermission(key))\n }\n const oldConceptResult = this.permissions$.getValue()\n ? this.permissions$.getValue()?.includes(permissionKey)\n : false\n const result = this.permissionsTopic$.getValue()\n ? this.permissionsTopic$.getValue()?.includes(permissionKey)\n : oldConceptResult\n\n if (!result) {\n console.log(`👮♀️ No permission for: ${permissionKey}`)\n }\n return !!result\n }\n\n private determineLanguage(): string | undefined {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined\n }\n\n let browserLang: any = window.navigator.languages ? window.navigator.languages[0] : null\n browserLang = browserLang || window.navigator.language\n\n if (typeof browserLang === 'undefined') {\n return undefined\n }\n\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0]\n }\n\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0]\n }\n\n return browserLang\n }\n\n private extractPermissions(userProfile: UserProfile) {\n if (userProfile) {\n if (userProfile.memberships) {\n const permissions: string[] = []\n userProfile.memberships.forEach((m) => {\n m.roleMemberships?.forEach((r) => {\n r.permissions?.forEach((p) => {\n if (p) {\n if (p.key !== undefined) {\n permissions.push(p.key)\n }\n }\n })\n })\n })\n return permissions\n }\n }\n return null\n }\n\n get isInitialized(): Promise<void> {\n return Promise.all([\n Promise.race([this.permissionsTopic$.isInitialized, this.oldStylePermissionsInitialized]),\n this.profile$.isInitialized,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n ]).then(() => {})\n }\n}\n","import { Injectable, OnDestroy, inject } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { MessageTopic } from '@onecx/integration-interface'\nimport { combineLatest, first, of } from 'rxjs'\n\nexport type Message = {\n summaryKey?: string\n summaryParameters?: object\n detailKey?: string\n detailParameters?: object\n id?: any\n key?: string\n life?: number\n sticky?: boolean\n closable?: boolean\n data?: any\n icon?: string\n contentStyleClass?: string\n styleClass?: string\n}\n\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageService implements OnDestroy {\n private translateService = inject(TranslateService)\n\n message$ = new MessageTopic()\n\n success(msg: Message) {\n this.addTranslated('success', msg)\n }\n\n info(msg: Message) {\n this.addTranslated('info', msg)\n }\n\n error(msg: Message) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: Message) {\n this.addTranslated('warning', msg)\n }\n\n private addTranslated(severity: string, msg: Message) {\n combineLatest([\n msg.summaryKey ? this.translateService.get(msg.summaryKey || '', msg.summaryParameters) : of(undefined),\n msg.detailKey ? this.translateService.get(msg.detailKey, msg.detailParameters) : of(undefined),\n ])\n .pipe(first())\n .subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\n }\n\n ngOnDestroy(): void {\n this.message$.destroy()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { CurrentThemeTopic } from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService implements OnDestroy {\n currentTheme$ = new CurrentThemeTopic()\n ngOnDestroy(): void {\n this.currentTheme$.destroy()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { RemoteComponentsTopic } from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsService implements OnDestroy {\n remoteComponents$ = new RemoteComponentsTopic()\n\n ngOnDestroy(): void {\n this.remoteComponents$.destroy()\n }\n}\n","import { Injectable, inject } from '@angular/core'\nimport { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'\nimport { TranslateService } from '@ngx-translate/core'\nimport { Observable, filter, from, isObservable, map, mergeMap, of, tap, zip } from 'rxjs'\nimport { AppStateService } from './app-state.service'\nimport { ConfigurationService } from './configuration.service'\nimport { UserService } from './user.service'\n\n@Injectable({ providedIn: 'any' })\nexport class InitializeModuleGuard implements CanActivate {\n protected translateService = inject(TranslateService)\n protected configService = inject(ConfigurationService)\n protected appStateService = inject(AppStateService)\n protected userService = inject(UserService)\n\n private SUPPORTED_LANGS = ['en', 'de']\n private DEFAULT_LANG = 'en'\n\n canActivate(\n _route: ActivatedRouteSnapshot,\n _state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n console.time('InitializeModuleGuard')\n return zip([\n this.loadTranslations(),\n from(this.configService.isInitialized),\n from(this.userService.isInitialized),\n from(this.appStateService.currentWorkspace$.isInitialized),\n ]).pipe(\n tap(() => {\n console.timeEnd('InitializeModuleGuard')\n }),\n map(() => true)\n )\n }\n\n getBestMatchLanguage(lang: string) {\n if (this.SUPPORTED_LANGS.includes(lang)) {\n return lang\n } else {\n console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`)\n }\n return this.DEFAULT_LANG\n }\n\n loadTranslations(): Observable<boolean> {\n return this.userService.lang$.pipe(\n filter((v) => v !== undefined),\n mergeMap((lang) => {\n const bestMatchLang = this.getBestMatchLanguage(lang as string)\n return this.translateService.use(bestMatchLang)\n }),\n mergeMap(() => of(true))\n )\n }\n\n protected toObservable(\n canActivateResult: Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree\n ): Observable<boolean | UrlTree> {\n if (isObservable(canActivateResult)) {\n return canActivateResult\n }\n return from(Promise.resolve(canActivateResult))\n }\n}\n","import { Location } from '@angular/common'\nimport { Injectable, inject } from '@angular/core'\nimport { Endpoint, Route } from '@onecx/integration-interface'\nimport { Observable, map } from 'rxjs'\nimport { AppStateService } from './app-state.service'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WorkspaceService {\n protected appStateService = inject(AppStateService)\n\n private aliasStart = '[['\n private aliasEnd = ']]'\n private paramStart = '{'\n private paramEnd = '}'\n\n getUrl(\n productName: string,\n appId: string,\n endpointName?: string,\n endpointParameters?: Record<string, unknown>\n ): Observable<string> {\n return this.appStateService.currentWorkspace$.pipe(\n map((workspace) => {\n const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, endpointParameters)\n return finalUrl\n })\n )\n }\n\n doesUrlExistFor(productName: string, appId: string, endpointName?: string): Observable<boolean> {\n return this.appStateService.currentWorkspace$.pipe(\n map((workspace) => {\n const checkEndpoint = endpointName !== undefined && endpointName.length > 0\n\n if (workspace.routes == undefined) {\n return false\n }\n const route = this.filterRouteFromList(workspace.routes, appId, productName)\n\n if (checkEndpoint) {\n if (!route || route.endpoints === undefined || route.endpoints.length == 0) {\n return false\n }\n\n const endpoint = route.endpoints.find((ep) => ep.name === endpointName)\n return !!(endpoint && endpoint.path && endpoint.path.length > 0)\n } else {\n return !!(route && route.baseUrl && route.baseUrl.length > 0)\n }\n })\n )\n }\n\n private constructBaseUrlFromWorkspace(workspace: any): string {\n if (workspace.baseUrl === undefined) {\n console.log('WARNING: There was no baseUrl for received workspace.')\n return ''\n }\n return workspace.baseUrl\n }\n\n private constructRouteUrl(\n workspace: any,\n appId: string,\n productName: string,\n endpointName?: string,\n endpointParameters?: Record<string, unknown>\n ): string {\n const route = this.filterRouteFromList(workspace.routes, appId, productName)\n let url = this.constructBaseUrlFromWorkspace(workspace)\n if (!route) {\n console.log(\n `WARNING: No route.baseUrl could be found for given appId \"${appId}\" and productName \"${productName}\"`\n )\n\n return url\n }\n\n if (route.baseUrl !== undefined && route.baseUrl.length > 0) {\n url = route.baseUrl\n }\n if (endpointName == undefined) {\n return url\n }\n\n url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, endpointParameters))\n return url\n }\n\n private constructEndpointUrl(\n route: any,\n endpointName: string,\n endpointParameters: Record<string, unknown> = {}\n ): string {\n if (!route.endpoints) {\n return ''\n }\n const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints)\n if (!finalEndpoint || finalEndpoint.path === undefined) {\n console.log('WARNING: No endpoint or endpoint.path could be found')\n return ''\n }\n\n const paramsFilled = this.fillParamsForPath(finalEndpoint.path, endpointParameters)\n if (paramsFilled === undefined) {\n console.log('WARNING: Params could not be filled correctly')\n return ''\n }\n\n return paramsFilled\n }\n\n private filterRouteFromList(routes: Array<Route>, appId: string, productName: string): Route | undefined {\n if (!routes) {\n return undefined\n }\n\n const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName)\n\n if (productRoutes.length === 0) {\n return undefined\n }\n\n if (productRoutes.length > 1) {\n console.log('WARNING: There were more than one route. First route has been used.')\n }\n\n return productRoutes[0]\n }\n\n private dissolveEndpoint(endpointName: string, endpoints: Array<Endpoint>): Endpoint | undefined {\n let endpoint = endpoints.find((ep) => ep.name === endpointName)\n\n if (!endpoint) {\n return undefined\n }\n\n while (endpoint.path?.includes(this.aliasStart)) {\n const path: string = endpoint.path\n const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length\n const endIdx = path.lastIndexOf(this.aliasEnd)\n if (endIdx <= startIdx) {\n return undefined\n }\n const aliasName = path.substring(startIdx, endIdx)\n endpoint = endpoints.find((ep) => ep.name === aliasName)\n\n if (!endpoint) {\n return undefined\n }\n }\n\n return endpoint\n }\n\n private fillParamsForPath(path: string, endpointParameters: Record<string, unknown>): string {\n while (path.includes(this.paramStart)) {\n const paramName = path.substring(\n path.indexOf(this.paramStart) + this.paramStart.length,\n path.indexOf(this.paramEnd)\n )\n const paramValue = this.getStringFromUnknown(endpointParameters[paramName])\n if (paramValue != undefined && paramValue.length > 0) {\n path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue)\n } else {\n console.log(`WARNING: Searched param \"${paramName}\" was not found in given param list `)\n return ''\n }\n }\n return path\n }\n\n private getStringFromUnknown(value: unknown): string {\n if (value === null || value === undefined) {\n return ''\n } else if (typeof value === 'string') {\n return value\n } else {\n return String(value)\n }\n }\n}\n","import { Injectable } from '@angular/core'\n\ndeclare global {\n interface Window {\n 'onecx-shell-capabilities': Capability[]\n }\n}\n\nexport enum Capability {\n CURRENT_LOCATION_TOPIC = 'currentLocationTopic',\n PARAMETERS_TOPIC = 'parametersTopic',\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShellCapabilityService {\n static setCapabilities(capabilities: Capability[]): void {\n window['onecx-shell-capabilities'] = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return window['onecx-shell-capabilities']?.includes(capability) ?? false\n }\n}\n","import { CanActivateFn, Route } from '@angular/router'\nimport { InitializeModuleGuard } from '../services/initialize-module-guard.service'\n\nexport function addInitializeModuleGuard(\n routes: Route[],\n initializeModuleGuard: typeof InitializeModuleGuard | CanActivateFn = InitializeModuleGuard\n): Route[] {\n return routes.map((r) => {\n if (r.redirectTo) {\n return r\n }\n const route = {\n canActivate: [],\n ...r,\n }\n if (!route.canActivate.includes(initializeModuleGuard)) {\n route.canActivate.push(initializeModuleGuard)\n }\n return route\n })\n}","// services\nexport * from './lib/services/app-config-service'\nexport * from './lib/services/app-state.service'\nexport * from './lib/services/configuration.service'\nexport * from './lib/services/user.service'\nexport * from './lib/services/portal-message.service'\nexport * from './lib/services/theme.service'\nexport * from './lib/services/remote-components.service'\nexport * from './lib/services/initialize-module-guard.service'\nexport * from './lib/services/workspace.service'\nexport * from './lib/services/shell-capability.service'\n\n// models\nexport * from './lib/model/config-key.model'\n\n// core\nexport * from './lib/api/iauth.service'\nexport * from './lib/api/injection-tokens'\n\n// utils\nexport * from './lib/utils/add-initialize-module-guard.utils'\n\nexport { MfeInfo, Theme } from '@onecx/integration-interface'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAOa,gBAAgB,CAAA;AAD7B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAEjC,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAA4B,EAAE,CAAC;AAiC7D;AA/BQ,IAAA,IAAI,CAAC,OAAe,EAAA;QACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;YACrC,MAAM,iBAAiB,GAAoB,cAAc,CACvD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAS,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAC1E;YAED;AACG,iBAAA,IAAI,CAAC,OAAO,MAAM,KAAI;gBACrB,IAAI,MAAM,EAAE;AACV,oBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;AACzB,oBAAA,OAAO,EAAE;;AAEb,aAAC;AACA,iBAAA,KAAK,CAAC,CAAC,CAAC,KAAI;AACX,gBAAA,OAAO,CAAC,GAAG,CAAC,CAAA,gCAAA,CAAkC,CAAC;gBAC/C,MAAM,CAAC,CAAC,CAAC;AACX,aAAC,CAAC;AACN,SAAC,CAAC;;AAGG,IAAA,WAAW,CAAC,GAAW,EAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC;;IAGhC,WAA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CAAC,CAAC,CAAC,KAAI;AACtB,QAAA,IAAI,CAAC,CAAC,UAAU,EAAE;AAChB,YAAA,OAAO,CAAC;;AAEV,QAAA,MAAM,KAAK,GAAG;AACZ,YAAA,WAAW,EAAE,EAAE;AACf,YAAA,GAAG,CAAC;SACL;QACD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;AACtD,YAAA,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC;;AAE/C,QAAA,OAAO,KAAK;AACd,KAAC,CAAC;AACJ;;ACpBA;;ACAA;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"onecx-angular-integration-interface.mjs","sources":["../../../../libs/angular-integration-interface/src/lib/services/app-config-service.ts","../../../../libs/angular-integration-interface/src/lib/services/app-state.service.ts","../../../../libs/angular-integration-interface/src/lib/api/injection-tokens.ts","../../../../libs/angular-integration-interface/src/lib/model/config-key.model.ts","../../../../libs/angular-integration-interface/src/lib/services/configuration.service.ts","../../../../libs/angular-integration-interface/src/lib/api/constants.ts","../../../../libs/angular-integration-interface/src/lib/services/user.service.ts","../../../../libs/angular-integration-interface/src/lib/services/portal-message.service.ts","../../../../libs/angular-integration-interface/src/lib/services/theme.service.ts","../../../../libs/angular-integration-interface/src/lib/services/remote-components.service.ts","../../../../libs/angular-integration-interface/src/lib/services/workspace.service.ts","../../../../libs/angular-integration-interface/src/lib/services/shell-capability.service.ts","../../../../libs/angular-integration-interface/src/index.ts","../../../../libs/angular-integration-interface/src/onecx-angular-integration-interface.ts"],"sourcesContent":["import { Location } from '@angular/common'\nimport { HttpClient } from '@angular/common/http'\nimport { Injectable, inject } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { BehaviorSubject, firstValueFrom } from 'rxjs'\n\n@Injectable()\nexport class AppConfigService {\n private http = inject(HttpClient)\n\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const loadConfigPromise: Promise<Config> = firstValueFrom(\n this.http.get<Config>(Location.joinWithSlash(baseUrl, 'assets/env.json'))\n )\n\n loadConfigPromise\n .then(async (config) => {\n if (config) {\n this.config$.next(config)\n resolve()\n }\n })\n .catch((e) => {\n console.log(`Failed to load env configuration`)\n reject(e)\n })\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport {\n GlobalErrorTopic,\n GlobalLoadingTopic,\n CurrentMfeTopic,\n CurrentPageTopic,\n CurrentWorkspaceTopic,\n IsAuthenticatedTopic,\n CurrentLocationTopic,\n} from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class AppStateService implements OnDestroy {\n globalError$ = new GlobalErrorTopic()\n globalLoading$ = new GlobalLoadingTopic()\n currentMfe$ = new CurrentMfeTopic()\n currentLocation$ = new CurrentLocationTopic()\n\n /**\n * This topic will only fire when pageInfo.path matches document.location.pathname,\n * if not it will fire undefined.\n */\n currentPage$ = new CurrentPageTopic()\n currentWorkspace$ = new CurrentWorkspaceTopic()\n\n /**\n * This Topic is initialized as soon as the authentication is done\n */\n isAuthenticated$ = new IsAuthenticatedTopic()\n\n ngOnDestroy(): void {\n this.globalError$.destroy()\n this.globalLoading$.destroy()\n this.currentMfe$.destroy()\n this.currentPage$.destroy()\n this.currentLocation$.destroy()\n this.currentWorkspace$.destroy()\n this.isAuthenticated$.destroy()\n }\n}\n","import { InjectionToken } from '@angular/core'\n\nexport interface LibConfig {\n appId: string\n portalId: string\n /**\n * If true, the tkit-module will not try to load remote env values from server(GET /assets/env.json)\n */\n skipRemoteConfigLoad: boolean\n /**\n * URL from which the remote config will be loaded, default: '/assets/env.json'\n */\n remoteConfigURL: string\n}\nexport const APP_CONFIG = new InjectionToken<LibConfig>('APP_CONFIG')\n\nexport const SANITY_CHECK = new InjectionToken<string>('OCXSANITY_CHECK')\n\nexport const APPLICATION_NAME = new InjectionToken<string>('APPLICATION_NAME')\n","export enum CONFIG_KEY {\n TKIT_PORTAL_DEFAULT_THEME = 'TKIT_PORTAL_DEFAULT_THEME',\n TKIT_PORTAL_DISABLE_THEME_MANAGEMENT = 'TKIT_PORTAL_DISABLE_THEME_MANAGEMENT',\n TKIT_PORTAL_THEME_SERVER_URL = 'TKIT_PORTAL_THEME_SERVER_URL',\n TKIT_TOKEN_ROLE_CLAIM_NAME = 'TKIT_TOKEN_ROLE_CLAIM_NAME',\n TKIT_PORTAL_ID = 'TKIT_PORTAL_ID',\n TKIT_SUPPORTED_LANGUAGES = 'TKIT_SUPPORTED_LANGUAGES',\n TKIT_SEARCH_BASE_URL = 'TKIT_SEARCH_BASE_URL',\n APP_BASE_HREF = 'APP_BASE_HREF',\n KEYCLOAK_REALM = 'KEYCLOAK_REALM',\n KEYCLOAK_ENABLE_SILENT_SSO = 'KEYCLOAK_ENABLE_SILENT_SSO',\n KEYCLOAK_URL = 'KEYCLOAK_URL',\n KEYCLOAK_CLIENT_ID = 'KEYCLOAK_CLIENT_ID',\n ONECX_PORTAL_FAVORITES_DISABLED = 'ONECX_PORTAL_FAVORITES_DISABLED',\n ONECX_PORTAL_FEEDBACK_DISABLED = 'ONECX_PORTAL_FEEDBACK_DISABLED',\n ONECX_PORTAL_SEARCH_DISABLED = 'ONECX_PORTAL_SEARCH_DISABLED',\n ONECX_PORTAL_SUPPORT_TICKET_DISABLED = 'ONECX_PORTAL_SUPPORT_TICKET_DISABLED',\n ONECX_PORTAL_ANNOUNCEMENTS_DISABLED = 'ONECX_PORTAL_ANNOUNCEMENTS_DISABLED',\n ONECX_PORTAL_PASSWORD_CHANGE_DISABLED = 'ONECX_PORTAL_PASSWORD_CHANGE_DISABLED',\n ONECX_PORTAL_SETTINGS_DISABLED = 'ONECX_PORTAL_SETTINGS_DISABLED',\n ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED = 'ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED',\n ONECX_PORTAL_HELP_DISABLED = 'ONECX_PORTAL_HELP_DISABLED',\n ONECX_PORTAL_SEARCH_BUTTONS_REVERSED = 'ONECX_PORTAL_SEARCH_BUTTONS_REVERSED',\n APP_VERSION = 'APP_VERSION',\n IS_SHELL = 'IS_SHELL',\n AUTH_SERVICE = 'AUTH_SERVICE',\n AUTH_SERVICE_CUSTOM_URL = 'AUTH_SERVICE_CUSTOM_URL',\n AUTH_SERVICE_CUSTOM_MODULE_NAME = 'AUTH_SERVICE_CUSTOM_MODULE_NAME',\n POLYFILL_SCOPE_MODE = 'POLYFILL_SCOPE_MODE'\n}\n\nexport enum POLYFILL_SCOPE_MODE {\n PERFORMANCE = 'PERFORMANCE',\n PRECISION = 'PRECISION',\n}","import { HttpClient } from '@angular/common/http'\nimport { Injectable, OnDestroy, inject } from '@angular/core'\nimport { firstValueFrom, map } from 'rxjs'\nimport { Config, ConfigurationTopic } from '@onecx/integration-interface'\nimport { APP_CONFIG } from '../api/injection-tokens'\nimport { CONFIG_KEY } from '../model/config-key.model'\nimport Semaphore from 'ts-semaphore'\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationService implements OnDestroy {\n private http = inject(HttpClient)\n private defaultConfig = inject<{\n [key: string]: string\n }>(APP_CONFIG, { optional: true })\n\n private config$ = new ConfigurationTopic()\n private semaphore = new Semaphore(1)\n\n ngOnDestroy(): void {\n this.config$.destroy()\n }\n\n public init(): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const skipRemoteConfigLoad = this.defaultConfig && this.defaultConfig['skipRemoteConfigLoad']\n let loadConfigPromise: Promise<Config>\n\n const inlinedConfig = (window as typeof window & { APP_CONFIG: Config })['APP_CONFIG']\n if (inlinedConfig) {\n console.log(`ENV resolved from injected config`)\n loadConfigPromise = Promise.resolve(inlinedConfig)\n } else {\n if (skipRemoteConfigLoad) {\n console.log(\n '📢 TKA001: Remote config load is disabled. To enable it, remove the \"skipRemoteConfigLoad\" key in your environment.json'\n )\n loadConfigPromise = Promise.resolve(this.defaultConfig || {})\n } else {\n loadConfigPromise = firstValueFrom(\n this.http.get<Config>((this.defaultConfig && this.defaultConfig['remoteConfigURL']) || 'assets/env.json')\n )\n }\n }\n\n loadConfigPromise\n .then(async (config) => {\n await this.config$.publish({ ...this.defaultConfig, ...(config ?? {}) }).then(() => {\n resolve(true)\n })\n })\n .catch((e) => {\n console.log(`Failed to load env configuration`)\n reject(e)\n })\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.config$.isInitialized\n }\n\n public async getProperty(key: CONFIG_KEY): Promise<string | undefined> {\n if (!Object.values(CONFIG_KEY).includes(key)) {\n console.error('Invalid config key ', key)\n }\n return firstValueFrom(this.config$.pipe(map((config) => config[key])))\n }\n\n public async setProperty(key: string, val: string) {\n return this.semaphore.use(async () => {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n })\n }\n\n public async getConfig(): Promise<Config | undefined> {\n return firstValueFrom(this.config$.asObservable())\n }\n}\n","export const API_PREFIX = 'portal-api'\n\nexport const DEFAULT_LANG = 'en'\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { PermissionsTopic, UserProfileTopic } from '@onecx/integration-interface'\nimport { BehaviorSubject, firstValueFrom, map } from 'rxjs'\nimport { DEFAULT_LANG } from '../api/constants'\n\n@Injectable({ providedIn: 'root' })\nexport class UserService implements OnDestroy {\n profile$ = new UserProfileTopic()\n lang$ = new BehaviorSubject(this.determineLanguage() ?? DEFAULT_LANG)\n\n private permissionsTopic$ = new PermissionsTopic()\n\n constructor() {\n this.profile$\n .pipe(\n map(\n (profile) =>\n profile.accountSettings?.localeAndTimeSettings?.locale ?? this.determineLanguage() ?? DEFAULT_LANG\n )\n )\n .subscribe(this.lang$)\n }\n\n ngOnDestroy(): void {\n this.profile$.destroy()\n }\n\n getPermissions() {\n return this.permissionsTopic$.asObservable()\n }\n\n async hasPermission(permissionKey: string | string[] | undefined): Promise<boolean> {\n if (!permissionKey) return true\n\n if (Array.isArray(permissionKey)) {\n const permissions = await Promise.all(permissionKey.map((key) => this.hasPermission(key)))\n return permissions.every((hasPermission) => hasPermission)\n }\n\n return firstValueFrom(\n this.permissionsTopic$.pipe(\n map((permissions) => {\n const result = permissions.includes(permissionKey)\n if (!result) {\n console.log(`👮♀️ No permission for: ${permissionKey}`)\n }\n return !!result\n })\n )\n )\n }\n\n private determineLanguage(): string | undefined {\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\n return undefined\n }\n\n let browserLang: any = window.navigator.languages ? window.navigator.languages[0] : null\n browserLang = browserLang || window.navigator.language\n\n if (typeof browserLang === 'undefined') {\n return undefined\n }\n\n if (browserLang.indexOf('-') !== -1) {\n browserLang = browserLang.split('-')[0]\n }\n\n if (browserLang.indexOf('_') !== -1) {\n browserLang = browserLang.split('_')[0]\n }\n\n return browserLang\n }\n\n get isInitialized(): Promise<void> {\n return Promise.all([\n this.permissionsTopic$.isInitialized,\n this.profile$.isInitialized,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n ]).then(() => {})\n }\n}\n","import { Injectable, OnDestroy, inject } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { MessageTopic } from '@onecx/integration-interface'\nimport { combineLatest, first, of } from 'rxjs'\n\nexport type Message = {\n summaryKey?: string\n summaryParameters?: object\n detailKey?: string\n detailParameters?: object\n id?: any\n key?: string\n life?: number\n sticky?: boolean\n closable?: boolean\n data?: any\n icon?: string\n contentStyleClass?: string\n styleClass?: string\n}\n\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageService implements OnDestroy {\n private translateService = inject(TranslateService)\n\n message$ = new MessageTopic()\n\n success(msg: Message) {\n this.addTranslated('success', msg)\n }\n\n info(msg: Message) {\n this.addTranslated('info', msg)\n }\n\n error(msg: Message) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: Message) {\n this.addTranslated('warning', msg)\n }\n\n private addTranslated(severity: string, msg: Message) {\n combineLatest([\n msg.summaryKey ? this.translateService.get(msg.summaryKey || '', msg.summaryParameters) : of(undefined),\n msg.detailKey ? this.translateService.get(msg.detailKey, msg.detailParameters) : of(undefined),\n ])\n .pipe(first())\n .subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\n }\n\n ngOnDestroy(): void {\n this.message$.destroy()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { CurrentThemeTopic } from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService implements OnDestroy {\n currentTheme$ = new CurrentThemeTopic()\n ngOnDestroy(): void {\n this.currentTheme$.destroy()\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core'\nimport { RemoteComponentsTopic } from '@onecx/integration-interface'\n\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsService implements OnDestroy {\n remoteComponents$ = new RemoteComponentsTopic()\n\n ngOnDestroy(): void {\n this.remoteComponents$.destroy()\n }\n}\n","import { Location } from '@angular/common'\nimport { Injectable, inject } from '@angular/core'\nimport { Endpoint, Route } from '@onecx/integration-interface'\nimport { Observable, map } from 'rxjs'\nimport { AppStateService } from './app-state.service'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WorkspaceService {\n protected appStateService = inject(AppStateService)\n\n private aliasStart = '[['\n private aliasEnd = ']]'\n private paramStart = '{'\n private paramEnd = '}'\n\n getUrl(\n productName: string,\n appId: string,\n endpointName?: string,\n endpointParameters?: Record<string, unknown>\n ): Observable<string> {\n return this.appStateService.currentWorkspace$.pipe(\n map((workspace) => {\n const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, endpointParameters)\n return finalUrl\n })\n )\n }\n\n doesUrlExistFor(productName: string, appId: string, endpointName?: string): Observable<boolean> {\n return this.appStateService.currentWorkspace$.pipe(\n map((workspace) => {\n const checkEndpoint = endpointName !== undefined && endpointName.length > 0\n\n if (workspace.routes == undefined) {\n return false\n }\n const route = this.filterRouteFromList(workspace.routes, appId, productName)\n\n if (checkEndpoint) {\n if (!route || route.endpoints === undefined || route.endpoints.length == 0) {\n return false\n }\n\n const endpoint = route.endpoints.find((ep) => ep.name === endpointName)\n return !!(endpoint && endpoint.path && endpoint.path.length > 0)\n } else {\n return !!(route && route.baseUrl && route.baseUrl.length > 0)\n }\n })\n )\n }\n\n private constructBaseUrlFromWorkspace(workspace: any): string {\n if (workspace.baseUrl === undefined) {\n console.log('WARNING: There was no baseUrl for received workspace.')\n return ''\n }\n return workspace.baseUrl\n }\n\n private constructRouteUrl(\n workspace: any,\n appId: string,\n productName: string,\n endpointName?: string,\n endpointParameters?: Record<string, unknown>\n ): string {\n const route = this.filterRouteFromList(workspace.routes, appId, productName)\n let url = this.constructBaseUrlFromWorkspace(workspace)\n if (!route) {\n console.log(\n `WARNING: No route.baseUrl could be found for given appId \"${appId}\" and productName \"${productName}\"`\n )\n\n return url\n }\n\n if (route.baseUrl !== undefined && route.baseUrl.length > 0) {\n url = route.baseUrl\n }\n if (endpointName == undefined) {\n return url\n }\n\n url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, endpointParameters))\n return url\n }\n\n private constructEndpointUrl(\n route: any,\n endpointName: string,\n endpointParameters: Record<string, unknown> = {}\n ): string {\n if (!route.endpoints) {\n return ''\n }\n const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints)\n if (!finalEndpoint || finalEndpoint.path === undefined) {\n console.log('WARNING: No endpoint or endpoint.path could be found')\n return ''\n }\n\n const paramsFilled = this.fillParamsForPath(finalEndpoint.path, endpointParameters)\n if (paramsFilled === undefined) {\n console.log('WARNING: Params could not be filled correctly')\n return ''\n }\n\n return paramsFilled\n }\n\n private filterRouteFromList(routes: Array<Route>, appId: string, productName: string): Route | undefined {\n if (!routes) {\n return undefined\n }\n\n const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName)\n\n if (productRoutes.length === 0) {\n return undefined\n }\n\n if (productRoutes.length > 1) {\n console.log('WARNING: There were more than one route. First route has been used.')\n }\n\n return productRoutes[0]\n }\n\n private dissolveEndpoint(endpointName: string, endpoints: Array<Endpoint>): Endpoint | undefined {\n let endpoint = endpoints.find((ep) => ep.name === endpointName)\n\n if (!endpoint) {\n return undefined\n }\n\n while (endpoint.path?.includes(this.aliasStart)) {\n const path: string = endpoint.path\n const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length\n const endIdx = path.lastIndexOf(this.aliasEnd)\n if (endIdx <= startIdx) {\n return undefined\n }\n const aliasName = path.substring(startIdx, endIdx)\n endpoint = endpoints.find((ep) => ep.name === aliasName)\n\n if (!endpoint) {\n return undefined\n }\n }\n\n return endpoint\n }\n\n private fillParamsForPath(path: string, endpointParameters: Record<string, unknown>): string {\n while (path.includes(this.paramStart)) {\n const paramName = path.substring(\n path.indexOf(this.paramStart) + this.paramStart.length,\n path.indexOf(this.paramEnd)\n )\n const paramValue = this.getStringFromUnknown(endpointParameters[paramName])\n if (paramValue != undefined && paramValue.length > 0) {\n path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue)\n } else {\n console.log(`WARNING: Searched param \"${paramName}\" was not found in given param list `)\n return ''\n }\n }\n return path\n }\n\n private getStringFromUnknown(value: unknown): string {\n if (value === null || value === undefined) {\n return ''\n } else if (typeof value === 'string') {\n return value\n } else {\n return String(value)\n }\n }\n}\n","import { Injectable } from '@angular/core'\n\ndeclare global {\n interface Window {\n 'onecx-shell-capabilities': Capability[]\n }\n}\n\nexport enum Capability {\n CURRENT_LOCATION_TOPIC = 'currentLocationTopic',\n PARAMETERS_TOPIC = 'parametersTopic',\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShellCapabilityService {\n static setCapabilities(capabilities: Capability[]): void {\n window['onecx-shell-capabilities'] = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return window['onecx-shell-capabilities']?.includes(capability) ?? false\n }\n}\n","// services\nexport * from './lib/services/app-config-service'\nexport * from './lib/services/app-state.service'\nexport * from './lib/services/configuration.service'\nexport * from './lib/services/user.service'\nexport * from './lib/services/portal-message.service'\nexport * from './lib/services/theme.service'\nexport * from './lib/services/remote-components.service'\nexport * from './lib/services/workspace.service'\nexport * from './lib/services/shell-capability.service'\n\n// models\nexport * from './lib/model/config-key.model'\n\n// core\nexport * from './lib/api/injection-tokens'\n\n// utils\n\nexport { MfeInfo, Theme } from '@onecx/integration-interface'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAOa,gBAAgB,CAAA;AAD7B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAEjC,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAA4B,EAAE,CAAC;AAiC7D;AA/BQ,IAAA,IAAI,CAAC,OAAe,EAAA;QACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;YACrC,MAAM,iBAAiB,GAAoB,cAAc,CACvD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAS,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAC1E;YAED;AACG,iBAAA,IAAI,CAAC,OAAO,MAAM,KAAI;gBACrB,IAAI,MAAM,EAAE;AACV,oBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;AACzB,oBAAA,OAAO,EAAE;;AAEb,aAAC;AACA,iBAAA,KAAK,CAAC,CAAC,CAAC,KAAI;AACX,gBAAA,OAAO,CAAC,GAAG,CAAC,CAAA,gCAAA,CAAkC,CAAC;gBAC/C,MAAM,CAAC,CAAC,CAAC;AACX,aAAC,CAAC;AACN,SAAC,CAAC;;AAGG,IAAA,WAAW,CAAC,GAAW,EAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,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AAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;4FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACblC;;ACAA;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
@@ -5,11 +5,8 @@ export * from './lib/services/user.service';
|
|
5
5
|
export * from './lib/services/portal-message.service';
|
6
6
|
export * from './lib/services/theme.service';
|
7
7
|
export * from './lib/services/remote-components.service';
|
8
|
-
export * from './lib/services/initialize-module-guard.service';
|
9
8
|
export * from './lib/services/workspace.service';
|
10
9
|
export * from './lib/services/shell-capability.service';
|
11
10
|
export * from './lib/model/config-key.model';
|
12
|
-
export * from './lib/api/iauth.service';
|
13
11
|
export * from './lib/api/injection-tokens';
|
14
|
-
export * from './lib/utils/add-initialize-module-guard.utils';
|
15
12
|
export { MfeInfo, Theme } from '@onecx/integration-interface';
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
2
|
-
import { IAuthService } from './iauth.service';
|
3
2
|
export interface LibConfig {
|
4
3
|
appId: string;
|
5
4
|
portalId: string;
|
@@ -13,11 +12,5 @@ export interface LibConfig {
|
|
13
12
|
remoteConfigURL: string;
|
14
13
|
}
|
15
14
|
export declare const APP_CONFIG: InjectionToken<LibConfig>;
|
16
|
-
/**
|
17
|
-
* @deprecated
|
18
|
-
* Please do not inject the auth service at all.
|
19
|
-
* There are better ways to achieve what you want. Please use permission service or user service.
|
20
|
-
*/
|
21
|
-
export declare const AUTH_SERVICE: InjectionToken<IAuthService>;
|
22
15
|
export declare const SANITY_CHECK: InjectionToken<string>;
|
23
16
|
export declare const APPLICATION_NAME: InjectionToken<string>;
|
@@ -25,5 +25,10 @@ export declare enum CONFIG_KEY {
|
|
25
25
|
IS_SHELL = "IS_SHELL",
|
26
26
|
AUTH_SERVICE = "AUTH_SERVICE",
|
27
27
|
AUTH_SERVICE_CUSTOM_URL = "AUTH_SERVICE_CUSTOM_URL",
|
28
|
-
AUTH_SERVICE_CUSTOM_MODULE_NAME = "AUTH_SERVICE_CUSTOM_MODULE_NAME"
|
28
|
+
AUTH_SERVICE_CUSTOM_MODULE_NAME = "AUTH_SERVICE_CUSTOM_MODULE_NAME",
|
29
|
+
POLYFILL_SCOPE_MODE = "POLYFILL_SCOPE_MODE"
|
30
|
+
}
|
31
|
+
export declare enum POLYFILL_SCOPE_MODE {
|
32
|
+
PERFORMANCE = "PERFORMANCE",
|
33
|
+
PRECISION = "PRECISION"
|
29
34
|
}
|
@@ -12,11 +12,6 @@ export declare class AppStateService implements OnDestroy {
|
|
12
12
|
*/
|
13
13
|
currentPage$: CurrentPageTopic;
|
14
14
|
currentWorkspace$: CurrentWorkspaceTopic;
|
15
|
-
/**
|
16
|
-
* @deprecated Will be replaced by currentWorkspace$
|
17
|
-
*/
|
18
|
-
get currentPortal$(): CurrentWorkspaceTopic;
|
19
|
-
set currentPortal$(value: CurrentWorkspaceTopic);
|
20
15
|
/**
|
21
16
|
* This Topic is initialized as soon as the authentication is done
|
22
17
|
*/
|
@@ -1,20 +1,16 @@
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
2
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
3
2
|
import { UserProfileTopic } from '@onecx/integration-interface';
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
export declare class UserService implements OnDestroy {
|
6
6
|
profile$: UserProfileTopic;
|
7
|
-
permissions$: BehaviorSubject<string[]>;
|
8
7
|
lang$: BehaviorSubject<string>;
|
9
|
-
private effectivePermissions$;
|
10
8
|
private permissionsTopic$;
|
11
|
-
private oldStylePermissionsInitialized;
|
12
9
|
constructor();
|
13
10
|
ngOnDestroy(): void;
|
14
|
-
getPermissions(): Observable<string[]>;
|
15
|
-
hasPermission(permissionKey: string | string[]): boolean
|
11
|
+
getPermissions(): import("rxjs").Observable<string[]>;
|
12
|
+
hasPermission(permissionKey: string | string[] | undefined): Promise<boolean>;
|
16
13
|
private determineLanguage;
|
17
|
-
private extractPermissions;
|
18
14
|
get isInitialized(): Promise<void>;
|
19
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
|
20
16
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
|
package/migrations.json
CHANGED
@@ -5,6 +5,24 @@
|
|
5
5
|
"version": "6.0.0",
|
6
6
|
"description": "Update package json to Angular 19, PrimeNG 19, OneCX versions to v6 and other dependencies to be compatible with Angular 19.",
|
7
7
|
"factory": "migrations/v6/migrate-onecx-to-v6"
|
8
|
+
},
|
9
|
+
"remove-add-initialize-module-guard": {
|
10
|
+
"cli": "nx",
|
11
|
+
"version": "6.0.0",
|
12
|
+
"description": "Removes all occurrences of addInitializeModuleGuard.",
|
13
|
+
"factory": "migrations/v6/remove-add-initialize-module-guard"
|
14
|
+
},
|
15
|
+
"replace-provide-app-service-mock": {
|
16
|
+
"cli": "nx",
|
17
|
+
"version": "6.0.0",
|
18
|
+
"description": "Detects and replaces all occurrences of provideAppServiceMock with provideAppStateServiceMock.",
|
19
|
+
"factory": "migrations/v6/replace-provide-app-service-mock"
|
20
|
+
},
|
21
|
+
"remove-auth-service": {
|
22
|
+
"cli": "nx",
|
23
|
+
"version": "6.0.0",
|
24
|
+
"description": "Removes all imports of IAuthService and AUTH_SERVICE and warns for usage.",
|
25
|
+
"factory": "migrations/v6/remove-auth-service"
|
8
26
|
}
|
9
27
|
},
|
10
28
|
"packageJsonUpdates": {
|
@@ -18,9 +36,17 @@
|
|
18
36
|
"@nx/angular": {
|
19
37
|
"version": "~20.3.0",
|
20
38
|
"alwaysAddToPackageJson": false
|
39
|
+
},
|
40
|
+
"@ngx-translate/core": {
|
41
|
+
"version": "~16.0.4",
|
42
|
+
"alwaysAddToPackageJson": false
|
43
|
+
},
|
44
|
+
"primeng": {
|
45
|
+
"version": "~19.0.0",
|
46
|
+
"alwaysAddToPackageJson": false
|
21
47
|
}
|
22
48
|
}
|
23
49
|
},
|
24
50
|
"version": "null"
|
25
51
|
}
|
26
|
-
}
|
52
|
+
}
|
@@ -2,13 +2,6 @@ import { CurrentLocationTopicPayload, MfeInfo, PageInfo, Workspace } from '@onec
|
|
2
2
|
import { AppStateService } from '@onecx/angular-integration-interface';
|
3
3
|
import { FakeTopic } from '@onecx/accelerator';
|
4
4
|
import * as i0 from "@angular/core";
|
5
|
-
/**
|
6
|
-
* @deprecated use provideAppStateServiceMock()
|
7
|
-
*/
|
8
|
-
export declare function provideAppServiceMock(): (typeof AppStateServiceMock | {
|
9
|
-
provide: typeof AppStateService;
|
10
|
-
useExisting: typeof AppStateServiceMock;
|
11
|
-
})[];
|
12
5
|
export declare function provideAppStateServiceMock(): (typeof AppStateServiceMock | {
|
13
6
|
provide: typeof AppStateService;
|
14
7
|
useExisting: typeof AppStateServiceMock;
|
@@ -14,9 +14,9 @@ export declare class ConfigurationServiceMock {
|
|
14
14
|
constructor();
|
15
15
|
init(config?: Config): Promise<boolean>;
|
16
16
|
get isInitialized(): Promise<void>;
|
17
|
-
getProperty(key: CONFIG_KEY): string | undefined
|
17
|
+
getProperty(key: CONFIG_KEY): Promise<string | undefined>;
|
18
18
|
setProperty(key: string, val: string): Promise<void>;
|
19
|
-
getConfig(): Config | undefined
|
19
|
+
getConfig(): Promise<Config | undefined>;
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurationServiceMock, never>;
|
21
21
|
static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationServiceMock>;
|
22
22
|
}
|
@@ -9,9 +9,9 @@ export declare function provideUserServiceMock(): (typeof UserServiceMock | {
|
|
9
9
|
})[];
|
10
10
|
export declare class UserServiceMock {
|
11
11
|
profile$: FakeTopic<UserProfile>;
|
12
|
-
|
12
|
+
permissionsTopic$: FakeTopic<string[]>;
|
13
13
|
lang$: BehaviorSubject<string>;
|
14
|
-
hasPermission(permissionKey: string | string[]): boolean
|
14
|
+
hasPermission(permissionKey: string | string[]): Promise<boolean>;
|
15
15
|
determineLanguage(): string | undefined;
|
16
16
|
extractPermissions(userProfile: UserProfile): string[] | null;
|
17
17
|
get isInitialized(): Promise<void>;
|
package/package.json
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@onecx/angular-integration-interface",
|
3
|
-
"version": "6.0.0
|
3
|
+
"version": "6.0.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"peerDependencies": {
|
6
6
|
"@angular/core": "^19.0.0",
|
7
|
-
"@onecx/
|
8
|
-
"@onecx/
|
7
|
+
"@onecx/accelerator": "^6.0.0",
|
8
|
+
"@onecx/nx-migration-utils": "^6.0.0",
|
9
|
+
"@onecx/integration-interface": "^6.0.0",
|
9
10
|
"rxjs": "~7.8.1",
|
10
11
|
"@nx/devkit": "^20.3.0",
|
11
|
-
"
|
12
|
+
"@phenomnomnominal/tsquery": "^6",
|
13
|
+
"ts-semaphore": "^1.0.0",
|
14
|
+
"@jest/globals": "29.7.0",
|
15
|
+
"jest-extended": "^6.0.0",
|
16
|
+
"typescript": "^5.5.4"
|
12
17
|
},
|
13
18
|
"dependencies": {
|
14
19
|
"tslib": "^2.3.0"
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @deprecated
|
3
|
-
*/
|
4
|
-
export interface IAuthService {
|
5
|
-
logout(): void;
|
6
|
-
/**
|
7
|
-
* Unique name of this auth provider: e.g. mockAuthProvider, KeycloakProvider..
|
8
|
-
*/
|
9
|
-
getAuthProviderName(): string;
|
10
|
-
/**
|
11
|
-
* Initialization method of the Auth service. Once resolved, all user data MUST be available.
|
12
|
-
*/
|
13
|
-
init(): Promise<boolean>;
|
14
|
-
getIdToken(): string | null;
|
15
|
-
hasRole(_role: string): boolean;
|
16
|
-
getUserRoles(): string[];
|
17
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router';
|
2
|
-
import { TranslateService } from '@ngx-translate/core';
|
3
|
-
import { Observable } from 'rxjs';
|
4
|
-
import { AppStateService } from './app-state.service';
|
5
|
-
import { ConfigurationService } from './configuration.service';
|
6
|
-
import { UserService } from './user.service';
|
7
|
-
import * as i0 from "@angular/core";
|
8
|
-
export declare class InitializeModuleGuard implements CanActivate {
|
9
|
-
protected translateService: TranslateService;
|
10
|
-
protected configService: ConfigurationService;
|
11
|
-
protected appStateService: AppStateService;
|
12
|
-
protected userService: UserService;
|
13
|
-
private SUPPORTED_LANGS;
|
14
|
-
private DEFAULT_LANG;
|
15
|
-
canActivate(_route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
16
|
-
getBestMatchLanguage(lang: string): string;
|
17
|
-
loadTranslations(): Observable<boolean>;
|
18
|
-
protected toObservable(canActivateResult: Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree): Observable<boolean | UrlTree>;
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<InitializeModuleGuard, never>;
|
20
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<InitializeModuleGuard>;
|
21
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { CanActivateFn, Route } from '@angular/router';
|
2
|
-
import { InitializeModuleGuard } from '../services/initialize-module-guard.service';
|
3
|
-
export declare function addInitializeModuleGuard(routes: Route[], initializeModuleGuard?: typeof InitializeModuleGuard | CanActivateFn): Route[];
|