@meshmakers/octo-services 3.3.580 → 3.3.600
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.
|
@@ -215,6 +215,26 @@ class ProgressValue {
|
|
|
215
215
|
class ProgressWindowService {
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
var IdentityProviderType;
|
|
219
|
+
(function (IdentityProviderType) {
|
|
220
|
+
IdentityProviderType[IdentityProviderType["Google"] = 0] = "Google";
|
|
221
|
+
IdentityProviderType[IdentityProviderType["Microsoft"] = 1] = "Microsoft";
|
|
222
|
+
IdentityProviderType[IdentityProviderType["MicrosoftAzureAd"] = 2] = "MicrosoftAzureAd";
|
|
223
|
+
IdentityProviderType[IdentityProviderType["MicrosoftActiveDirectory"] = 3] = "MicrosoftActiveDirectory";
|
|
224
|
+
IdentityProviderType[IdentityProviderType["OpenLdap"] = 4] = "OpenLdap";
|
|
225
|
+
IdentityProviderType[IdentityProviderType["Facebook"] = 5] = "Facebook";
|
|
226
|
+
IdentityProviderType[IdentityProviderType["OctoTenant"] = 6] = "OctoTenant";
|
|
227
|
+
})(IdentityProviderType || (IdentityProviderType = {}));
|
|
228
|
+
const IDENTITY_PROVIDER_TYPE_LABELS = {
|
|
229
|
+
[IdentityProviderType.Google]: 'Google',
|
|
230
|
+
[IdentityProviderType.Microsoft]: 'Microsoft',
|
|
231
|
+
[IdentityProviderType.MicrosoftAzureAd]: 'Azure Entra ID',
|
|
232
|
+
[IdentityProviderType.MicrosoftActiveDirectory]: 'Microsoft Active Directory',
|
|
233
|
+
[IdentityProviderType.OpenLdap]: 'OpenLDAP',
|
|
234
|
+
[IdentityProviderType.Facebook]: 'Facebook',
|
|
235
|
+
[IdentityProviderType.OctoTenant]: 'Octo Tenant'
|
|
236
|
+
};
|
|
237
|
+
|
|
218
238
|
/**
|
|
219
239
|
* Communication service DTOs for adapter and pipeline management.
|
|
220
240
|
*/
|
|
@@ -879,7 +899,7 @@ var SystemNavigationFilterModesDto;
|
|
|
879
899
|
(function (SystemNavigationFilterModesDto) {
|
|
880
900
|
/** Entities without matching associations are filtered out (pre-pagination). */
|
|
881
901
|
SystemNavigationFilterModesDto["FilterDto"] = "FILTER";
|
|
882
|
-
/** Entities without matching associations are kept with null values (post-pagination
|
|
902
|
+
/** Entities without matching associations are kept with null values (post-pagination). */
|
|
883
903
|
SystemNavigationFilterModesDto["IncludeDto"] = "INCLUDE";
|
|
884
904
|
})(SystemNavigationFilterModesDto || (SystemNavigationFilterModesDto = {}));
|
|
885
905
|
/** Runtime entities of construction kit enum 'System.Notification/EventLevels' */
|
|
@@ -1077,6 +1097,7 @@ const result = {
|
|
|
1077
1097
|
"SystemReportingFolder",
|
|
1078
1098
|
"SystemReportingFolderRoot",
|
|
1079
1099
|
"SystemSimpleRtQuery",
|
|
1100
|
+
"SystemStreamDataSimpleQuery",
|
|
1080
1101
|
"SystemTenant",
|
|
1081
1102
|
"SystemTenantConfiguration",
|
|
1082
1103
|
"SystemTenantModeConfiguration",
|
|
@@ -1269,6 +1290,7 @@ const result = {
|
|
|
1269
1290
|
"SystemReportingFolder",
|
|
1270
1291
|
"SystemReportingFolderRoot",
|
|
1271
1292
|
"SystemSimpleRtQuery",
|
|
1293
|
+
"SystemStreamDataSimpleQuery",
|
|
1272
1294
|
"SystemTenant",
|
|
1273
1295
|
"SystemTenantConfiguration",
|
|
1274
1296
|
"SystemTenantModeConfiguration",
|
|
@@ -1306,6 +1328,9 @@ const result = {
|
|
|
1306
1328
|
"EnergyCommunityBillingDocumentLineItem_BillingUnion": [
|
|
1307
1329
|
"EnergyCommunityBillingDocumentLineItem"
|
|
1308
1330
|
],
|
|
1331
|
+
"EnergyCommunityBillingDocumentLineItem_BillingsUnion": [
|
|
1332
|
+
"EnergyCommunityBillingDocumentLineItem"
|
|
1333
|
+
],
|
|
1309
1334
|
"EnergyCommunityBillingDocumentLineItem_ChildrenUnion": [
|
|
1310
1335
|
"EnergyCommunityBillingDocumentLineItem"
|
|
1311
1336
|
],
|
|
@@ -1364,6 +1389,10 @@ const result = {
|
|
|
1364
1389
|
"OctoSdkDemoMeteringPoint",
|
|
1365
1390
|
"OctoSdkDemoOperatingFacility"
|
|
1366
1391
|
],
|
|
1392
|
+
"EnergyCommunityMeteringPoint_MeteringPointUnion": [
|
|
1393
|
+
"EnergyCommunityConsumer",
|
|
1394
|
+
"EnergyCommunityProducer"
|
|
1395
|
+
],
|
|
1367
1396
|
"EnergyCommunityMeteringPoint_ParentUnion": [
|
|
1368
1397
|
"EnergyCommunityConsumer",
|
|
1369
1398
|
"EnergyCommunityProducer"
|
|
@@ -1635,6 +1664,7 @@ const result = {
|
|
|
1635
1664
|
"SystemReportingFolder",
|
|
1636
1665
|
"SystemReportingFolderRoot",
|
|
1637
1666
|
"SystemSimpleRtQuery",
|
|
1667
|
+
"SystemStreamDataSimpleQuery",
|
|
1638
1668
|
"SystemTenant",
|
|
1639
1669
|
"SystemTenantConfiguration",
|
|
1640
1670
|
"SystemTenantModeConfiguration",
|
|
@@ -1741,6 +1771,7 @@ const result = {
|
|
|
1741
1771
|
"SystemReportingFolder",
|
|
1742
1772
|
"SystemReportingFolderRoot",
|
|
1743
1773
|
"SystemSimpleRtQuery",
|
|
1774
|
+
"SystemStreamDataSimpleQuery",
|
|
1744
1775
|
"SystemTenant",
|
|
1745
1776
|
"SystemTenantConfiguration",
|
|
1746
1777
|
"SystemTenantModeConfiguration",
|
|
@@ -1846,6 +1877,7 @@ const result = {
|
|
|
1846
1877
|
"SystemReportingFolder",
|
|
1847
1878
|
"SystemReportingFolderRoot",
|
|
1848
1879
|
"SystemSimpleRtQuery",
|
|
1880
|
+
"SystemStreamDataSimpleQuery",
|
|
1849
1881
|
"SystemTenant",
|
|
1850
1882
|
"SystemTenantConfiguration",
|
|
1851
1883
|
"SystemTenantModeConfiguration",
|
|
@@ -1951,6 +1983,7 @@ const result = {
|
|
|
1951
1983
|
"SystemReportingFolder",
|
|
1952
1984
|
"SystemReportingFolderRoot",
|
|
1953
1985
|
"SystemSimpleRtQuery",
|
|
1986
|
+
"SystemStreamDataSimpleQuery",
|
|
1954
1987
|
"SystemTenant",
|
|
1955
1988
|
"SystemTenantConfiguration",
|
|
1956
1989
|
"SystemTenantModeConfiguration",
|
|
@@ -2056,6 +2089,7 @@ const result = {
|
|
|
2056
2089
|
"SystemReportingFolder",
|
|
2057
2090
|
"SystemReportingFolderRoot",
|
|
2058
2091
|
"SystemSimpleRtQuery",
|
|
2092
|
+
"SystemStreamDataSimpleQuery",
|
|
2059
2093
|
"SystemTenant",
|
|
2060
2094
|
"SystemTenantConfiguration",
|
|
2061
2095
|
"SystemTenantModeConfiguration",
|
|
@@ -2081,7 +2115,8 @@ const result = {
|
|
|
2081
2115
|
"SystemPersistentQueryInterface": [
|
|
2082
2116
|
"SystemAggregationRtQuery",
|
|
2083
2117
|
"SystemGroupingAggregationRtQuery",
|
|
2084
|
-
"SystemSimpleRtQuery"
|
|
2118
|
+
"SystemSimpleRtQuery",
|
|
2119
|
+
"SystemStreamDataSimpleQuery"
|
|
2085
2120
|
],
|
|
2086
2121
|
"SystemReportingFileSystemContainerInterface": [
|
|
2087
2122
|
"SystemReportingFileSystemItem",
|
|
@@ -2194,7 +2229,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2194
2229
|
}], ctorParameters: () => [{ type: i1.Apollo }] });
|
|
2195
2230
|
|
|
2196
2231
|
const GetCkTypeAvailableQueryColumnsDocumentDto = gql `
|
|
2197
|
-
query getCkTypeAvailableQueryColumns($after: String, $first: Int, $rtCkId: String!, $filter: String, $attributeValueType: AttributeValueType, $searchTerm: String, $includeNavigationProperties: Boolean, $maxDepth: Int) {
|
|
2232
|
+
query getCkTypeAvailableQueryColumns($after: String, $first: Int, $rtCkId: String!, $filter: String, $attributeValueType: AttributeValueType, $searchTerm: String, $includeNavigationProperties: Boolean, $maxDepth: Int, $attributePaths: [String]) {
|
|
2198
2233
|
constructionKit {
|
|
2199
2234
|
types(rtCkId: $rtCkId) {
|
|
2200
2235
|
items {
|
|
@@ -2211,6 +2246,7 @@ const GetCkTypeAvailableQueryColumnsDocumentDto = gql `
|
|
|
2211
2246
|
searchTerm: $searchTerm
|
|
2212
2247
|
includeNavigationProperties: $includeNavigationProperties
|
|
2213
2248
|
maxDepth: $maxDepth
|
|
2249
|
+
attributePaths: $attributePaths
|
|
2214
2250
|
) {
|
|
2215
2251
|
totalCount
|
|
2216
2252
|
pageInfo {
|
|
@@ -2392,7 +2428,7 @@ const CONFIGURATION_SERVICE = new InjectionToken('IConfigurationService');
|
|
|
2392
2428
|
|
|
2393
2429
|
class AttributeSelectorService {
|
|
2394
2430
|
getCkTypeAvailableQueryColumnsGQL = inject(GetCkTypeAvailableQueryColumnsDtoGQL);
|
|
2395
|
-
getAvailableAttributes(ckTypeId, filter, first = 1000, after, attributeValueType, searchTerm, includeNavigationProperties, maxDepth) {
|
|
2431
|
+
getAvailableAttributes(ckTypeId, filter, first = 1000, after, attributeValueType, searchTerm, includeNavigationProperties, maxDepth, attributePaths) {
|
|
2396
2432
|
return this.getCkTypeAvailableQueryColumnsGQL.fetch({
|
|
2397
2433
|
variables: {
|
|
2398
2434
|
rtCkId: ckTypeId,
|
|
@@ -2402,7 +2438,8 @@ class AttributeSelectorService {
|
|
|
2402
2438
|
attributeValueType: attributeValueType,
|
|
2403
2439
|
searchTerm: searchTerm,
|
|
2404
2440
|
includeNavigationProperties: includeNavigationProperties,
|
|
2405
|
-
maxDepth: maxDepth
|
|
2441
|
+
maxDepth: maxDepth,
|
|
2442
|
+
attributePaths: attributePaths
|
|
2406
2443
|
},
|
|
2407
2444
|
fetchPolicy: 'network-only'
|
|
2408
2445
|
}).pipe(map(result => {
|
|
@@ -2772,14 +2809,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2772
2809
|
}]
|
|
2773
2810
|
}] });
|
|
2774
2811
|
|
|
2812
|
+
/**
|
|
2813
|
+
* Injection token for providing the current tenant ID.
|
|
2814
|
+
* This is required for operations that need tenant context, such as:
|
|
2815
|
+
* - Exporting/importing runtime models
|
|
2816
|
+
* - Asset repository operations
|
|
2817
|
+
* - Job management
|
|
2818
|
+
*
|
|
2819
|
+
* @example
|
|
2820
|
+
* ```typescript
|
|
2821
|
+
* // app.config.ts
|
|
2822
|
+
* import { TENANT_ID_PROVIDER } from '@meshmakers/octo-services';
|
|
2823
|
+
* import { ActivatedRoute } from '@angular/router';
|
|
2824
|
+
* import { firstValueFrom } from 'rxjs';
|
|
2825
|
+
*
|
|
2826
|
+
* export const appConfig: ApplicationConfig = {
|
|
2827
|
+
* providers: [
|
|
2828
|
+
* {
|
|
2829
|
+
* provide: TENANT_ID_PROVIDER,
|
|
2830
|
+
* useFactory: () => {
|
|
2831
|
+
* const route = inject(ActivatedRoute);
|
|
2832
|
+
* const configService = inject(CONFIGURATION_SERVICE);
|
|
2833
|
+
* return async (): Promise<string | null> => {
|
|
2834
|
+
* if (route.firstChild) {
|
|
2835
|
+
* const params = await firstValueFrom(route.firstChild.params);
|
|
2836
|
+
* const tenantId = params['tenantId'] as string;
|
|
2837
|
+
* if (tenantId) {
|
|
2838
|
+
* return tenantId;
|
|
2839
|
+
* }
|
|
2840
|
+
* }
|
|
2841
|
+
* return configService.config?.systemTenantId ?? null;
|
|
2842
|
+
* };
|
|
2843
|
+
* }
|
|
2844
|
+
* }
|
|
2845
|
+
* ]
|
|
2846
|
+
* };
|
|
2847
|
+
* ```
|
|
2848
|
+
*/
|
|
2849
|
+
const TENANT_ID_PROVIDER = new InjectionToken('TENANT_ID_PROVIDER');
|
|
2850
|
+
|
|
2775
2851
|
class AssetRepoService {
|
|
2776
2852
|
httpClient = inject(HttpClient);
|
|
2777
2853
|
configurationService = inject(CONFIGURATION_SERVICE);
|
|
2854
|
+
tenantIdProvider = inject(TENANT_ID_PROVIDER, { optional: true });
|
|
2855
|
+
async getTenantApiBaseUrl() {
|
|
2856
|
+
if (!this.configurationService.config?.assetServices)
|
|
2857
|
+
return null;
|
|
2858
|
+
let tenantId = 'octosystem';
|
|
2859
|
+
if (this.tenantIdProvider) {
|
|
2860
|
+
tenantId = await this.tenantIdProvider() ?? 'octosystem';
|
|
2861
|
+
}
|
|
2862
|
+
return `${this.configurationService.config.assetServices}${tenantId}/v1/tenants`;
|
|
2863
|
+
}
|
|
2778
2864
|
async getTenants(skip, take) {
|
|
2779
2865
|
const params = new HttpParams().set('skip', '' + skip.toString()).set('take', '' + take.toString());
|
|
2780
|
-
|
|
2866
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2867
|
+
if (baseUrl) {
|
|
2781
2868
|
const r = await firstValueFrom(this.httpClient
|
|
2782
|
-
.get(
|
|
2869
|
+
.get(baseUrl, {
|
|
2783
2870
|
params,
|
|
2784
2871
|
observe: 'response'
|
|
2785
2872
|
}));
|
|
@@ -2787,10 +2874,11 @@ class AssetRepoService {
|
|
|
2787
2874
|
}
|
|
2788
2875
|
return null;
|
|
2789
2876
|
}
|
|
2790
|
-
async getTenantDetails(
|
|
2791
|
-
|
|
2877
|
+
async getTenantDetails(childTenantId) {
|
|
2878
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2879
|
+
if (baseUrl) {
|
|
2792
2880
|
const r = await firstValueFrom(this.httpClient
|
|
2793
|
-
.get(
|
|
2881
|
+
.get(`${baseUrl}/${childTenantId}`, {
|
|
2794
2882
|
observe: 'response'
|
|
2795
2883
|
}));
|
|
2796
2884
|
return r.body;
|
|
@@ -2798,36 +2886,40 @@ class AssetRepoService {
|
|
|
2798
2886
|
return null;
|
|
2799
2887
|
}
|
|
2800
2888
|
async createTenant(tenantDto) {
|
|
2801
|
-
const params = new HttpParams().set('
|
|
2802
|
-
|
|
2803
|
-
|
|
2889
|
+
const params = new HttpParams().set('childTenantId', tenantDto.tenantId).set('databaseName', tenantDto.database);
|
|
2890
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2891
|
+
if (baseUrl) {
|
|
2892
|
+
await firstValueFrom(this.httpClient.post(baseUrl, null, {
|
|
2804
2893
|
params,
|
|
2805
2894
|
observe: 'response'
|
|
2806
2895
|
}));
|
|
2807
2896
|
}
|
|
2808
2897
|
}
|
|
2809
2898
|
async attachTenant(dataSourceDto) {
|
|
2810
|
-
const params = new HttpParams().set('
|
|
2811
|
-
|
|
2812
|
-
|
|
2899
|
+
const params = new HttpParams().set('childTenantId', dataSourceDto.tenantId).set('databaseName', dataSourceDto.database);
|
|
2900
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2901
|
+
if (baseUrl) {
|
|
2902
|
+
await firstValueFrom(this.httpClient.post(`${baseUrl}/attach`, null, {
|
|
2813
2903
|
params,
|
|
2814
2904
|
observe: 'response'
|
|
2815
2905
|
}));
|
|
2816
2906
|
}
|
|
2817
2907
|
}
|
|
2818
|
-
async detachTenant(
|
|
2819
|
-
const params = new HttpParams().set('
|
|
2820
|
-
|
|
2821
|
-
|
|
2908
|
+
async detachTenant(childTenantId) {
|
|
2909
|
+
const params = new HttpParams().set('childTenantId', childTenantId);
|
|
2910
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2911
|
+
if (baseUrl) {
|
|
2912
|
+
await firstValueFrom(this.httpClient.post(`${baseUrl}/detach`, null, {
|
|
2822
2913
|
params,
|
|
2823
2914
|
observe: 'response'
|
|
2824
2915
|
}));
|
|
2825
2916
|
}
|
|
2826
2917
|
}
|
|
2827
|
-
async deleteTenant(
|
|
2828
|
-
const params = new HttpParams().set('
|
|
2829
|
-
|
|
2830
|
-
|
|
2918
|
+
async deleteTenant(childTenantId) {
|
|
2919
|
+
const params = new HttpParams().set('childTenantId', childTenantId);
|
|
2920
|
+
const baseUrl = await this.getTenantApiBaseUrl();
|
|
2921
|
+
if (baseUrl) {
|
|
2922
|
+
await firstValueFrom(this.httpClient.delete(baseUrl, {
|
|
2831
2923
|
params,
|
|
2832
2924
|
observe: 'response'
|
|
2833
2925
|
}));
|
|
@@ -2835,12 +2927,11 @@ class AssetRepoService {
|
|
|
2835
2927
|
}
|
|
2836
2928
|
async importRtModel(tenantId, file, importStrategy = ImportStrategyDto.InsertOnly) {
|
|
2837
2929
|
const params = new HttpParams()
|
|
2838
|
-
.set('tenantId', tenantId)
|
|
2839
2930
|
.set('importStrategy', importStrategy.toString());
|
|
2840
2931
|
if (this.configurationService.config?.assetServices) {
|
|
2841
2932
|
const formData = new FormData();
|
|
2842
2933
|
formData.append("file", file);
|
|
2843
|
-
const r = await firstValueFrom(this.httpClient.post(this.configurationService.config.assetServices + '
|
|
2934
|
+
const r = await firstValueFrom(this.httpClient.post(this.configurationService.config.assetServices + tenantId + '/v1/Models/ImportRt', formData, {
|
|
2844
2935
|
params,
|
|
2845
2936
|
observe: 'response'
|
|
2846
2937
|
}));
|
|
@@ -2850,12 +2941,11 @@ class AssetRepoService {
|
|
|
2850
2941
|
}
|
|
2851
2942
|
async importCkModel(tenantId, file, importStrategy = ImportStrategyDto.InsertOnly) {
|
|
2852
2943
|
const params = new HttpParams()
|
|
2853
|
-
.set('tenantId', tenantId)
|
|
2854
2944
|
.set('importStrategy', importStrategy.toString());
|
|
2855
2945
|
if (this.configurationService.config?.assetServices) {
|
|
2856
2946
|
const formData = new FormData();
|
|
2857
2947
|
formData.append("file", file);
|
|
2858
|
-
const r = await firstValueFrom(this.httpClient.post(this.configurationService.config.assetServices + '
|
|
2948
|
+
const r = await firstValueFrom(this.httpClient.post(this.configurationService.config.assetServices + tenantId + '/v1/Models/ImportCk', formData, {
|
|
2859
2949
|
params,
|
|
2860
2950
|
observe: 'response'
|
|
2861
2951
|
}));
|
|
@@ -2864,11 +2954,9 @@ class AssetRepoService {
|
|
|
2864
2954
|
return null;
|
|
2865
2955
|
}
|
|
2866
2956
|
async exportRtModelByQuery(tenantId, queryId) {
|
|
2867
|
-
const params = new HttpParams().set('tenantId', tenantId);
|
|
2868
2957
|
if (this.configurationService.config?.assetServices) {
|
|
2869
2958
|
const r = await firstValueFrom(this.httpClient
|
|
2870
|
-
.post(this.configurationService.config.assetServices + '
|
|
2871
|
-
params,
|
|
2959
|
+
.post(this.configurationService.config.assetServices + tenantId + '/v1/Models/ExportRtByQuery', { queryId }, {
|
|
2872
2960
|
observe: 'response'
|
|
2873
2961
|
}));
|
|
2874
2962
|
return r.body?.jobId ?? null;
|
|
@@ -2876,11 +2964,9 @@ class AssetRepoService {
|
|
|
2876
2964
|
return null;
|
|
2877
2965
|
}
|
|
2878
2966
|
async exportRtModelDeepGraph(tenantId, originRtIds, originCkTypeId) {
|
|
2879
|
-
const params = new HttpParams().set('tenantId', tenantId);
|
|
2880
2967
|
if (this.configurationService.config?.assetServices) {
|
|
2881
2968
|
const r = await firstValueFrom(this.httpClient
|
|
2882
|
-
.post(this.configurationService.config.assetServices + '
|
|
2883
|
-
params,
|
|
2969
|
+
.post(this.configurationService.config.assetServices + tenantId + '/v1/Models/ExportRtByDeepGraph', { originRtIds, originCkTypeId }, {
|
|
2884
2970
|
observe: 'response'
|
|
2885
2971
|
}));
|
|
2886
2972
|
return r.body?.jobId ?? null;
|
|
@@ -3020,16 +3106,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
3020
3106
|
class IdentityService {
|
|
3021
3107
|
httpClient = inject(HttpClient);
|
|
3022
3108
|
configurationService = inject(CONFIGURATION_SERVICE);
|
|
3109
|
+
tenantIdProvider = inject(TENANT_ID_PROVIDER, { optional: true });
|
|
3110
|
+
async getApiBaseUrl() {
|
|
3111
|
+
if (!this.configurationService.config?.issuer)
|
|
3112
|
+
return null;
|
|
3113
|
+
let tenantId = 'octosystem';
|
|
3114
|
+
if (this.tenantIdProvider) {
|
|
3115
|
+
tenantId = await this.tenantIdProvider() ?? 'octosystem';
|
|
3116
|
+
}
|
|
3117
|
+
return `${this.configurationService.config.issuer}${tenantId}/v1/`;
|
|
3118
|
+
}
|
|
3023
3119
|
async userDiagnostics() {
|
|
3024
|
-
|
|
3025
|
-
|
|
3120
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3121
|
+
if (baseUrl) {
|
|
3122
|
+
return await firstValueFrom(this.httpClient.get(baseUrl + 'Diagnostics'));
|
|
3026
3123
|
}
|
|
3027
3124
|
return null;
|
|
3028
3125
|
}
|
|
3029
3126
|
async getUsers(skip, take) {
|
|
3030
3127
|
const params = new HttpParams().set('skip', '' + skip.toString()).set('take', '' + take.toString());
|
|
3031
|
-
|
|
3032
|
-
|
|
3128
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3129
|
+
if (baseUrl) {
|
|
3130
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'users/getPaged', {
|
|
3033
3131
|
params,
|
|
3034
3132
|
observe: 'response'
|
|
3035
3133
|
}));
|
|
@@ -3038,8 +3136,9 @@ class IdentityService {
|
|
|
3038
3136
|
return null;
|
|
3039
3137
|
}
|
|
3040
3138
|
async getUserDetails(userName) {
|
|
3041
|
-
|
|
3042
|
-
|
|
3139
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3140
|
+
if (baseUrl) {
|
|
3141
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `users/${userName}`, {
|
|
3043
3142
|
observe: 'response'
|
|
3044
3143
|
}));
|
|
3045
3144
|
return response.body;
|
|
@@ -3047,29 +3146,43 @@ class IdentityService {
|
|
|
3047
3146
|
return null;
|
|
3048
3147
|
}
|
|
3049
3148
|
async createUser(userDto) {
|
|
3050
|
-
|
|
3051
|
-
|
|
3149
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3150
|
+
if (baseUrl) {
|
|
3151
|
+
await firstValueFrom(this.httpClient.post(baseUrl + 'users', userDto, {
|
|
3052
3152
|
observe: 'response'
|
|
3053
3153
|
}));
|
|
3054
3154
|
}
|
|
3055
3155
|
}
|
|
3056
3156
|
async updateUser(userName, userDto) {
|
|
3057
|
-
|
|
3058
|
-
|
|
3157
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3158
|
+
if (baseUrl) {
|
|
3159
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `users/${userName}`, userDto, {
|
|
3059
3160
|
observe: 'response'
|
|
3060
3161
|
}));
|
|
3061
3162
|
}
|
|
3062
3163
|
}
|
|
3063
3164
|
async deleteUser(userName) {
|
|
3064
|
-
|
|
3065
|
-
|
|
3165
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3166
|
+
if (baseUrl) {
|
|
3167
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `users/${userName}`, {
|
|
3066
3168
|
observe: 'response'
|
|
3067
3169
|
}));
|
|
3068
3170
|
}
|
|
3069
3171
|
}
|
|
3070
3172
|
async getUserRoles(userName) {
|
|
3071
|
-
|
|
3072
|
-
|
|
3173
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3174
|
+
if (baseUrl) {
|
|
3175
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `users/${userName}/roles`, {
|
|
3176
|
+
observe: 'response'
|
|
3177
|
+
}));
|
|
3178
|
+
return response.body;
|
|
3179
|
+
}
|
|
3180
|
+
return null;
|
|
3181
|
+
}
|
|
3182
|
+
async getUserDirectRoles(userName) {
|
|
3183
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3184
|
+
if (baseUrl) {
|
|
3185
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `users/${userName}/directRoles`, {
|
|
3073
3186
|
observe: 'response'
|
|
3074
3187
|
}));
|
|
3075
3188
|
return response.body;
|
|
@@ -3077,37 +3190,42 @@ class IdentityService {
|
|
|
3077
3190
|
return null;
|
|
3078
3191
|
}
|
|
3079
3192
|
async updateUserRoles(userName, roles) {
|
|
3080
|
-
|
|
3193
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3194
|
+
if (baseUrl) {
|
|
3081
3195
|
const roleIds = roles.map((role) => role.id);
|
|
3082
|
-
await firstValueFrom(this.httpClient.put(
|
|
3196
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `users/${userName}/roles`, roleIds, {
|
|
3083
3197
|
observe: 'response'
|
|
3084
3198
|
}));
|
|
3085
3199
|
}
|
|
3086
3200
|
}
|
|
3087
3201
|
async addUserToRole(userName, roleName) {
|
|
3088
|
-
|
|
3089
|
-
|
|
3202
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3203
|
+
if (baseUrl) {
|
|
3204
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `users/${userName}/roles/${roleName}`, null, {
|
|
3090
3205
|
observe: 'response'
|
|
3091
3206
|
}));
|
|
3092
3207
|
}
|
|
3093
3208
|
}
|
|
3094
3209
|
async removeRoleFromUser(userName, roleName) {
|
|
3095
|
-
|
|
3096
|
-
|
|
3210
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3211
|
+
if (baseUrl) {
|
|
3212
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `users/${userName}/roles/${roleName}`, {
|
|
3097
3213
|
observe: 'response'
|
|
3098
3214
|
}));
|
|
3099
3215
|
}
|
|
3100
3216
|
}
|
|
3101
3217
|
async mergeUsers(targetUserName, sourceUserName) {
|
|
3102
|
-
|
|
3218
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3219
|
+
if (baseUrl) {
|
|
3103
3220
|
const request = { sourceUserName };
|
|
3104
|
-
await firstValueFrom(this.httpClient.post(
|
|
3221
|
+
await firstValueFrom(this.httpClient.post(baseUrl + `users/${encodeURIComponent(targetUserName)}/merge`, request, { observe: 'response' }));
|
|
3105
3222
|
}
|
|
3106
3223
|
}
|
|
3107
3224
|
async resetPassword(userName, password) {
|
|
3108
3225
|
const params = new HttpParams().set('userName', userName).set('password', password);
|
|
3109
|
-
|
|
3110
|
-
|
|
3226
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3227
|
+
if (baseUrl) {
|
|
3228
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + 'users/ResetPassword', null, {
|
|
3111
3229
|
params,
|
|
3112
3230
|
observe: 'response'
|
|
3113
3231
|
}));
|
|
@@ -3117,8 +3235,9 @@ class IdentityService {
|
|
|
3117
3235
|
}
|
|
3118
3236
|
async getClients(skip, take) {
|
|
3119
3237
|
const params = new HttpParams().set('skip', '' + skip.toString()).set('take', '' + take.toString());
|
|
3120
|
-
|
|
3121
|
-
|
|
3238
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3239
|
+
if (baseUrl) {
|
|
3240
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'clients/getPaged', {
|
|
3122
3241
|
params,
|
|
3123
3242
|
observe: 'response'
|
|
3124
3243
|
}));
|
|
@@ -3127,8 +3246,9 @@ class IdentityService {
|
|
|
3127
3246
|
return null;
|
|
3128
3247
|
}
|
|
3129
3248
|
async getClientDetails(clientId) {
|
|
3130
|
-
|
|
3131
|
-
|
|
3249
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3250
|
+
if (baseUrl) {
|
|
3251
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `clients/${clientId}`, {
|
|
3132
3252
|
observe: 'response'
|
|
3133
3253
|
}));
|
|
3134
3254
|
return response.body;
|
|
@@ -3136,31 +3256,35 @@ class IdentityService {
|
|
|
3136
3256
|
return null;
|
|
3137
3257
|
}
|
|
3138
3258
|
async createClient(clientDto) {
|
|
3139
|
-
|
|
3140
|
-
|
|
3259
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3260
|
+
if (baseUrl) {
|
|
3261
|
+
await firstValueFrom(this.httpClient.post(baseUrl + 'clients', clientDto, {
|
|
3141
3262
|
observe: 'response'
|
|
3142
3263
|
}));
|
|
3143
3264
|
}
|
|
3144
3265
|
}
|
|
3145
3266
|
async updateClient(clientId, clientDto) {
|
|
3146
|
-
|
|
3147
|
-
|
|
3267
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3268
|
+
if (baseUrl) {
|
|
3269
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `clients/${clientId}`, clientDto, {
|
|
3148
3270
|
observe: 'response'
|
|
3149
3271
|
}));
|
|
3150
3272
|
}
|
|
3151
3273
|
}
|
|
3152
3274
|
async deleteClient(clientId) {
|
|
3153
|
-
|
|
3154
|
-
|
|
3275
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3276
|
+
if (baseUrl) {
|
|
3277
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `clients/${clientId}`, {
|
|
3155
3278
|
observe: 'response'
|
|
3156
3279
|
}));
|
|
3157
3280
|
}
|
|
3158
3281
|
}
|
|
3159
3282
|
async generatePassword() {
|
|
3160
3283
|
const params = new HttpParams();
|
|
3161
|
-
|
|
3284
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3285
|
+
if (baseUrl) {
|
|
3162
3286
|
const r = await firstValueFrom(this.httpClient
|
|
3163
|
-
.get(
|
|
3287
|
+
.get(baseUrl + 'tools/generatePassword', {
|
|
3164
3288
|
params,
|
|
3165
3289
|
observe: 'response'
|
|
3166
3290
|
}));
|
|
@@ -3173,8 +3297,9 @@ class IdentityService {
|
|
|
3173
3297
|
// ========================================
|
|
3174
3298
|
async getRoles(skip, take) {
|
|
3175
3299
|
const params = new HttpParams().set('skip', '' + skip.toString()).set('take', '' + take.toString());
|
|
3176
|
-
|
|
3177
|
-
|
|
3300
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3301
|
+
if (baseUrl) {
|
|
3302
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'roles/getPaged', {
|
|
3178
3303
|
params,
|
|
3179
3304
|
observe: 'response'
|
|
3180
3305
|
}));
|
|
@@ -3183,8 +3308,9 @@ class IdentityService {
|
|
|
3183
3308
|
return null;
|
|
3184
3309
|
}
|
|
3185
3310
|
async getRoleDetails(roleName) {
|
|
3186
|
-
|
|
3187
|
-
|
|
3311
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3312
|
+
if (baseUrl) {
|
|
3313
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `roles/names/${roleName}`, {
|
|
3188
3314
|
observe: 'response'
|
|
3189
3315
|
}));
|
|
3190
3316
|
return response.body;
|
|
@@ -3192,22 +3318,292 @@ class IdentityService {
|
|
|
3192
3318
|
return null;
|
|
3193
3319
|
}
|
|
3194
3320
|
async createRole(roleDto) {
|
|
3195
|
-
|
|
3196
|
-
|
|
3321
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3322
|
+
if (baseUrl) {
|
|
3323
|
+
await firstValueFrom(this.httpClient.post(baseUrl + 'roles', roleDto, {
|
|
3197
3324
|
observe: 'response'
|
|
3198
3325
|
}));
|
|
3199
3326
|
}
|
|
3200
3327
|
}
|
|
3201
3328
|
async updateRole(roleName, roleDto) {
|
|
3202
|
-
|
|
3203
|
-
|
|
3329
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3330
|
+
if (baseUrl) {
|
|
3331
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `roles/${roleName}`, roleDto, {
|
|
3204
3332
|
observe: 'response'
|
|
3205
3333
|
}));
|
|
3206
3334
|
}
|
|
3207
3335
|
}
|
|
3208
3336
|
async deleteRole(roleName) {
|
|
3209
|
-
|
|
3210
|
-
|
|
3337
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3338
|
+
if (baseUrl) {
|
|
3339
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `roles/${roleName}`, {
|
|
3340
|
+
observe: 'response'
|
|
3341
|
+
}));
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
// ========================================
|
|
3345
|
+
// Identity Provider Management
|
|
3346
|
+
// ========================================
|
|
3347
|
+
async getIdentityProviders() {
|
|
3348
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3349
|
+
if (baseUrl) {
|
|
3350
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'identityproviders', {
|
|
3351
|
+
observe: 'response'
|
|
3352
|
+
}));
|
|
3353
|
+
return response.body;
|
|
3354
|
+
}
|
|
3355
|
+
return null;
|
|
3356
|
+
}
|
|
3357
|
+
async getIdentityProviderDetails(rtId) {
|
|
3358
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3359
|
+
if (baseUrl) {
|
|
3360
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `identityproviders/${rtId}`, {
|
|
3361
|
+
observe: 'response'
|
|
3362
|
+
}));
|
|
3363
|
+
return response.body;
|
|
3364
|
+
}
|
|
3365
|
+
return null;
|
|
3366
|
+
}
|
|
3367
|
+
async createIdentityProvider(dto) {
|
|
3368
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3369
|
+
if (baseUrl) {
|
|
3370
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + 'identityproviders', dto, {
|
|
3371
|
+
observe: 'response'
|
|
3372
|
+
}));
|
|
3373
|
+
return response.body;
|
|
3374
|
+
}
|
|
3375
|
+
return null;
|
|
3376
|
+
}
|
|
3377
|
+
async updateIdentityProvider(rtId, dto) {
|
|
3378
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3379
|
+
if (baseUrl) {
|
|
3380
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `identityproviders/${rtId}`, dto, {
|
|
3381
|
+
observe: 'response'
|
|
3382
|
+
}));
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
async deleteIdentityProvider(rtId) {
|
|
3386
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3387
|
+
if (baseUrl) {
|
|
3388
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `identityproviders/${rtId}`, {
|
|
3389
|
+
observe: 'response'
|
|
3390
|
+
}));
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
// ========================================
|
|
3394
|
+
// Email Domain Group Rules
|
|
3395
|
+
// ========================================
|
|
3396
|
+
async getEmailDomainGroupRules() {
|
|
3397
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3398
|
+
if (baseUrl) {
|
|
3399
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'emaildomaingrouprules', {
|
|
3400
|
+
observe: 'response'
|
|
3401
|
+
}));
|
|
3402
|
+
return response.body;
|
|
3403
|
+
}
|
|
3404
|
+
return null;
|
|
3405
|
+
}
|
|
3406
|
+
async getEmailDomainGroupRuleDetails(rtId) {
|
|
3407
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3408
|
+
if (baseUrl) {
|
|
3409
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `emaildomaingrouprules/${rtId}`, {
|
|
3410
|
+
observe: 'response'
|
|
3411
|
+
}));
|
|
3412
|
+
return response.body;
|
|
3413
|
+
}
|
|
3414
|
+
return null;
|
|
3415
|
+
}
|
|
3416
|
+
async createEmailDomainGroupRule(dto) {
|
|
3417
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3418
|
+
if (baseUrl) {
|
|
3419
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + 'emaildomaingrouprules', dto, {
|
|
3420
|
+
observe: 'response'
|
|
3421
|
+
}));
|
|
3422
|
+
return response.body;
|
|
3423
|
+
}
|
|
3424
|
+
return null;
|
|
3425
|
+
}
|
|
3426
|
+
async updateEmailDomainGroupRule(rtId, dto) {
|
|
3427
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3428
|
+
if (baseUrl) {
|
|
3429
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `emaildomaingrouprules/${rtId}`, dto, {
|
|
3430
|
+
observe: 'response'
|
|
3431
|
+
}));
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
async deleteEmailDomainGroupRule(rtId) {
|
|
3435
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3436
|
+
if (baseUrl) {
|
|
3437
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `emaildomaingrouprules/${rtId}`, {
|
|
3438
|
+
observe: 'response'
|
|
3439
|
+
}));
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
// ========================================
|
|
3443
|
+
// Group Management
|
|
3444
|
+
// ========================================
|
|
3445
|
+
async getGroups() {
|
|
3446
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3447
|
+
if (baseUrl) {
|
|
3448
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'groups', {
|
|
3449
|
+
observe: 'response'
|
|
3450
|
+
}));
|
|
3451
|
+
return response.body;
|
|
3452
|
+
}
|
|
3453
|
+
return null;
|
|
3454
|
+
}
|
|
3455
|
+
async getGroupsPaged(skip, take) {
|
|
3456
|
+
const params = new HttpParams().set('skip', skip.toString()).set('take', take.toString());
|
|
3457
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3458
|
+
if (baseUrl) {
|
|
3459
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + 'groups/getPaged', {
|
|
3460
|
+
params,
|
|
3461
|
+
observe: 'response'
|
|
3462
|
+
}));
|
|
3463
|
+
return response.body;
|
|
3464
|
+
}
|
|
3465
|
+
return null;
|
|
3466
|
+
}
|
|
3467
|
+
async getGroupById(rtId) {
|
|
3468
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3469
|
+
if (baseUrl) {
|
|
3470
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `groups/${rtId}`, {
|
|
3471
|
+
observe: 'response'
|
|
3472
|
+
}));
|
|
3473
|
+
return response.body;
|
|
3474
|
+
}
|
|
3475
|
+
return null;
|
|
3476
|
+
}
|
|
3477
|
+
async getGroupByName(groupName) {
|
|
3478
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3479
|
+
if (baseUrl) {
|
|
3480
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `groups/names/${encodeURIComponent(groupName)}`, {
|
|
3481
|
+
observe: 'response'
|
|
3482
|
+
}));
|
|
3483
|
+
return response.body;
|
|
3484
|
+
}
|
|
3485
|
+
return null;
|
|
3486
|
+
}
|
|
3487
|
+
async createGroup(dto) {
|
|
3488
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3489
|
+
if (baseUrl) {
|
|
3490
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + 'groups', dto, {
|
|
3491
|
+
observe: 'response'
|
|
3492
|
+
}));
|
|
3493
|
+
return response.body;
|
|
3494
|
+
}
|
|
3495
|
+
return null;
|
|
3496
|
+
}
|
|
3497
|
+
async updateGroup(rtId, dto) {
|
|
3498
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3499
|
+
if (baseUrl) {
|
|
3500
|
+
const response = await firstValueFrom(this.httpClient.put(baseUrl + `groups/${rtId}`, dto, {
|
|
3501
|
+
observe: 'response'
|
|
3502
|
+
}));
|
|
3503
|
+
return response.body;
|
|
3504
|
+
}
|
|
3505
|
+
return null;
|
|
3506
|
+
}
|
|
3507
|
+
async deleteGroup(rtId) {
|
|
3508
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3509
|
+
if (baseUrl) {
|
|
3510
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `groups/${rtId}`, {
|
|
3511
|
+
observe: 'response'
|
|
3512
|
+
}));
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
async getGroupRoles(rtId) {
|
|
3516
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3517
|
+
if (baseUrl) {
|
|
3518
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `groups/${rtId}/roles`, {
|
|
3519
|
+
observe: 'response'
|
|
3520
|
+
}));
|
|
3521
|
+
return response.body;
|
|
3522
|
+
}
|
|
3523
|
+
return null;
|
|
3524
|
+
}
|
|
3525
|
+
async updateGroupRoles(rtId, roleIds) {
|
|
3526
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3527
|
+
if (baseUrl) {
|
|
3528
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `groups/${rtId}/roles`, roleIds, {
|
|
3529
|
+
observe: 'response'
|
|
3530
|
+
}));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
async addUserToGroup(rtId, userId) {
|
|
3534
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3535
|
+
if (baseUrl) {
|
|
3536
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `groups/${rtId}/members/users/${userId}`, null, {
|
|
3537
|
+
observe: 'response'
|
|
3538
|
+
}));
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
async removeUserFromGroup(rtId, userId) {
|
|
3542
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3543
|
+
if (baseUrl) {
|
|
3544
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `groups/${rtId}/members/users/${userId}`, {
|
|
3545
|
+
observe: 'response'
|
|
3546
|
+
}));
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
async addGroupToGroup(rtId, childGroupId) {
|
|
3550
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3551
|
+
if (baseUrl) {
|
|
3552
|
+
await firstValueFrom(this.httpClient.put(baseUrl + `groups/${rtId}/members/groups/${childGroupId}`, null, {
|
|
3553
|
+
observe: 'response'
|
|
3554
|
+
}));
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
async removeGroupFromGroup(rtId, childGroupId) {
|
|
3558
|
+
const baseUrl = await this.getApiBaseUrl();
|
|
3559
|
+
if (baseUrl) {
|
|
3560
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `groups/${rtId}/members/groups/${childGroupId}`, {
|
|
3561
|
+
observe: 'response'
|
|
3562
|
+
}));
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
// ========================================
|
|
3566
|
+
// Admin Provisioning (via system tenant)
|
|
3567
|
+
// ========================================
|
|
3568
|
+
getSystemTenantBaseUrl() {
|
|
3569
|
+
if (!this.configurationService.config?.issuer)
|
|
3570
|
+
return null;
|
|
3571
|
+
return `${this.configurationService.config.issuer}octosystem/v1/`;
|
|
3572
|
+
}
|
|
3573
|
+
async getAdminProvisionedUsers(targetTenantId) {
|
|
3574
|
+
const baseUrl = this.getSystemTenantBaseUrl();
|
|
3575
|
+
if (baseUrl) {
|
|
3576
|
+
const response = await firstValueFrom(this.httpClient.get(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}`, {
|
|
3577
|
+
observe: 'response'
|
|
3578
|
+
}));
|
|
3579
|
+
return response.body;
|
|
3580
|
+
}
|
|
3581
|
+
return null;
|
|
3582
|
+
}
|
|
3583
|
+
async provisionCurrentUser(targetTenantId) {
|
|
3584
|
+
const baseUrl = this.getSystemTenantBaseUrl();
|
|
3585
|
+
if (baseUrl) {
|
|
3586
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/provisionCurrentUser`, null, {
|
|
3587
|
+
observe: 'response'
|
|
3588
|
+
}));
|
|
3589
|
+
return response.body;
|
|
3590
|
+
}
|
|
3591
|
+
return null;
|
|
3592
|
+
}
|
|
3593
|
+
async createAdminProvisioning(targetTenantId, dto) {
|
|
3594
|
+
const baseUrl = this.getSystemTenantBaseUrl();
|
|
3595
|
+
if (baseUrl) {
|
|
3596
|
+
const response = await firstValueFrom(this.httpClient.post(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}`, dto, {
|
|
3597
|
+
observe: 'response'
|
|
3598
|
+
}));
|
|
3599
|
+
return response.body;
|
|
3600
|
+
}
|
|
3601
|
+
return null;
|
|
3602
|
+
}
|
|
3603
|
+
async deleteAdminProvisioning(targetTenantId, mappingRtId) {
|
|
3604
|
+
const baseUrl = this.getSystemTenantBaseUrl();
|
|
3605
|
+
if (baseUrl) {
|
|
3606
|
+
await firstValueFrom(this.httpClient.delete(baseUrl + `adminProvisioning/${encodeURIComponent(targetTenantId)}/${encodeURIComponent(mappingRtId)}`, {
|
|
3211
3607
|
observe: 'response'
|
|
3212
3608
|
}));
|
|
3213
3609
|
}
|
|
@@ -3635,45 +4031,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
3635
4031
|
}]
|
|
3636
4032
|
}] });
|
|
3637
4033
|
|
|
3638
|
-
/**
|
|
3639
|
-
* Injection token for providing the current tenant ID.
|
|
3640
|
-
* This is required for operations that need tenant context, such as:
|
|
3641
|
-
* - Exporting/importing runtime models
|
|
3642
|
-
* - Asset repository operations
|
|
3643
|
-
* - Job management
|
|
3644
|
-
*
|
|
3645
|
-
* @example
|
|
3646
|
-
* ```typescript
|
|
3647
|
-
* // app.config.ts
|
|
3648
|
-
* import { TENANT_ID_PROVIDER } from '@meshmakers/octo-services';
|
|
3649
|
-
* import { ActivatedRoute } from '@angular/router';
|
|
3650
|
-
* import { firstValueFrom } from 'rxjs';
|
|
3651
|
-
*
|
|
3652
|
-
* export const appConfig: ApplicationConfig = {
|
|
3653
|
-
* providers: [
|
|
3654
|
-
* {
|
|
3655
|
-
* provide: TENANT_ID_PROVIDER,
|
|
3656
|
-
* useFactory: () => {
|
|
3657
|
-
* const route = inject(ActivatedRoute);
|
|
3658
|
-
* const configService = inject(CONFIGURATION_SERVICE);
|
|
3659
|
-
* return async (): Promise<string | null> => {
|
|
3660
|
-
* if (route.firstChild) {
|
|
3661
|
-
* const params = await firstValueFrom(route.firstChild.params);
|
|
3662
|
-
* const tenantId = params['tenantId'] as string;
|
|
3663
|
-
* if (tenantId) {
|
|
3664
|
-
* return tenantId;
|
|
3665
|
-
* }
|
|
3666
|
-
* }
|
|
3667
|
-
* return configService.config?.systemTenantId ?? null;
|
|
3668
|
-
* };
|
|
3669
|
-
* }
|
|
3670
|
-
* }
|
|
3671
|
-
* ]
|
|
3672
|
-
* };
|
|
3673
|
-
* ```
|
|
3674
|
-
*/
|
|
3675
|
-
const TENANT_ID_PROVIDER = new InjectionToken('TENANT_ID_PROVIDER');
|
|
3676
|
-
|
|
3677
4034
|
const GetEntitiesByCkTypeDocumentDto = gql `
|
|
3678
4035
|
query getEntitiesByCkType($ckTypeId: String!, $rtId: OctoObjectId, $after: String, $first: Int, $searchFilter: SearchFilter, $fieldFilters: [FieldFilter], $sort: [Sort]) {
|
|
3679
4036
|
runtime {
|
|
@@ -4105,5 +4462,5 @@ function provideOctoServices(octoServiceOptions) {
|
|
|
4105
4462
|
* Generated bundle index. Do not edit.
|
|
4106
4463
|
*/
|
|
4107
4464
|
|
|
4108
|
-
export { AggregationInputTypesDto, AggregationTypeDto, AggregationTypesDto, AssetRepoGraphQlDataSource, AssetRepoService, AssociationModOptionsDto, AttributeSelectorService, AttributeValueTypeDto, BasicLegalEntityTypeDto, BasicSalutationDto, BasicTypeOfTelephoneBasicDto, BasicTypeOfTelephoneEnhancedDto, BasicUnitOfMeasureDto, BotService, CONFIGURATION_SERVICE, CkExtensionUpdateOperationsDto, CkModelService, CkTypeAttributeService, CkTypeMetaData, CkTypeSelectorService, CommunicationService, DeleteStrategiesDto, DeploymentState, EnergyCommunityBillingCycleDto, EnergyCommunityBillingDocumentStateDto, EnergyCommunityBillingTypeDto, EnergyCommunityDataQualityDto, EnergyCommunityFacilityTypeDto, EnergyCommunityProductionTypeDto, EnergyCommunityStateDto, EnergyCommunityTaxProcedureCreditNoteDto, EnvironmentGoalStateDto, FieldFilterOperatorsDto, GetCkModelByIdDocumentDto, GetCkModelByIdDtoGQL, GetCkRecordAttributesDocumentDto, GetCkRecordAttributesDtoGQL, GetCkTypeAttributesDocumentDto, GetCkTypeAttributesDtoGQL, GetCkTypeAvailableQueryColumnsDocumentDto, GetCkTypeAvailableQueryColumnsDtoGQL, GetCkTypesDocumentDto, GetCkTypesDtoGQL, GetDerivedCkTypesDocumentDto, GetDerivedCkTypesDtoGQL, GetEntitiesByCkTypeDocumentDto, GetEntitiesByCkTypeDtoGQL, GraphDirectionDto, GraphQL, GraphQLCloneIgnoredProperties, GraphQLCommonIgnoredProperties, GraphQlDataSource, HealthService, HealthStatus, IdentityService, ImportStrategyDto, IndustryBasicAlarmPriorityDto, IndustryBasicAlarmSourceTypeDto, IndustryBasicAlarmStateDto, IndustryBasicAlarmTypeDto, IndustryBasicIecDataTypeDto, IndustryBasicMachineCapabilitiesDto, IndustryBasicMachineStateDto, IndustryMaintenanceAggregationTypeDto, IndustryMaintenanceCostCategoryDto, IndustryMaintenanceEnergyBalanceGroupDto, IndustryMaintenanceEnergyBalanceProductDto, IndustryMaintenanceEnergyBalanceUnitDto, IndustryMaintenanceOrderPriorityDto, IndustryMaintenanceOrderStateDto, IndustryMaintenanceOrderTypeDto, IndustryMaintenanceServiceTypeDto, JobManagementService, LevelMetaData, LoggerSeverity, ModelStateDto, MultiplicitiesDto, NavigationFilterModeDto, OctoErrorLink, OctoGraphQLServiceBase, OctoSdkDemoCustomerStatusDto, OctoSdkDemoNetworkOperatorDto, OctoSdkDemoOperatingStatusDto, OctoServiceOptions, OctoServicesModule, PagedGraphResultDto, ProgressValue, ProgressWindowService, QueryModeDto, RtAssociationMetaData, RuntimeEntityDialogDataSource, RuntimeEntitySelectDataSource, SearchFilterTypesDto, SortOrderDto, SortOrdersDto, SystemAggregationTypesDto, SystemCommunicationCommunicationStateDto, SystemCommunicationConfigurationStateDto, SystemCommunicationDeploymentStateDto, SystemCommunicationPipelineExecutionStatusDto, SystemCommunicationPipelineTriggerTypeDto, SystemEnvironmentModesDto, SystemFieldFilterOperatorDto, SystemIdentityTokenExpirationDto, SystemIdentityTokenTypeDto, SystemIdentityTokenUsageDto, SystemMaintenanceLevelsDto, SystemNavigationFilterModesDto, SystemNotificationEventLevelsDto, SystemNotificationEventSourcesDto, SystemNotificationEventStatesDto, SystemNotificationNotificationTypesDto, SystemNotificationRenderingTypesDto, SystemQueryTypesDto, SystemSortOrdersDto, TENANT_ID_PROVIDER, TusUploadService, UpdateTypeDto, result as possibleTypes, provideOctoServices };
|
|
4465
|
+
export { AggregationInputTypesDto, AggregationTypeDto, AggregationTypesDto, AssetRepoGraphQlDataSource, AssetRepoService, AssociationModOptionsDto, AttributeSelectorService, AttributeValueTypeDto, BasicLegalEntityTypeDto, BasicSalutationDto, BasicTypeOfTelephoneBasicDto, BasicTypeOfTelephoneEnhancedDto, BasicUnitOfMeasureDto, BotService, CONFIGURATION_SERVICE, CkExtensionUpdateOperationsDto, CkModelService, CkTypeAttributeService, CkTypeMetaData, CkTypeSelectorService, CommunicationService, DeleteStrategiesDto, DeploymentState, EnergyCommunityBillingCycleDto, EnergyCommunityBillingDocumentStateDto, EnergyCommunityBillingTypeDto, EnergyCommunityDataQualityDto, EnergyCommunityFacilityTypeDto, EnergyCommunityProductionTypeDto, EnergyCommunityStateDto, EnergyCommunityTaxProcedureCreditNoteDto, EnvironmentGoalStateDto, FieldFilterOperatorsDto, GetCkModelByIdDocumentDto, GetCkModelByIdDtoGQL, GetCkRecordAttributesDocumentDto, GetCkRecordAttributesDtoGQL, GetCkTypeAttributesDocumentDto, GetCkTypeAttributesDtoGQL, GetCkTypeAvailableQueryColumnsDocumentDto, GetCkTypeAvailableQueryColumnsDtoGQL, GetCkTypesDocumentDto, GetCkTypesDtoGQL, GetDerivedCkTypesDocumentDto, GetDerivedCkTypesDtoGQL, GetEntitiesByCkTypeDocumentDto, GetEntitiesByCkTypeDtoGQL, GraphDirectionDto, GraphQL, GraphQLCloneIgnoredProperties, GraphQLCommonIgnoredProperties, GraphQlDataSource, HealthService, HealthStatus, IDENTITY_PROVIDER_TYPE_LABELS, IdentityProviderType, IdentityService, ImportStrategyDto, IndustryBasicAlarmPriorityDto, IndustryBasicAlarmSourceTypeDto, IndustryBasicAlarmStateDto, IndustryBasicAlarmTypeDto, IndustryBasicIecDataTypeDto, IndustryBasicMachineCapabilitiesDto, IndustryBasicMachineStateDto, IndustryMaintenanceAggregationTypeDto, IndustryMaintenanceCostCategoryDto, IndustryMaintenanceEnergyBalanceGroupDto, IndustryMaintenanceEnergyBalanceProductDto, IndustryMaintenanceEnergyBalanceUnitDto, IndustryMaintenanceOrderPriorityDto, IndustryMaintenanceOrderStateDto, IndustryMaintenanceOrderTypeDto, IndustryMaintenanceServiceTypeDto, JobManagementService, LevelMetaData, LoggerSeverity, ModelStateDto, MultiplicitiesDto, NavigationFilterModeDto, OctoErrorLink, OctoGraphQLServiceBase, OctoSdkDemoCustomerStatusDto, OctoSdkDemoNetworkOperatorDto, OctoSdkDemoOperatingStatusDto, OctoServiceOptions, OctoServicesModule, PagedGraphResultDto, ProgressValue, ProgressWindowService, QueryModeDto, RtAssociationMetaData, RuntimeEntityDialogDataSource, RuntimeEntitySelectDataSource, SearchFilterTypesDto, SortOrderDto, SortOrdersDto, SystemAggregationTypesDto, SystemCommunicationCommunicationStateDto, SystemCommunicationConfigurationStateDto, SystemCommunicationDeploymentStateDto, SystemCommunicationPipelineExecutionStatusDto, SystemCommunicationPipelineTriggerTypeDto, SystemEnvironmentModesDto, SystemFieldFilterOperatorDto, SystemIdentityTokenExpirationDto, SystemIdentityTokenTypeDto, SystemIdentityTokenUsageDto, SystemMaintenanceLevelsDto, SystemNavigationFilterModesDto, SystemNotificationEventLevelsDto, SystemNotificationEventSourcesDto, SystemNotificationEventStatesDto, SystemNotificationNotificationTypesDto, SystemNotificationRenderingTypesDto, SystemQueryTypesDto, SystemSortOrdersDto, TENANT_ID_PROVIDER, TusUploadService, UpdateTypeDto, result as possibleTypes, provideOctoServices };
|
|
4109
4466
|
//# sourceMappingURL=meshmakers-octo-services.mjs.map
|