@acorex/connectivity 20.6.0-next.2 → 20.6.0-next.21
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.
- package/api/index.d.ts +168 -2
- package/fesm2022/{acorex-connectivity-api-execute.command-BesxhDsD.mjs → acorex-connectivity-api-execute.command-CQt_HF1B.mjs} +16 -7
- package/fesm2022/acorex-connectivity-api-execute.command-CQt_HF1B.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-api.mjs +224 -184
- package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
- package/fesm2022/{acorex-connectivity-mock-category-with-items.query-Cii5As1T.mjs → acorex-connectivity-mock-category-with-items.query-Dsxj98tX.mjs} +5 -5
- package/fesm2022/acorex-connectivity-mock-category-with-items.query-Dsxj98tX.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-distribution-record.command-w3zoeELy.mjs → acorex-connectivity-mock-distribution-record.command-DRiDwlqN.mjs} +15 -6
- package/fesm2022/acorex-connectivity-mock-distribution-record.command-DRiDwlqN.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-sample.command-C5jZuYcW.mjs → acorex-connectivity-mock-sample.command-CkH5bmEs.mjs} +7 -4
- package/fesm2022/acorex-connectivity-mock-sample.command-CkH5bmEs.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock.mjs +15875 -9867
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-utils.mjs +7 -7
- package/fesm2022/acorex-connectivity-utils.mjs.map +1 -1
- package/mock/index.d.ts +1317 -95
- package/package.json +2 -2
- package/fesm2022/acorex-connectivity-api-execute.command-BesxhDsD.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-category-with-items.query-Cii5As1T.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-distribution-record.command-w3zoeELy.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-sample.command-C5jZuYcW.mjs.map +0 -1
|
@@ -8,11 +8,14 @@ import { kebabCase } from 'lodash-es';
|
|
|
8
8
|
import { firstValueFrom, catchError, of, map, BehaviorSubject, tap, filter, take, switchMap, delay } from 'rxjs';
|
|
9
9
|
import * as i2 from '@acorex/platform/auth';
|
|
10
10
|
import { AXPAuthStrategy, AXPSessionService, JwtUtil, TimeUtil, PkceUtil, AXPAuthModule, AXP_TENANT_LOADER, AXP_APPLICATION_LOADER, AXP_PERMISSION_LOADER, AXP_FEATURE_LOADER } from '@acorex/platform/auth';
|
|
11
|
+
import { AXP_USER_AVATAR_PROVIDER } from '@acorex/platform/layout/components';
|
|
11
12
|
import { STRATEGY_CONFIG_TOKEN } from '@acorex/platform/layout/widgets';
|
|
12
13
|
import * as i1$1 from 'angular-oauth2-oidc';
|
|
13
14
|
import { OAuthService, OAuthModule } from 'angular-oauth2-oidc';
|
|
14
15
|
import { AXM_AUTH_CONFIG_TOKEN } from '@acorex/modules/auth';
|
|
15
16
|
import { Router } from '@angular/router';
|
|
17
|
+
import { AXMUsersEntityService } from '@acorex/modules/security-management';
|
|
18
|
+
import { AXPDataGenerator } from '@acorex/platform/core';
|
|
16
19
|
import { AXCUtilsModule, AXCExternalAuthorizationService } from '@acorex/connectivity/utils';
|
|
17
20
|
import { AXPRuntimeModule, provideCommandSetups } from '@acorex/platform/runtime';
|
|
18
21
|
import { AXP_REPORT_CATEGORY_PROVIDER, AXP_REPORT_DEFINITION_PROVIDER } from '@acorex/modules/report-management';
|
|
@@ -138,10 +141,10 @@ class AXCApiEntityStorageService {
|
|
|
138
141
|
};
|
|
139
142
|
});
|
|
140
143
|
}
|
|
141
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
142
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
144
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiEntityStorageService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
145
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiEntityStorageService }); }
|
|
143
146
|
}
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiEntityStorageService, decorators: [{
|
|
145
148
|
type: Injectable
|
|
146
149
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
147
150
|
|
|
@@ -285,10 +288,10 @@ class AXCFileStorageApiService extends AXPFileStorageService {
|
|
|
285
288
|
// Silently fail in fallback mode
|
|
286
289
|
}
|
|
287
290
|
}
|
|
288
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
289
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
291
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCFileStorageApiService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
292
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCFileStorageApiService }); }
|
|
290
293
|
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCFileStorageApiService, decorators: [{
|
|
292
295
|
type: Injectable
|
|
293
296
|
}] });
|
|
294
297
|
|
|
@@ -333,10 +336,10 @@ class AXMOidcApplicationLoader {
|
|
|
333
336
|
// features: item.features || [],
|
|
334
337
|
};
|
|
335
338
|
}
|
|
336
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
337
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcApplicationLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
340
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcApplicationLoader }); }
|
|
338
341
|
}
|
|
339
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcApplicationLoader, decorators: [{
|
|
340
343
|
type: Injectable
|
|
341
344
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
342
345
|
|
|
@@ -376,10 +379,10 @@ class AXMConfigurationService {
|
|
|
376
379
|
switchMap(() => of(this.applicationConfig)));
|
|
377
380
|
}
|
|
378
381
|
}
|
|
379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
380
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
382
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMConfigurationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
383
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMConfigurationService, providedIn: 'root' }); }
|
|
381
384
|
}
|
|
382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMConfigurationService, decorators: [{
|
|
383
386
|
type: Injectable,
|
|
384
387
|
args: [{
|
|
385
388
|
providedIn: 'root',
|
|
@@ -725,10 +728,10 @@ class AXCAPIOidcStrategy extends AXPAuthStrategy {
|
|
|
725
728
|
get name() {
|
|
726
729
|
return 'oidc';
|
|
727
730
|
}
|
|
728
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
729
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
731
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCAPIOidcStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
732
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCAPIOidcStrategy }); }
|
|
730
733
|
}
|
|
731
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCAPIOidcStrategy, decorators: [{
|
|
732
735
|
type: Injectable
|
|
733
736
|
}] });
|
|
734
737
|
|
|
@@ -753,10 +756,10 @@ class AXMOidcPermissionLoader {
|
|
|
753
756
|
const truePolicies = Object.keys(policies).filter((key) => policies[key] === true);
|
|
754
757
|
return truePolicies;
|
|
755
758
|
}
|
|
756
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
757
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
759
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcPermissionLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
760
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcPermissionLoader }); }
|
|
758
761
|
}
|
|
759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
762
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcPermissionLoader, decorators: [{
|
|
760
763
|
type: Injectable
|
|
761
764
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
762
765
|
|
|
@@ -782,120 +785,77 @@ class AXMOidcTenantLoader {
|
|
|
782
785
|
// Add other fields and defaults as needed, and handle the logo if applicable
|
|
783
786
|
};
|
|
784
787
|
}
|
|
785
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
786
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
788
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcTenantLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
789
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcTenantLoader }); }
|
|
787
790
|
}
|
|
788
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXMOidcTenantLoader, decorators: [{
|
|
789
792
|
type: Injectable
|
|
790
793
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
791
794
|
|
|
792
|
-
|
|
793
|
-
//#region ---- Helper Functions ----
|
|
794
|
-
// /**
|
|
795
|
-
// * Converts a widget string to AXPWidgetsList key
|
|
796
|
-
// */
|
|
797
|
-
// function convertWidgetStringToAXPWidgetsListKey(
|
|
798
|
-
// widgetString: string,
|
|
799
|
-
// )
|
|
800
|
-
// :
|
|
801
|
-
// | keyof typeof AXPWidgetsList.Editors
|
|
802
|
-
// | keyof typeof AXPWidgetsList.Layouts
|
|
803
|
-
// | keyof typeof AXPWidgetsList.Actions
|
|
804
|
-
// | keyof typeof AXPWidgetsList.Advanced
|
|
805
|
-
// | keyof typeof AXPWidgetsList.Templates
|
|
806
|
-
// | keyof typeof AXPWidgetsList.Entity
|
|
807
|
-
// | keyof typeof AXPWidgetsList.Theme
|
|
808
|
-
// {
|
|
809
|
-
// console.log('Converting widget string:', widgetString);
|
|
810
|
-
// // Check if the string is in format "AXPWidgetsList.Category.Key"
|
|
811
|
-
// if (widgetString.startsWith('AXPWidgetsList.')) {
|
|
812
|
-
// // Extract the key from "AXPWidgetsList.Editors.DateTimeBox" -> "DateTimeBox"
|
|
813
|
-
// const parts = widgetString.split('.');
|
|
814
|
-
// if (parts.length >= 3) {
|
|
815
|
-
// const key = parts[parts.length - 1]; // Get the last part (key)
|
|
816
|
-
// console.log('Extracted key from AXPWidgetsList format:', key);
|
|
817
|
-
// return key as any;
|
|
818
|
-
// }
|
|
819
|
-
// }
|
|
820
|
-
// // Search through all AXPWidgetsList categories to find matching widget
|
|
821
|
-
// for (const category of Object.values(AXPWidgetsList)) {
|
|
822
|
-
// if (typeof category === 'object') {
|
|
823
|
-
// for (const [key, value] of Object.entries(category)) {
|
|
824
|
-
// if (value === widgetString) {
|
|
825
|
-
// console.log('Found matching widget:', key, 'for value:', value);
|
|
826
|
-
// return key as any; // Return the AXPWidgetsList key (e.g., "DateTimeBox")
|
|
827
|
-
// }
|
|
828
|
-
// }
|
|
829
|
-
// }
|
|
830
|
-
// }
|
|
831
|
-
// console.log('Widget not found in AXPWidgetsList, returning original string:', widgetString);
|
|
832
|
-
// // If not found in AXPWidgetsList, return the original string as fallback
|
|
833
|
-
// return widgetString as any;
|
|
834
|
-
// }
|
|
835
|
-
//#endregion
|
|
836
|
-
//#region ---- Shared Data Service ----
|
|
837
|
-
class AXCReportManagementDataService {
|
|
795
|
+
class AXCApiUserAvatarProvider {
|
|
838
796
|
constructor() {
|
|
839
|
-
this.
|
|
840
|
-
this.
|
|
841
|
-
this.baseUrl = this.configs.baseUrl;
|
|
842
|
-
// Shared cache for all categories data
|
|
843
|
-
this.allCategoriesData = [];
|
|
844
|
-
this.dataLoaded = false;
|
|
797
|
+
this.userService = inject(AXMUsersEntityService);
|
|
798
|
+
this.sessionService = inject(AXPSessionService);
|
|
845
799
|
}
|
|
846
|
-
async
|
|
847
|
-
if
|
|
848
|
-
|
|
800
|
+
async provide(userId) {
|
|
801
|
+
// Check if requesting current user info
|
|
802
|
+
const currentUser = this.sessionService.user;
|
|
803
|
+
const isCurrentUser = currentUser?.id === userId;
|
|
804
|
+
if (isCurrentUser && currentUser) {
|
|
805
|
+
// Use session service user data for current user
|
|
806
|
+
const [firstName, lastName] = (currentUser.name || '').split(' ') || ['', ''];
|
|
807
|
+
return {
|
|
808
|
+
id: currentUser.id,
|
|
809
|
+
username: currentUser.name || '',
|
|
810
|
+
firstName: firstName || '',
|
|
811
|
+
lastName: lastName || '',
|
|
812
|
+
status: 'online',
|
|
813
|
+
avatarUrl: currentUser.avatar || `https://avatar.iran.liara.run/public/${AXPDataGenerator.pick([35, 22, 16, 6, 31])}`,
|
|
814
|
+
};
|
|
849
815
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
816
|
+
// Use entity service for other users
|
|
817
|
+
const user = await this.userService.getOne(userId);
|
|
818
|
+
if (!user) {
|
|
819
|
+
throw new Error(`User not found for ${userId}`);
|
|
820
|
+
}
|
|
821
|
+
const [firstName, lastName] = user.displayName.split(' ') || ['', ''];
|
|
822
|
+
return {
|
|
823
|
+
id: user.id,
|
|
824
|
+
username: user.username,
|
|
825
|
+
firstName: firstName || '',
|
|
826
|
+
lastName: lastName || '',
|
|
827
|
+
status: 'online',
|
|
828
|
+
avatarUrl: `https://avatar.iran.liara.run/public/${AXPDataGenerator.pick([35, 22, 16, 6, 31])}`,
|
|
829
|
+
};
|
|
862
830
|
}
|
|
863
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXCReportManagementDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
864
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXCReportManagementDataService }); }
|
|
865
831
|
}
|
|
866
|
-
|
|
867
|
-
type: Injectable
|
|
868
|
-
}] });
|
|
832
|
+
|
|
869
833
|
//#endregion
|
|
870
834
|
//#region ---- API Providers ----
|
|
871
835
|
class AXCReportCategoryApiProvider {
|
|
872
836
|
constructor() {
|
|
873
|
-
this.
|
|
874
|
-
|
|
875
|
-
this.
|
|
837
|
+
this.http = inject(HttpClient);
|
|
838
|
+
this.configs = inject(AXP_ROOT_CONFIG_TOKEN);
|
|
839
|
+
this.baseUrl = this.configs.baseUrl;
|
|
876
840
|
}
|
|
877
841
|
async getList(parentId) {
|
|
878
|
-
// Check cache first
|
|
879
|
-
if (this.categoriesCache.has(parentId)) {
|
|
880
|
-
return this.categoriesCache.get(parentId);
|
|
881
|
-
}
|
|
882
842
|
try {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
filteredItems
|
|
843
|
+
let url;
|
|
844
|
+
if (parentId) {
|
|
845
|
+
url = `${this.baseUrl}/v1/global/report-management/category/${parentId}`;
|
|
846
|
+
const response = await firstValueFrom(this.http.get(url));
|
|
847
|
+
const categoryData = response.items?.[0];
|
|
848
|
+
const filteredItems = categoryData?.folderItems ?? [];
|
|
849
|
+
return filteredItems.map((item) => this.mapApiCategoryToReportCategory(item));
|
|
890
850
|
}
|
|
891
851
|
else {
|
|
892
|
-
|
|
893
|
-
|
|
852
|
+
url = `${this.baseUrl}/v1/global/report-management/category`;
|
|
853
|
+
const params = { Skip: 0, Take: 1000 };
|
|
854
|
+
const response = await firstValueFrom(this.http.get(url, { params }));
|
|
855
|
+
const all = response.items ?? [];
|
|
856
|
+
const rootCategories = all.filter((i) => !i.reportCategoryParentId);
|
|
857
|
+
return rootCategories.map((item) => this.mapApiCategoryToReportCategory(item));
|
|
894
858
|
}
|
|
895
|
-
const categories = filteredItems.map((item) => this.mapApiCategoryToReportCategory(item));
|
|
896
|
-
// Cache the result
|
|
897
|
-
this.categoriesCache.set(parentId, categories);
|
|
898
|
-
return categories;
|
|
899
859
|
}
|
|
900
860
|
catch (error) {
|
|
901
861
|
console.error('Error fetching report categories:', error);
|
|
@@ -904,11 +864,17 @@ class AXCReportCategoryApiProvider {
|
|
|
904
864
|
}
|
|
905
865
|
async getById(id) {
|
|
906
866
|
try {
|
|
907
|
-
|
|
908
|
-
const
|
|
909
|
-
const apiItem =
|
|
867
|
+
const url = `${this.baseUrl}/v1/global/report-management/category/${id}`;
|
|
868
|
+
const response = await firstValueFrom(this.http.get(url));
|
|
869
|
+
const apiItem = response.items?.[0];
|
|
910
870
|
if (!apiItem) {
|
|
911
|
-
|
|
871
|
+
// Fallback: search in all categories
|
|
872
|
+
const allUrl = `${this.baseUrl}/v1/global/report-management/category`;
|
|
873
|
+
const params = { Skip: 0, Take: 1000 };
|
|
874
|
+
const allResponse = await firstValueFrom(this.http.get(allUrl, { params }));
|
|
875
|
+
const all = allResponse.items ?? [];
|
|
876
|
+
const found = all.find((c) => c.id === id);
|
|
877
|
+
return found ? this.mapApiCategoryToReportCategory(found) : undefined;
|
|
912
878
|
}
|
|
913
879
|
return this.mapApiCategoryToReportCategory(apiItem);
|
|
914
880
|
}
|
|
@@ -923,59 +889,50 @@ class AXCReportCategoryApiProvider {
|
|
|
923
889
|
title: apiItem.title,
|
|
924
890
|
description: apiItem.description || undefined,
|
|
925
891
|
parentId: apiItem.reportCategoryParentId || undefined,
|
|
926
|
-
|
|
927
|
-
|
|
892
|
+
childrenCount: apiItem.folderCount ?? 0,
|
|
893
|
+
itemsCount: apiItem.itemCount ?? 0,
|
|
928
894
|
};
|
|
929
895
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
this.categoriesCache.clear();
|
|
933
|
-
this.dataService.clearCache();
|
|
934
|
-
}
|
|
935
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXCReportCategoryApiProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
936
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXCReportCategoryApiProvider }); }
|
|
896
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportCategoryApiProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
897
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportCategoryApiProvider }); }
|
|
937
898
|
}
|
|
938
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportCategoryApiProvider, decorators: [{
|
|
939
900
|
type: Injectable
|
|
940
901
|
}] });
|
|
941
902
|
class AXCReportDefinitionApiProvider {
|
|
942
903
|
constructor() {
|
|
943
|
-
this.dataService = inject(AXCReportManagementDataService);
|
|
944
904
|
this.http = inject(HttpClient);
|
|
945
|
-
|
|
946
|
-
this.
|
|
905
|
+
this.configs = inject(AXP_ROOT_CONFIG_TOKEN);
|
|
906
|
+
this.baseUrl = this.configs.baseUrl;
|
|
947
907
|
}
|
|
948
908
|
async getList(categoryId) {
|
|
949
|
-
// Check cache first
|
|
950
|
-
if (this.reportDefinitionsCache.has(categoryId)) {
|
|
951
|
-
return this.reportDefinitionsCache.get(categoryId);
|
|
952
|
-
}
|
|
953
909
|
try {
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
910
|
+
const url = `${this.baseUrl}/v1/global/report-management/category/${categoryId}`;
|
|
911
|
+
const response = await firstValueFrom(this.http.get(url));
|
|
912
|
+
const categoryData = response.items?.[0];
|
|
913
|
+
const defs = categoryData?.reportDefinitionItems ?? [];
|
|
914
|
+
// Fetch full report definitions for each item to get layouts and parameterGroups
|
|
915
|
+
const fullDefinitions = await Promise.all(defs.map(async (item) => {
|
|
916
|
+
try {
|
|
917
|
+
const reportUrl = `${this.baseUrl}/v1/global/report-management/report/${item.id}`;
|
|
918
|
+
const reportResponse = await firstValueFrom(this.http.get(reportUrl));
|
|
919
|
+
return this.mapApiReportDefinitionToReportDefinition(reportResponse);
|
|
920
|
+
}
|
|
921
|
+
catch {
|
|
922
|
+
// Fallback to item mapping if full fetch fails
|
|
923
|
+
return this.mapApiReportDefinitionItemToReportDefinition(item);
|
|
924
|
+
}
|
|
925
|
+
}));
|
|
926
|
+
return fullDefinitions;
|
|
967
927
|
}
|
|
968
928
|
catch (error) {
|
|
969
929
|
console.error('Error fetching report definitions:', error);
|
|
970
|
-
// Cache empty result to avoid repeated failed API calls
|
|
971
|
-
this.reportDefinitionsCache.set(categoryId, []);
|
|
972
930
|
return [];
|
|
973
931
|
}
|
|
974
932
|
}
|
|
975
933
|
async getById(id) {
|
|
976
934
|
try {
|
|
977
|
-
|
|
978
|
-
const url = `${this.dataService['baseUrl']}/v1/global/report-management/report/${id}`;
|
|
935
|
+
const url = `${this.baseUrl}/v1/global/report-management/report/${id}`;
|
|
979
936
|
const response = await firstValueFrom(this.http.get(url));
|
|
980
937
|
return this.mapApiReportDefinitionToReportDefinition(response);
|
|
981
938
|
}
|
|
@@ -990,13 +947,13 @@ class AXCReportDefinitionApiProvider {
|
|
|
990
947
|
title: apiItem.title,
|
|
991
948
|
description: apiItem.description || undefined,
|
|
992
949
|
categoryIds: apiItem.categoryIds,
|
|
993
|
-
parameterGroups: [],
|
|
994
|
-
layouts: [],
|
|
995
|
-
defaultLayoutId: '',
|
|
950
|
+
parameterGroups: [],
|
|
951
|
+
layouts: [],
|
|
952
|
+
defaultLayoutId: '',
|
|
996
953
|
};
|
|
997
954
|
}
|
|
998
955
|
mapApiReportDefinitionToReportDefinition(apiResponse) {
|
|
999
|
-
|
|
956
|
+
return {
|
|
1000
957
|
id: apiResponse.id,
|
|
1001
958
|
title: apiResponse.title,
|
|
1002
959
|
description: apiResponse.description || undefined,
|
|
@@ -1025,17 +982,11 @@ class AXCReportDefinitionApiProvider {
|
|
|
1025
982
|
})),
|
|
1026
983
|
defaultLayoutId: apiResponse.defaultLayoutId,
|
|
1027
984
|
};
|
|
1028
|
-
return res;
|
|
1029
|
-
}
|
|
1030
|
-
// Method to clear cache when needed
|
|
1031
|
-
clearCache() {
|
|
1032
|
-
this.reportDefinitionsCache.clear();
|
|
1033
|
-
this.dataService.clearCache();
|
|
1034
985
|
}
|
|
1035
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1036
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
986
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportDefinitionApiProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
987
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportDefinitionApiProvider }); }
|
|
1037
988
|
}
|
|
1038
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportDefinitionApiProvider, decorators: [{
|
|
1039
990
|
type: Injectable
|
|
1040
991
|
}] });
|
|
1041
992
|
//#endregion
|
|
@@ -1052,45 +1003,43 @@ const AXC_REPORT_DEFINITION_API_PROVIDER = {
|
|
|
1052
1003
|
};
|
|
1053
1004
|
|
|
1054
1005
|
class AXCReportManagementApiModule {
|
|
1055
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1056
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
1057
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
1058
|
-
AXCReportManagementDataService,
|
|
1006
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportManagementApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1007
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXCReportManagementApiModule, imports: [AXPRuntimeModule] }); }
|
|
1008
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportManagementApiModule, providers: [
|
|
1059
1009
|
AXC_REPORT_CATEGORY_API_PROVIDER,
|
|
1060
1010
|
AXC_REPORT_DEFINITION_API_PROVIDER,
|
|
1061
1011
|
provideCommandSetups([
|
|
1062
1012
|
{
|
|
1063
1013
|
key: 'ReportManagement.Report:Execute',
|
|
1064
|
-
command: () => import('./acorex-connectivity-api-execute.command-
|
|
1065
|
-
}
|
|
1014
|
+
command: () => import('./acorex-connectivity-api-execute.command-CQt_HF1B.mjs').then((c) => c.AXCReportExecuteCommand),
|
|
1015
|
+
}
|
|
1066
1016
|
]),
|
|
1067
1017
|
], imports: [AXPRuntimeModule] }); }
|
|
1068
1018
|
}
|
|
1069
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCReportManagementApiModule, decorators: [{
|
|
1070
1020
|
type: NgModule,
|
|
1071
1021
|
args: [{
|
|
1072
1022
|
imports: [AXPRuntimeModule],
|
|
1073
1023
|
exports: [],
|
|
1074
1024
|
declarations: [],
|
|
1075
1025
|
providers: [
|
|
1076
|
-
AXCReportManagementDataService,
|
|
1077
1026
|
AXC_REPORT_CATEGORY_API_PROVIDER,
|
|
1078
1027
|
AXC_REPORT_DEFINITION_API_PROVIDER,
|
|
1079
1028
|
provideCommandSetups([
|
|
1080
1029
|
{
|
|
1081
1030
|
key: 'ReportManagement.Report:Execute',
|
|
1082
|
-
command: () => import('./acorex-connectivity-api-execute.command-
|
|
1083
|
-
}
|
|
1031
|
+
command: () => import('./acorex-connectivity-api-execute.command-CQt_HF1B.mjs').then((c) => c.AXCReportExecuteCommand),
|
|
1032
|
+
}
|
|
1084
1033
|
]),
|
|
1085
1034
|
],
|
|
1086
1035
|
}]
|
|
1087
1036
|
}] });
|
|
1088
1037
|
|
|
1089
1038
|
class AXCApiModule {
|
|
1090
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1091
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
1039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1040
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXCApiModule, imports: [i1$1.OAuthModule, i2.AXPAuthModule, AXCUtilsModule,
|
|
1092
1041
|
AXCReportManagementApiModule] }); }
|
|
1093
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
1042
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiModule, providers: [
|
|
1094
1043
|
{
|
|
1095
1044
|
provide: AXPEntityStorageService,
|
|
1096
1045
|
useClass: AXCApiEntityStorageService,
|
|
@@ -1121,7 +1070,11 @@ class AXCApiModule {
|
|
|
1121
1070
|
selectValueStrategy: 'valueField',
|
|
1122
1071
|
lookupValueStrategy: 'valueField',
|
|
1123
1072
|
},
|
|
1124
|
-
}
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
provide: AXP_USER_AVATAR_PROVIDER,
|
|
1076
|
+
useClass: AXCApiUserAvatarProvider,
|
|
1077
|
+
},
|
|
1125
1078
|
], imports: [OAuthModule.forRoot(),
|
|
1126
1079
|
AXPAuthModule.forRoot({
|
|
1127
1080
|
strategies: [AXCAPIOidcStrategy],
|
|
@@ -1129,7 +1082,7 @@ class AXCApiModule {
|
|
|
1129
1082
|
AXCUtilsModule,
|
|
1130
1083
|
AXCReportManagementApiModule] }); }
|
|
1131
1084
|
}
|
|
1132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCApiModule, decorators: [{
|
|
1133
1086
|
type: NgModule,
|
|
1134
1087
|
args: [{
|
|
1135
1088
|
imports: [
|
|
@@ -1171,7 +1124,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImpo
|
|
|
1171
1124
|
selectValueStrategy: 'valueField',
|
|
1172
1125
|
lookupValueStrategy: 'valueField',
|
|
1173
1126
|
},
|
|
1174
|
-
}
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
provide: AXP_USER_AVATAR_PROVIDER,
|
|
1130
|
+
useClass: AXCApiUserAvatarProvider,
|
|
1131
|
+
},
|
|
1175
1132
|
],
|
|
1176
1133
|
}]
|
|
1177
1134
|
}] });
|
|
@@ -1440,16 +1397,99 @@ class APIGoogleStrategy extends AXPAuthStrategy {
|
|
|
1440
1397
|
console.error('Authentication error:', error);
|
|
1441
1398
|
throw error;
|
|
1442
1399
|
}
|
|
1443
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1444
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
1400
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: APIGoogleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1401
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: APIGoogleStrategy }); }
|
|
1445
1402
|
}
|
|
1446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: APIGoogleStrategy, decorators: [{
|
|
1447
1404
|
type: Injectable
|
|
1448
1405
|
}], ctorParameters: () => [] });
|
|
1449
1406
|
|
|
1407
|
+
//#region ---- Imports ----
|
|
1408
|
+
//#endregion
|
|
1409
|
+
//#region ---- API Providers ----
|
|
1410
|
+
class AXCSystemInsightReportCategoryApiProvider {
|
|
1411
|
+
constructor() {
|
|
1412
|
+
this.http = inject(HttpClient);
|
|
1413
|
+
}
|
|
1414
|
+
async getList(parentId) {
|
|
1415
|
+
try {
|
|
1416
|
+
// Call API to get report categories
|
|
1417
|
+
const params = {};
|
|
1418
|
+
if (parentId) {
|
|
1419
|
+
params.parentId = parentId;
|
|
1420
|
+
}
|
|
1421
|
+
const response = await firstValueFrom(this.http.get('/api/system-insight/report-categories', { params }));
|
|
1422
|
+
return response;
|
|
1423
|
+
}
|
|
1424
|
+
catch (error) {
|
|
1425
|
+
console.error('Failed to fetch system insight report categories from API:', error);
|
|
1426
|
+
return [];
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
async getById(id) {
|
|
1430
|
+
try {
|
|
1431
|
+
const response = await firstValueFrom(this.http.get(`/api/system-insight/report-categories/${id}`));
|
|
1432
|
+
return response;
|
|
1433
|
+
}
|
|
1434
|
+
catch (error) {
|
|
1435
|
+
console.error(`Failed to fetch system insight report category ${id} from API:`, error);
|
|
1436
|
+
return undefined;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportCategoryApiProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1440
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportCategoryApiProvider }); }
|
|
1441
|
+
}
|
|
1442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportCategoryApiProvider, decorators: [{
|
|
1443
|
+
type: Injectable
|
|
1444
|
+
}] });
|
|
1445
|
+
class AXCSystemInsightReportDefinitionApiProvider {
|
|
1446
|
+
constructor() {
|
|
1447
|
+
this.http = inject(HttpClient);
|
|
1448
|
+
}
|
|
1449
|
+
async getList(categoryId) {
|
|
1450
|
+
try {
|
|
1451
|
+
const response = await firstValueFrom(this.http.get(`/api/system-insight/report-definitions`, {
|
|
1452
|
+
params: { categoryId }
|
|
1453
|
+
}));
|
|
1454
|
+
return response;
|
|
1455
|
+
}
|
|
1456
|
+
catch (error) {
|
|
1457
|
+
console.error(`Failed to fetch system insight report definitions for category ${categoryId} from API:`, error);
|
|
1458
|
+
return [];
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
async getById(id) {
|
|
1462
|
+
try {
|
|
1463
|
+
const response = await firstValueFrom(this.http.get(`/api/system-insight/report-definitions/${id}`));
|
|
1464
|
+
return response;
|
|
1465
|
+
}
|
|
1466
|
+
catch (error) {
|
|
1467
|
+
console.error(`Failed to fetch system insight report definition ${id} from API:`, error);
|
|
1468
|
+
return undefined;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportDefinitionApiProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1472
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportDefinitionApiProvider }); }
|
|
1473
|
+
}
|
|
1474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXCSystemInsightReportDefinitionApiProvider, decorators: [{
|
|
1475
|
+
type: Injectable
|
|
1476
|
+
}] });
|
|
1477
|
+
//#endregion
|
|
1478
|
+
//#region ---- Provider Exports ----
|
|
1479
|
+
const AXC_SYSTEM_INSIGHT_REPORT_CATEGORY_API_PROVIDER = {
|
|
1480
|
+
provide: AXP_REPORT_CATEGORY_PROVIDER,
|
|
1481
|
+
useClass: AXCSystemInsightReportCategoryApiProvider,
|
|
1482
|
+
multi: true,
|
|
1483
|
+
};
|
|
1484
|
+
const AXC_SYSTEM_INSIGHT_REPORT_DEFINITION_API_PROVIDER = {
|
|
1485
|
+
provide: AXP_REPORT_DEFINITION_PROVIDER,
|
|
1486
|
+
useClass: AXCSystemInsightReportDefinitionApiProvider,
|
|
1487
|
+
multi: true,
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1450
1490
|
/**
|
|
1451
1491
|
* Generated bundle index. Do not edit.
|
|
1452
1492
|
*/
|
|
1453
1493
|
|
|
1454
|
-
export { APIGoogleStrategy, AXCAPIOidcStrategy, AXCApiEntityStorageService, AXCApiModule, AXCReportManagementApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcTenantLoader };
|
|
1494
|
+
export { APIGoogleStrategy, AXCAPIOidcStrategy, AXCApiEntityStorageService, AXCApiModule, AXCApiUserAvatarProvider, AXCReportCategoryApiProvider, AXCReportDefinitionApiProvider, AXCReportManagementApiModule, AXCSystemInsightReportCategoryApiProvider, AXCSystemInsightReportDefinitionApiProvider, AXC_REPORT_CATEGORY_API_PROVIDER, AXC_REPORT_DEFINITION_API_PROVIDER, AXC_SYSTEM_INSIGHT_REPORT_CATEGORY_API_PROVIDER, AXC_SYSTEM_INSIGHT_REPORT_DEFINITION_API_PROVIDER, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcTenantLoader };
|
|
1455
1495
|
//# sourceMappingURL=acorex-connectivity-api.mjs.map
|