@onecx/angular-integration-interface 4.23.0 → 4.23.2

Sign up to get free protection for your applications and to get access to all the features.
package/esm2020/index.mjs CHANGED
@@ -5,9 +5,12 @@ 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';
8
9
  // models
9
10
  export * from './lib/model/config-key.model';
10
11
  // core
11
12
  export * from './lib/api/iauth.service';
12
13
  export * from './lib/api/injection-tokens';
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXO0FBQ1gsY0FBYyxrQ0FBa0MsQ0FBQTtBQUNoRCxjQUFjLHNDQUFzQyxDQUFBO0FBQ3BELGNBQWMsNkJBQTZCLENBQUE7QUFDM0MsY0FBYyx1Q0FBdUMsQ0FBQTtBQUNyRCxjQUFjLDhCQUE4QixDQUFBO0FBQzVDLGNBQWMsMENBQTBDLENBQUE7QUFFeEQsU0FBUztBQUNULGNBQWMsOEJBQThCLENBQUE7QUFFNUMsT0FBTztBQUNQLGNBQWMseUJBQXlCLENBQUE7QUFDdkMsY0FBYyw0QkFBNEIsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbIi8vIHNlcnZpY2VzXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy9hcHAtc3RhdGUuc2VydmljZSdcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL2NvbmZpZ3VyYXRpb24uc2VydmljZSdcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL3VzZXIuc2VydmljZSdcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL3BvcnRhbC1tZXNzYWdlLnNlcnZpY2UnXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy90aGVtZS5zZXJ2aWNlJ1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvcmVtb3RlLWNvbXBvbmVudHMuc2VydmljZSdcblxuLy8gbW9kZWxzXG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbC9jb25maWcta2V5Lm1vZGVsJ1xuXG4vLyBjb3JlXG5leHBvcnQgKiBmcm9tICcuL2xpYi9hcGkvaWF1dGguc2VydmljZSdcbmV4cG9ydCAqIGZyb20gJy4vbGliL2FwaS9pbmplY3Rpb24tdG9rZW5zJ1xuXG4vLyB1dGlsc1xuXG5leHBvcnQgeyBNZmVJbmZvLCBUaGVtZSB9IGZyb20gJ0BvbmVjeC9pbnRlZ3JhdGlvbi1pbnRlcmZhY2UnXG4iXX0=
14
+ // utils
15
+ export * from './lib/utils/add-initialize-module-guard.utils';
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXO0FBQ1gsY0FBYyxrQ0FBa0MsQ0FBQTtBQUNoRCxjQUFjLHNDQUFzQyxDQUFBO0FBQ3BELGNBQWMsNkJBQTZCLENBQUE7QUFDM0MsY0FBYyx1Q0FBdUMsQ0FBQTtBQUNyRCxjQUFjLDhCQUE4QixDQUFBO0FBQzVDLGNBQWMsMENBQTBDLENBQUE7QUFDeEQsY0FBYyxnREFBZ0QsQ0FBQTtBQUU5RCxTQUFTO0FBQ1QsY0FBYyw4QkFBOEIsQ0FBQTtBQUU1QyxPQUFPO0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1
  import { InjectionToken } from '@angular/core';
2
2
  export const APP_CONFIG = new InjectionToken('APP_CONFIG');
3
+ /**
4
+ * @deprecated
5
+ * Please do not inject the auth service at all.
6
+ * There are better ways to achieve what you want. Please use permission service or user service.
7
+ */
3
8
  export const AUTH_SERVICE = new InjectionToken('AUTH_SERVICE');
4
9
  export const SANITY_CHECK = new InjectionToken('OCXSANITY_CHECK');
5
10
  export const APPLICATION_NAME = new InjectionToken('APPLICATION_NAME');
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0aW9uLXRva2Vucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2Uvc3JjL2xpYi9hcGkvaW5qZWN0aW9uLXRva2Vucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBZTlDLE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRyxJQUFJLGNBQWMsQ0FBWSxZQUFZLENBQUMsQ0FBQTtBQUVyRSxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsSUFBSSxjQUFjLENBQWUsY0FBYyxDQUFDLENBQUE7QUFFNUUsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLElBQUksY0FBYyxDQUFTLGlCQUFpQixDQUFDLENBQUE7QUFFekUsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSxjQUFjLENBQVMsa0JBQWtCLENBQUMsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGlvblRva2VuIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSdcbmltcG9ydCB7IElBdXRoU2VydmljZSB9IGZyb20gJy4vaWF1dGguc2VydmljZSdcblxuZX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AgKi9cbiAgcmVtb3RlQ29uZmlnVVJMOiBzdHJpbmdcbn1cbmV4cG9ydCBjb25zdCBBUFBfQ09ORklHID0gbmV3IEluamVjdGlvblRva2VuPExpYkNvbmZpZz4oJ0FQUF9DT05GSUcnKVxuXG4vKipcbiAqIEBkZXByZWNhdGVkXG4gKiBQbGVhc2UgZG8gbm90IGluamVjdCB0aGUgYXV0aCBzZXJ2aWNlIGF0IGFsbC5cbiAqIFRoZXJlIGFyZSBiZXR0ZXIgd2F5cyB0byBhY2hpZXZlIHdoYXQgeW91IHdhbnQuIFBsZWFzZSB1c2UgcGVybWlzc2lvbiBzZXJ2aWNlIG9yIHVzZXIgc2VydmljZS5cbiAqL1xuZXhwb3J0IGNvbnN0IEFVVEhfU0VSVklDRSA9IG5ldyBJbmplY3Rpb25Ub2tlbjxJQXV0aFNlcnZpY2U+KCdBVVRIX1NFUlZJQ0UnKVxuXG5leHBvcnQgY29uc3QgU0FOSVRZX0NIRUNLID0gbmV3IEluamVjdGlvblRva2VuPHN0cmluZz4oJ09DWFNBTklUWV9DSEVDSycpXG5cbmV4cG9ydCBjb25zdCBBUFBMSUNBVElPTl9OQU1FID0gbmV3IEluamVjdGlvblRva2VuPHN0cmluZz4oJ0FQUExJQ0FUSU9OX05BTUUnKVxuIl19
@@ -0,0 +1,60 @@
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.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VyZ2VNYXAoKGxhbmcpID0+IHtcbiAgICAgICAgY29uc3QgYmVzdE1hdGNoTGFuZyA9IHRoaXMuZ2V0QmVzdE1hdGNoTGFuZ3VhZ2UobGFuZyBhcyBzdHJpbmcpXG4gICAgICAgIHJldHVybiB0aGlzLnRyYW5zbGF0ZVNlcnZpY2UudXNlKGJlc3RNYXRjaExhbmcpXG4gICAgICB9KSxcbiAgICAgIG1lcmdlTWFwKCgpID0+IG9mKHRydWUpKVxuICAgIClcbiAgfVxuXG4gIHByb3RlY3RlZCB0b09ic2VydmFibGUoXG4gICAgY2FuQWN0aXZhdGVSZXN1bHQ6IE9ic2VydmFibGU8Ym9vbGVhbiB8IFVybFRyZWU+IHwgUHJvbWlzZTxib29sZWFuIHwgVXJsVHJlZT4gfCBib29sZWFuIHwgVXJsVHJlZVxuICApOiBPYnNlcnZhYmxlPGJvb2xlYW4gfCBVcmxUcmVlPiB7XG4gICAgaWYgKGlzT2JzZXJ2YWJsZShjYW5BY3RpdmF0ZVJlc3VsdCkpIHtcbiAgICAgIHJldHVybiBjYW5BY3RpdmF0ZVJlc3VsdFxuICAgIH1cbiAgICByZXR1cm4gZnJvbShQcm9taXNlLnJlc29sdmUoY2FuQWN0aXZhdGVSZXN1bHQpKVxuICB9XG59XG4iXX0=
@@ -0,0 +1,17 @@
1
+ import { InitializeModuleGuard } from '../services/initialize-module-guard.service';
2
+ export function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
3
+ return routes.map((r) => {
4
+ if (r.redirectTo) {
5
+ return r;
6
+ }
7
+ const route = {
8
+ canActivate: [],
9
+ ...r,
10
+ };
11
+ if (!route.canActivate.includes(initializeModuleGuard)) {
12
+ route.canActivate.push(initializeModuleGuard);
13
+ }
14
+ return route;
15
+ });
16
+ }
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkLWluaXRpYWxpemUtbW9kdWxlLWd1YXJkLnV0aWxzLmpzIiwic291c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R3VhcmQoXG4gIHJvdXRlczogUm91dGVbXSxcbiAgaW5pdGlhbGl6ZU1vZHVsZUd1YXJkOiB0eXBlb2YgSW5pdGlhbGl6ZU1vZHVsZUd1YXJkIHwgQ2FuQWN0aXZhdGVGbiA9IEluaXRpYWxpemVNb2R1bGVHdWFyZFxuKTogUm91dGVbXSB7XG4gIHJldHVybiByb3V0ZXMubWFwKChyKSA9PiB7XG4gICAgaWYgKHIucmVkaXJlY3RUbykge1xuICAgICAgcmV0dXJuIHJcbiAgICB9XG4gICAgY29uc3Qgcm91dGUgPSB7XG4gICAgICBjYW5BY3RpdmF0ZTogW10sXG4gICAgICAuLi5yLFxuICAgIH1cbiAgICBpZiAoIXJvdXRlLmNhbkFjdGl2YXRlLmluY2x1ZGVzKGluaXRpYWxpemVNb2R1bGVHdWFyZCkpIHtcbiAgICAgIHJvdXRlLmNhbkFjdGl2YXRlLnB1c2goaW5pdGlhbGl6ZU1vZHVsZUd1YXJkKVxuICAgIH1cbiAgICByZXR1cm4gcm91dGVcbiAgfSlcbn0iXX0=
@@ -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 { __awaiter } from 'tslib';
5
- import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, mergeMap, from } from 'rxjs';
5
+ import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, mergeMap, from, zip, tap, isObservable } from 'rxjs';
6
6
  import * as i1 from '@angular/common/http';
7
7
  import * as i1$1 from '@ngx-translate/core';
8
8
 
@@ -49,6 +49,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
49
49
  }] });
50
50
 
51
51
  const APP_CONFIG = new InjectionToken('APP_CONFIG');
52
+ /**
53
+ * @deprecated
54
+ * Please do not inject the auth service at all.
55
+ * There are better ways to achieve what you want. Please use permission service or user service.
56
+ */
52
57
  const AUTH_SERVICE = new InjectionToken('AUTH_SERVICE');
53
58
  const SANITY_CHECK = new InjectionToken('OCXSANITY_CHECK');
54
59
  const APPLICATION_NAME = new InjectionToken('APPLICATION_NAME');
@@ -335,11 +340,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
335
340
  args: [{ providedIn: 'root' }]
336
341
  }] });
337
342
 
343
+ class InitializeModuleGuard {
344
+ constructor(translateService, configService, appStateService, userService) {
345
+ this.translateService = translateService;
346
+ this.configService = configService;
347
+ this.appStateService = appStateService;
348
+ this.userService = userService;
349
+ this.SUPPORTED_LANGS = ['en', 'de'];
350
+ this.DEFAULT_LANG = 'en';
351
+ }
352
+ canActivate(_route, _state) {
353
+ console.time('InitializeModuleGuard');
354
+ return zip([
355
+ this.loadTranslations(),
356
+ from(this.configService.isInitialized),
357
+ from(this.userService.isInitialized),
358
+ from(this.appStateService.currentWorkspace$.isInitialized),
359
+ ]).pipe(tap(() => {
360
+ console.timeEnd('InitializeModuleGuard');
361
+ }), map(() => true));
362
+ }
363
+ getBestMatchLanguage(lang) {
364
+ if (this.SUPPORTED_LANGS.includes(lang)) {
365
+ return lang;
366
+ }
367
+ else {
368
+ console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
369
+ }
370
+ return this.DEFAULT_LANG;
371
+ }
372
+ loadTranslations() {
373
+ return this.userService.lang$.pipe(filter((v) => v !== undefined), mergeMap((lang) => {
374
+ const bestMatchLang = this.getBestMatchLanguage(lang);
375
+ return this.translateService.use(bestMatchLang);
376
+ }), mergeMap(() => of(true)));
377
+ }
378
+ toObservable(canActivateResult) {
379
+ if (isObservable(canActivateResult)) {
380
+ return canActivateResult;
381
+ }
382
+ return from(Promise.resolve(canActivateResult));
383
+ }
384
+ }
385
+ 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 });
386
+ InitializeModuleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' });
387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, decorators: [{
388
+ type: Injectable,
389
+ args: [{ providedIn: 'any' }]
390
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
391
+
392
+ function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
393
+ return routes.map((r) => {
394
+ if (r.redirectTo) {
395
+ return r;
396
+ }
397
+ const route = Object.assign({ canActivate: [] }, r);
398
+ if (!route.canActivate.includes(initializeModuleGuard)) {
399
+ route.canActivate.push(initializeModuleGuard);
400
+ }
401
+ return route;
402
+ });
403
+ }
404
+
338
405
  // services
339
406
 
340
407
  /**
341
408
  * Generated bundle index. Do not edit.
342
409
  */
343
410
 
344
- export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService };
411
+ export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, addInitializeModuleGuard };
345
412
  //# 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-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/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\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}\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 } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { combineLatest, 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 {\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 ]).subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\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","// 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'\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\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"],"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;KAW9C;AAxBC;;AAEG;AACH,IAAA,IAAI,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAA;KAC9B;IACD,IAAI,cAAc,CAAC,KAA4B,EAAA;A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cADV,MAAM,EAAA,CAAA,CAAA;4FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACHlC;;ACAA;;AAEG;;;;"}
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/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}\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 } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { combineLatest, 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 {\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 ]).subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\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 { 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'\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"],"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;KAW9C;AAxBC;;AAEG;AACH,IAAA,IAAI,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAA;KAC9B;IACD,IAAI,cAAc,CAAC,KAA4B,EAAA;AAC7C,QAAA,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAA;KAC/B;IAOD,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;AAC3B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;AAC7B,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAA;AAC1B,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;AAC3B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;AAC7B,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAA;AAChC,QAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAA;KAChC;;6GAnCU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EA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AA;AAC9C,SAAA;AACD,QAAA,OAAO,KAAK,CAAA;AACd,KAAC,CAAC,CAAA;AACJ;;ACpBA;;ACAA;;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 } from 'rxjs';
5
+ import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, mergeMap, from, zip, tap, isObservable } from 'rxjs';
6
6
  import * as i1$1 from '@ngx-translate/core';
7
7
 
8
8
  class AppStateService {
@@ -48,6 +48,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
48
48
  }] });
49
49
 
50
50
  const APP_CONFIG = new InjectionToken('APP_CONFIG');
51
+ /**
52
+ * @deprecated
53
+ * Please do not inject the auth service at all.
54
+ * There are better ways to achieve what you want. Please use permission service or user service.
55
+ */
51
56
  const AUTH_SERVICE = new InjectionToken('AUTH_SERVICE');
52
57
  const SANITY_CHECK = new InjectionToken('OCXSANITY_CHECK');
53
58
  const APPLICATION_NAME = new InjectionToken('APPLICATION_NAME');
@@ -328,11 +333,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
328
333
  args: [{ providedIn: 'root' }]
329
334
  }] });
330
335
 
336
+ class InitializeModuleGuard {
337
+ constructor(translateService, configService, appStateService, userService) {
338
+ this.translateService = translateService;
339
+ this.configService = configService;
340
+ this.appStateService = appStateService;
341
+ this.userService = userService;
342
+ this.SUPPORTED_LANGS = ['en', 'de'];
343
+ this.DEFAULT_LANG = 'en';
344
+ }
345
+ canActivate(_route, _state) {
346
+ console.time('InitializeModuleGuard');
347
+ return zip([
348
+ this.loadTranslations(),
349
+ from(this.configService.isInitialized),
350
+ from(this.userService.isInitialized),
351
+ from(this.appStateService.currentWorkspace$.isInitialized),
352
+ ]).pipe(tap(() => {
353
+ console.timeEnd('InitializeModuleGuard');
354
+ }), map(() => true));
355
+ }
356
+ getBestMatchLanguage(lang) {
357
+ if (this.SUPPORTED_LANGS.includes(lang)) {
358
+ return lang;
359
+ }
360
+ else {
361
+ console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
362
+ }
363
+ return this.DEFAULT_LANG;
364
+ }
365
+ loadTranslations() {
366
+ return this.userService.lang$.pipe(filter((v) => v !== undefined), mergeMap((lang) => {
367
+ const bestMatchLang = this.getBestMatchLanguage(lang);
368
+ return this.translateService.use(bestMatchLang);
369
+ }), mergeMap(() => of(true)));
370
+ }
371
+ toObservable(canActivateResult) {
372
+ if (isObservable(canActivateResult)) {
373
+ return canActivateResult;
374
+ }
375
+ return from(Promise.resolve(canActivateResult));
376
+ }
377
+ }
378
+ 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 });
379
+ InitializeModuleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' });
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, decorators: [{
381
+ type: Injectable,
382
+ args: [{ providedIn: 'any' }]
383
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
384
+
385
+ function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
386
+ return routes.map((r) => {
387
+ if (r.redirectTo) {
388
+ return r;
389
+ }
390
+ const route = {
391
+ canActivate: [],
392
+ ...r,
393
+ };
394
+ if (!route.canActivate.includes(initializeModuleGuard)) {
395
+ route.canActivate.push(initializeModuleGuard);
396
+ }
397
+ return route;
398
+ });
399
+ }
400
+
331
401
  // services
332
402
 
333
403
  /**
334
404
  * Generated bundle index. Do not edit.
335
405
  */
336
406
 
337
- export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService };
407
+ export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, addInitializeModuleGuard };
338
408
  //# 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-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/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\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}\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 } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { combineLatest, 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 {\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 ]).subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\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","// 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'\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\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"],"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,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAA;KAC9B;IACD,IAAI,cAAc,CAAC,KAA4B,EAAA;AAC7C,QAAA,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAA;KAC/B;IAOD,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;AAC3B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;AAC7B,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAA;AAC1B,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA;AAC3B,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;AAC7B,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAA;AAChC,QAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAA;KAChC;;6GAnCU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA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EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,YAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA,CAAA;4FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;MCLrB,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,qBAAqB,EAAE,CAAA;AAKhD,KAAA;IAHC,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAA;KACjC;;qHALU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;4FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACHlC;;ACAA;;AAEG;;;;"}
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/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}\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 } from '@angular/core'\nimport { TranslateService } from '@ngx-translate/core'\nimport { combineLatest, 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 {\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 ]).subscribe(([summaryTranslation, detailTranslation]: string[]) => {\n this.message$.publish({\n ...msg,\n severity: severity,\n summary: summaryTranslation,\n detail: detailTranslation,\n })\n })\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 { 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'\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"],"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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AA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAF,IAAA,CAAA,gBAAA,EAAA,EAAA,EAAA,KAAA,EAAAG,oBAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,eAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,qBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,KAAK,EAAA,CAAA,CAAA;4FAClB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;;;SCLjB,wBAAwB,CACtC,MAAe,EACf,wBAAsE,qBAAqB,EAAA;AAE3F,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;QACtB,IAAI,CAAC,CAAC,UAAU,EAAE;AAChB,YAAA,OAAO,CAAC,CAAA;AACT,SAAA;AACD,QAAA,MAAM,KAAK,GAAG;AACZ,YAAA,WAAW,EAAE,EAAE;AACf,YAAA,GAAG,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;AAC9C,SAAA;AACD,QAAA,OAAO,KAAK,CAAA;AACd,KAAC,CAAC,CAAA;AACJ;;ACpBA;;ACAA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -4,7 +4,9 @@ export * from './lib/services/user.service';
4
4
  export * from './lib/services/portal-message.service';
5
5
  export * from './lib/services/theme.service';
6
6
  export * from './lib/services/remote-components.service';
7
+ export * from './lib/services/initialize-module-guard.service';
7
8
  export * from './lib/model/config-key.model';
8
9
  export * from './lib/api/iauth.service';
9
10
  export * from './lib/api/injection-tokens';
11
+ export * from './lib/utils/add-initialize-module-guard.utils';
10
12
  export { MfeInfo, Theme } from '@onecx/integration-interface';
@@ -13,6 +13,11 @@ export interface LibConfig {
13
13
  remoteConfigURL: string;
14
14
  }
15
15
  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
+ */
16
21
  export declare const AUTH_SERVICE: InjectionToken<IAuthService>;
17
22
  export declare const SANITY_CHECK: InjectionToken<string>;
18
23
  export declare const APPLICATION_NAME: InjectionToken<string>;
@@ -0,0 +1,22 @@
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
+ constructor(translateService: TranslateService, configService: ConfigurationService, appStateService: AppStateService, userService: UserService);
16
+ canActivate(_route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
17
+ getBestMatchLanguage(lang: string): string;
18
+ loadTranslations(): Observable<boolean>;
19
+ protected toObservable(canActivateResult: Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree): Observable<boolean | UrlTree>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<InitializeModuleGuard, never>;
21
+ static ɵprov: i0.ɵɵInjectableDeclaration<InitializeModuleGuard>;
22
+ }
@@ -0,0 +1,3 @@
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[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onecx/angular-integration-interface",
3
- "version": "4.23.0",
3
+ "version": "4.23.2",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^15.2.7",
6
6
  "@onecx/integration-interface": "^4",