@onecx/angular-integration-interface 4.43.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/{esm2020 → esm2022}/lib/services/app-state.service.mjs +4 -4
  2. package/esm2022/lib/services/configuration.service.mjs +79 -0
  3. package/esm2022/lib/services/initialize-module-guard.service.mjs +60 -0
  4. package/esm2022/lib/services/portal-message.service.mjs +49 -0
  5. package/{esm2020 → esm2022}/lib/services/remote-components.service.mjs +4 -4
  6. package/{esm2020 → esm2022}/lib/services/theme.service.mjs +5 -5
  7. package/esm2022/lib/services/user.service.mjs +86 -0
  8. package/esm2022/lib/services/workspace.service.mjs +124 -0
  9. package/esm2022/lib/utils/add-initialize-module-guard.utils.mjs +17 -0
  10. package/{esm2020 → esm2022}/mocks/app-state-service-mock.mjs +4 -4
  11. package/esm2022/mocks/fake-topic.mjs +25 -0
  12. package/{fesm2015 → fesm2022}/onecx-angular-integration-interface-mocks.mjs +3 -3
  13. package/{fesm2015 → fesm2022}/onecx-angular-integration-interface-mocks.mjs.map +1 -1
  14. package/{fesm2020 → fesm2022}/onecx-angular-integration-interface.mjs +38 -33
  15. package/fesm2022/onecx-angular-integration-interface.mjs.map +1 -0
  16. package/lib/services/portal-message.service.d.ts +3 -1
  17. package/package.json +10 -18
  18. package/esm2020/lib/services/configuration.service.mjs +0 -79
  19. package/esm2020/lib/services/initialize-module-guard.service.mjs +0 -60
  20. package/esm2020/lib/services/portal-message.service.mjs +0 -44
  21. package/esm2020/lib/services/user.service.mjs +0 -86
  22. package/esm2020/lib/services/workspace.service.mjs +0 -124
  23. package/esm2020/lib/utils/add-initialize-module-guard.utils.mjs +0 -17
  24. package/esm2020/mocks/fake-topic.mjs +0 -25
  25. package/fesm2015/onecx-angular-integration-interface.mjs +0 -533
  26. package/fesm2015/onecx-angular-integration-interface.mjs.map +0 -1
  27. package/fesm2020/onecx-angular-integration-interface-mocks.mjs +0 -71
  28. package/fesm2020/onecx-angular-integration-interface-mocks.mjs.map +0 -1
  29. package/fesm2020/onecx-angular-integration-interface.mjs.map +0 -1
  30. /package/{esm2020 → esm2022}/index.mjs +0 -0
  31. /package/{esm2020 → esm2022}/lib/api/constants.mjs +0 -0
  32. /package/{esm2020 → esm2022}/lib/api/iauth.service.mjs +0 -0
  33. /package/{esm2020 → esm2022}/lib/api/injection-tokens.mjs +0 -0
  34. /package/{esm2020 → esm2022}/lib/model/config-key.model.mjs +0 -0
  35. /package/{esm2020 → esm2022}/mocks/index.mjs +0 -0
  36. /package/{esm2020 → esm2022}/mocks/mock-user-service.mjs +0 -0
  37. /package/{esm2020 → esm2022}/mocks/onecx-angular-integration-interface-mocks.mjs +0 -0
  38. /package/{esm2020 → esm2022}/onecx-angular-integration-interface.mjs +0 -0
@@ -0,0 +1,25 @@
1
+ import { BehaviorSubject, ReplaySubject } from 'rxjs';
2
+ export class FakeTopic {
3
+ constructor(initialValue = undefined) {
4
+ if (initialValue !== undefined) {
5
+ this.state = new BehaviorSubject(initialValue);
6
+ }
7
+ else {
8
+ this.state = new ReplaySubject(1);
9
+ }
10
+ }
11
+ asObservable() {
12
+ return this.state.asObservable();
13
+ }
14
+ subscribe(observerOrNext, error, complete) {
15
+ return this.asObservable().subscribe(observerOrNext, error, complete);
16
+ }
17
+ pipe(...operations) {
18
+ return this.asObservable().pipe(...operations);
19
+ }
20
+ publish(value) {
21
+ this.state.next(value);
22
+ return Promise.resolve();
23
+ }
24
+ }
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFrZS10b3BpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2UvbW9ja3MvZmFrZS10b3BpYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQThELGVBQWUsRUFBRSxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUE7QUF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5uZXh0KHZhbHVlKVxuICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKVxuICB9XG59XG4iXX0=
@@ -56,10 +56,10 @@ class AppStateServiceMock {
56
56
  this.currentWorkspace$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' });
57
57
  this.isAuthenticated$ = new FakeTopic(null);
58
58
  }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
60
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateServiceMock }); }
59
61
  }
60
- AppStateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
61
- AppStateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock });
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateServiceMock, decorators: [{
63
63
  type: Injectable
64
64
  }] });
65
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/mock-user-service.ts","../../../../libs/angular-integration-interface/mocks/fake-topic.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { BehaviorSubject } from 'rxjs'\n\nexport class MockUserService {\n lang$ = new BehaviorSubject<string>('en')\n /* eslint-disable @typescript-eslint/no-unused-vars */\n hasPermission(permissionKey: string): boolean {\n return true\n }\n}\n","import { Subject, Observable, Observer, Subscription, UnaryFunction, BehaviorSubject, ReplaySubject } from 'rxjs'\n\nexport class FakeTopic<T> {\n private state: Subject<T>\n constructor(initialValue: T | undefined = undefined) {\n if (initialValue !== undefined) {\n this.state = new BehaviorSubject<T>(initialValue)\n } else {\n this.state = new ReplaySubject<T>(1)\n }\n }\n asObservable(): Observable<T> {\n return this.state.asObservable()\n }\n\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void\n ): Subscription {\n return (<any>this.asObservable()).subscribe(observerOrNext, error, complete)\n }\n\n pipe(...operations: UnaryFunction<any, any>[]): unknown {\n return (<any>this.asObservable()).pipe(...operations)\n }\n\n publish(value: T): Promise<void> {\n this.state.next(value)\n return Promise.resolve()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from './fake-topic'\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({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' })\n currentWorkspace$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","/**\n * Generated bundle index. Do not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EAAE,CAAC,CAAA;AAC9F,CAAC;MAGY,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,SAAS,EAAE,CAAA;QAC9B,IAAA,CAAA,cAAc,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,CAAA;QACrC,IAAW,CAAA,WAAA,GAAG,IAAI,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;QACrG,IAAA,CAAA,YAAY,GAAG,IAAI,SAAS,CAAuB,SAAS,CAAC,CAAA;QAC7D,IAAc,CAAA,cAAA,GAAG,IAAI,SAAS,CAAY,EAAE,OAAO,EAAE,GAAG,EAAE,0BAA0B,EAAE,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAA;QACpJ,IAAiB,CAAA,iBAAA,GAAG,IAAI,SAAS,CAAY,EAAE,OAAO,EAAE,GAAG,EAAE,0BAA0B,EAAE,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,CAAA;QAC7J,IAAA,CAAA,gBAAgB,GAAG,IAAI,SAAS,CAAO,IAAI,CAAC,CAAA;KAC7C;;iHARY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qHAAnB,mBAAmB,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;;;ACjBX;;AAEG;;;;"}
1
+ {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/mock-user-service.ts","../../../../libs/angular-integration-interface/mocks/fake-topic.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { BehaviorSubject } from 'rxjs'\n\nexport class MockUserService {\n lang$ = new BehaviorSubject<string>('en')\n /* eslint-disable @typescript-eslint/no-unused-vars */\n hasPermission(permissionKey: string): boolean {\n return true\n }\n}\n","import { Subject, Observable, Observer, Subscription, UnaryFunction, BehaviorSubject, ReplaySubject } from 'rxjs'\n\nexport class FakeTopic<T> {\n private state: Subject<T>\n constructor(initialValue: T | undefined = undefined) {\n if (initialValue !== undefined) {\n this.state = new BehaviorSubject<T>(initialValue)\n } else {\n this.state = new ReplaySubject<T>(1)\n }\n }\n asObservable(): Observable<T> {\n return this.state.asObservable()\n }\n\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void\n ): Subscription {\n return (<any>this.asObservable()).subscribe(observerOrNext, error, complete)\n }\n\n pipe(...operations: UnaryFunction<any, any>[]): unknown {\n return (<any>this.asObservable()).pipe(...operations)\n }\n\n publish(value: T): Promise<void> {\n this.state.next(value)\n return Promise.resolve()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from './fake-topic'\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({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' })\n currentWorkspace$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAEa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,eAAe,CAAS,IAAI,CAAC,CAAA;KAK1C;;AAHC,IAAA,aAAa,CAAC,aAAqB,EAAA;AACjC,QAAA,OAAO,IAAI,CAAA;KACZ;AACF;;MCNY,SAAS,CAAA;AAEpB,IAAA,WAAA,CAAY,eAA8B,SAAS,EAAA;AACjD,QAAA,IAAI,YAAY,KAAK,SAAS,EAAE;YAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAI,YAAY,CAAC,CAAA;SAClD;aAAM;YACL,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAI,CAAC,CAAC,CAAA;SACrC;KACF;IACD,YAAY,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAA;KACjC;AAED,IAAA,SAAS,CACP,cAA4D,EAC5D,KAA4B,EAC5B,QAAqB,EAAA;AAErB,QAAA,OAAa,IAAI,CAAC,YAAY,EAAG,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;KAC7E;IAED,IAAI,CAAC,GAAG,UAAqC,EAAA;QAC3C,OAAa,IAAI,CAAC,YAAY,EAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAA;KACtD;AAED,IAAA,OAAO,CAAC,KAAQ,EAAA;AACd,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACtB,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;KACzB;AACF;;ACzBD;;AAEG;SACa,qBAAqB,GAAA;IACn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;;;ACjBX;;AAEG;;;;"}
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, InjectionToken, Optional, Inject } from '@angular/core';
3
3
  import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentPageTopic, CurrentWorkspaceTopic, IsAuthenticatedTopic, ConfigurationTopic, UserProfileTopic, PermissionsTopic, MessageTopic, CurrentThemeTopic, RemoteComponentsTopic } from '@onecx/integration-interface';
4
4
  import * as i1 from '@angular/common/http';
5
- import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, mergeMap, from, zip, tap, isObservable } from 'rxjs';
5
+ import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, first, mergeMap, from, zip, tap, isObservable } from 'rxjs';
6
6
  import * as i1$1 from '@ngx-translate/core';
7
7
  import { Location } from '@angular/common';
8
8
 
@@ -40,10 +40,10 @@ class AppStateService {
40
40
  this.currentWorkspace$.destroy();
41
41
  this.isAuthenticated$.destroy();
42
42
  }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
44
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateService, providedIn: 'root' }); }
43
45
  }
44
- AppStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
45
- AppStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, providedIn: 'root' });
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AppStateService, decorators: [{
47
47
  type: Injectable,
48
48
  args: [{ providedIn: 'root' }]
49
49
  }] });
@@ -146,18 +146,18 @@ class ConfigurationService {
146
146
  getConfig() {
147
147
  return this.config$.getValue();
148
148
  }
149
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: APP_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
150
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ConfigurationService, providedIn: 'root' }); }
149
151
  }
150
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: APP_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
151
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, decorators: [{
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ConfigurationService, decorators: [{
153
153
  type: Injectable,
154
154
  args: [{ providedIn: 'root' }]
155
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
155
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
156
156
  type: Optional
157
157
  }, {
158
158
  type: Inject,
159
159
  args: [APP_CONFIG]
160
- }] }]; } });
160
+ }] }] });
161
161
 
162
162
  const API_PREFIX = 'portal-api';
163
163
  const DEFAULT_LANG = 'en';
@@ -235,13 +235,13 @@ class UserService {
235
235
  // eslint-disable-next-line @typescript-eslint/no-empty-function
236
236
  ]).then(() => { });
237
237
  }
238
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
239
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: UserService, providedIn: 'root' }); }
238
240
  }
239
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
240
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, providedIn: 'root' });
241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: UserService, decorators: [{
242
242
  type: Injectable,
243
243
  args: [{ providedIn: 'root' }]
244
- }], ctorParameters: function () { return []; } });
244
+ }], ctorParameters: () => [] });
245
245
 
246
246
  class PortalMessageService {
247
247
  constructor(translateService) {
@@ -264,7 +264,9 @@ class PortalMessageService {
264
264
  combineLatest([
265
265
  msg.summaryKey ? this.translateService.get(msg.summaryKey || '', msg.summaryParameters) : of(undefined),
266
266
  msg.detailKey ? this.translateService.get(msg.detailKey, msg.detailParameters) : of(undefined),
267
- ]).subscribe(([summaryTranslation, detailTranslation]) => {
267
+ ])
268
+ .pipe(first())
269
+ .subscribe(([summaryTranslation, detailTranslation]) => {
268
270
  this.message$.publish({
269
271
  ...msg,
270
272
  severity: severity,
@@ -273,13 +275,16 @@ class PortalMessageService {
273
275
  });
274
276
  });
275
277
  }
278
+ ngOnDestroy() {
279
+ this.message$.destroy();
280
+ }
281
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: PortalMessageService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
282
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: PortalMessageService, providedIn: 'any' }); }
276
283
  }
277
- PortalMessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
278
- PortalMessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, providedIn: 'any' });
279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, decorators: [{
284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: PortalMessageService, decorators: [{
280
285
  type: Injectable,
281
286
  args: [{ providedIn: 'any' }]
282
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
287
+ }], ctorParameters: () => [{ type: i1$1.TranslateService }] });
283
288
 
284
289
  const defaultThemeServerUrl = 'http://portal-theme-management:8080';
285
290
  class ThemeService {
@@ -312,13 +317,13 @@ class ThemeService {
312
317
  ngOnDestroy() {
313
318
  this.currentTheme$.destroy();
314
319
  }
320
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ThemeService, deps: [{ token: ConfigurationService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
321
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
315
322
  }
316
- ThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, deps: [{ token: ConfigurationService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
317
- ThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, providedIn: 'root' });
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, decorators: [{
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ThemeService, decorators: [{
319
324
  type: Injectable,
320
325
  args: [{ providedIn: 'root' }]
321
- }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: i1.HttpClient }]; } });
326
+ }], ctorParameters: () => [{ type: ConfigurationService }, { type: i1.HttpClient }] });
322
327
 
323
328
  class RemoteComponentsService {
324
329
  constructor() {
@@ -327,10 +332,10 @@ class RemoteComponentsService {
327
332
  ngOnDestroy() {
328
333
  this.remoteComponents$.destroy();
329
334
  }
335
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
336
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' }); }
330
337
  }
331
- RemoteComponentsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
332
- RemoteComponentsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' });
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, decorators: [{
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: RemoteComponentsService, decorators: [{
334
339
  type: Injectable,
335
340
  args: [{ providedIn: 'root' }]
336
341
  }] });
@@ -376,13 +381,13 @@ class InitializeModuleGuard {
376
381
  }
377
382
  return from(Promise.resolve(canActivateResult));
378
383
  }
384
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: InitializeModuleGuard, deps: [{ token: i1$1.TranslateService }, { token: ConfigurationService }, { token: AppStateService }, { token: UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
385
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' }); }
379
386
  }
380
- InitializeModuleGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, deps: [{ token: i1$1.TranslateService }, { token: ConfigurationService }, { token: AppStateService }, { token: UserService }], target: i0.ɵɵFactoryTarget.Injectable });
381
- InitializeModuleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' });
382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, decorators: [{
387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: InitializeModuleGuard, decorators: [{
383
388
  type: Injectable,
384
389
  args: [{ providedIn: 'any' }]
385
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
390
+ }], ctorParameters: () => [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }] });
386
391
 
387
392
  class WorkspaceService {
388
393
  constructor(appStateService) {
@@ -492,15 +497,15 @@ class WorkspaceService {
492
497
  return String(value);
493
498
  }
494
499
  }
500
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WorkspaceService, deps: [{ token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
501
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WorkspaceService, providedIn: 'root' }); }
495
502
  }
496
- WorkspaceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, deps: [{ token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable });
497
- WorkspaceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, providedIn: 'root' });
498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, decorators: [{
503
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: WorkspaceService, decorators: [{
499
504
  type: Injectable,
500
505
  args: [{
501
506
  providedIn: 'root',
502
507
  }]
503
- }], ctorParameters: function () { return [{ type: AppStateService }]; } });
508
+ }], ctorParameters: () => [{ type: AppStateService }] });
504
509
 
505
510
  function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
506
511
  return routes.map((r) => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onecx-angular-integration-interface.mjs","sources":["../../../../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/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 { Injectable, OnDestroy } from '@angular/core'\nimport {\n GlobalErrorTopic,\n GlobalLoadingTopic,\n CurrentMfeTopic,\n CurrentPageTopic,\n CurrentWorkspaceTopic,\n IsAuthenticatedTopic,\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\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.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 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 { Inject, Injectable, OnDestroy, Optional } from '@angular/core'\nimport { firstValueFrom } from 'rxjs'\nimport { Config, ConfigurationTopic } from '@onecx/integration-interface'\nimport { APP_CONFIG } from '../api/injection-tokens'\nimport { CONFIG_KEY } from '../model/config-key.model'\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationService implements OnDestroy {\n config$ = new ConfigurationTopic()\n\n constructor(\n private http: HttpClient,\n @Optional() @Inject(APP_CONFIG) private defaultConfig?: { [key: string]: string }\n ) {}\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 if (config) {\n await this.config$.publish({ ...this.defaultConfig, ...config }).then(() => {\n resolve(true)\n })\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 getProperty(key: CONFIG_KEY): string | undefined {\n if (!Object.values(CONFIG_KEY).includes(key)) {\n console.error('Invalid config key ', key)\n }\n return this.config$.getValue()?.[key]\n }\n\n public async setProperty(key: string, val: string) {\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","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 } 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 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.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 hasPermission(permissionKey: string): boolean {\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 } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { combineLatest, first, of } from 'rxjs'\nimport { MessageTopic } from '@onecx/integration-interface'\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 constructor(private translateService: 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 { HttpClient } from '@angular/common/http'\nimport { Injectable, OnDestroy } from '@angular/core'\nimport { from, map, mergeMap } from 'rxjs'\nimport { CurrentThemeTopic, Theme } from '@onecx/integration-interface'\nimport { ConfigurationService } from './configuration.service'\nimport { CONFIG_KEY } from '../model/config-key.model'\n\nconst defaultThemeServerUrl = 'http://portal-theme-management:8080'\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService implements OnDestroy {\n baseUrlV1 = './portal-api'\n currentTheme$ = new CurrentThemeTopic()\n\n constructor(private configService: ConfigurationService, private http: HttpClient) {}\n\n getThemeHref(themeId: string): string {\n const themeServerUrl =\n this.configService.getProperty(CONFIG_KEY.TKIT_PORTAL_THEME_SERVER_URL) || defaultThemeServerUrl\n return `${themeServerUrl}/themes/${themeId}/${themeId}.min.css`\n }\n\n public loadAndApplyTheme(themeName: string) {\n return this.http.get<Theme>(`${this.baseUrlV1}/internal/themes/${encodeURI(themeName)}`).pipe(\n mergeMap((theme) => {\n return from(this.apply(theme)).pipe(map(() => theme))\n })\n )\n }\n\n public async apply(theme: Theme): Promise<void> {\n console.log(`🎨 Applying theme: ${theme.name}`)\n await this.currentTheme$.publish(theme)\n if (theme.properties) {\n Object.values(theme.properties).forEach((group) => {\n for (const [key, value] of Object.entries(group)) {\n document.documentElement.style.setProperty(`--${key}`, value)\n }\n })\n }\n }\n\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 } from '@angular/core'\nimport { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'\nimport { TranslateService } from '@ngx-translate/core'\nimport { filter, from, isObservable, map, mergeMap, Observable, 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 private SUPPORTED_LANGS = ['en', 'de']\n private DEFAULT_LANG = 'en'\n constructor(\n protected translateService: TranslateService,\n protected configService: ConfigurationService,\n protected appStateService: AppStateService,\n protected userService: UserService\n ) {}\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 { Injectable } from '@angular/core'\nimport { AppStateService } from './app-state.service'\nimport { Observable, map } from 'rxjs'\nimport { Route } from '@onecx/integration-interface'\nimport { Endpoint } from '@onecx/integration-interface'\nimport { Location } from '@angular/common'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WorkspaceService {\n private aliasStart = '[['\n private aliasEnd = ']]'\n private paramStart = '{'\n private paramEnd = '}'\n\n constructor(protected appStateService: AppStateService) {}\n\n getUrl(\n appId: string,\n productName: string,\n endpointName: string,\n params: Record<string, unknown> = {}\n ): Observable<string> {\n return this.appStateService.currentWorkspace$.pipe(\n map((workspace) => {\n const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, params)\n return finalUrl\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 params: 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\n url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, params))\n return url\n }\n\n private constructEndpointUrl(route: any, endpointName: string, params: Record<string, unknown>): 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, params)\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, params: 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(params[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 { 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-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'\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":["i1","i1.ConfigurationService","i2","i2.ConfigurationService","i3.AppStateService","i4.UserService","i1.AppStateService"],"mappings":";;;;;;;;MAWa,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAA;AACrC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,kBAAkB,EAAE,CAAA;AACzC,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,eAAe,EAAE,CAAA;AAEnC;;;AAGG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAA;AACrC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,qBAAqB,EAAE,CAAA;AAY/C;;AAEG;AACH,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAW9C,KAAA;AAxBC;;AAEG;AACH,IAAA,IAAI,cAA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G,CAAC;SACL,CAAA;QACD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;AACtD,YAAA,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;SAC9C;AACD,QAAA,OAAO,KAAK,CAAA;AACd,KAAC,CAAC,CAAA;AACJ;;ACpBA;;ACAA;;AAEG;;;;"}
@@ -1,3 +1,4 @@
1
+ import { OnDestroy } from '@angular/core';
1
2
  import { TranslateService } from '@ngx-translate/core';
2
3
  import { MessageTopic } from '@onecx/integration-interface';
3
4
  import * as i0 from "@angular/core";
@@ -16,7 +17,7 @@ export type Message = {
16
17
  contentStyleClass?: string;
17
18
  styleClass?: string;
18
19
  };
19
- export declare class PortalMessageService {
20
+ export declare class PortalMessageService implements OnDestroy {
20
21
  private translateService;
21
22
  constructor(translateService: TranslateService);
22
23
  message$: MessageTopic;
@@ -25,6 +26,7 @@ export declare class PortalMessageService {
25
26
  error(msg: Message): void;
26
27
  warning(msg: Message): void;
27
28
  private addTranslated;
29
+ ngOnDestroy(): void;
28
30
  static ɵfac: i0.ɵɵFactoryDeclaration<PortalMessageService, never>;
29
31
  static ɵprov: i0.ɵɵInjectableDeclaration<PortalMessageService>;
30
32
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@onecx/angular-integration-interface",
3
- "version": "4.43.1",
3
+ "version": "5.0.0",
4
4
  "peerDependencies": {
5
- "@angular/core": "^15.2.7",
5
+ "@angular/core": "^18.0.5",
6
6
  "@onecx/integration-interface": "~4",
7
- "rxjs": "~7.8.0"
7
+ "rxjs": "~7.8.1"
8
8
  },
9
9
  "dependencies": {
10
10
  "tslib": "^2.3.0"
@@ -12,11 +12,7 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "module": "fesm2015/onecx-angular-integration-interface.mjs",
16
- "es2020": "fesm2020/onecx-angular-integration-interface.mjs",
17
- "esm2020": "esm2020/onecx-angular-integration-interface.mjs",
18
- "fesm2020": "fesm2020/onecx-angular-integration-interface.mjs",
19
- "fesm2015": "fesm2015/onecx-angular-integration-interface.mjs",
15
+ "module": "fesm2022/onecx-angular-integration-interface.mjs",
20
16
  "typings": "index.d.ts",
21
17
  "exports": {
22
18
  "./package.json": {
@@ -24,19 +20,15 @@
24
20
  },
25
21
  ".": {
26
22
  "types": "./index.d.ts",
27
- "esm2020": "./esm2020/onecx-angular-integration-interface.mjs",
28
- "es2020": "./fesm2020/onecx-angular-integration-interface.mjs",
29
- "es2015": "./fesm2015/onecx-angular-integration-interface.mjs",
30
- "node": "./fesm2015/onecx-angular-integration-interface.mjs",
31
- "default": "./fesm2020/onecx-angular-integration-interface.mjs"
23
+ "esm2022": "./esm2022/onecx-angular-integration-interface.mjs",
24
+ "esm": "./esm2022/onecx-angular-integration-interface.mjs",
25
+ "default": "./fesm2022/onecx-angular-integration-interface.mjs"
32
26
  },
33
27
  "./mocks": {
34
28
  "types": "./mocks/index.d.ts",
35
- "esm2020": "./esm2020/mocks/onecx-angular-integration-interface-mocks.mjs",
36
- "es2020": "./fesm2020/onecx-angular-integration-interface-mocks.mjs",
37
- "es2015": "./fesm2015/onecx-angular-integration-interface-mocks.mjs",
38
- "node": "./fesm2015/onecx-angular-integration-interface-mocks.mjs",
39
- "default": "./fesm2020/onecx-angular-integration-interface-mocks.mjs"
29
+ "esm2022": "./esm2022/mocks/onecx-angular-integration-interface-mocks.mjs",
30
+ "esm": "./esm2022/mocks/onecx-angular-integration-interface-mocks.mjs",
31
+ "default": "./fesm2022/onecx-angular-integration-interface-mocks.mjs"
40
32
  }
41
33
  },
42
34
  "sideEffects": false
@@ -1,79 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Inject, Injectable, Optional } from '@angular/core';
3
- import { firstValueFrom } from 'rxjs';
4
- import { ConfigurationTopic } from '@onecx/integration-interface';
5
- import { APP_CONFIG } from '../api/injection-tokens';
6
- import { CONFIG_KEY } from '../model/config-key.model';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@angular/common/http";
9
- export class ConfigurationService {
10
- constructor(http, defaultConfig) {
11
- this.http = http;
12
- this.defaultConfig = defaultConfig;
13
- this.config$ = new ConfigurationTopic();
14
- }
15
- ngOnDestroy() {
16
- this.config$.destroy();
17
- }
18
- init() {
19
- return new Promise((resolve, reject) => {
20
- const skipRemoteConfigLoad = this.defaultConfig && this.defaultConfig['skipRemoteConfigLoad'];
21
- let loadConfigPromise;
22
- const inlinedConfig = window['APP_CONFIG'];
23
- if (inlinedConfig) {
24
- console.log(`ENV resolved from injected config`);
25
- loadConfigPromise = Promise.resolve(inlinedConfig);
26
- }
27
- else {
28
- if (skipRemoteConfigLoad) {
29
- console.log('📢 TKA001: Remote config load is disabled. To enable it, remove the "skipRemoteConfigLoad" key in your environment.json');
30
- loadConfigPromise = Promise.resolve(this.defaultConfig || {});
31
- }
32
- else {
33
- loadConfigPromise = firstValueFrom(this.http.get((this.defaultConfig && this.defaultConfig['remoteConfigURL']) || 'assets/env.json'));
34
- }
35
- }
36
- loadConfigPromise
37
- .then(async (config) => {
38
- if (config) {
39
- await this.config$.publish({ ...this.defaultConfig, ...config }).then(() => {
40
- resolve(true);
41
- });
42
- }
43
- })
44
- .catch((e) => {
45
- console.log(`Failed to load env configuration`);
46
- reject(e);
47
- });
48
- });
49
- }
50
- get isInitialized() {
51
- return this.config$.isInitialized;
52
- }
53
- getProperty(key) {
54
- if (!Object.values(CONFIG_KEY).includes(key)) {
55
- console.error('Invalid config key ', key);
56
- }
57
- return this.config$.getValue()?.[key];
58
- }
59
- async setProperty(key, val) {
60
- const currentValues = await firstValueFrom(this.config$.asObservable());
61
- currentValues[key] = val;
62
- await this.config$.publish(currentValues);
63
- }
64
- getConfig() {
65
- return this.config$.getValue();
66
- }
67
- }
68
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: APP_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
69
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, decorators: [{
71
- type: Injectable,
72
- args: [{ providedIn: 'root' }]
73
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
74
- type: Optional
75
- }, {
76
- type: Inject,
77
- args: [APP_CONFIG]
78
- }] }]; } });
79
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLWludGVncmF0aW9uLWludGVyZmFjZS9zcmMvbGliL3NlcnZpY2VzL2NvbmZpZ3VyYXRpb24uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUE7QUFDakQsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQWEsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3ZFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFDckMsT0FBTyxFQUFVLGtCQUFrQixFQUFFLE1BQU0sOEJBQThCLENBQUE7QUFDekUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHlCQUF5QixDQUFBO0FBQ3BELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQTs7O0FBR3RELE1BQU0sT0FBTyxvQkFBb0I7SUFHL0IsWUFDVSxJQUFnQixFQUNnQixhQU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ICBpZiAoc2tpcFJlbW90ZUNvbmZpZ0xvYWQpIHtcbiAgICAgICAgICBjb25zb2xlLmxvZyhcbiAgICAgICAgICAgICfwn5OiIFRLQTAwMTogUmVtb3RlIGNvbmZpZyBsb2FkIGlzIGRpc2FibGVkLiBUbyBlbmFibGUgaXQsIHJlbW92ZSB0aGUgXCJza2lwUmVtb3RlQ29uZmlnTG9hZFwiIGtleSBpbiB5b3VyIGVudmlyb25tZW50Lmpzb24nXG4gICAgICAgICAgKVxuICAgICAgICAgIGxvYWRDb25maWdQcm9taXNlID0gUHJvbWlzZS5yZXNvbHZlKHRoaXMuZGVmYXVsdENvbmZpZyB8fCB7fSlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBsb2FkQ29uZmlnUHJvbWlzZSA9IGZpcnN0VmFsdWVGcm9tKFxuICAgICAgICAgICAgdGhpcy5odHRwLmdldDxDb25maWc+KCh0aGlzLmRlZmF1bHRDb25maWcgJiYgdGhpcy5kZWZhdWx0Q29uZmlnWydyZW1vdGVDb25maWdVUkwnXSkgfHwgJ2Fzc2V0cy9lbnYuanNvbicpXG4gICAgICAgICAgKVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGxvYWRDb25maWdQcm9taXNlXG4gICAgICAgIC50aGVuKGFzeW5jIChjb25maWcpID0+IHtcbiAgICAgICAgICBpZiAoY29uZmlnKSB7XG4gICAgICAgICAgICBhd2FpdCB0aGlzLmNvbmZpZyQucHVibGlzaCh7IC4uLnRoaXMuZGVmYXVsdENvbmZpZywgLi4uY29uZmlnIH0pLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICByZXNvbHZlKHRydWUpXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgICAgLmNhdGNoKChlKSA9PiB7XG4gICAgICAgICAgY29uc29sZS5sb2coYEZhaWxlZCB0byBsb2FkIGVudiBjb25maWd1cmF0aW9uYClcbiAgICAgICAgICByZWplY3QoZSlcbiAgICAgICAgfSlcbiAgICB9KVxuICB9XG5cbiAgZ2V0IGlzSW5pdGlhbGl6ZWQoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgcmV0dXJuIHRoaXMuY29uZmlnJC5pc0luaXRpYWxpemVkXG4gIH1cblxuICBwdWJsaWMgZ2V0UHJvcGVydHkoa2V5OiBDT05GSUdfS0VZKTogc3RyaW5nIHwgdW5kZWZpbmVkIHtcbiAgICBpZiAoIU9iamVjdC52YWx1ZXMoQ09ORklHX0tFWSkuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgY29uc29sZS5lcnJvcignSW52YWxpZCBjb25maWcga2V5ICcsIGtleSlcbiAgICB9XG4gICAgcmV0dXJuIHRoaXMuY29uZmlnJC5nZXRWYWx1ZSgpPy5ba2V5XVxuICB9XG5cbiAgcHVibGljIGFzeW5jIHNldFByb3BlcnR5KGtleTogc3RyaW5nLCB2YWw6IHN0cmluZykge1xuICAgIGNvbnN0IGN1cnJlbnRWYWx1ZXMgPSBhd2FpdCBmaXJzdFZhbHVlRnJvbSh0aGlzLmNvbmZpZyQuYXNPYnNlcnZhYmxlKCkpXG4gICAgY3VycmVudFZhbHVlc1trZXldID0gdmFsXG4gICAgYXdhaXQgdGhpcy5jb25maWckLnB1Ymxpc2goY3VycmVudFZhbHVlcylcbiAgfVxuXG4gIHB1YmxpYyBnZXRDb25maWcoKTogQ29uZmlnIHwgdW5kZWZpbmVkIHtcbiAgICByZXR1cm4gdGhpcy5jb25maWckLmdldFZhbHVlKClcbiAgfVxufVxuIl19
@@ -1,60 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { TranslateService } from '@ngx-translate/core';
3
- import { filter, from, isObservable, map, mergeMap, of, tap, zip } 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
- import * as i1 from "@ngx-translate/core";
9
- import * as i2 from "./configuration.service";
10
- import * as i3 from "./app-state.service";
11
- import * as i4 from "./user.service";
12
- export class InitializeModuleGuard {
13
- constructor(translateService, configService, appStateService, userService) {
14
- this.translateService = translateService;
15
- this.configService = configService;
16
- this.appStateService = appStateService;
17
- this.userService = userService;
18
- this.SUPPORTED_LANGS = ['en', 'de'];
19
- this.DEFAULT_LANG = 'en';
20
- }
21
- canActivate(_route, _state) {
22
- console.time('InitializeModuleGuard');
23
- return zip([
24
- this.loadTranslations(),
25
- from(this.configService.isInitialized),
26
- from(this.userService.isInitialized),
27
- from(this.appStateService.currentWorkspace$.isInitialized),
28
- ]).pipe(tap(() => {
29
- console.timeEnd('InitializeModuleGuard');
30
- }), map(() => true));
31
- }
32
- getBestMatchLanguage(lang) {
33
- if (this.SUPPORTED_LANGS.includes(lang)) {
34
- return lang;
35
- }
36
- else {
37
- console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
38
- }
39
- return this.DEFAULT_LANG;
40
- }
41
- loadTranslations() {
42
- return this.userService.lang$.pipe(filter((v) => v !== undefined), mergeMap((lang) => {
43
- const bestMatchLang = this.getBestMatchLanguage(lang);
44
- return this.translateService.use(bestMatchLang);
45
- }), mergeMap(() => of(true)));
46
- }
47
- toObservable(canActivateResult) {
48
- if (isObservable(canActivateResult)) {
49
- return canActivateResult;
50
- }
51
- return from(Promise.resolve(canActivateResult));
52
- }
53
- }
54
- InitializeModuleGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, deps: [{ token: i1.TranslateService }, { token: i2.ConfigurationService }, { token: i3.AppStateService }, { token: i4.UserService }], target: i0.ɵɵFactoryTarget.Injectable });
55
- InitializeModuleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' });
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, decorators: [{
57
- type: Injectable,
58
- args: [{ providedIn: 'any' }]
59
- }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i2.ConfigurationService }, { type: i3.AppStateService }, { type: i4.UserService }]; } });
60
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdGlhbGl6ZS1tb2R1bGUtZ3VhcmQuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2Uvc3JjL2xpYi9zZXJ2aWNlcy9pbml0aWFsaXplLW1vZHVsZS1ndWFyZC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFFMUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDdEQsT0FBTyxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsWUFBWSxFQUFFLEdBQUcsRUFBRSxRQUFRLEVBQWMsRUFBRSxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFDMUYsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQy9ELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7Ozs7O0FBRzdDLE1BQU0sT0FBTyxxQkFBcUI7SUFHaEMsWUFDWSxnQkFBa0MsRUFDbEMsYUFBbUMsRUFDbkMsZUFBZ0MsRUFDaEMsV0FBd0I7UUFIeEIscUJBQWdCLEdBQWhCLGdCQUFnQixDQUFrQjtRQUNsQyxrQkFBYSxHQUFiLGFBQWEs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