@onecx/angular-integration-interface 4.42.1 → 4.43.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2020/index.mjs +2 -1
- package/esm2020/lib/services/workspace.service.mjs +124 -0
- package/fesm2015/onecx-angular-integration-interface.mjs +121 -1
- package/fesm2015/onecx-angular-integration-interface.mjs.map +1 -1
- package/fesm2020/onecx-angular-integration-interface.mjs +120 -1
- package/fesm2020/onecx-angular-integration-interface.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/services/workspace.service.d.ts +21 -0
- package/package.json +1 -1
package/esm2020/index.mjs
CHANGED
@@ -6,6 +6,7 @@ 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
8
|
export * from './lib/services/initialize-module-guard.service';
|
9
|
+
export * from './lib/services/workspace.service';
|
9
10
|
// models
|
10
11
|
export * from './lib/model/config-key.model';
|
11
12
|
// core
|
@@ -13,4 +14,4 @@ export * from './lib/api/iauth.service';
|
|
13
14
|
export * from './lib/api/injection-tokens';
|
14
15
|
// utils
|
15
16
|
export * from './lib/utils/add-initialize-module-guard.utils';
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXO0FBQ1gsY0FBYyxrQ0FBa0MsQ0FBQTtBQUNoRCxjQUFjLHNDQUFzQyxDQUFBO0FBQ3BELGNBQWMsNkJBQTZCLENBQUE7QUFDM0MsY0FBYyx1Q0FBdUMsQ0FBQTtBQUNyRCxjQUFjLDhCQUE4QixDQUFBO0FBQzVDLGNBQWMsMENBQTBDLENBQUE7QUFDeE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4vbGliL3V0aWxzL2FkZC1pbml0aWFsaXplLW1vZHVsZS1ndWFyZC51dGlscydcblxuZXhwb3J0IHsgTWZlSW5mbywgVGhlbWUgfSBmcm9tICdAb25lY3gvaW50ZWdyYXRpb24taW50ZXJmYWNlJ1xuIl19
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { AppStateService } from './app-state.service';
|
3
|
+
import { map } from 'rxjs';
|
4
|
+
import { Location } from '@angular/common';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
import * as i1 from "./app-state.service";
|
7
|
+
export class WorkspaceService {
|
8
|
+
constructor(appStateService) {
|
9
|
+
this.appStateService = appStateService;
|
10
|
+
this.aliasStart = '[[';
|
11
|
+
this.aliasEnd = ']]';
|
12
|
+
this.paramStart = '{';
|
13
|
+
this.paramEnd = '}';
|
14
|
+
}
|
15
|
+
getUrl(appId, productName, endpointName, params = {}) {
|
16
|
+
return this.appStateService.currentWorkspace$.pipe(map((workspace) => {
|
17
|
+
const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, params);
|
18
|
+
return finalUrl;
|
19
|
+
}));
|
20
|
+
}
|
21
|
+
constructBaseUrlFromWorkspace(workspace) {
|
22
|
+
if (workspace.baseUrl === undefined) {
|
23
|
+
console.log('WARNING: There was no baseUrl for received workspace.');
|
24
|
+
return '';
|
25
|
+
}
|
26
|
+
return workspace.baseUrl;
|
27
|
+
}
|
28
|
+
constructRouteUrl(workspace, appId, productName, endpointName, params) {
|
29
|
+
const route = this.filterRouteFromList(workspace.routes, appId, productName);
|
30
|
+
let url = this.constructBaseUrlFromWorkspace(workspace);
|
31
|
+
if (!route) {
|
32
|
+
console.log(`WARNING: No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
|
33
|
+
return url;
|
34
|
+
}
|
35
|
+
if (route.baseUrl !== undefined && route.baseUrl.length > 0) {
|
36
|
+
url = route.baseUrl;
|
37
|
+
}
|
38
|
+
url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, params));
|
39
|
+
return url;
|
40
|
+
}
|
41
|
+
constructEndpointUrl(route, endpointName, params) {
|
42
|
+
if (!route.endpoints) {
|
43
|
+
return '';
|
44
|
+
}
|
45
|
+
const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints);
|
46
|
+
if (!finalEndpoint || finalEndpoint.path === undefined) {
|
47
|
+
console.log('WARNING: No endpoint or endpoint.path could be found');
|
48
|
+
return '';
|
49
|
+
}
|
50
|
+
const paramsFilled = this.fillParamsForPath(finalEndpoint.path, params);
|
51
|
+
if (paramsFilled === undefined) {
|
52
|
+
console.log('WARNING: Params could not be filled correctly');
|
53
|
+
return '';
|
54
|
+
}
|
55
|
+
return paramsFilled;
|
56
|
+
}
|
57
|
+
filterRouteFromList(routes, appId, productName) {
|
58
|
+
if (!routes) {
|
59
|
+
return undefined;
|
60
|
+
}
|
61
|
+
const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName);
|
62
|
+
if (productRoutes.length === 0) {
|
63
|
+
return undefined;
|
64
|
+
}
|
65
|
+
if (productRoutes.length > 1) {
|
66
|
+
console.log('WARNING: There were more than one route. First route has been used.');
|
67
|
+
}
|
68
|
+
return productRoutes[0];
|
69
|
+
}
|
70
|
+
dissolveEndpoint(endpointName, endpoints) {
|
71
|
+
let endpoint = endpoints.find((ep) => ep.name === endpointName);
|
72
|
+
if (!endpoint) {
|
73
|
+
return undefined;
|
74
|
+
}
|
75
|
+
while (endpoint.path?.includes(this.aliasStart)) {
|
76
|
+
const path = endpoint.path;
|
77
|
+
const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length;
|
78
|
+
const endIdx = path.lastIndexOf(this.aliasEnd);
|
79
|
+
if (endIdx <= startIdx) {
|
80
|
+
return undefined;
|
81
|
+
}
|
82
|
+
const aliasName = path.substring(startIdx, endIdx);
|
83
|
+
endpoint = endpoints.find((ep) => ep.name === aliasName);
|
84
|
+
if (!endpoint) {
|
85
|
+
return undefined;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
return endpoint;
|
89
|
+
}
|
90
|
+
fillParamsForPath(path, params) {
|
91
|
+
while (path.includes(this.paramStart)) {
|
92
|
+
const paramName = path.substring(path.indexOf(this.paramStart) + this.paramStart.length, path.indexOf(this.paramEnd));
|
93
|
+
const paramValue = this.getStringFromUnknown(params[paramName]);
|
94
|
+
if (paramValue != undefined && paramValue.length > 0) {
|
95
|
+
path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue);
|
96
|
+
}
|
97
|
+
else {
|
98
|
+
console.log(`WARNING: Searched param "${paramName}" was not found in given param list `);
|
99
|
+
return '';
|
100
|
+
}
|
101
|
+
}
|
102
|
+
return path;
|
103
|
+
}
|
104
|
+
getStringFromUnknown(value) {
|
105
|
+
if (value === null || value === undefined) {
|
106
|
+
return '';
|
107
|
+
}
|
108
|
+
else if (typeof value === 'string') {
|
109
|
+
return value;
|
110
|
+
}
|
111
|
+
else {
|
112
|
+
return String(value);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
WorkspaceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, deps: [{ token: i1.AppStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
117
|
+
WorkspaceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, providedIn: 'root' });
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, decorators: [{
|
119
|
+
type: Injectable,
|
120
|
+
args: [{
|
121
|
+
providedIn: 'root',
|
122
|
+
}]
|
123
|
+
}], ctorParameters: function () { return [{ type: i1.AppStateService }]; } });
|
124
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya3NwYWNlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIi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VVua25vd24odmFsdWU6IHVua25vd24pOiBzdHJpbmcge1xuICAgIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gJydcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgIHJldHVybiB2YWx1ZVxuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gU3RyaW5nKHZhbHVlKVxuICAgIH1cbiAgfVxufVxuIl19
|
@@ -5,6 +5,7 @@ import { __awaiter } from 'tslib';
|
|
5
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
|
+
import { Location } from '@angular/common';
|
8
9
|
|
9
10
|
class AppStateService {
|
10
11
|
constructor() {
|
@@ -390,6 +391,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
390
391
|
args: [{ providedIn: 'any' }]
|
391
392
|
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
|
392
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
|
+
|
393
513
|
function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
|
394
514
|
return routes.map((r) => {
|
395
515
|
if (r.redirectTo) {
|
@@ -409,5 +529,5 @@ function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModu
|
|
409
529
|
* Generated bundle index. Do not edit.
|
410
530
|
*/
|
411
531
|
|
412
|
-
export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, addInitializeModuleGuard };
|
532
|
+
export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, WorkspaceService, addInitializeModuleGuard };
|
413
533
|
//# 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/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 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 { 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,CAA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AAqB,EAAA,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;QACD,MAAM,KAAK,mBACT,WAAW,EAAE,EAAE,EACZ,EAAA,CAAC,CACL,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;;;;"}
|
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,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,CA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AAC,UAAU,EAAE;AAChB,YAAA,OAAO,CAAC,CAAA;AACT,SAAA;QACD,MAAM,KAAK,mBACT,WAAW,EAAE,EAAE,EACZ,EAAA,CAAC,CACL,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;;;;"}
|
@@ -4,6 +4,7 @@ import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentPageTopic
|
|
4
4
|
import * as i1 from '@angular/common/http';
|
5
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
|
+
import { Location } from '@angular/common';
|
7
8
|
|
8
9
|
class AppStateService {
|
9
10
|
constructor() {
|
@@ -383,6 +384,124 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
383
384
|
args: [{ providedIn: 'any' }]
|
384
385
|
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }, { type: ConfigurationService }, { type: AppStateService }, { type: UserService }]; } });
|
385
386
|
|
387
|
+
class WorkspaceService {
|
388
|
+
constructor(appStateService) {
|
389
|
+
this.appStateService = appStateService;
|
390
|
+
this.aliasStart = '[[';
|
391
|
+
this.aliasEnd = ']]';
|
392
|
+
this.paramStart = '{';
|
393
|
+
this.paramEnd = '}';
|
394
|
+
}
|
395
|
+
getUrl(appId, productName, endpointName, params = {}) {
|
396
|
+
return this.appStateService.currentWorkspace$.pipe(map((workspace) => {
|
397
|
+
const finalUrl = this.constructRouteUrl(workspace, appId, productName, endpointName, params);
|
398
|
+
return finalUrl;
|
399
|
+
}));
|
400
|
+
}
|
401
|
+
constructBaseUrlFromWorkspace(workspace) {
|
402
|
+
if (workspace.baseUrl === undefined) {
|
403
|
+
console.log('WARNING: There was no baseUrl for received workspace.');
|
404
|
+
return '';
|
405
|
+
}
|
406
|
+
return workspace.baseUrl;
|
407
|
+
}
|
408
|
+
constructRouteUrl(workspace, appId, productName, endpointName, params) {
|
409
|
+
const route = this.filterRouteFromList(workspace.routes, appId, productName);
|
410
|
+
let url = this.constructBaseUrlFromWorkspace(workspace);
|
411
|
+
if (!route) {
|
412
|
+
console.log(`WARNING: No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
|
413
|
+
return url;
|
414
|
+
}
|
415
|
+
if (route.baseUrl !== undefined && route.baseUrl.length > 0) {
|
416
|
+
url = route.baseUrl;
|
417
|
+
}
|
418
|
+
url = Location.joinWithSlash(url, this.constructEndpointUrl(route, endpointName, params));
|
419
|
+
return url;
|
420
|
+
}
|
421
|
+
constructEndpointUrl(route, endpointName, params) {
|
422
|
+
if (!route.endpoints) {
|
423
|
+
return '';
|
424
|
+
}
|
425
|
+
const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints);
|
426
|
+
if (!finalEndpoint || finalEndpoint.path === undefined) {
|
427
|
+
console.log('WARNING: No endpoint or endpoint.path could be found');
|
428
|
+
return '';
|
429
|
+
}
|
430
|
+
const paramsFilled = this.fillParamsForPath(finalEndpoint.path, params);
|
431
|
+
if (paramsFilled === undefined) {
|
432
|
+
console.log('WARNING: Params could not be filled correctly');
|
433
|
+
return '';
|
434
|
+
}
|
435
|
+
return paramsFilled;
|
436
|
+
}
|
437
|
+
filterRouteFromList(routes, appId, productName) {
|
438
|
+
if (!routes) {
|
439
|
+
return undefined;
|
440
|
+
}
|
441
|
+
const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName);
|
442
|
+
if (productRoutes.length === 0) {
|
443
|
+
return undefined;
|
444
|
+
}
|
445
|
+
if (productRoutes.length > 1) {
|
446
|
+
console.log('WARNING: There were more than one route. First route has been used.');
|
447
|
+
}
|
448
|
+
return productRoutes[0];
|
449
|
+
}
|
450
|
+
dissolveEndpoint(endpointName, endpoints) {
|
451
|
+
let endpoint = endpoints.find((ep) => ep.name === endpointName);
|
452
|
+
if (!endpoint) {
|
453
|
+
return undefined;
|
454
|
+
}
|
455
|
+
while (endpoint.path?.includes(this.aliasStart)) {
|
456
|
+
const path = endpoint.path;
|
457
|
+
const startIdx = path.indexOf(this.aliasStart) + this.aliasStart.length;
|
458
|
+
const endIdx = path.lastIndexOf(this.aliasEnd);
|
459
|
+
if (endIdx <= startIdx) {
|
460
|
+
return undefined;
|
461
|
+
}
|
462
|
+
const aliasName = path.substring(startIdx, endIdx);
|
463
|
+
endpoint = endpoints.find((ep) => ep.name === aliasName);
|
464
|
+
if (!endpoint) {
|
465
|
+
return undefined;
|
466
|
+
}
|
467
|
+
}
|
468
|
+
return endpoint;
|
469
|
+
}
|
470
|
+
fillParamsForPath(path, params) {
|
471
|
+
while (path.includes(this.paramStart)) {
|
472
|
+
const paramName = path.substring(path.indexOf(this.paramStart) + this.paramStart.length, path.indexOf(this.paramEnd));
|
473
|
+
const paramValue = this.getStringFromUnknown(params[paramName]);
|
474
|
+
if (paramValue != undefined && paramValue.length > 0) {
|
475
|
+
path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue);
|
476
|
+
}
|
477
|
+
else {
|
478
|
+
console.log(`WARNING: Searched param "${paramName}" was not found in given param list `);
|
479
|
+
return '';
|
480
|
+
}
|
481
|
+
}
|
482
|
+
return path;
|
483
|
+
}
|
484
|
+
getStringFromUnknown(value) {
|
485
|
+
if (value === null || value === undefined) {
|
486
|
+
return '';
|
487
|
+
}
|
488
|
+
else if (typeof value === 'string') {
|
489
|
+
return value;
|
490
|
+
}
|
491
|
+
else {
|
492
|
+
return String(value);
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
WorkspaceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, deps: [{ token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
497
|
+
WorkspaceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, providedIn: 'root' });
|
498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WorkspaceService, decorators: [{
|
499
|
+
type: Injectable,
|
500
|
+
args: [{
|
501
|
+
providedIn: 'root',
|
502
|
+
}]
|
503
|
+
}], ctorParameters: function () { return [{ type: AppStateService }]; } });
|
504
|
+
|
386
505
|
function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModuleGuard) {
|
387
506
|
return routes.map((r) => {
|
388
507
|
if (r.redirectTo) {
|
@@ -405,5 +524,5 @@ function addInitializeModuleGuard(routes, initializeModuleGuard = InitializeModu
|
|
405
524
|
* Generated bundle index. Do not edit.
|
406
525
|
*/
|
407
526
|
|
408
|
-
export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, addInitializeModuleGuard };
|
527
|
+
export { APPLICATION_NAME, APP_CONFIG, AUTH_SERVICE, AppStateService, CONFIG_KEY, ConfigurationService, InitializeModuleGuard, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ThemeService, UserService, WorkspaceService, addInitializeModuleGuard };
|
409
528
|
//# 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/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 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 { 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,GAA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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,IAAA,CAAA,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAA;AACrC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,kBAAkB,EAAE,C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,MAAM;AACnB,iBAAA,CAAA;;;SCNe,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
@@ -5,6 +5,7 @@ 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
7
|
export * from './lib/services/initialize-module-guard.service';
|
8
|
+
export * from './lib/services/workspace.service';
|
8
9
|
export * from './lib/model/config-key.model';
|
9
10
|
export * from './lib/api/iauth.service';
|
10
11
|
export * from './lib/api/injection-tokens';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { AppStateService } from './app-state.service';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class WorkspaceService {
|
5
|
+
protected appStateService: AppStateService;
|
6
|
+
private aliasStart;
|
7
|
+
private aliasEnd;
|
8
|
+
private paramStart;
|
9
|
+
private paramEnd;
|
10
|
+
constructor(appStateService: AppStateService);
|
11
|
+
getUrl(appId: string, productName: string, endpointName: string, params?: Record<string, unknown>): Observable<string>;
|
12
|
+
private constructBaseUrlFromWorkspace;
|
13
|
+
private constructRouteUrl;
|
14
|
+
private constructEndpointUrl;
|
15
|
+
private filterRouteFromList;
|
16
|
+
private dissolveEndpoint;
|
17
|
+
private fillParamsForPath;
|
18
|
+
private getStringFromUnknown;
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WorkspaceService, never>;
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WorkspaceService>;
|
21
|
+
}
|