@acorex/connectivity 20.0.25 → 20.2.0-next.0
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 +0 -1
- package/fesm2022/acorex-connectivity-api.mjs +441 -36
- package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock.mjs +9621 -9539
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/index.d.ts +222 -276
- package/package.json +1 -1
package/api/index.d.ts
CHANGED
@@ -183,7 +183,6 @@ declare class AXMOidcTenantLoader implements AXPTenantLoader {
|
|
183
183
|
private http;
|
184
184
|
private configs;
|
185
185
|
private apiGetTenants;
|
186
|
-
private apiSetTenant;
|
187
186
|
constructor(http: HttpClient);
|
188
187
|
getList(): Observable<AXPTenant[]>;
|
189
188
|
set(tenant: AXPTenant): Promise<void>;
|
@@ -1,17 +1,19 @@
|
|
1
|
-
import { AXP_ROOT_CONFIG_TOKEN, AXPFilterOperatorMiddlewareService } from '@acorex/platform/common';
|
1
|
+
import { AXP_ROOT_CONFIG_TOKEN, AXPFilterOperatorMiddlewareService, AXPFileStorageService, AXPFileStorageStatus, AXPRegionalService } from '@acorex/platform/common';
|
2
2
|
import { AXPEntityResolver, AXPEntityStorageService } from '@acorex/platform/layout/entity';
|
3
3
|
import * as i1 from '@angular/common/http';
|
4
4
|
import { HttpParams, HttpClient, HttpHeaders } from '@angular/common/http';
|
5
5
|
import * as i0 from '@angular/core';
|
6
6
|
import { inject, Injectable, NgModule } from '@angular/core';
|
7
7
|
import { kebabCase } from 'lodash-es';
|
8
|
-
import { firstValueFrom, map, BehaviorSubject, tap, filter, take, of, switchMap, delay } from 'rxjs';
|
8
|
+
import { firstValueFrom, map, BehaviorSubject, tap, filter, take, of, switchMap, delay, catchError } from 'rxjs';
|
9
9
|
import * as i2 from '@acorex/platform/auth';
|
10
|
-
import { AXPSessionService, AXPAuthModule,
|
10
|
+
import { AXPSessionService, AXPAuthModule, AXP_APPLICATION_LOADER, AXP_PERMISSION_LOADER, AXP_FEATURE_LOADER } from '@acorex/platform/auth';
|
11
11
|
import { STRATEGY_CONFIG_TOKEN } from '@acorex/platform/widgets';
|
12
12
|
import * as i1$1 from 'angular-oauth2-oidc';
|
13
13
|
import { OAuthService, OAuthModule } from 'angular-oauth2-oidc';
|
14
14
|
import { AXM_AUTH_CONFIG_TOKEN } from '@acorex/modules/auth';
|
15
|
+
import { AXUSLocaleProfile, AXIRLocaleProfile } from '@acorex/core/locale';
|
16
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
15
17
|
|
16
18
|
class AXCApiEntityStorageService {
|
17
19
|
constructor(http) {
|
@@ -129,10 +131,10 @@ class AXCApiEntityStorageService {
|
|
129
131
|
};
|
130
132
|
});
|
131
133
|
}
|
132
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
133
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiEntityStorageService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
135
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiEntityStorageService }); }
|
134
136
|
}
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiEntityStorageService, decorators: [{
|
136
138
|
type: Injectable
|
137
139
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
138
140
|
|
@@ -140,7 +142,7 @@ class AXMOidcApplicationLoader {
|
|
140
142
|
constructor(http) {
|
141
143
|
this.http = http;
|
142
144
|
this.configs = inject(AXP_ROOT_CONFIG_TOKEN);
|
143
|
-
this.apiGetApps = `${this.configs.baseUrl}/applications/
|
145
|
+
this.apiGetApps = `${this.configs.baseUrl}/applications/applications-for-current-tenant`;
|
144
146
|
this.apiSetApp = `${this.configs.baseUrl}/SetApplication`;
|
145
147
|
}
|
146
148
|
getList() {
|
@@ -177,10 +179,10 @@ class AXMOidcApplicationLoader {
|
|
177
179
|
// features: item.features || [],
|
178
180
|
};
|
179
181
|
}
|
180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
181
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
182
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcApplicationLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
183
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcApplicationLoader }); }
|
182
184
|
}
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcApplicationLoader, decorators: [{
|
184
186
|
type: Injectable
|
185
187
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
186
188
|
|
@@ -220,10 +222,10 @@ class AXMConfigurationService {
|
|
220
222
|
switchMap(() => of(this.applicationConfig)));
|
221
223
|
}
|
222
224
|
}
|
223
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
224
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
225
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMConfigurationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
226
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMConfigurationService, providedIn: 'root' }); }
|
225
227
|
}
|
226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMConfigurationService, decorators: [{
|
227
229
|
type: Injectable,
|
228
230
|
args: [{
|
229
231
|
providedIn: 'root',
|
@@ -435,7 +437,7 @@ class AXMOidcStrategy {
|
|
435
437
|
}
|
436
438
|
logout() {
|
437
439
|
this.oauthService.logOut({
|
438
|
-
noRedirectToLogoutUrl: true
|
440
|
+
noRedirectToLogoutUrl: true,
|
439
441
|
});
|
440
442
|
}
|
441
443
|
handleError(error) {
|
@@ -453,10 +455,10 @@ class AXMOidcStrategy {
|
|
453
455
|
get name() {
|
454
456
|
return 'user-pass';
|
455
457
|
}
|
456
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
457
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
459
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcStrategy }); }
|
458
460
|
}
|
459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcStrategy, decorators: [{
|
460
462
|
type: Injectable
|
461
463
|
}] });
|
462
464
|
|
@@ -481,10 +483,10 @@ class AXMOidcPermissionLoader {
|
|
481
483
|
const truePolicies = Object.keys(policies).filter((key) => policies[key] === true);
|
482
484
|
return truePolicies;
|
483
485
|
}
|
484
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
485
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcPermissionLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
487
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcPermissionLoader }); }
|
486
488
|
}
|
487
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcPermissionLoader, decorators: [{
|
488
490
|
type: Injectable
|
489
491
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
490
492
|
|
@@ -492,11 +494,12 @@ class AXMOidcTenantLoader {
|
|
492
494
|
constructor(http) {
|
493
495
|
this.http = http;
|
494
496
|
this.configs = inject(AXP_ROOT_CONFIG_TOKEN);
|
495
|
-
this.apiGetTenants = `${this.configs.baseUrl}/
|
496
|
-
this.apiSetTenant = `${this.configs.baseUrl}/SetTenant`;
|
497
|
+
this.apiGetTenants = `${this.configs.baseUrl}/tenants/available-for-user`;
|
497
498
|
}
|
498
499
|
getList() {
|
499
|
-
return this.http.get(this.apiGetTenants).pipe(map((response) => response.items.map((item) =>
|
500
|
+
return this.http.get(this.apiGetTenants).pipe(map((response) => response.items.map((item) => {
|
501
|
+
return this.mapToAXPTenant(item);
|
502
|
+
})));
|
500
503
|
}
|
501
504
|
async set(tenant) {
|
502
505
|
return Promise.resolve();
|
@@ -509,25 +512,419 @@ class AXMOidcTenantLoader {
|
|
509
512
|
// Add other fields and defaults as needed, and handle the logo if applicable
|
510
513
|
};
|
511
514
|
}
|
512
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
513
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
515
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcTenantLoader, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
516
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcTenantLoader }); }
|
514
517
|
}
|
515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMOidcTenantLoader, decorators: [{
|
516
519
|
type: Injectable
|
517
520
|
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
518
521
|
|
522
|
+
class AXCFileStorageApiService extends AXPFileStorageService {
|
523
|
+
constructor() {
|
524
|
+
super(...arguments);
|
525
|
+
this.http = inject(HttpClient);
|
526
|
+
//#region ---- API Endpoints ----
|
527
|
+
this.baseUrl = '/api/file-storage';
|
528
|
+
//#endregion
|
529
|
+
//#region ---- Fallback Data ----
|
530
|
+
this.fallbackFileInfo = {
|
531
|
+
fileId: 'fallback-file-id',
|
532
|
+
refId: 'fallback-ref-id',
|
533
|
+
refType: 'fallback-ref-type',
|
534
|
+
category: 'fallback-category',
|
535
|
+
size: 0,
|
536
|
+
mimeType: 'application/octet-stream',
|
537
|
+
uploadedAt: new Date(),
|
538
|
+
isPublic: true,
|
539
|
+
isPrimary: false,
|
540
|
+
status: AXPFileStorageStatus.Temporary,
|
541
|
+
name: 'fallback-file',
|
542
|
+
binary: new File([''], 'fallback-file'),
|
543
|
+
};
|
544
|
+
}
|
545
|
+
//#endregion
|
546
|
+
async save(request) {
|
547
|
+
try {
|
548
|
+
const formData = new FormData();
|
549
|
+
formData.append('file', request.file);
|
550
|
+
formData.append('refId', request.refId);
|
551
|
+
formData.append('refType', request.refType);
|
552
|
+
formData.append('category', request.category);
|
553
|
+
if (request.name) {
|
554
|
+
formData.append('name', request.name);
|
555
|
+
}
|
556
|
+
if (request.path) {
|
557
|
+
formData.append('path', request.path);
|
558
|
+
}
|
559
|
+
if (request.isPrimary !== undefined) {
|
560
|
+
formData.append('isPrimary', request.isPrimary.toString());
|
561
|
+
}
|
562
|
+
if (request.status) {
|
563
|
+
formData.append('status', request.status);
|
564
|
+
}
|
565
|
+
if (request.metadata) {
|
566
|
+
formData.append('metadata', JSON.stringify(request.metadata));
|
567
|
+
}
|
568
|
+
return await firstValueFrom(this.http.post(`${this.baseUrl}/save`, formData).pipe(catchError(() => of(this.fallbackFileInfo))));
|
569
|
+
}
|
570
|
+
catch {
|
571
|
+
return this.fallbackFileInfo;
|
572
|
+
}
|
573
|
+
}
|
574
|
+
async update(request) {
|
575
|
+
try {
|
576
|
+
const updateData = {
|
577
|
+
metadata: request.metadata,
|
578
|
+
};
|
579
|
+
if (request.path !== undefined) {
|
580
|
+
updateData.path = request.path;
|
581
|
+
}
|
582
|
+
if (request.isPrimary !== undefined) {
|
583
|
+
updateData.isPrimary = request.isPrimary;
|
584
|
+
}
|
585
|
+
return await firstValueFrom(this.http.put(`${this.baseUrl}/update/${request.fileId}`, updateData).pipe(catchError(() => of(this.fallbackFileInfo))));
|
586
|
+
}
|
587
|
+
catch {
|
588
|
+
return this.fallbackFileInfo;
|
589
|
+
}
|
590
|
+
}
|
591
|
+
async find(request) {
|
592
|
+
try {
|
593
|
+
let params = new HttpParams();
|
594
|
+
if (request.refId) {
|
595
|
+
params = params.set('refId', request.refId);
|
596
|
+
}
|
597
|
+
if (request.refType) {
|
598
|
+
params = params.set('refType', request.refType);
|
599
|
+
}
|
600
|
+
if (request.category) {
|
601
|
+
params = params.set('category', request.category);
|
602
|
+
}
|
603
|
+
if (request.mimeType) {
|
604
|
+
params = params.set('mimeType', request.mimeType);
|
605
|
+
}
|
606
|
+
if (request.isPublic !== undefined) {
|
607
|
+
params = params.set('isPublic', request.isPublic.toString());
|
608
|
+
}
|
609
|
+
if (request.isPrimary !== undefined) {
|
610
|
+
params = params.set('isPrimary', request.isPrimary.toString());
|
611
|
+
}
|
612
|
+
if (request.uploadedAtRange) {
|
613
|
+
params = params.set('uploadedAtFrom', request.uploadedAtRange.from.toISOString());
|
614
|
+
params = params.set('uploadedAtTo', request.uploadedAtRange.to.toISOString());
|
615
|
+
}
|
616
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/find`, { params }).pipe(catchError(() => of([]))));
|
617
|
+
}
|
618
|
+
catch {
|
619
|
+
return [];
|
620
|
+
}
|
621
|
+
}
|
622
|
+
async getInfo(fileId) {
|
623
|
+
try {
|
624
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/info/${fileId}`).pipe(catchError(() => of(this.fallbackFileInfo))));
|
625
|
+
}
|
626
|
+
catch {
|
627
|
+
return this.fallbackFileInfo;
|
628
|
+
}
|
629
|
+
}
|
630
|
+
async remove(fileId) {
|
631
|
+
try {
|
632
|
+
await firstValueFrom(this.http.delete(`${this.baseUrl}/remove/${fileId}`).pipe(catchError(() => of(void 0))));
|
633
|
+
}
|
634
|
+
catch {
|
635
|
+
// Silently fail in fallback mode
|
636
|
+
}
|
637
|
+
}
|
638
|
+
async commit(fileId) {
|
639
|
+
try {
|
640
|
+
await firstValueFrom(this.http.post(`${this.baseUrl}/commit/${fileId}`, {}).pipe(catchError(() => of(void 0))));
|
641
|
+
}
|
642
|
+
catch {
|
643
|
+
// Silently fail in fallback mode
|
644
|
+
}
|
645
|
+
}
|
646
|
+
async markForDeletion(fileId) {
|
647
|
+
try {
|
648
|
+
await firstValueFrom(this.http.post(`${this.baseUrl}/mark-for-deletion/${fileId}`, {}).pipe(catchError(() => of(void 0))));
|
649
|
+
}
|
650
|
+
catch {
|
651
|
+
// Silently fail in fallback mode
|
652
|
+
}
|
653
|
+
}
|
654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCFileStorageApiService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
655
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCFileStorageApiService }); }
|
656
|
+
}
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCFileStorageApiService, decorators: [{
|
658
|
+
type: Injectable
|
659
|
+
}] });
|
660
|
+
|
661
|
+
class AXCRegionalApiService extends AXPRegionalService {
|
662
|
+
constructor() {
|
663
|
+
super(...arguments);
|
664
|
+
this.http = inject(HttpClient);
|
665
|
+
this.languageService = inject(AXTranslationService);
|
666
|
+
//#region ---- API Endpoints ----
|
667
|
+
this.baseUrl = '/api/regional';
|
668
|
+
//#endregion
|
669
|
+
//#region ---- Fallback Data ----
|
670
|
+
this.fallbackCountries = [
|
671
|
+
{
|
672
|
+
code: 'US',
|
673
|
+
title: 'United States',
|
674
|
+
native: 'United States',
|
675
|
+
regional: 'en',
|
676
|
+
timezone: 'America/New_York'
|
677
|
+
},
|
678
|
+
{
|
679
|
+
code: 'CA',
|
680
|
+
title: 'Canada',
|
681
|
+
native: 'Canada',
|
682
|
+
regional: 'en',
|
683
|
+
timezone: 'America/Toronto'
|
684
|
+
},
|
685
|
+
{
|
686
|
+
code: 'GB',
|
687
|
+
title: 'United Kingdom',
|
688
|
+
native: 'United Kingdom',
|
689
|
+
regional: 'en',
|
690
|
+
timezone: 'Europe/London'
|
691
|
+
}
|
692
|
+
];
|
693
|
+
this.fallbackProvinces = [
|
694
|
+
{
|
695
|
+
code: 'CA',
|
696
|
+
title: 'California',
|
697
|
+
native: 'California',
|
698
|
+
timezone: 'America/Los_Angeles'
|
699
|
+
},
|
700
|
+
{
|
701
|
+
code: 'NY',
|
702
|
+
title: 'New York',
|
703
|
+
native: 'New York',
|
704
|
+
timezone: 'America/New_York'
|
705
|
+
},
|
706
|
+
{
|
707
|
+
code: 'ON',
|
708
|
+
title: 'Ontario',
|
709
|
+
native: 'Ontario',
|
710
|
+
timezone: 'America/Toronto'
|
711
|
+
}
|
712
|
+
];
|
713
|
+
this.fallbackCities = [
|
714
|
+
{
|
715
|
+
code: 'NYC',
|
716
|
+
title: 'New York City',
|
717
|
+
native: 'New York City',
|
718
|
+
timezone: 'America/New_York'
|
719
|
+
},
|
720
|
+
{
|
721
|
+
code: 'LA',
|
722
|
+
title: 'Los Angeles',
|
723
|
+
native: 'Los Angeles',
|
724
|
+
timezone: 'America/Los_Angeles'
|
725
|
+
},
|
726
|
+
{
|
727
|
+
code: 'TOR',
|
728
|
+
title: 'Toronto',
|
729
|
+
native: 'Toronto',
|
730
|
+
timezone: 'America/Toronto'
|
731
|
+
}
|
732
|
+
];
|
733
|
+
this.fallbackCurrencies = [
|
734
|
+
{
|
735
|
+
code: 'USD',
|
736
|
+
title: 'United States Dollar',
|
737
|
+
symbol: '$',
|
738
|
+
format: '${amount}'
|
739
|
+
},
|
740
|
+
{
|
741
|
+
code: 'CAD',
|
742
|
+
title: 'Canadian Dollar',
|
743
|
+
symbol: 'CA$',
|
744
|
+
format: 'CA${amount}'
|
745
|
+
},
|
746
|
+
{
|
747
|
+
code: 'GBP',
|
748
|
+
title: 'British Pound',
|
749
|
+
symbol: '£',
|
750
|
+
format: '£{amount}'
|
751
|
+
}
|
752
|
+
];
|
753
|
+
this.fallbackLocaleProfiles = [
|
754
|
+
{
|
755
|
+
...AXUSLocaleProfile,
|
756
|
+
code: 'en-US',
|
757
|
+
title: 'English (United States)',
|
758
|
+
nativeTitle: 'English (United States)',
|
759
|
+
},
|
760
|
+
{
|
761
|
+
...AXIRLocaleProfile,
|
762
|
+
code: 'fa-IR',
|
763
|
+
title: 'Persian (Iran)',
|
764
|
+
nativeTitle: 'فارسی (ایران)',
|
765
|
+
}
|
766
|
+
];
|
767
|
+
this.fallbackLanguages = [
|
768
|
+
{
|
769
|
+
code: 'en',
|
770
|
+
title: 'English'
|
771
|
+
},
|
772
|
+
{
|
773
|
+
code: 'fa',
|
774
|
+
title: 'Persian'
|
775
|
+
},
|
776
|
+
{
|
777
|
+
code: 'es',
|
778
|
+
title: 'Spanish'
|
779
|
+
}
|
780
|
+
];
|
781
|
+
this.fallbackTimeZones = [
|
782
|
+
{
|
783
|
+
code: 'America/New_York',
|
784
|
+
title: 'Eastern Time (US & Canada)',
|
785
|
+
offset: '-05:00',
|
786
|
+
iana: 'America/New_York',
|
787
|
+
abbr: 'EST'
|
788
|
+
},
|
789
|
+
{
|
790
|
+
code: 'America/Los_Angeles',
|
791
|
+
title: 'Pacific Time (US & Canada)',
|
792
|
+
offset: '-08:00',
|
793
|
+
iana: 'America/Los_Angeles',
|
794
|
+
abbr: 'PST'
|
795
|
+
},
|
796
|
+
{
|
797
|
+
code: 'Europe/London',
|
798
|
+
title: 'Greenwich Mean Time',
|
799
|
+
offset: '+00:00',
|
800
|
+
iana: 'Europe/London',
|
801
|
+
abbr: 'GMT'
|
802
|
+
}
|
803
|
+
];
|
804
|
+
}
|
805
|
+
//#endregion
|
806
|
+
async getCountries() {
|
807
|
+
const lang = await firstValueFrom(this.languageService.langChanges$);
|
808
|
+
try {
|
809
|
+
const countries = await firstValueFrom(this.http.get(`${this.baseUrl}/countries`).pipe(catchError(() => of(this.fallbackCountries))));
|
810
|
+
return countries.map((country) => {
|
811
|
+
if (lang == country.regional) {
|
812
|
+
return {
|
813
|
+
...country,
|
814
|
+
title: country.native,
|
815
|
+
};
|
816
|
+
}
|
817
|
+
else {
|
818
|
+
return country;
|
819
|
+
}
|
820
|
+
});
|
821
|
+
}
|
822
|
+
catch {
|
823
|
+
return this.fallbackCountries.map((country) => {
|
824
|
+
if (lang == country.regional) {
|
825
|
+
return {
|
826
|
+
...country,
|
827
|
+
title: country.native,
|
828
|
+
};
|
829
|
+
}
|
830
|
+
else {
|
831
|
+
return country;
|
832
|
+
}
|
833
|
+
});
|
834
|
+
}
|
835
|
+
}
|
836
|
+
async getProvinces(countryId) {
|
837
|
+
let params = new HttpParams();
|
838
|
+
if (countryId) {
|
839
|
+
params = params.set('countryId', countryId);
|
840
|
+
}
|
841
|
+
try {
|
842
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/provinces`, { params }).pipe(catchError(() => of(this.fallbackProvinces))));
|
843
|
+
}
|
844
|
+
catch {
|
845
|
+
return this.fallbackProvinces;
|
846
|
+
}
|
847
|
+
}
|
848
|
+
async getCities(filter) {
|
849
|
+
let params = new HttpParams();
|
850
|
+
if (filter?.countryId) {
|
851
|
+
params = params.set('countryId', filter.countryId);
|
852
|
+
}
|
853
|
+
if (filter?.provinceId) {
|
854
|
+
params = params.set('provinceId', filter.provinceId);
|
855
|
+
}
|
856
|
+
try {
|
857
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/cities`, { params }).pipe(catchError(() => of(this.fallbackCities))));
|
858
|
+
}
|
859
|
+
catch {
|
860
|
+
return this.fallbackCities;
|
861
|
+
}
|
862
|
+
}
|
863
|
+
async getCurrencies() {
|
864
|
+
try {
|
865
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/currencies`).pipe(catchError(() => of(this.fallbackCurrencies))));
|
866
|
+
}
|
867
|
+
catch {
|
868
|
+
return this.fallbackCurrencies;
|
869
|
+
}
|
870
|
+
}
|
871
|
+
async getLocaleProfiles() {
|
872
|
+
try {
|
873
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/locale-profiles`).pipe(catchError(() => of(this.fallbackLocaleProfiles))));
|
874
|
+
}
|
875
|
+
catch {
|
876
|
+
return this.fallbackLocaleProfiles;
|
877
|
+
}
|
878
|
+
}
|
879
|
+
async getLanguages() {
|
880
|
+
try {
|
881
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/languages`).pipe(catchError(() => of(this.fallbackLanguages))));
|
882
|
+
}
|
883
|
+
catch {
|
884
|
+
return this.fallbackLanguages;
|
885
|
+
}
|
886
|
+
}
|
887
|
+
async getAvailableLanguages() {
|
888
|
+
try {
|
889
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/available-languages`).pipe(catchError(() => of(this.fallbackLanguages))));
|
890
|
+
}
|
891
|
+
catch {
|
892
|
+
return this.fallbackLanguages;
|
893
|
+
}
|
894
|
+
}
|
895
|
+
async getBrowserTimeZoneCode() {
|
896
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
897
|
+
}
|
898
|
+
async getTimeZones() {
|
899
|
+
try {
|
900
|
+
return await firstValueFrom(this.http.get(`${this.baseUrl}/timezones`).pipe(catchError(() => of(this.fallbackTimeZones))));
|
901
|
+
}
|
902
|
+
catch {
|
903
|
+
return this.fallbackTimeZones;
|
904
|
+
}
|
905
|
+
}
|
906
|
+
}
|
907
|
+
|
519
908
|
class AXCApiModule {
|
520
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
521
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
522
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
909
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
910
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXCApiModule, imports: [i1$1.OAuthModule, i2.AXPAuthModule] }); }
|
911
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiModule, providers: [
|
523
912
|
{
|
524
913
|
provide: AXPEntityStorageService,
|
525
914
|
useClass: AXCApiEntityStorageService,
|
526
915
|
},
|
527
916
|
{
|
528
|
-
provide:
|
529
|
-
useClass:
|
917
|
+
provide: AXPRegionalService,
|
918
|
+
useClass: AXCRegionalApiService,
|
530
919
|
},
|
920
|
+
{
|
921
|
+
provide: AXPFileStorageService,
|
922
|
+
useClass: AXCFileStorageApiService,
|
923
|
+
},
|
924
|
+
// {
|
925
|
+
// provide: AXP_TENANT_LOADER,
|
926
|
+
// useClass: AXMOidcTenantLoader,
|
927
|
+
// },
|
531
928
|
{
|
532
929
|
provide: AXP_APPLICATION_LOADER,
|
533
930
|
useClass: AXMOidcApplicationLoader,
|
@@ -549,16 +946,16 @@ class AXCApiModule {
|
|
549
946
|
},
|
550
947
|
], imports: [OAuthModule.forRoot(),
|
551
948
|
AXPAuthModule.forRoot({
|
552
|
-
strategies: [
|
949
|
+
strategies: [],
|
553
950
|
})] }); }
|
554
951
|
}
|
555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
952
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXCApiModule, decorators: [{
|
556
953
|
type: NgModule,
|
557
954
|
args: [{
|
558
955
|
imports: [
|
559
956
|
OAuthModule.forRoot(),
|
560
957
|
AXPAuthModule.forRoot({
|
561
|
-
strategies: [
|
958
|
+
strategies: [],
|
562
959
|
}),
|
563
960
|
],
|
564
961
|
providers: [
|
@@ -567,9 +964,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
|
|
567
964
|
useClass: AXCApiEntityStorageService,
|
568
965
|
},
|
569
966
|
{
|
570
|
-
provide:
|
571
|
-
useClass:
|
967
|
+
provide: AXPRegionalService,
|
968
|
+
useClass: AXCRegionalApiService,
|
969
|
+
},
|
970
|
+
{
|
971
|
+
provide: AXPFileStorageService,
|
972
|
+
useClass: AXCFileStorageApiService,
|
572
973
|
},
|
974
|
+
// {
|
975
|
+
// provide: AXP_TENANT_LOADER,
|
976
|
+
// useClass: AXMOidcTenantLoader,
|
977
|
+
// },
|
573
978
|
{
|
574
979
|
provide: AXP_APPLICATION_LOADER,
|
575
980
|
useClass: AXMOidcApplicationLoader,
|