@onecx/angular-integration-interface 4.43.1 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +11 -19
  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
@@ -1,533 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, InjectionToken, Optional, Inject } from '@angular/core';
3
- import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentPageTopic, CurrentWorkspaceTopic, IsAuthenticatedTopic, ConfigurationTopic, UserProfileTopic, PermissionsTopic, MessageTopic, CurrentThemeTopic, RemoteComponentsTopic } from '@onecx/integration-interface';
4
- import { __awaiter } from 'tslib';
5
- import { firstValueFrom, BehaviorSubject, map, skip, filter, combineLatest, of, mergeMap, from, zip, tap, isObservable } from 'rxjs';
6
- import * as i1 from '@angular/common/http';
7
- import * as i1$1 from '@ngx-translate/core';
8
- import { Location } from '@angular/common';
9
-
10
- class AppStateService {
11
- constructor() {
12
- this.globalError$ = new GlobalErrorTopic();
13
- this.globalLoading$ = new GlobalLoadingTopic();
14
- this.currentMfe$ = new CurrentMfeTopic();
15
- /**
16
- * This topic will only fire when pageInfo.path matches document.location.pathname,
17
- * if not it will fire undefined.
18
- */
19
- this.currentPage$ = new CurrentPageTopic();
20
- this.currentWorkspace$ = new CurrentWorkspaceTopic();
21
- /**
22
- * This Topic is initialized as soon as the authentication is done
23
- */
24
- this.isAuthenticated$ = new IsAuthenticatedTopic();
25
- }
26
- /**
27
- * @deprecated Will be replaced by currentWorkspace$
28
- */
29
- get currentPortal$() {
30
- return this.currentWorkspace$;
31
- }
32
- set currentPortal$(value) {
33
- this.currentWorkspace$ = value;
34
- }
35
- ngOnDestroy() {
36
- this.globalError$.destroy();
37
- this.globalLoading$.destroy();
38
- this.currentMfe$.destroy();
39
- this.currentPage$.destroy();
40
- this.currentPortal$.destroy();
41
- this.currentWorkspace$.destroy();
42
- this.isAuthenticated$.destroy();
43
- }
44
- }
45
- AppStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
46
- AppStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, providedIn: 'root' });
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateService, decorators: [{
48
- type: Injectable,
49
- args: [{ providedIn: 'root' }]
50
- }] });
51
-
52
- const APP_CONFIG = new InjectionToken('APP_CONFIG');
53
- /**
54
- * @deprecated
55
- * Please do not inject the auth service at all.
56
- * There are better ways to achieve what you want. Please use permission service or user service.
57
- */
58
- const AUTH_SERVICE = new InjectionToken('AUTH_SERVICE');
59
- const SANITY_CHECK = new InjectionToken('OCXSANITY_CHECK');
60
- const APPLICATION_NAME = new InjectionToken('APPLICATION_NAME');
61
-
62
- var CONFIG_KEY;
63
- (function (CONFIG_KEY) {
64
- CONFIG_KEY["TKIT_PORTAL_DEFAULT_THEME"] = "TKIT_PORTAL_DEFAULT_THEME";
65
- CONFIG_KEY["TKIT_PORTAL_DISABLE_THEME_MANAGEMENT"] = "TKIT_PORTAL_DISABLE_THEME_MANAGEMENT";
66
- CONFIG_KEY["TKIT_PORTAL_THEME_SERVER_URL"] = "TKIT_PORTAL_THEME_SERVER_URL";
67
- CONFIG_KEY["TKIT_TOKEN_ROLE_CLAIM_NAME"] = "TKIT_TOKEN_ROLE_CLAIM_NAME";
68
- CONFIG_KEY["TKIT_PORTAL_ID"] = "TKIT_PORTAL_ID";
69
- CONFIG_KEY["TKIT_SUPPORTED_LANGUAGES"] = "TKIT_SUPPORTED_LANGUAGES";
70
- CONFIG_KEY["TKIT_SEARCH_BASE_URL"] = "TKIT_SEARCH_BASE_URL";
71
- CONFIG_KEY["APP_BASE_HREF"] = "APP_BASE_HREF";
72
- CONFIG_KEY["KEYCLOAK_REALM"] = "KEYCLOAK_REALM";
73
- CONFIG_KEY["KEYCLOAK_ENABLE_SILENT_SSO"] = "KEYCLOAK_ENABLE_SILENT_SSO";
74
- CONFIG_KEY["KEYCLOAK_URL"] = "KEYCLOAK_URL";
75
- CONFIG_KEY["KEYCLOAK_CLIENT_ID"] = "KEYCLOAK_CLIENT_ID";
76
- CONFIG_KEY["ONECX_PORTAL_FAVORITES_DISABLED"] = "ONECX_PORTAL_FAVORITES_DISABLED";
77
- CONFIG_KEY["ONECX_PORTAL_FEEDBACK_DISABLED"] = "ONECX_PORTAL_FEEDBACK_DISABLED";
78
- CONFIG_KEY["ONECX_PORTAL_SEARCH_DISABLED"] = "ONECX_PORTAL_SEARCH_DISABLED";
79
- CONFIG_KEY["ONECX_PORTAL_SUPPORT_TICKET_DISABLED"] = "ONECX_PORTAL_SUPPORT_TICKET_DISABLED";
80
- CONFIG_KEY["ONECX_PORTAL_ANNOUNCEMENTS_DISABLED"] = "ONECX_PORTAL_ANNOUNCEMENTS_DISABLED";
81
- CONFIG_KEY["ONECX_PORTAL_PASSWORD_CHANGE_DISABLED"] = "ONECX_PORTAL_PASSWORD_CHANGE_DISABLED";
82
- CONFIG_KEY["ONECX_PORTAL_SETTINGS_DISABLED"] = "ONECX_PORTAL_SETTINGS_DISABLED";
83
- CONFIG_KEY["ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED"] = "ONECX_PORTAL_MY_ROLES_PERMISSIONS_DISABLED";
84
- CONFIG_KEY["ONECX_PORTAL_HELP_DISABLED"] = "ONECX_PORTAL_HELP_DISABLED";
85
- CONFIG_KEY["APP_VERSION"] = "APP_VERSION";
86
- CONFIG_KEY["IS_SHELL"] = "IS_SHELL";
87
- CONFIG_KEY["AUTH_SERVICE"] = "AUTH_SERVICE";
88
- CONFIG_KEY["AUTH_SERVICE_CUSTOM_URL"] = "AUTH_SERVICE_CUSTOM_URL";
89
- CONFIG_KEY["AUTH_SERVICE_CUSTOM_MODULE_NAME"] = "AUTH_SERVICE_CUSTOM_MODULE_NAME";
90
- })(CONFIG_KEY || (CONFIG_KEY = {}));
91
-
92
- class ConfigurationService {
93
- constructor(http, defaultConfig) {
94
- this.http = http;
95
- this.defaultConfig = defaultConfig;
96
- this.config$ = new ConfigurationTopic();
97
- }
98
- ngOnDestroy() {
99
- this.config$.destroy();
100
- }
101
- init() {
102
- return new Promise((resolve, reject) => {
103
- const skipRemoteConfigLoad = this.defaultConfig && this.defaultConfig['skipRemoteConfigLoad'];
104
- let loadConfigPromise;
105
- const inlinedConfig = window['APP_CONFIG'];
106
- if (inlinedConfig) {
107
- console.log(`ENV resolved from injected config`);
108
- loadConfigPromise = Promise.resolve(inlinedConfig);
109
- }
110
- else {
111
- if (skipRemoteConfigLoad) {
112
- console.log('📢 TKA001: Remote config load is disabled. To enable it, remove the "skipRemoteConfigLoad" key in your environment.json');
113
- loadConfigPromise = Promise.resolve(this.defaultConfig || {});
114
- }
115
- else {
116
- loadConfigPromise = firstValueFrom(this.http.get((this.defaultConfig && this.defaultConfig['remoteConfigURL']) || 'assets/env.json'));
117
- }
118
- }
119
- loadConfigPromise
120
- .then((config) => __awaiter(this, void 0, void 0, function* () {
121
- if (config) {
122
- yield this.config$.publish(Object.assign(Object.assign({}, this.defaultConfig), config)).then(() => {
123
- resolve(true);
124
- });
125
- }
126
- }))
127
- .catch((e) => {
128
- console.log(`Failed to load env configuration`);
129
- reject(e);
130
- });
131
- });
132
- }
133
- get isInitialized() {
134
- return this.config$.isInitialized;
135
- }
136
- getProperty(key) {
137
- var _a;
138
- if (!Object.values(CONFIG_KEY).includes(key)) {
139
- console.error('Invalid config key ', key);
140
- }
141
- return (_a = this.config$.getValue()) === null || _a === void 0 ? void 0 : _a[key];
142
- }
143
- setProperty(key, val) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- const currentValues = yield firstValueFrom(this.config$.asObservable());
146
- currentValues[key] = val;
147
- yield this.config$.publish(currentValues);
148
- });
149
- }
150
- getConfig() {
151
- return this.config$.getValue();
152
- }
153
- }
154
- 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 });
155
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ConfigurationService, decorators: [{
157
- type: Injectable,
158
- args: [{ providedIn: 'root' }]
159
- }], ctorParameters: function () {
160
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
161
- type: Optional
162
- }, {
163
- type: Inject,
164
- args: [APP_CONFIG]
165
- }] }];
166
- } });
167
-
168
- const API_PREFIX = 'portal-api';
169
- const DEFAULT_LANG = 'en';
170
-
171
- class UserService {
172
- constructor() {
173
- var _a;
174
- this.profile$ = new UserProfileTopic();
175
- this.permissions$ = new BehaviorSubject([]);
176
- this.lang$ = new BehaviorSubject((_a = this.determineLanguage()) !== null && _a !== void 0 ? _a : DEFAULT_LANG);
177
- this.permissionsTopic$ = new PermissionsTopic();
178
- this.profile$
179
- .pipe(map((profile) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = profile.accountSettings) === null || _a === void 0 ? void 0 : _a.localeAndTimeSettings) === null || _b === void 0 ? void 0 : _b.locale) !== null && _c !== void 0 ? _c : this.determineLanguage()) !== null && _d !== void 0 ? _d : DEFAULT_LANG; }))
180
- .subscribe(this.lang$);
181
- this.oldStylePermissionsInitialized = firstValueFrom(this.permissions$.pipe(skip(1)));
182
- this.profile$
183
- .pipe(map((profile) => this.extractPermissions(profile)), filter((permissions) => !!permissions))
184
- .subscribe(this.permissions$);
185
- }
186
- ngOnDestroy() {
187
- this.profile$.destroy();
188
- }
189
- hasPermission(permissionKey) {
190
- var _a, _b;
191
- const oldConceptResult = this.permissions$.getValue()
192
- ? (_a = this.permissions$.getValue()) === null || _a === void 0 ? void 0 : _a.includes(permissionKey)
193
- : false;
194
- const result = this.permissionsTopic$.getValue()
195
- ? (_b = this.permissionsTopic$.getValue()) === null || _b === void 0 ? void 0 : _b.includes(permissionKey)
196
- : oldConceptResult;
197
- if (!result) {
198
- console.log(`👮‍♀️ No permission for: ${permissionKey}`);
199
- }
200
- return !!result;
201
- }
202
- determineLanguage() {
203
- if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {
204
- return undefined;
205
- }
206
- let browserLang = window.navigator.languages ? window.navigator.languages[0] : null;
207
- browserLang = browserLang || window.navigator.language;
208
- if (typeof browserLang === 'undefined') {
209
- return undefined;
210
- }
211
- if (browserLang.indexOf('-') !== -1) {
212
- browserLang = browserLang.split('-')[0];
213
- }
214
- if (browserLang.indexOf('_') !== -1) {
215
- browserLang = browserLang.split('_')[0];
216
- }
217
- return browserLang;
218
- }
219
- extractPermissions(userProfile) {
220
- if (userProfile) {
221
- if (userProfile.memberships) {
222
- const permissions = [];
223
- userProfile.memberships.forEach((m) => {
224
- var _a;
225
- (_a = m.roleMemberships) === null || _a === void 0 ? void 0 : _a.forEach((r) => {
226
- var _a;
227
- (_a = r.permissions) === null || _a === void 0 ? void 0 : _a.forEach((p) => {
228
- if (p) {
229
- if (p.key !== undefined) {
230
- permissions.push(p.key);
231
- }
232
- }
233
- });
234
- });
235
- });
236
- return permissions;
237
- }
238
- }
239
- return null;
240
- }
241
- get isInitialized() {
242
- return Promise.all([
243
- Promise.race([this.permissionsTopic$.isInitialized, this.oldStylePermissionsInitialized]),
244
- this.profile$.isInitialized,
245
- // eslint-disable-next-line @typescript-eslint/no-empty-function
246
- ]).then(() => { });
247
- }
248
- }
249
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
250
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, providedIn: 'root' });
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
252
- type: Injectable,
253
- args: [{ providedIn: 'root' }]
254
- }], ctorParameters: function () { return []; } });
255
-
256
- class PortalMessageService {
257
- constructor(translateService) {
258
- this.translateService = translateService;
259
- this.message$ = new MessageTopic();
260
- }
261
- success(msg) {
262
- this.addTranslated('success', msg);
263
- }
264
- info(msg) {
265
- this.addTranslated('info', msg);
266
- }
267
- error(msg) {
268
- this.addTranslated('error', msg);
269
- }
270
- warning(msg) {
271
- this.addTranslated('warning', msg);
272
- }
273
- addTranslated(severity, msg) {
274
- combineLatest([
275
- msg.summaryKey ? this.translateService.get(msg.summaryKey || '', msg.summaryParameters) : of(undefined),
276
- msg.detailKey ? this.translateService.get(msg.detailKey, msg.detailParameters) : of(undefined),
277
- ]).subscribe(([summaryTranslation, detailTranslation]) => {
278
- this.message$.publish(Object.assign(Object.assign({}, msg), { severity: severity, summary: summaryTranslation, detail: detailTranslation }));
279
- });
280
- }
281
- }
282
- 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 });
283
- PortalMessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, providedIn: 'any' });
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PortalMessageService, decorators: [{
285
- type: Injectable,
286
- args: [{ providedIn: 'any' }]
287
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
288
-
289
- const defaultThemeServerUrl = 'http://portal-theme-management:8080';
290
- class ThemeService {
291
- constructor(configService, http) {
292
- this.configService = configService;
293
- this.http = http;
294
- this.baseUrlV1 = './portal-api';
295
- this.currentTheme$ = new CurrentThemeTopic();
296
- }
297
- getThemeHref(themeId) {
298
- const themeServerUrl = this.configService.getProperty(CONFIG_KEY.TKIT_PORTAL_THEME_SERVER_URL) || defaultThemeServerUrl;
299
- return `${themeServerUrl}/themes/${themeId}/${themeId}.min.css`;
300
- }
301
- loadAndApplyTheme(themeName) {
302
- return this.http.get(`${this.baseUrlV1}/internal/themes/${encodeURI(themeName)}`).pipe(mergeMap((theme) => {
303
- return from(this.apply(theme)).pipe(map(() => theme));
304
- }));
305
- }
306
- apply(theme) {
307
- return __awaiter(this, void 0, void 0, function* () {
308
- console.log(`🎨 Applying theme: ${theme.name}`);
309
- yield this.currentTheme$.publish(theme);
310
- if (theme.properties) {
311
- Object.values(theme.properties).forEach((group) => {
312
- for (const [key, value] of Object.entries(group)) {
313
- document.documentElement.style.setProperty(`--${key}`, value);
314
- }
315
- });
316
- }
317
- });
318
- }
319
- ngOnDestroy() {
320
- this.currentTheme$.destroy();
321
- }
322
- }
323
- 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 });
324
- ThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, providedIn: 'root' });
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, decorators: [{
326
- type: Injectable,
327
- args: [{ providedIn: 'root' }]
328
- }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: i1.HttpClient }]; } });
329
-
330
- class RemoteComponentsService {
331
- constructor() {
332
- this.remoteComponents$ = new RemoteComponentsTopic();
333
- }
334
- ngOnDestroy() {
335
- this.remoteComponents$.destroy();
336
- }
337
- }
338
- RemoteComponentsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
339
- RemoteComponentsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' });
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoteComponentsService, decorators: [{
341
- type: Injectable,
342
- args: [{ providedIn: 'root' }]
343
- }] });
344
-
345
- class InitializeModuleGuard {
346
- constructor(translateService, configService, appStateService, userService) {
347
- this.translateService = translateService;
348
- this.configService = configService;
349
- this.appStateService = appStateService;
350
- this.userService = userService;
351
- this.SUPPORTED_LANGS = ['en', 'de'];
352
- this.DEFAULT_LANG = 'en';
353
- }
354
- canActivate(_route, _state) {
355
- console.time('InitializeModuleGuard');
356
- return zip([
357
- this.loadTranslations(),
358
- from(this.configService.isInitialized),
359
- from(this.userService.isInitialized),
360
- from(this.appStateService.currentWorkspace$.isInitialized),
361
- ]).pipe(tap(() => {
362
- console.timeEnd('InitializeModuleGuard');
363
- }), map(() => true));
364
- }
365
- getBestMatchLanguage(lang) {
366
- if (this.SUPPORTED_LANGS.includes(lang)) {
367
- return lang;
368
- }
369
- else {
370
- console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
371
- }
372
- return this.DEFAULT_LANG;
373
- }
374
- loadTranslations() {
375
- return this.userService.lang$.pipe(filter((v) => v !== undefined), mergeMap((lang) => {
376
- const bestMatchLang = this.getBestMatchLanguage(lang);
377
- return this.translateService.use(bestMatchLang);
378
- }), mergeMap(() => of(true)));
379
- }
380
- toObservable(canActivateResult) {
381
- if (isObservable(canActivateResult)) {
382
- return canActivateResult;
383
- }
384
- return from(Promise.resolve(canActivateResult));
385
- }
386
- }
387
- 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 });
388
- InitializeModuleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, providedIn: 'any' });
389
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InitializeModuleGuard, decorators: [{
390
- type: Injectable,
391
- args: [{ providedIn: 'any' }]
392
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
393
-
394
- class WorkspaceService {
395
- constructor(appStateService) {
396
- this.appStateService = appStateService;
397
- this.aliasStart = '[[';
398
- this.aliasEnd = ']]';
399
- this.paramStart = '{';
400
- this.paramEnd = '}';
401
- }
402
- getUrl(appId, productName, endpointName, params = {}) {
403
- return this.appStateService.currentWorkspace$.pipe(map((workspace) => {
404
- const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, params);
405
- return finalUrl;
406
- }));
407
- }
408
- constructBaseUrlFromWorkspace(workspace) {
409
- if (workspace.baseUrl === undefined) {
410
- console.log('WARNING: There was no baseUrl for received workspace.');
411
- return '';
412
- }
413
- return workspace.baseUrl;
414
- }
415
- constructRouteUrl(workspace, appId, productName, endpointName, params) {
416
- const route = this.filterRouteFromList(workspace.routes, appId, productName);
417
- let url = this.constructBaseUrlFromWorkspace(workspace);
418
- if (!route) {
419
- console.log(`WARNING: No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
420
- return url;
421
- }
422
- if (route.baseUrl !== undefined && route.baseUrl.length > 0) {
423
- url = route.baseUrl;
424
- }
425
- url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, params));
426
- return url;
427
- }
428
- constructEndpointUrl(route, endpointName, params) {
429
- if (!route.endpoints) {
430
- return '';
431
- }
432
- const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints);
433
- if (!finalEndpoint || finalEndpoint.path === undefined) {
434
- console.log('WARNING: No endpoint or endpoint.path could be found');
435
- return '';
436
- }
437
- const paramsFilled = this.fillParamsForPath(finalEndpoint.path, params);
438
- if (paramsFilled === undefined) {
439
- console.log('WARNING: Params could not be filled correctly');
440
- return '';
441
- }
442
- return paramsFilled;
443
- }
444
- filterRouteFromList(routes, appId, productName) {
445
- if (!routes) {
446
- return undefined;
447
- }
448
- const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName);
449
- if (productRoutes.length === 0) {
450
- return undefined;
451
- }
452
- if (productRoutes.length > 1) {
453
- console.log('WARNING: There were more than one route. First route has been used.');
454
- }
455
- return productRoutes[0];
456
- }
457
- dissolveEndpoint(endpointName, endpoints) {
458
- var _a;
459
- let endpoint = endpoints.find((ep) => ep.name === endpointName);
460
- if (!endpoint) {
461
- return undefined;
462
- }
463
- while ((_a = endpoint.path) === null || _a === void 0 ? void 0 : _a.includes(this.aliasStart)) {
464
- const path = endpoint.path;
465
- const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length;
466
- const endIdx = path.lastIndexOf(this.aliasEnd);
467
- if (endIdx <= startIdx) {
468
- return undefined;
469
- }
470
- const aliasName = path.substring(startIdx, endIdx);
471
- endpoint = endpoints.find((ep) => ep.name === aliasName);
472
- if (!endpoint) {
473
- return undefined;
474
- }
475
- }
476
- return endpoint;
477
- }
478
- fillParamsForPath(path, params) {
479
- while (path.includes(this.paramStart)) {
480
- const paramName = path.substring(path.indexOf(this.paramStart) + this.paramStart.length, path.indexOf(this.paramEnd));
481
- const paramValue = this.getStringFromUnknown(params[paramName]);
482
- if (paramValue != undefined && paramValue.length > 0) {
483
- path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue);
484
- }
485
- else {
486
- console.log(`WARNING: Searched param "${paramName}" was not found in given param list `);
487
- return '';
488
- }
489
- }
490
- return path;
491
- }
492
- getStringFromUnknown(value) {
493
- if (value === null || value === undefined) {
494
- return '';
495
- }
496
- else if (typeof value === 'string') {
497
- return value;
498
- }
499
- else {
500
- return String(value);
501
- }
502
- }
503
- }
504
- WorkspaceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, deps: [{ token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable });
505
- WorkspaceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, providedIn: 'root' });
506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, decorators: [{
507
- type: Injectable,
508
- args: [{
509
- providedIn: 'root',
510
- }]
511
- }], ctorParameters: function () { return [{ type: AppStateService }]; } });
512
-
513
- function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
514
- return routes.map((r) => {
515
- if (r.redirectTo) {
516
- return r;
517
- }
518
- const route = Object.assign({ canActivate: [] }, r);
519
- if (!route.canActivate.includes(initializeModuleGuard)) {
520
- route.canActivate.push(initializeModuleGuard);
521
- }
522
- return route;
523
- });
524
- }
525
-
526
- // services
527
-
528
- /**
529
- * Generated bundle index. Do not edit.
530
- */
531
-
532
- export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, WorkspaceService, addInitializeModuleGuard };
533
- //# sourceMappingURL=onecx-angular-integration-interface.mjs.map
@@ -1 +0,0 @@
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 } 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 { 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,IAA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