@onecx/angular-integration-interface 7.6.0 → 8.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +13 -4
  2. package/fesm2022/onecx-angular-integration-interface-mocks.mjs +23 -26
  3. package/fesm2022/onecx-angular-integration-interface-mocks.mjs.map +1 -1
  4. package/fesm2022/onecx-angular-integration-interface.mjs +81 -64
  5. package/fesm2022/onecx-angular-integration-interface.mjs.map +1 -1
  6. package/package.json +8 -21
  7. package/{mocks/index.d.ts → types/onecx-angular-integration-interface-mocks.d.ts} +0 -1
  8. package/{index.d.ts → types/onecx-angular-integration-interface.d.ts} +19 -18
  9. package/migrations/index.d.ts +0 -5
  10. package/migrations/index.js +0 -9
  11. package/migrations/index.js.map +0 -1
  12. package/migrations/test-utils/test-setup.d.ts +0 -1
  13. package/migrations/test-utils/test-setup.js +0 -6
  14. package/migrations/test-utils/test-setup.js.map +0 -1
  15. package/migrations/v6/migrate-onecx-to-v6.d.ts +0 -2
  16. package/migrations/v6/migrate-onecx-to-v6.js +0 -8
  17. package/migrations/v6/migrate-onecx-to-v6.js.map +0 -1
  18. package/migrations/v6/remove-add-initialize-module-guard.d.ts +0 -2
  19. package/migrations/v6/remove-add-initialize-module-guard.js +0 -29
  20. package/migrations/v6/remove-add-initialize-module-guard.js.map +0 -1
  21. package/migrations/v6/remove-auth-service.d.ts +0 -2
  22. package/migrations/v6/remove-auth-service.js +0 -28
  23. package/migrations/v6/remove-auth-service.js.map +0 -1
  24. package/migrations/v6/replace-provide-app-service-mock.d.ts +0 -2
  25. package/migrations/v6/replace-provide-app-service-mock.js +0 -14
  26. package/migrations/v6/replace-provide-app-service-mock.js.map +0 -1
  27. package/migrations/v6/utils/remove-and-track-import.d.ts +0 -2
  28. package/migrations/v6/utils/remove-and-track-import.js +0 -14
  29. package/migrations/v6/utils/remove-and-track-import.js.map +0 -1
  30. package/migrations/v6/warn-removed-properties-from-theme-service.d.ts +0 -3
  31. package/migrations/v6/warn-removed-properties-from-theme-service.js +0 -24
  32. package/migrations/v6/warn-removed-properties-from-theme-service.js.map +0 -1
  33. package/migrations.json +0 -58
package/README.md CHANGED
@@ -1,7 +1,16 @@
1
- # angular-integration-interface
1
+ # @onecx/angular-integration-interface
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ `@onecx/angular-integration-interface` contains all integration services and interfaces for connecting Angular applications with the OneCX platform.
4
+ More information about the library can be found [here](https://onecx.github.io/docs/documentation/current/onecx-portal-ui-libs/libraries/angular-integration-interface.html)
4
5
 
5
- ## Running unit tests
6
+ ## Installation
6
7
 
7
- Run `nx test angular-integration-interface` to execute the unit tests.
8
+ ```bash
9
+ npm install @onecx/angular-integration-interface
10
+ ```
11
+
12
+ ## Additional Commands
13
+ - `npx nx run angular-integration-interface:build` - Builds the library and outputs the result to the `dist` folder.
14
+ - `npx nx run angular-integration-interface:test` - Runs the unit tests for the library.
15
+ - `npx nx run angular-integration-interface:lint` - Lints the library's codebase.
16
+ - `npx nx run angular-integration-interface:release` - Releases a new version of the library to npm, following semantic versioning guidelines.
@@ -3,7 +3,6 @@ import { Injectable } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { AppConfigService, AppStateService, ConfigurationService, PortalMessageService, RemoteComponentsService, UserService, ShellCapabilityService } from '@onecx/angular-integration-interface';
5
5
  import { FakeTopic } from '@onecx/accelerator';
6
- export * from '@onecx/accelerator';
7
6
  import { firstValueFrom } from 'rxjs/internal/firstValueFrom';
8
7
 
9
8
  function provideAppConfigServiceMock() {
@@ -30,10 +29,10 @@ class AppConfigServiceMock {
30
29
  getConfig() {
31
30
  return this.config$.getValue();
32
31
  }
33
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigServiceMock }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
33
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigServiceMock }); }
35
34
  }
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigServiceMock, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigServiceMock, decorators: [{
37
36
  type: Injectable
38
37
  }] });
39
38
 
@@ -71,10 +70,10 @@ class AppStateServiceMock {
71
70
  });
72
71
  this.isAuthenticated$ = new FakeTopic(null);
73
72
  }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
75
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateServiceMock }); }
73
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
74
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateServiceMock }); }
76
75
  }
77
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateServiceMock, decorators: [{
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateServiceMock, decorators: [{
78
77
  type: Injectable
79
78
  }] });
80
79
 
@@ -108,10 +107,10 @@ class ConfigurationServiceMock {
108
107
  getConfig() {
109
108
  return firstValueFrom(this.config$.asObservable());
110
109
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationServiceMock, providedIn: 'root' }); }
110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationServiceMock, providedIn: 'root' }); }
113
112
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationServiceMock, decorators: [{
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationServiceMock, decorators: [{
115
114
  type: Injectable,
116
115
  args: [{ providedIn: 'root' }]
117
116
  }], ctorParameters: () => [] });
@@ -142,10 +141,10 @@ class PortalMessageServiceMock {
142
141
  severity: severity,
143
142
  });
144
143
  }
145
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
146
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageServiceMock, providedIn: 'any' }); }
144
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
145
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageServiceMock, providedIn: 'any' }); }
147
146
  }
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageServiceMock, decorators: [{
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageServiceMock, decorators: [{
149
148
  type: Injectable,
150
149
  args: [{ providedIn: 'any' }]
151
150
  }] });
@@ -157,10 +156,10 @@ class RemoteComponentsServiceMock {
157
156
  constructor() {
158
157
  this.remoteComponents$ = new FakeTopic();
159
158
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
161
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsServiceMock, providedIn: 'root' }); }
159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
160
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsServiceMock, providedIn: 'root' }); }
162
161
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsServiceMock, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsServiceMock, decorators: [{
164
163
  type: Injectable,
165
164
  args: [{ providedIn: 'root' }]
166
165
  }] });
@@ -176,12 +175,10 @@ class UserServiceMock {
176
175
  }
177
176
  async hasPermission(permissionKey) {
178
177
  if (Array.isArray(permissionKey)) {
179
- return permissionKey.every(async (key) => await this.hasPermission(key));
178
+ const results = await Promise.all(permissionKey.map((key) => this.hasPermission(key)));
179
+ return results.every(Boolean);
180
180
  }
181
181
  const result = this.permissionsTopic$.getValue()?.includes(permissionKey);
182
- if (!result) {
183
- console.log(`👮‍♀️ No permission for: ${permissionKey}`);
184
- }
185
182
  return !!result;
186
183
  }
187
184
  getPermissions() {
@@ -197,10 +194,10 @@ class UserServiceMock {
197
194
  get isInitialized() {
198
195
  return Promise.resolve();
199
196
  }
200
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
201
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserServiceMock, providedIn: 'root' }); }
197
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
198
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserServiceMock, providedIn: 'root' }); }
202
199
  }
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserServiceMock, decorators: [{
200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserServiceMock, decorators: [{
204
201
  type: Injectable,
205
202
  args: [{ providedIn: 'root' }]
206
203
  }] });
@@ -216,10 +213,10 @@ class ShellCapabilityServiceMock {
216
213
  hasCapability(capability) {
217
214
  return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false;
218
215
  }
219
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
220
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityServiceMock }); }
216
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
217
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityServiceMock }); }
221
218
  }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityServiceMock, decorators: [{
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityServiceMock, decorators: [{
223
220
  type: Injectable
224
221
  }] });
225
222
 
@@ -1 +1 @@
1
- {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/app-config-service-mock.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/configuration-service-mock.ts","../../../../libs/angular-integration-interface/mocks/portal-message-service-mock.ts","../../../../libs/angular-integration-interface/mocks/remote-components-service-mock.ts","../../../../libs/angular-integration-interface/mocks/user-service-mock.ts","../../../../libs/angular-integration-interface/mocks/shell-capability-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { Config } from '@onecx/integration-interface'\nimport { AppConfigService } from '@onecx/angular-integration-interface'\n\nexport function provideAppConfigServiceMock() {\n return [AppConfigServiceMock, { provide: AppConfigService, useExisting: AppConfigServiceMock }]\n}\n@Injectable()\nexport class AppConfigServiceMock {\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve) => {\n const mockConfig: Config = { key: 'config' }\n this.config$.next(mockConfig)\n resolve()\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { CurrentLocationTopicPayload, MfeInfo, PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideAppStateServiceMock() {\n return [AppStateServiceMock, { provide: AppStateService, useExisting: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic<MfeInfo>({\n mountPath: '/',\n remoteBaseUrl: '.',\n baseHref: '/',\n shellName: 'test',\n appId: 'test',\n productName: 'test',\n })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test portal',\n workspaceName: 'Test portal',\n })\n currentWorkspace$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test workspace',\n workspaceName: 'Test workspace',\n })\n currentLocation$ = new FakeTopic<CurrentLocationTopicPayload>({\n url: '/',\n isFirst: true,\n })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","import { Injectable } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { CONFIG_KEY } from '@onecx/angular-integration-interface'\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom'\nimport { ConfigurationService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideConfigurationServiceMock() {\n return [ConfigurationServiceMock, { provide: ConfigurationService, useExisting: ConfigurationServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationServiceMock {\n config$ = new FakeTopic<Config>({})\n\n private resolveInitPromise!: (value: void | PromiseLike<void>) => void\n private isInitializedPromise: Promise<void>\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveInitPromise = resolve\n })\n }\n\n public init(config?: Config): Promise<boolean> {\n return this.config$.publish(config ?? {}).then(() => {\n this.resolveInitPromise()\n return true\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.isInitializedPromise\n }\n\n public getProperty(key: CONFIG_KEY): Promise<string | undefined> {\n return firstValueFrom(this.config$.asObservable()).then((config) => config[key])\n }\n\n public async setProperty(key: string, val: string): Promise<void> {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n }\n\n public getConfig(): Promise<Config | undefined> {\n return firstValueFrom(this.config$.asObservable())\n }\n}\n","import { Injectable } from '@angular/core'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { Message as PortalMessage, PortalMessageService } from '@onecx/angular-integration-interface'\nimport { Message } from '@onecx/integration-interface'\n\nexport function providePortalMessageServiceMock() {\n return [PortalMessageServiceMock, { provide: PortalMessageService, useExisting: PortalMessageServiceMock }]\n}\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageServiceMock {\n message$ = new FakeTopic<Message>()\n\n success(msg: PortalMessage) {\n this.addTranslated('success', msg)\n }\n\n info(msg: PortalMessage) {\n this.addTranslated('info', msg)\n }\n\n error(msg: PortalMessage) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: PortalMessage) {\n this.addTranslated('warning', msg)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private addTranslated(severity: string, msg: PortalMessage) {\n this.message$.publish({\n ...msg,\n severity: severity,\n })\n }\n}\n","import { Injectable } from '@angular/core'\nimport { RemoteComponentsInfo } from '@onecx/integration-interface'\nimport { RemoteComponentsService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideRemoteComponentsServiceMock() {\n return [RemoteComponentsServiceMock, { provide: RemoteComponentsService, useExisting: RemoteComponentsServiceMock }]\n}\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsServiceMock {\n remoteComponents$ = new FakeTopic<RemoteComponentsInfo>()\n}\n","import { Injectable } from '@angular/core'\nimport { BehaviorSubject, Observable } from 'rxjs'\nimport { UserProfile } from '@onecx/integration-interface'\nimport { UserService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideUserServiceMock() {\n return [UserServiceMock, { provide: UserService, useExisting: UserServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UserServiceMock {\n profile$ = new FakeTopic<UserProfile>()\n permissionsTopic$ = new FakeTopic<string[]>(['mocked-permission'])\n lang$ = new BehaviorSubject('en')\n\n async hasPermission(permissionKey: string | string[]): Promise<boolean> {\n if (Array.isArray(permissionKey)) {\n return permissionKey.every(async (key) => await this.hasPermission(key))\n }\n\n const result = this.permissionsTopic$.getValue()?.includes(permissionKey)\n if (!result) {\n console.log(`👮‍♀️ No permission for: ${permissionKey}`)\n }\n return !!result\n }\n\n getPermissions(): Observable<string[]> {\n return this.permissionsTopic$.asObservable()\n }\n\n determineLanguage(): string | undefined {\n return 'mocked-lang'\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n extractPermissions(userProfile: UserProfile): string[] | null {\n return ['mocked-permission']\n }\n\n get isInitialized(): Promise<void> {\n return Promise.resolve()\n }\n}\n\nexport type MockUserService = UserServiceMock\n","import { Injectable } from '@angular/core'\nimport { Capability, ShellCapabilityService } from '@onecx/angular-integration-interface'\n\nexport function provideShellCapabilityServiceMock() {\n return [ShellCapabilityServiceMock, { provide: ShellCapabilityService, useExisting: ShellCapabilityServiceMock }]\n}\n\n@Injectable()\nexport class ShellCapabilityServiceMock {\n static capabilities: Capability[] = []\n\n static setCapabilities(capabilities: Capability[]): void {\n ShellCapabilityServiceMock.capabilities = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAKgB,2BAA2B,GAAA;AACzC,IAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;AACjG;MAEa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAA4B,EAAE,CAAC;AAsB7D,IAAA;;AAnBQ,IAAA,IAAI,CAAC,OAAe,EAAA;AACzB,QAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAI;AAC7B,YAAA,MAAM,UAAU,GAAW,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC5C,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;AAC7B,YAAA,OAAO,EAAE;AACX,QAAA,CAAC,CAAC;IACJ;AAEO,IAAA,WAAW,CAAC,GAAW,EAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC;IACvC;IAEO,WAAW,CAAC,GAAW,EAAE,GAAW,EAAA;QACzC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;IAC1D;IAEO,SAAS,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;IAChC;+GAtBW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAApB,oBAAoB,EAAA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AAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA,CAAA;;4FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;SCPlB,iCAAiC,GAAA;AAC/C,IAAA,OAAO,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;AACnH;MAGa,0BAA0B,CAAA;aAC9B,IAAA,CAAA,YAAY,GAAiB,EAAjB,CAAmB;IAEtC,OAAO,eAAe,CAAC,YAA0B,EAAA;AAC/C,QAAA,0BAA0B,CAAC,YAAY,GAAG,YAAY;IACxD;AAEA,IAAA,aAAa,CAAC,UAAsB,EAAA;QAClC,OAAO,0BAA0B,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK;IAC/E;+GATW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAA1B,0BAA0B,EAAA,CAAA,CAAA;;4FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/app-config-service-mock.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/configuration-service-mock.ts","../../../../libs/angular-integration-interface/mocks/portal-message-service-mock.ts","../../../../libs/angular-integration-interface/mocks/remote-components-service-mock.ts","../../../../libs/angular-integration-interface/mocks/user-service-mock.ts","../../../../libs/angular-integration-interface/mocks/shell-capability-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { Injectable } from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { Config } from '@onecx/integration-interface'\nimport { AppConfigService } from '@onecx/angular-integration-interface'\n\nexport function provideAppConfigServiceMock() {\n return [AppConfigServiceMock, { provide: AppConfigService, useExisting: AppConfigServiceMock }]\n}\n@Injectable()\nexport class AppConfigServiceMock {\n config$ = new BehaviorSubject<{ [key: string]: string }>({})\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public init(baseUrl: string): Promise<void> {\n return new Promise((resolve) => {\n const mockConfig: Config = { key: 'config' }\n this.config$.next(mockConfig)\n resolve()\n })\n }\n\n public getProperty(key: string): string | undefined {\n return this.config$.getValue()?.[key]\n }\n\n public setProperty(key: string, val: string) {\n this.config$.next({ ...this.config$.value, [key]: val })\n }\n\n public getConfig(): { [key: string]: string } {\n return this.config$.getValue()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { CurrentLocationTopicPayload, MfeInfo, PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideAppStateServiceMock() {\n return [AppStateServiceMock, { provide: AppStateService, useExisting: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic<MfeInfo>({\n mountPath: '/',\n remoteBaseUrl: '.',\n baseHref: '/',\n shellName: 'test',\n appId: 'test',\n productName: 'test',\n })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test portal',\n workspaceName: 'Test portal',\n })\n currentWorkspace$ = new FakeTopic<Workspace>({\n baseUrl: '/',\n microfrontendRegistrations: [],\n portalName: 'Test workspace',\n workspaceName: 'Test workspace',\n })\n currentLocation$ = new FakeTopic<CurrentLocationTopicPayload>({\n url: '/',\n isFirst: true,\n })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","import { Injectable } from '@angular/core'\nimport { Config } from '@onecx/integration-interface'\nimport { CONFIG_KEY } from '@onecx/angular-integration-interface'\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom'\nimport { ConfigurationService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideConfigurationServiceMock() {\n return [ConfigurationServiceMock, { provide: ConfigurationService, useExisting: ConfigurationServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigurationServiceMock {\n config$ = new FakeTopic<Config>({})\n\n private resolveInitPromise!: (value: void | PromiseLike<void>) => void\n private isInitializedPromise: Promise<void>\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveInitPromise = resolve\n })\n }\n\n public init(config?: Config): Promise<boolean> {\n return this.config$.publish(config ?? {}).then(() => {\n this.resolveInitPromise()\n return true\n })\n }\n\n get isInitialized(): Promise<void> {\n return this.isInitializedPromise\n }\n\n public getProperty(key: CONFIG_KEY): Promise<string | undefined> {\n return firstValueFrom(this.config$.asObservable()).then((config) => config[key])\n }\n\n public async setProperty(key: string, val: string): Promise<void> {\n const currentValues = await firstValueFrom(this.config$.asObservable())\n currentValues[key] = val\n await this.config$.publish(currentValues)\n }\n\n public getConfig(): Promise<Config | undefined> {\n return firstValueFrom(this.config$.asObservable())\n }\n}\n","import { Injectable } from '@angular/core'\nimport { FakeTopic } from '@onecx/accelerator'\nimport { Message as PortalMessage, PortalMessageService } from '@onecx/angular-integration-interface'\nimport { Message } from '@onecx/integration-interface'\n\nexport function providePortalMessageServiceMock() {\n return [PortalMessageServiceMock, { provide: PortalMessageService, useExisting: PortalMessageServiceMock }]\n}\n@Injectable({ providedIn: 'any' })\nexport class PortalMessageServiceMock {\n message$ = new FakeTopic<Message>()\n\n success(msg: PortalMessage) {\n this.addTranslated('success', msg)\n }\n\n info(msg: PortalMessage) {\n this.addTranslated('info', msg)\n }\n\n error(msg: PortalMessage) {\n this.addTranslated('error', msg)\n }\n\n warning(msg: PortalMessage) {\n this.addTranslated('warning', msg)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private addTranslated(severity: string, msg: PortalMessage) {\n this.message$.publish({\n ...msg,\n severity: severity,\n })\n }\n}\n","import { Injectable } from '@angular/core'\nimport { RemoteComponentsInfo } from '@onecx/integration-interface'\nimport { RemoteComponentsService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideRemoteComponentsServiceMock() {\n return [RemoteComponentsServiceMock, { provide: RemoteComponentsService, useExisting: RemoteComponentsServiceMock }]\n}\n@Injectable({ providedIn: 'root' })\nexport class RemoteComponentsServiceMock {\n remoteComponents$ = new FakeTopic<RemoteComponentsInfo>()\n}\n","import { Injectable } from '@angular/core'\nimport { BehaviorSubject, Observable } from 'rxjs'\nimport { UserProfile } from '@onecx/integration-interface'\nimport { UserService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from '@onecx/accelerator'\n\nexport function provideUserServiceMock() {\n return [UserServiceMock, { provide: UserService, useExisting: UserServiceMock }]\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UserServiceMock {\n profile$ = new FakeTopic<UserProfile>()\n permissionsTopic$ = new FakeTopic<string[]>(['mocked-permission'])\n lang$ = new BehaviorSubject('en')\n\n async hasPermission(permissionKey: string | string[]): Promise<boolean> {\n if (Array.isArray(permissionKey)) {\n const results = await Promise.all(permissionKey.map((key) => this.hasPermission(key)))\n return results.every(Boolean)\n }\n\n const result = this.permissionsTopic$.getValue()?.includes(permissionKey)\n return !!result\n }\n\n getPermissions(): Observable<string[]> {\n return this.permissionsTopic$.asObservable()\n }\n\n determineLanguage(): string | undefined {\n return 'mocked-lang'\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n extractPermissions(userProfile: UserProfile): string[] | null {\n return ['mocked-permission']\n }\n\n get isInitialized(): Promise<void> {\n return Promise.resolve()\n }\n}\n\nexport type MockUserService = UserServiceMock\n","import { Injectable } from '@angular/core'\nimport { Capability, ShellCapabilityService } from '@onecx/angular-integration-interface'\n\nexport function provideShellCapabilityServiceMock() {\n return [ShellCapabilityServiceMock, { provide: ShellCapabilityService, useExisting: ShellCapabilityServiceMock }]\n}\n\n@Injectable()\nexport class ShellCapabilityServiceMock {\n static capabilities: Capability[] = []\n\n static setCapabilities(capabilities: Capability[]): void {\n ShellCapabilityServiceMock.capabilities = capabilities\n }\n\n hasCapability(capability: Capability): boolean {\n return ShellCapabilityServiceMock.capabilities?.includes(capability) ?? false\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAKgB,2BAA2B,GAAA;AACzC,IAAA,OAAO,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;AACjG;MAEa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAA4B,EAAE,CAAC;AAsB7D,IAAA;;AAnBQ,IAAA,IAAI,CAAC,OAAe,EAAA;AACzB,QAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAI;AAC7B,YAAA,MAAM,UAAU,GAAW,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC5C,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;AAC7B,YAAA,OAAO,EAAE;AACX,QAAA,CAAC,CAAC;IACJ;AAEO,IAAA,WAAW,CAAC,GAAW,EAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC;IACvC;IAEO,WAAW,CAAC,GAAW,EAAE,GAAW,EAAA;QACzC,IAAI,CAAC,OAAO,CAAC,IAA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HttpClient } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
4
  import { inject, Injectable, InjectionToken } from '@angular/core';
5
5
  import { BehaviorSubject, firstValueFrom, map, combineLatest, of, first } from 'rxjs';
6
- import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentLocationTopic, CurrentPageTopic, CurrentWorkspaceTopic, IsAuthenticatedTopic, ConfigurationTopic, PermissionsTopic, UserProfileTopic, ParametersTopic, MessageTopic, CurrentThemeTopic, RemoteComponentsTopic, ImageRepositoryService as ImageRepositoryService$1, IconService as IconService$1 } from '@onecx/integration-interface';
6
+ import { createLoggerFactory, getNormalizedBrowserLocales } from '@onecx/accelerator';
7
+ import { GlobalErrorTopic, GlobalLoadingTopic, CurrentMfeTopic, CurrentLocationTopic, CurrentPageTopic, CurrentWorkspaceTopic, IsAuthenticatedTopic, ConfigurationTopic, PermissionsTopic, UserProfileTopic, ParametersTopic, ShellCapability, MessageTopic, CurrentThemeTopic, RemoteComponentsTopic, ImageRepositoryService as ImageRepositoryService$1, IconService as IconService$1, DynamicTranslationService as DynamicTranslationService$1 } from '@onecx/integration-interface';
8
+ export { ShellCapability as Capability } from '@onecx/integration-interface';
7
9
  import Semaphore from 'ts-semaphore';
8
- import { getNormalizedBrowserLocales } from '@onecx/accelerator';
9
10
  import { TranslateService } from '@ngx-translate/core';
10
11
 
12
+ // This file is not planned to be in the index.ts so it is private to this lib
13
+ const createLogger = createLoggerFactory('@onecx/angular-integration-interface');
14
+
11
15
  class AppConfigService {
12
16
  constructor() {
13
17
  this.http = inject(HttpClient);
18
+ this.logger = createLogger('AppConfigService');
14
19
  this.config$ = new BehaviorSubject({});
15
20
  }
16
21
  init(baseUrl) {
@@ -24,7 +29,7 @@ class AppConfigService {
24
29
  }
25
30
  })
26
31
  .catch((e) => {
27
- console.log(`Failed to load env configuration`);
32
+ this.logger.error('Failed to load env configuration', e);
28
33
  reject(e);
29
34
  });
30
35
  });
@@ -38,10 +43,10 @@ class AppConfigService {
38
43
  getConfig() {
39
44
  return this.config$.getValue();
40
45
  }
41
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
42
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigService }); }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
47
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigService }); }
43
48
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppConfigService, decorators: [{
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppConfigService, decorators: [{
45
50
  type: Injectable
46
51
  }] });
47
52
 
@@ -108,10 +113,10 @@ class AppStateService {
108
113
  this._currentWorkspace$?.destroy();
109
114
  this._isAuthenticated$?.destroy();
110
115
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateService, providedIn: 'root' }); }
116
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
117
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateService, providedIn: 'root' }); }
113
118
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AppStateService, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AppStateService, decorators: [{
115
120
  type: Injectable,
116
121
  args: [{ providedIn: 'root' }]
117
122
  }] });
@@ -161,6 +166,7 @@ var POLYFILL_SCOPE_MODE;
161
166
  class ConfigurationService {
162
167
  constructor() {
163
168
  this.http = inject(HttpClient);
169
+ this.logger = createLogger('ConfigurationService');
164
170
  this.defaultConfig = inject(APP_CONFIG, { optional: true });
165
171
  this.semaphore = new Semaphore(1);
166
172
  }
@@ -180,12 +186,12 @@ class ConfigurationService {
180
186
  let loadConfigPromise;
181
187
  const inlinedConfig = window['APP_CONFIG'];
182
188
  if (inlinedConfig) {
183
- console.log(`ENV resolved from injected config`);
189
+ this.logger.info('ENV resolved from injected config');
184
190
  loadConfigPromise = Promise.resolve(inlinedConfig);
185
191
  }
186
192
  else {
187
193
  if (skipRemoteConfigLoad) {
188
- console.log('📢 TKA001: Remote config load is disabled. To enable it, remove the "skipRemoteConfigLoad" key in your environment.json');
194
+ this.logger.info('📢 TKA001: Remote config load is disabled. To enable it, remove the "skipRemoteConfigLoad" key in your environment.json');
189
195
  loadConfigPromise = Promise.resolve(this.defaultConfig || {});
190
196
  }
191
197
  else {
@@ -199,7 +205,7 @@ class ConfigurationService {
199
205
  });
200
206
  })
201
207
  .catch((e) => {
202
- console.log(`Failed to load env configuration`);
208
+ this.logger.error('Failed to load env configuration', e);
203
209
  reject(e);
204
210
  });
205
211
  });
@@ -209,7 +215,7 @@ class ConfigurationService {
209
215
  }
210
216
  async getProperty(key) {
211
217
  if (!Object.values(CONFIG_KEY).includes(key)) {
212
- console.error('Invalid config key ', key);
218
+ this.logger.error('Invalid config key ', key);
213
219
  }
214
220
  return firstValueFrom(this.config$.pipe(map((config) => config[key])));
215
221
  }
@@ -223,10 +229,10 @@ class ConfigurationService {
223
229
  async getConfig() {
224
230
  return firstValueFrom(this.config$.asObservable());
225
231
  }
226
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
227
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationService, providedIn: 'root' }); }
232
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
233
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationService, providedIn: 'root' }); }
228
234
  }
229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigurationService, decorators: [{
235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ConfigurationService, decorators: [{
230
236
  type: Injectable,
231
237
  args: [{ providedIn: 'root' }]
232
238
  }] });
@@ -234,6 +240,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
234
240
  const API_PREFIX = 'portal-api';
235
241
  const DEFAULT_LANG = 'en';
236
242
 
243
+ const logger = createLogger('UserService');
237
244
  class UserService {
238
245
  get permissionsTopic$() {
239
246
  this._permissionsTopic$ ??= new PermissionsTopic();
@@ -282,7 +289,7 @@ class UserService {
282
289
  return firstValueFrom(this.permissionsTopic$.pipe(map((permissions) => {
283
290
  const result = permissions.includes(permissionKey);
284
291
  if (!result) {
285
- console.log(`👮‍♀️ No permission for: ${permissionKey}`);
292
+ logger.debug(`No permission for: ${permissionKey}`);
286
293
  }
287
294
  return !!result;
288
295
  })));
@@ -311,20 +318,14 @@ class UserService {
311
318
  // eslint-disable-next-line @typescript-eslint/no-empty-function
312
319
  ]).then(() => { });
313
320
  }
314
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
315
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserService, providedIn: 'root' }); }
321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
322
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserService, providedIn: 'root' }); }
316
323
  }
317
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UserService, decorators: [{
324
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: UserService, decorators: [{
318
325
  type: Injectable,
319
326
  args: [{ providedIn: 'root' }]
320
327
  }], ctorParameters: () => [] });
321
328
 
322
- var Capability;
323
- (function (Capability) {
324
- Capability["CURRENT_LOCATION_TOPIC"] = "currentLocationTopic";
325
- Capability["PARAMETERS_TOPIC"] = "parametersTopic";
326
- Capability["ACTIVENESS_AWARE_MENUS"] = "activenessAwareMenus";
327
- })(Capability || (Capability = {}));
328
329
  class ShellCapabilityService {
329
330
  static setCapabilities(capabilities) {
330
331
  window['onecx-shell-capabilities'] = capabilities;
@@ -332,10 +333,10 @@ class ShellCapabilityService {
332
333
  hasCapability(capability) {
333
334
  return window['onecx-shell-capabilities']?.includes(capability) ?? false;
334
335
  }
335
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
336
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityService, providedIn: 'root' }); }
336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
337
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityService, providedIn: 'root' }); }
337
338
  }
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ShellCapabilityService, decorators: [{
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ShellCapabilityService, decorators: [{
339
340
  type: Injectable,
340
341
  args: [{ providedIn: 'root' }]
341
342
  }] });
@@ -356,7 +357,7 @@ class ParametersService {
356
357
  this._parameters$?.destroy();
357
358
  }
358
359
  async get(key, defaultValue, productName = undefined, appId = undefined) {
359
- if (!this.shellCapabilityService.hasCapability(Capability.PARAMETERS_TOPIC)) {
360
+ if (!this.shellCapabilityService.hasCapability(ShellCapability.PARAMETERS_TOPIC)) {
360
361
  return Promise.resolve(defaultValue);
361
362
  }
362
363
  if (!productName) {
@@ -374,10 +375,10 @@ class ParametersService {
374
375
  }
375
376
  });
376
377
  }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ParametersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
378
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ParametersService, providedIn: 'root' }); }
378
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ParametersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
379
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ParametersService, providedIn: 'root' }); }
379
380
  }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ParametersService, decorators: [{
381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ParametersService, decorators: [{
381
382
  type: Injectable,
382
383
  args: [{ providedIn: 'root' }]
383
384
  }] });
@@ -423,10 +424,10 @@ class PortalMessageService {
423
424
  ngOnDestroy() {
424
425
  this._message$?.destroy();
425
426
  }
426
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
427
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageService, providedIn: 'any' }); }
427
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
428
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageService, providedIn: 'any' }); }
428
429
  }
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PortalMessageService, decorators: [{
430
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PortalMessageService, decorators: [{
430
431
  type: Injectable,
431
432
  args: [{ providedIn: 'any' }]
432
433
  }] });
@@ -442,10 +443,10 @@ class ThemeService {
442
443
  ngOnDestroy() {
443
444
  this._currentTheme$?.destroy();
444
445
  }
445
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
446
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
446
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
447
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
447
448
  }
448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ThemeService, decorators: [{
449
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService, decorators: [{
449
450
  type: Injectable,
450
451
  args: [{ providedIn: 'root' }]
451
452
  }] });
@@ -461,10 +462,10 @@ class RemoteComponentsService {
461
462
  ngOnDestroy() {
462
463
  this._remoteComponents$?.destroy();
463
464
  }
464
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
465
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' }); }
465
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
466
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsService, providedIn: 'root' }); }
466
467
  }
467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoteComponentsService, decorators: [{
468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RemoteComponentsService, decorators: [{
468
469
  type: Injectable,
469
470
  args: [{ providedIn: 'root' }]
470
471
  }] });
@@ -472,6 +473,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
472
473
  class WorkspaceService {
473
474
  constructor() {
474
475
  this.appStateService = inject(AppStateService);
476
+ this.logger = createLogger('WorkspaceService');
475
477
  this.aliasStart = '[[';
476
478
  this.aliasEnd = ']]';
477
479
  this.paramStart = '{';
@@ -504,7 +506,7 @@ class WorkspaceService {
504
506
  }
505
507
  constructBaseUrlFromWorkspace(workspace) {
506
508
  if (workspace.baseUrl === undefined) {
507
- console.log('WARNING: There was no baseUrl for received workspace.');
509
+ this.logger.warn('There was no baseUrl for received workspace.');
508
510
  return '';
509
511
  }
510
512
  return workspace.baseUrl;
@@ -513,7 +515,7 @@ class WorkspaceService {
513
515
  const route = this.filterRouteFromList(workspace.routes, appId, productName);
514
516
  let url = this.constructBaseUrlFromWorkspace(workspace);
515
517
  if (!route) {
516
- console.log(`WARNING: No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
518
+ this.logger.warn(`No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
517
519
  return url;
518
520
  }
519
521
  if (route.baseUrl !== undefined && route.baseUrl.length > 0) {
@@ -531,12 +533,12 @@ class WorkspaceService {
531
533
  }
532
534
  const finalEndpoint = this.dissolveEndpoint(endpointName, route.endpoints);
533
535
  if (!finalEndpoint || finalEndpoint.path === undefined) {
534
- console.log('WARNING: No endpoint or endpoint.path could be found');
536
+ this.logger.warn('No endpoint or endpoint.path could be found');
535
537
  return '';
536
538
  }
537
539
  const paramsFilled = this.fillParamsForPath(finalEndpoint.path, endpointParameters);
538
540
  if (paramsFilled === undefined) {
539
- console.log('WARNING: Params could not be filled correctly');
541
+ this.logger.warn('Params could not be filled correctly');
540
542
  return '';
541
543
  }
542
544
  return paramsFilled;
@@ -550,7 +552,7 @@ class WorkspaceService {
550
552
  return undefined;
551
553
  }
552
554
  if (productRoutes.length > 1) {
553
- console.log('WARNING: There were more than one route. First route has been used.');
555
+ this.logger.warn('There were more than one route. First route has been used.');
554
556
  }
555
557
  return productRoutes[0];
556
558
  }
@@ -582,7 +584,7 @@ class WorkspaceService {
582
584
  path = path.replace(this.paramStart.concat(paramName).concat(this.paramEnd), paramValue);
583
585
  }
584
586
  else {
585
- console.log(`WARNING: Searched param "${paramName}" was not found in given param list `);
587
+ this.logger.warn(`Searched param "${paramName}" was not found in given param list `);
586
588
  return '';
587
589
  }
588
590
  }
@@ -599,10 +601,10 @@ class WorkspaceService {
599
601
  return String(value);
600
602
  }
601
603
  }
602
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: WorkspaceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
603
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: WorkspaceService, providedIn: 'root' }); }
604
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: WorkspaceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
605
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: WorkspaceService, providedIn: 'root' }); }
604
606
  }
605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: WorkspaceService, decorators: [{
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: WorkspaceService, decorators: [{
606
608
  type: Injectable,
607
609
  args: [{
608
610
  providedIn: 'root',
@@ -616,9 +618,6 @@ class ImageRepositoryService {
616
618
  get imageRepositoryTopic() {
617
619
  return this.imageRepositoryInterface.imageRepositoryTopic;
618
620
  }
619
- set imageRepositoryTopic(source) {
620
- this.imageRepositoryInterface.imageRepositoryTopic = source;
621
- }
622
621
  async getUrl(names, fallbackUrl) {
623
622
  if (fallbackUrl) {
624
623
  return this.imageRepositoryInterface.getUrl(names, fallbackUrl);
@@ -628,13 +627,10 @@ class ImageRepositoryService {
628
627
  ngOnDestroy() {
629
628
  this.imageRepositoryInterface.destroy();
630
629
  }
631
- destroy() {
632
- this.ngOnDestroy();
633
- }
634
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageRepositoryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
635
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageRepositoryService, providedIn: 'root' }); }
630
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ImageRepositoryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
631
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ImageRepositoryService, providedIn: 'root' }); }
636
632
  }
637
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageRepositoryService, decorators: [{
633
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ImageRepositoryService, decorators: [{
638
634
  type: Injectable,
639
635
  args: [{ providedIn: 'root' }]
640
636
  }] });
@@ -655,10 +651,31 @@ class IconService {
655
651
  ngOnDestroy() {
656
652
  this.iconServiceInterface.destroy();
657
653
  }
658
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
659
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IconService, providedIn: 'root' }); }
654
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
655
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, providedIn: 'root' }); }
656
+ }
657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, decorators: [{
658
+ type: Injectable,
659
+ args: [{ providedIn: 'root' }]
660
+ }] });
661
+
662
+ class DynamicTranslationService {
663
+ constructor() {
664
+ this.dynamicTranslationInterface = new DynamicTranslationService$1();
665
+ }
666
+ get dynamicTranslationsTopic$() {
667
+ return this.dynamicTranslationInterface.dynamicTranslationsTopic$;
668
+ }
669
+ getTranslations(lang, contexts) {
670
+ return this.dynamicTranslationInterface.getTranslations(lang, contexts);
671
+ }
672
+ ngOnDestroy() {
673
+ this.dynamicTranslationInterface.destroy();
674
+ }
675
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DynamicTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
676
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DynamicTranslationService, providedIn: 'root' }); }
660
677
  }
661
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IconService, decorators: [{
678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DynamicTranslationService, decorators: [{
662
679
  type: Injectable,
663
680
  args: [{ providedIn: 'root' }]
664
681
  }] });
@@ -669,5 +686,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
669
686
  * Generated bundle index. Do not edit.
670
687
  */
671
688
 
672
- export { APPLICATION_NAME, APP_CONFIG, AppConfigService, AppStateService, CONFIG_KEY, Capability, ConfigurationService, IconService, ImageRepositoryService, POLYFILL_SCOPE_MODE, ParametersService, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ShellCapabilityService, ThemeService, UserService, WorkspaceService };
689
+ export { APPLICATION_NAME, APP_CONFIG, AppConfigService, AppStateService, CONFIG_KEY, ConfigurationService, DynamicTranslationService, IconService, ImageRepositoryService, POLYFILL_SCOPE_MODE, ParametersService, PortalMessageService, RemoteComponentsService, SANITY_CHECK, ShellCapabilityService, ThemeService, UserService, WorkspaceService };
673
690
  //# sourceMappingURL=onecx-angular-integration-interface.mjs.map