@onecx/angular-integration-interface 4.41.0 → 4.42.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ import { Injectable } from '@angular/core';
2
+ // eslint-disable-next-line
3
+ import { AppStateService } from '@onecx/angular-integration-interface';
4
+ import { FakeTopic } from './fake-topic';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * @deprecated use provideAppStateServiceMock()
8
+ */
9
+ export function provideAppServiceMock() {
10
+ return provideAppStateServiceMock();
11
+ }
12
+ export function provideAppStateServiceMock() {
13
+ return [{ provide: AppStateService, useClass: AppStateServiceMock }];
14
+ }
15
+ export class AppStateServiceMock {
16
+ constructor() {
17
+ this.globalError$ = new FakeTopic();
18
+ this.globalLoading$ = new FakeTopic(false);
19
+ this.currentMfe$ = new FakeTopic({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' });
20
+ this.currentPage$ = new FakeTopic(undefined);
21
+ this.currentPortal$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' });
22
+ this.currentWorkspace$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' });
23
+ this.isAuthenticated$ = new FakeTopic(null);
24
+ }
25
+ }
26
+ AppStateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27
+ AppStateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock });
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, decorators: [{
29
+ type: Injectable
30
+ }] });
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLXN0YXRlLXNlcnZpY2UtbW9jay5qcy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initialValue = undefined) {
4
+ if (initialValue !== undefined) {
5
+ this.state = new BehaviorSubject(initialValue);
6
+ }
7
+ else {
8
+ this.state = new ReplaySubject(1);
9
+ }
10
+ }
11
+ asObservable() {
12
+ return this.state.asObservable();
13
+ }
14
+ subscribe(observerOrNext, error, complete) {
15
+ return this.asObservable().subscribe(observerOrNext, error, complete);
16
+ }
17
+ pipe(...operations) {
18
+ return this.asObservable().pipe(...operations);
19
+ }
20
+ publish(value) {
21
+ this.state.next(value);
22
+ return Promise.resolve();
23
+ }
24
+ }
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFrZS10b3BpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2UvbW9ja3MvZmFrZS10b3BpYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQThELGVBQWUsRUFBRSxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFFakgsTUFBTSxPQUFPLFNBQVM7SUFFcEIsWUFBWSxlQUE4QixTQUFTO1FBQ2pELElBQUksWUFBWSxLQUFLLFNBQVMsRUFBRTtZQUM5QixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksZUFBZSxDQUFJLFlBQVksQ0FBQyxDQUFBO1NBQ2xEO2FBQU07WUFDTCxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksYUFBYSxDQUFJLENBQUMsQ0FBQyxDQUFBO1NBQ3JDO0lBQ0gsQ0FBQztJQUNELFlBQVk7UUFDVixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsWUFBWSxFQUFFLENBQUE7SUFDbEMsQ0FBQztJQUVELFNBQVMsQ0FDUCxjQUE0RCxFQUM1RCxLQUE0QixFQUM1QixRQUFxQjtRQUVyQixPQUFhLElBQUksQ0FBQyxZQUFZL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1YnNjcmliZShcbiAgICBvYnNlcnZlck9yTmV4dD86IFBhcnRpYWw8T2JzZXJ2ZXI8VD4+IHwgKCh2YWx1ZTogVCkgPT4gdm9pZCksXG4gICAgZXJyb3I/OiAoZXJyb3I6IGFueSkgPT4gdm9pZCxcbiAgICBjb21wbGV0ZT86ICgpID0+IHZvaWRcbiAgKTogU3Vic2NyaXB0aW9uIHtcbiAgICByZXR1cm4gKDxhbnk+dGhpcy5hc09ic2VydmFibGUoKSkuc3Vic2NyaWJlKG9ic2VydmVyT3JOZXh0LCBlcnJvciwgY29tcGxldGUpXG4gIH1cblxuICBwaXBlKC4uLm9wZXJhdGlvbnM6IFVuYXJ5RnVuY3Rpb248YW55LCBhbnk+W10pOiB1bmtub3duIHtcbiAgICByZXR1cm4gKDxhbnk+dGhpcy5hc09ic2VydmFibGUoKSkucGlwZSguLi5vcGVyYXRpb25zKVxuICB9XG5cbiAgcHVibGlzaCh2YWx1ZTogVCk6IFByb21pc2U8dm9pZD4ge1xuICAgIHRoaXMuc3RhdGUubmV4dCh2YWx1ZSlcbiAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKClcbiAgfVxufVxuIl19
@@ -0,0 +1,3 @@
1
+ export * from './mock-user-service';
2
+ export * from './app-state-service-mock';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL21vY2tzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMscUJBQXFCLENBQUE7QUFDbkMsY0FBYywwQkFBMEIsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbW9jay11c2VyLXNlcnZpY2UnXG5leHBvcnQgKiBmcm9tICcuL2FwcC1zdGF0ZS1zZXJ2aWNlLW1vY2snXG4iXX0=
@@ -0,0 +1,11 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ export class MockUserService {
3
+ constructor() {
4
+ this.lang$ = new BehaviorSubject('en');
5
+ }
6
+ /* eslint-disable @typescript-eslint/no-unused-vars */
7
+ hasPermission(permissionKey) {
8
+ return true;
9
+ }
10
+ }
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9jay11c2VyLXNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL21vY2tzL21vY2stdXNlci1zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxNQUFNLENBQUE7QUFFdEMsTUFBTSxPQUFPLGVBQWU7SUFBNUI7UUFDRSxVQUFLLEdBQUcsSUFBSSxlQUFlLENBQVMsSUFBSSxDQUFDLENBQUE7SUFLM0MsQ0FBQztJQUpDLHNEQUFzRDtJQUN0RCxhQUFhLENBQUMsYUFBcUI7UUFDakMsT0FBTyxJQUFJLENBQUE7SUFDYixDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBCZWhhdmlvclN1YmplY3QgfSBmcm9tICdyeGpzJ1xuXG5leHBvcnQgY2xhc3MgTW9ja1VzZXJTZXJ2aWNlIHtcbiAgbGFuZyQgPSBuZXcgQmVoYXZpb3JTdWJqZWN0PHN0cmluZz4oJ2VuJylcbiAgLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzICovXG4gIGhhc1Blcm1pc3Npb24ocGVybWlzc2lvbktleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRydWVcbiAgfVxufVxuIl19
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib25lY3gtYW5ndWxhci1pbnRlZ3JhdGlvbi1pbnRlcmZhY2UtbW9ja3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlL21vY2tzL29uZWN4LWFuZ3VsYXItaW50ZWdyYXRpb24taW50ZXJmYWNlLW1vY2tzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,71 @@
1
+ import { BehaviorSubject, ReplaySubject } from 'rxjs';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable } from '@angular/core';
4
+ import { AppStateService } from '@onecx/angular-integration-interface';
5
+
6
+ class MockUserService {
7
+ constructor() {
8
+ this.lang$ = new BehaviorSubject('en');
9
+ }
10
+ /* eslint-disable @typescript-eslint/no-unused-vars */
11
+ hasPermission(permissionKey) {
12
+ return true;
13
+ }
14
+ }
15
+
16
+ class FakeTopic {
17
+ constructor(initialValue = undefined) {
18
+ if (initialValue !== undefined) {
19
+ this.state = new BehaviorSubject(initialValue);
20
+ }
21
+ else {
22
+ this.state = new ReplaySubject(1);
23
+ }
24
+ }
25
+ asObservable() {
26
+ return this.state.asObservable();
27
+ }
28
+ subscribe(observerOrNext, error, complete) {
29
+ return this.asObservable().subscribe(observerOrNext, error, complete);
30
+ }
31
+ pipe(...operations) {
32
+ return this.asObservable().pipe(...operations);
33
+ }
34
+ publish(value) {
35
+ this.state.next(value);
36
+ return Promise.resolve();
37
+ }
38
+ }
39
+
40
+ /**
41
+ * @deprecated use provideAppStateServiceMock()
42
+ */
43
+ function provideAppServiceMock() {
44
+ return provideAppStateServiceMock();
45
+ }
46
+ function provideAppStateServiceMock() {
47
+ return [{ provide: AppStateService, useClass: AppStateServiceMock }];
48
+ }
49
+ class AppStateServiceMock {
50
+ constructor() {
51
+ this.globalError$ = new FakeTopic();
52
+ this.globalLoading$ = new FakeTopic(false);
53
+ this.currentMfe$ = new FakeTopic({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' });
54
+ this.currentPage$ = new FakeTopic(undefined);
55
+ this.currentPortal$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' });
56
+ this.currentWorkspace$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' });
57
+ this.isAuthenticated$ = new FakeTopic(null);
58
+ }
59
+ }
60
+ AppStateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
61
+ AppStateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock });
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, decorators: [{
63
+ type: Injectable
64
+ }] });
65
+
66
+ /**
67
+ * Generated bundle index. Do not edit.
68
+ */
69
+
70
+ export { AppStateServiceMock, MockUserService, provideAppServiceMock, provideAppStateServiceMock };
71
+ //# sourceMappingURL=onecx-angular-integration-interface-mocks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/mock-user-service.ts","../../../../libs/angular-integration-interface/mocks/fake-topic.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { BehaviorSubject } from 'rxjs'\n\nexport class MockUserService {\n lang$ = new BehaviorSubject<string>('en')\n /* eslint-disable @typescript-eslint/no-unused-vars */\n hasPermission(permissionKey: string): boolean {\n return true\n }\n}\n","import { Subject, Observable, Observer, Subscription, UnaryFunction, BehaviorSubject, ReplaySubject } from 'rxjs'\n\nexport class FakeTopic<T> {\n private state: Subject<T>\n constructor(initialValue: T | undefined = undefined) {\n if (initialValue !== undefined) {\n this.state = new BehaviorSubject<T>(initialValue)\n } else {\n this.state = new ReplaySubject<T>(1)\n }\n }\n asObservable(): Observable<T> {\n return this.state.asObservable()\n }\n\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void\n ): Subscription {\n return (<any>this.asObservable()).subscribe(observerOrNext, error, complete)\n }\n\n pipe(...operations: UnaryFunction<any, any>[]): unknown {\n return (<any>this.asObservable()).pipe(...operations)\n }\n\n publish(value: T): Promise<void> {\n this.state.next(value)\n return Promise.resolve()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from './fake-topic'\n\n/**\n * @deprecated use provideAppStateServiceMock()\n */\nexport function provideAppServiceMock() {\n return provideAppStateServiceMock()\n}\n\nexport function provideAppStateServiceMock() {\n return [{ provide: AppStateService, useClass: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' })\n currentWorkspace$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAEa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,KAAK,GAAG,IAAI,eAAe,CAAS,IAAI,CAAC,CAAA;KAK1C;;AAHC,IAAA,aAAa,CAAC,aAAqB,EAAA;AACjC,QAAA,OAAO,IAAI,CAAA;KACZ;AACF;;MCNY,SAAS,CAAA;IAEpB,WAAY,CAAA,eAA8B,SAAS,EAAA;QACjD,IAAI,YAAY,KAAK,SAAS,EAAE;YAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAI,YAAY,CAAC,CAAA;AAClD,SAAA;AAAM,aAAA;YACL,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAI,CAAC,CAAC,CAAA;AACrC,SAAA;KACF;IACD,YAAY,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAA;KACjC;AAED,IAAA,SAAS,CACP,cAA4D,EAC5D,KAA4B,EAC5B,QAAqB,EAAA;AAErB,QAAA,OAAa,IAAI,CAAC,YAAY,EAAG,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;KAC7E;IAED,IAAI,CAAC,GAAG,UAAqC,EAAA;QAC3C,OAAa,IAAI,CAAC,YAAY,EAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAA;KACtD;AAED,IAAA,OAAO,CAAC,KAAQ,EAAA;AACd,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACtB,QAAA,OAAO,OAAO,CAAC,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AD/B,UAAU;;;ACjBX;;AAEG;;;;"}
@@ -0,0 +1,71 @@
1
+ import { BehaviorSubject, ReplaySubject } from 'rxjs';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable } from '@angular/core';
4
+ import { AppStateService } from '@onecx/angular-integration-interface';
5
+
6
+ class MockUserService {
7
+ constructor() {
8
+ this.lang$ = new BehaviorSubject('en');
9
+ }
10
+ /* eslint-disable @typescript-eslint/no-unused-vars */
11
+ hasPermission(permissionKey) {
12
+ return true;
13
+ }
14
+ }
15
+
16
+ class FakeTopic {
17
+ constructor(initialValue = undefined) {
18
+ if (initialValue !== undefined) {
19
+ this.state = new BehaviorSubject(initialValue);
20
+ }
21
+ else {
22
+ this.state = new ReplaySubject(1);
23
+ }
24
+ }
25
+ asObservable() {
26
+ return this.state.asObservable();
27
+ }
28
+ subscribe(observerOrNext, error, complete) {
29
+ return this.asObservable().subscribe(observerOrNext, error, complete);
30
+ }
31
+ pipe(...operations) {
32
+ return this.asObservable().pipe(...operations);
33
+ }
34
+ publish(value) {
35
+ this.state.next(value);
36
+ return Promise.resolve();
37
+ }
38
+ }
39
+
40
+ /**
41
+ * @deprecated use provideAppStateServiceMock()
42
+ */
43
+ function provideAppServiceMock() {
44
+ return provideAppStateServiceMock();
45
+ }
46
+ function provideAppStateServiceMock() {
47
+ return [{ provide: AppStateService, useClass: AppStateServiceMock }];
48
+ }
49
+ class AppStateServiceMock {
50
+ constructor() {
51
+ this.globalError$ = new FakeTopic();
52
+ this.globalLoading$ = new FakeTopic(false);
53
+ this.currentMfe$ = new FakeTopic({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' });
54
+ this.currentPage$ = new FakeTopic(undefined);
55
+ this.currentPortal$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' });
56
+ this.currentWorkspace$ = new FakeTopic({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' });
57
+ this.isAuthenticated$ = new FakeTopic(null);
58
+ }
59
+ }
60
+ AppStateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
61
+ AppStateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock });
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppStateServiceMock, decorators: [{
63
+ type: Injectable
64
+ }] });
65
+
66
+ /**
67
+ * Generated bundle index. Do not edit.
68
+ */
69
+
70
+ export { AppStateServiceMock, MockUserService, provideAppServiceMock, provideAppStateServiceMock };
71
+ //# sourceMappingURL=onecx-angular-integration-interface-mocks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onecx-angular-integration-interface-mocks.mjs","sources":["../../../../libs/angular-integration-interface/mocks/mock-user-service.ts","../../../../libs/angular-integration-interface/mocks/fake-topic.ts","../../../../libs/angular-integration-interface/mocks/app-state-service-mock.ts","../../../../libs/angular-integration-interface/mocks/onecx-angular-integration-interface-mocks.ts"],"sourcesContent":["import { BehaviorSubject } from 'rxjs'\n\nexport class MockUserService {\n lang$ = new BehaviorSubject<string>('en')\n /* eslint-disable @typescript-eslint/no-unused-vars */\n hasPermission(permissionKey: string): boolean {\n return true\n }\n}\n","import { Subject, Observable, Observer, Subscription, UnaryFunction, BehaviorSubject, ReplaySubject } from 'rxjs'\n\nexport class FakeTopic<T> {\n private state: Subject<T>\n constructor(initialValue: T | undefined = undefined) {\n if (initialValue !== undefined) {\n this.state = new BehaviorSubject<T>(initialValue)\n } else {\n this.state = new ReplaySubject<T>(1)\n }\n }\n asObservable(): Observable<T> {\n return this.state.asObservable()\n }\n\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void\n ): Subscription {\n return (<any>this.asObservable()).subscribe(observerOrNext, error, complete)\n }\n\n pipe(...operations: UnaryFunction<any, any>[]): unknown {\n return (<any>this.asObservable()).pipe(...operations)\n }\n\n publish(value: T): Promise<void> {\n this.state.next(value)\n return Promise.resolve()\n }\n}\n","import { Injectable } from '@angular/core'\nimport { PageInfo, Workspace } from '@onecx/integration-interface'\n// eslint-disable-next-line\nimport { AppStateService } from '@onecx/angular-integration-interface'\nimport { FakeTopic } from './fake-topic'\n\n/**\n * @deprecated use provideAppStateServiceMock()\n */\nexport function provideAppServiceMock() {\n return provideAppStateServiceMock()\n}\n\nexport function provideAppStateServiceMock() {\n return [{ provide: AppStateService, useClass: AppStateServiceMock }]\n}\n\n@Injectable()\nexport class AppStateServiceMock {\n globalError$ = new FakeTopic()\n globalLoading$ = new FakeTopic(false)\n currentMfe$ = new FakeTopic({ mountPath: '/', remoteBaseUrl: '.', baseHref: '/', shellName: 'test' })\n currentPage$ = new FakeTopic<PageInfo | undefined>(undefined)\n currentPortal$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test portal', workspaceName: 'Test portal' })\n currentWorkspace$ = new FakeTopic<Workspace>({ baseUrl: '/', microfrontendRegistrations: [], portalName: 'Test workspace', workspaceName: 'Test workspace' })\n isAuthenticated$ = new FakeTopic<null>(null)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAEa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,eAAe,CAAS,IAAI,CAAC,CAAA;KAK1C;;AAHC,IAAA,aAAa,CAAC,aAAqB,EAAA;AACjC,QAAA,OAAO,IAAI,CAAA;KACZ;AACF;;MCNY,SAAS,CAAA;AAEpB,IAAA,WAAA,CAAY,eAA8B,SAAS,EAAA;QACjD,IAAI,YAAY,KAAK,SAAS,EAAE;YAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,eAA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AA,YAAY,GAAG,IAAI,SAAS,CAAuB,SAAS,CAAC,CAAA;QAC7D,IAAc,CAAA,cAAA,GAAG,IAAI,SAAS,CAAY,EAAE,OAAO,EAAE,GAAG,EAAE,0BAA0B,EAAE,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAA;QACpJ,IAAiB,CAAA,iBAAA,GAAG,IAAI,SAAS,CAAY,EAAE,OAAO,EAAE,GAAG,EAAE,0BAA0B,EAAE,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,CAAA;AAC7J,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,SAAS,CAAO,IAAI,CAAC,CAAA;AAC7C,KAAA;;iHARY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qHAAnB,mBAAmB,EAAA,CAAA,CAAA;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;;;ACjBX;;AAEG;;;;"}
@@ -0,0 +1,31 @@
1
+ import { PageInfo, Workspace } from '@onecx/integration-interface';
2
+ import { AppStateService } from '@onecx/angular-integration-interface';
3
+ import { FakeTopic } from './fake-topic';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * @deprecated use provideAppStateServiceMock()
7
+ */
8
+ export declare function provideAppServiceMock(): {
9
+ provide: typeof AppStateService;
10
+ useClass: typeof AppStateServiceMock;
11
+ }[];
12
+ export declare function provideAppStateServiceMock(): {
13
+ provide: typeof AppStateService;
14
+ useClass: typeof AppStateServiceMock;
15
+ }[];
16
+ export declare class AppStateServiceMock {
17
+ globalError$: FakeTopic<unknown>;
18
+ globalLoading$: FakeTopic<boolean>;
19
+ currentMfe$: FakeTopic<{
20
+ mountPath: string;
21
+ remoteBaseUrl: string;
22
+ baseHref: string;
23
+ shellName: string;
24
+ }>;
25
+ currentPage$: FakeTopic<PageInfo | undefined>;
26
+ currentPortal$: FakeTopic<Workspace>;
27
+ currentWorkspace$: FakeTopic<Workspace>;
28
+ isAuthenticated$: FakeTopic<null>;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppStateServiceMock, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<AppStateServiceMock>;
31
+ }
@@ -0,0 +1,9 @@
1
+ import { Observable, Observer, Subscription, UnaryFunction } from 'rxjs';
2
+ export declare class FakeTopic<T> {
3
+ private state;
4
+ constructor(initialValue?: T | undefined);
5
+ asObservable(): Observable<T>;
6
+ subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void), error?: (error: any) => void, complete?: () => void): Subscription;
7
+ pipe(...operations: UnaryFunction<any, any>[]): unknown;
8
+ publish(value: T): Promise<void>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from './mock-user-service';
2
+ export * from './app-state-service-mock';
@@ -0,0 +1,5 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ export declare class MockUserService {
3
+ lang$: BehaviorSubject<string>;
4
+ hasPermission(permissionKey: string): boolean;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onecx/angular-integration-interface",
3
- "version": "4.41.0",
3
+ "version": "4.42.0",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^15.2.7",
6
6
  "@onecx/integration-interface": "~4",
@@ -29,6 +29,14 @@
29
29
  "es2015": "./fesm2015/onecx-angular-integration-interface.mjs",
30
30
  "node": "./fesm2015/onecx-angular-integration-interface.mjs",
31
31
  "default": "./fesm2020/onecx-angular-integration-interface.mjs"
32
+ },
33
+ "./mocks": {
34
+ "types": "./mocks/index.d.ts",
35
+ "esm2020": "./esm2020/mocks/onecx-angular-integration-interface-mocks.mjs",
36
+ "es2020": "./fesm2020/onecx-angular-integration-interface-mocks.mjs",
37
+ "es2015": "./fesm2015/onecx-angular-integration-interface-mocks.mjs",
38
+ "node": "./fesm2015/onecx-angular-integration-interface-mocks.mjs",
39
+ "default": "./fesm2020/onecx-angular-integration-interface-mocks.mjs"
32
40
  }
33
41
  },
34
42
  "sideEffects": false