@experteam-mx/ngx-services 16.1.1 → 18.0.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/README.md +8 -8
- package/esm2022/lib/apis/api-companies.service.mjs +9 -7
- package/esm2022/lib/apis/api-security.service.mjs +15 -12
- package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-companies.interfaces.mjs +1 -1
- package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
- package/esm2022/lib/apis/models/api.models.mjs +1 -1
- package/esm2022/lib/helpers/http.mjs +4 -2
- package/esm2022/lib/interceptors/api-headers.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/api-token.interceptor.mjs +14 -8
- package/esm2022/lib/interceptors/http-caching.interceptor.mjs +8 -7
- package/esm2022/lib/ngx-services.models.mjs +1 -1
- package/esm2022/lib/ngx-services.module.mjs +7 -11
- package/esm2022/public-api.mjs +2 -9
- package/fesm2022/experteam-mx-ngx-services.mjs +53 -165
- package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/apis/api-companies.service.d.ts +163 -163
- package/lib/apis/api-security.service.d.ts +79 -79
- package/lib/apis/models/{api-catalogs.interfaces.d.ts → api-catalog.interfaces.d.ts} +71 -75
- package/lib/apis/models/api-companies.interfaces.d.ts +380 -380
- package/lib/apis/models/api-companies.types.d.ts +75 -75
- package/lib/apis/models/api-security.interfaces.d.ts +55 -55
- package/lib/apis/models/api-security.types.d.ts +30 -30
- package/lib/apis/models/api.models.d.ts +23 -23
- package/lib/helpers/http.d.ts +38 -38
- package/lib/interceptors/api-headers.interceptor.d.ts +16 -16
- package/lib/interceptors/api-token.interceptor.d.ts +21 -19
- package/lib/interceptors/http-caching.interceptor.d.ts +12 -12
- package/lib/ngx-services.models.d.ts +6 -9
- package/lib/ngx-services.module.d.ts +16 -17
- package/package.json +10 -16
- package/public-api.d.ts +12 -19
- package/esm2020/experteam-mx-ngx-services.mjs +0 -5
- package/esm2020/lib/apis/api-catalogs.service.mjs +0 -42
- package/esm2020/lib/apis/api-companies.service.mjs +0 -255
- package/esm2020/lib/apis/api-external-ops.service.mjs +0 -53
- package/esm2020/lib/apis/api-security.service.mjs +0 -128
- package/esm2020/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-catalogs.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-companies.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-companies.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-external-ops.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-security.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-security.types.mjs +0 -2
- package/esm2020/lib/apis/models/api.models.mjs +0 -2
- package/esm2020/lib/helpers/http.mjs +0 -64
- package/esm2020/lib/interceptors/api-headers.interceptor.mjs +0 -34
- package/esm2020/lib/interceptors/api-key.interceptor.mjs +0 -38
- package/esm2020/lib/interceptors/api-token.interceptor.mjs +0 -35
- package/esm2020/lib/interceptors/http-caching.interceptor.mjs +0 -38
- package/esm2020/lib/ngx-services.models.mjs +0 -2
- package/esm2020/lib/ngx-services.module.mjs +0 -37
- package/esm2020/public-api.mjs +0 -27
- package/esm2022/lib/apis/api-catalogs.service.mjs +0 -42
- package/esm2022/lib/apis/api-external-ops.service.mjs +0 -53
- package/esm2022/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
- package/esm2022/lib/apis/models/api-catalogs.types.mjs +0 -2
- package/esm2022/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
- package/esm2022/lib/apis/models/api-external-ops.types.mjs +0 -2
- package/esm2022/lib/interceptors/api-key.interceptor.mjs +0 -38
- package/fesm2015/experteam-mx-ngx-services.mjs +0 -723
- package/fesm2015/experteam-mx-ngx-services.mjs.map +0 -1
- package/fesm2020/experteam-mx-ngx-services.mjs +0 -705
- package/fesm2020/experteam-mx-ngx-services.mjs.map +0 -1
- package/lib/apis/api-catalogs.service.d.ts +0 -26
- package/lib/apis/api-external-ops.service.d.ts +0 -34
- package/lib/apis/models/api-catalogs.types.d.ts +0 -5
- package/lib/apis/models/api-external-ops.interfaces.d.ts +0 -23
- package/lib/apis/models/api-external-ops.types.d.ts +0 -18
- package/lib/interceptors/api-key.interceptor.d.ts +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export class NgxServicesModule {
|
|
5
5
|
/**
|
|
@@ -20,18 +20,14 @@ export class NgxServicesModule {
|
|
|
20
20
|
]
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
static
|
|
24
|
-
static
|
|
25
|
-
static
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
24
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule });
|
|
25
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, providers: [provideHttpClient()] });
|
|
26
26
|
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, decorators: [{
|
|
28
28
|
type: NgModule,
|
|
29
29
|
args: [{
|
|
30
|
-
|
|
31
|
-
imports: [
|
|
32
|
-
HttpClientModule
|
|
33
|
-
],
|
|
34
|
-
exports: []
|
|
30
|
+
providers: [provideHttpClient()]
|
|
35
31
|
}]
|
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2VzLm1vZGVscydcclxuaW1wb3J0IHsgcHJvdmlkZUh0dHBDbGllbnQgfSBmcm9tICdAYW5ndWxhci9jb21tb24vaHR0cCdcclxuXHJcbkBOZ01vZHVsZSh7XHJcbiAgcHJvdmlkZXJzOiBbcHJvdmlkZUh0dHBDbGllbnQoKV1cclxufSlcclxuZXhwb3J0IGNsYXNzIE5neFNlcnZpY2VzTW9kdWxlIHtcclxuICAvKipcclxuICAgKiBSZXR1cm5zIGEgbW9kdWxlIHdpdGggcHJvdmlkZXJzIGZvciB0aGUgTmd4U2VydmljZXNNb2R1bGUuXHJcbiAgICpcclxuICAgKiBAcGFyYW0ge0Vudmlyb25tZW50fSBlbnZpcm9ubWVudCAtIFRoZSBlbnZpcm9ubWVudCBjb25maWd1cmF0aW9uIG9iamVjdC5cclxuICAgKlxyXG4gICAqIEByZXR1cm4ge01vZHVsZVdpdGhQcm92aWRlcnM8Tmd4U2VydmljZXNNb2R1bGU+fSBUaGUgbW9kdWxlIHdpdGggcHJvdmlkZXJzIGZvciB0aGUgTmd4U2VydmljZXNNb2R1bGUuXHJcbiAgICovXHJcbiAgcHVibGljIHN0YXRpYyBmb3JSb290IChlbnZpcm9ubWVudDogRW52aXJvbm1lbnQpOiBNb2R1bGVXaXRoUHJvdmlkZXJzPE5neFNlcnZpY2VzTW9kdWxlPiB7XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICBuZ01vZHVsZTogTmd4U2VydmljZXNNb2R1bGUsXHJcbiAgICAgIHByb3ZpZGVyczogW1xyXG4gICAgICAgIHtcclxuICAgICAgICAgIHByb3ZpZGU6ICdlbnYnLFxyXG4gICAgICAgICAgdXNlVmFsdWU6IGVudmlyb25tZW50XHJcbiAgICAgICAgfVxyXG4gICAgICBdXHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
package/esm2022/public-api.mjs
CHANGED
|
@@ -3,25 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './lib/ngx-services.module';
|
|
5
5
|
// api services
|
|
6
|
-
export * from './lib/apis/api-catalogs.service';
|
|
7
6
|
export * from './lib/apis/api-companies.service';
|
|
8
|
-
export * from './lib/apis/api-external-ops.service';
|
|
9
7
|
export * from './lib/apis/api-security.service';
|
|
10
8
|
// api models
|
|
11
|
-
export * from './lib/apis/models/api
|
|
12
|
-
export * from './lib/apis/models/api-catalogs.types';
|
|
9
|
+
export * from './lib/apis/models/api.models';
|
|
13
10
|
export * from './lib/apis/models/api-companies.interfaces';
|
|
14
11
|
export * from './lib/apis/models/api-companies.types';
|
|
15
|
-
export * from './lib/apis/models/api-external-ops.interfaces';
|
|
16
|
-
export * from './lib/apis/models/api-external-ops.types';
|
|
17
12
|
export * from './lib/apis/models/api-security.interfaces';
|
|
18
13
|
export * from './lib/apis/models/api-security.types';
|
|
19
|
-
export * from './lib/apis/models/api.models';
|
|
20
14
|
// interceptors
|
|
21
15
|
export * from './lib/interceptors/api-headers.interceptor';
|
|
22
|
-
export * from './lib/interceptors/api-key.interceptor';
|
|
23
16
|
export * from './lib/interceptors/api-token.interceptor';
|
|
24
17
|
export * from './lib/interceptors/http-caching.interceptor';
|
|
25
18
|
// helpers
|
|
26
19
|
export * from './lib/helpers/http';
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2V4cGVydGVhbS9uZ3gtc2VydmljZXMvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxjQUFjLDJCQUEyQixDQUFBO0FBRXpDLGVBQWU7QUFDZixjQUFjLGtDQUFrQyxDQUFBO0FBQ2hELGNBQWMsaUNBQWlDLENBQUE7QUFFL0MsYUFBYTtBQUNiLGNBQWMsOEJ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0ICogZnJvbSAnLi9saWIvaW50ZXJjZXB0b3JzL2FwaS1oZWFkZXJzLmludGVyY2VwdG9yJ1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9pbnRlcmNlcHRvcnMvYXBpLXRva2VuLmludGVyY2VwdG9yJ1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9pbnRlcmNlcHRvcnMvaHR0cC1jYWNoaW5nLmludGVyY2VwdG9yJ1xyXG5cclxuLy8gaGVscGVyc1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9oZWxwZXJzL2h0dHAnXHJcbiJdfQ==
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { NgModule, Injectable, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
|
-
import {
|
|
4
|
+
import { provideHttpClient, HttpParams, HttpHeaders, HttpResponse } from '@angular/common/http';
|
|
5
5
|
import { map, mergeMap, forkJoin, tap, of } from 'rxjs';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i1$1 from 'ngx-cookie-service';
|
|
7
7
|
import { tap as tap$1 } from 'rxjs/operators';
|
|
8
8
|
|
|
9
9
|
class NgxServicesModule {
|
|
@@ -25,18 +25,14 @@ class NgxServicesModule {
|
|
|
25
25
|
]
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
static
|
|
29
|
-
static
|
|
30
|
-
static
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
29
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule });
|
|
30
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, providers: [provideHttpClient()] });
|
|
31
31
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: NgxServicesModule, decorators: [{
|
|
33
33
|
type: NgModule,
|
|
34
34
|
args: [{
|
|
35
|
-
|
|
36
|
-
imports: [
|
|
37
|
-
HttpClientModule
|
|
38
|
-
],
|
|
39
|
-
exports: []
|
|
35
|
+
providers: [provideHttpClient()]
|
|
40
36
|
}]
|
|
41
37
|
}] });
|
|
42
38
|
|
|
@@ -71,7 +67,9 @@ const queryString = (params) => {
|
|
|
71
67
|
*
|
|
72
68
|
* @returns {HttpParams} - An instance of HttpParams created from the params object.
|
|
73
69
|
*/
|
|
74
|
-
const httpParams = (params) => new HttpParams({
|
|
70
|
+
const httpParams = (params) => new HttpParams({
|
|
71
|
+
fromObject: params
|
|
72
|
+
});
|
|
75
73
|
/**
|
|
76
74
|
* Returns the headers for generating PDF files.
|
|
77
75
|
*
|
|
@@ -103,44 +101,9 @@ const xmlHeaders = (format = 'object') => {
|
|
|
103
101
|
: new HttpHeaders(headers);
|
|
104
102
|
};
|
|
105
103
|
|
|
106
|
-
class ApiCatalogsService {
|
|
107
|
-
constructor(environments, http) {
|
|
108
|
-
this.environments = environments;
|
|
109
|
-
this.http = http;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Retrieves the URL from the environments' API catalogs configuration.
|
|
113
|
-
*
|
|
114
|
-
* @return {string} The URL from the API catalogs, or an empty string if not defined.
|
|
115
|
-
*/
|
|
116
|
-
get url() {
|
|
117
|
-
return this.environments.apiCatalogsUrl ?? '';
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Fetches a list of languages based on the provided query parameters.
|
|
121
|
-
*
|
|
122
|
-
* @param {QueryParams} params - The query parameters to filter the languages.
|
|
123
|
-
* @return {Observable<LanguagesData>} An observable containing the languages' data.
|
|
124
|
-
*/
|
|
125
|
-
getLanguages(params) {
|
|
126
|
-
return this.http.get(`${this.url}/languages`, {
|
|
127
|
-
params: httpParams(params),
|
|
128
|
-
}).pipe(map(({ data }) => data));
|
|
129
|
-
}
|
|
130
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiCatalogsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
131
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiCatalogsService, providedIn: 'root' }); }
|
|
132
|
-
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiCatalogsService, decorators: [{
|
|
134
|
-
type: Injectable,
|
|
135
|
-
args: [{
|
|
136
|
-
providedIn: 'root'
|
|
137
|
-
}]
|
|
138
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
139
|
-
type: Inject,
|
|
140
|
-
args: ['env']
|
|
141
|
-
}] }, { type: i1.HttpClient }]; } });
|
|
142
|
-
|
|
143
104
|
class ApiCompaniesService {
|
|
105
|
+
environments;
|
|
106
|
+
http;
|
|
144
107
|
constructor(environments, http) {
|
|
145
108
|
this.environments = environments;
|
|
146
109
|
this.http = http;
|
|
@@ -151,7 +114,7 @@ class ApiCompaniesService {
|
|
|
151
114
|
* @return {string} The URL of the companies API.
|
|
152
115
|
*/
|
|
153
116
|
get url() {
|
|
154
|
-
return this.environments.apiCompaniesUrl
|
|
117
|
+
return this.environments.apiCompaniesUrl;
|
|
155
118
|
}
|
|
156
119
|
/**
|
|
157
120
|
* Fetches the installations based on the provided query parameters.
|
|
@@ -377,73 +340,27 @@ class ApiCompaniesService {
|
|
|
377
340
|
params: httpParams(params),
|
|
378
341
|
}).pipe(map(({ data }) => data));
|
|
379
342
|
}
|
|
380
|
-
static
|
|
381
|
-
static
|
|
343
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiCompaniesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
344
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiCompaniesService, providedIn: 'root' });
|
|
382
345
|
}
|
|
383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiCompaniesService, decorators: [{
|
|
384
347
|
type: Injectable,
|
|
385
348
|
args: [{
|
|
386
349
|
providedIn: 'root'
|
|
387
350
|
}]
|
|
388
|
-
}], ctorParameters:
|
|
351
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
389
352
|
type: Inject,
|
|
390
353
|
args: ['env']
|
|
391
|
-
}] }, { type: i1.HttpClient }]
|
|
392
|
-
|
|
393
|
-
class ApiExternalOpsService {
|
|
394
|
-
constructor(environments, http) {
|
|
395
|
-
this.environments = environments;
|
|
396
|
-
this.http = http;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Retrieves the API pickups URL from the environments configuration.
|
|
400
|
-
*
|
|
401
|
-
* @return {string} The API pickups URL.
|
|
402
|
-
*/
|
|
403
|
-
get url() {
|
|
404
|
-
return this.environments.apiExternalOps ?? '';
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Retrieves delivery confirmation details based on the provided OTP code.
|
|
408
|
-
*
|
|
409
|
-
* @param {string} otpCode - The OTP code used to search for delivery confirmation.
|
|
410
|
-
* @return {Observable<DeliveryConfirmationData>} An observable containing the delivery confirmation data.
|
|
411
|
-
*/
|
|
412
|
-
getDeliveryConfirmation(otpCode) {
|
|
413
|
-
return this.http.get(`${this.url}/delivery-confirmation/search/${otpCode}`)
|
|
414
|
-
.pipe(map(({ data }) => data));
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Put a delivery confirmation by sending an OTP code and a signature.
|
|
418
|
-
*
|
|
419
|
-
* @param {Object} options - The options object
|
|
420
|
-
* @param {string} options.otpCode - The OTP code for confirming the delivery.
|
|
421
|
-
* @param {string} options.signature - The signature for the delivery confirmation.
|
|
422
|
-
* @return {Observable<{}>} An observable that completes when the delivery confirmation is successfully submitted.
|
|
423
|
-
*/
|
|
424
|
-
putDeliveryConfirmation({ otpCode, signature, }) {
|
|
425
|
-
return this.http.put(`${this.url}/delivery-confirmation/confirmation/${otpCode}`, {
|
|
426
|
-
signature
|
|
427
|
-
}).pipe(map(({ data }) => data));
|
|
428
|
-
}
|
|
429
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiExternalOpsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
430
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiExternalOpsService, providedIn: 'root' }); }
|
|
431
|
-
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiExternalOpsService, decorators: [{
|
|
433
|
-
type: Injectable,
|
|
434
|
-
args: [{
|
|
435
|
-
providedIn: 'root'
|
|
436
|
-
}]
|
|
437
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
438
|
-
type: Inject,
|
|
439
|
-
args: ['env']
|
|
440
|
-
}] }, { type: i1.HttpClient }]; } });
|
|
354
|
+
}] }, { type: i1.HttpClient }] });
|
|
441
355
|
|
|
442
356
|
class ApiSecurityService {
|
|
443
|
-
|
|
357
|
+
environments;
|
|
358
|
+
cookie;
|
|
359
|
+
http;
|
|
360
|
+
constructor(environments, cookie, http) {
|
|
444
361
|
this.environments = environments;
|
|
445
|
-
this.http = http;
|
|
446
362
|
this.cookie = cookie;
|
|
363
|
+
this.http = http;
|
|
447
364
|
}
|
|
448
365
|
/**
|
|
449
366
|
* Retrieves the API security URL from the environments configuration.
|
|
@@ -451,7 +368,7 @@ class ApiSecurityService {
|
|
|
451
368
|
* @return {string} The API security URL.
|
|
452
369
|
*/
|
|
453
370
|
get url() {
|
|
454
|
-
return this.environments.apiSecurityUrl
|
|
371
|
+
return this.environments.apiSecurityUrl;
|
|
455
372
|
}
|
|
456
373
|
/**
|
|
457
374
|
* Authenticates a user with the provided credentials and role.
|
|
@@ -468,7 +385,7 @@ class ApiSecurityService {
|
|
|
468
385
|
username,
|
|
469
386
|
password,
|
|
470
387
|
role,
|
|
471
|
-
}).pipe(map(({ data }) => data), tap(({ access_token }) => this.cookie.set(
|
|
388
|
+
}).pipe(map(({ data }) => data), tap(({ access_token }) => this.cookie.set(this.environments.tokenName, access_token, { path: '/' })));
|
|
472
389
|
}
|
|
473
390
|
/**
|
|
474
391
|
* Logs out the current user by making a POST request to the logout endpoint.
|
|
@@ -548,18 +465,18 @@ class ApiSecurityService {
|
|
|
548
465
|
language_id: languageId
|
|
549
466
|
}).pipe(map(({ data }) => data));
|
|
550
467
|
}
|
|
551
|
-
static
|
|
552
|
-
static
|
|
468
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiSecurityService, deps: [{ token: 'env' }, { token: i1$1.CookieService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
469
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiSecurityService, providedIn: 'root' });
|
|
553
470
|
}
|
|
554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiSecurityService, decorators: [{
|
|
555
472
|
type: Injectable,
|
|
556
473
|
args: [{
|
|
557
474
|
providedIn: 'root'
|
|
558
475
|
}]
|
|
559
|
-
}], ctorParameters:
|
|
476
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
560
477
|
type: Inject,
|
|
561
478
|
args: ['env']
|
|
562
|
-
}] }, { type: i1.
|
|
479
|
+
}] }, { type: i1$1.CookieService }, { type: i1.HttpClient }] });
|
|
563
480
|
|
|
564
481
|
class ApiHeadersInterceptor {
|
|
565
482
|
/**
|
|
@@ -585,51 +502,18 @@ class ApiHeadersInterceptor {
|
|
|
585
502
|
request = request.clone({ headers });
|
|
586
503
|
return next.handle(request);
|
|
587
504
|
}
|
|
588
|
-
static
|
|
589
|
-
static
|
|
505
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiHeadersInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
506
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiHeadersInterceptor });
|
|
590
507
|
}
|
|
591
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiHeadersInterceptor, decorators: [{
|
|
592
509
|
type: Injectable
|
|
593
510
|
}] });
|
|
594
511
|
|
|
595
|
-
class ApiKeyInterceptor {
|
|
596
|
-
constructor(environments) {
|
|
597
|
-
this.environments = environments;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Intercepts the HTTP request and adds the Authorization header.
|
|
601
|
-
*
|
|
602
|
-
* @param {HttpRequest<unknown>} request - The HTTP request to intercept.
|
|
603
|
-
* @param {HttpHandler} next - The next HTTP handler in the chain.
|
|
604
|
-
*
|
|
605
|
-
* @returns {Observable<HttpEvent<unknown>>} - An observable containing the HTTP event.
|
|
606
|
-
*/
|
|
607
|
-
intercept(request, next) {
|
|
608
|
-
const keyName = this.environments.keyName;
|
|
609
|
-
const keyValue = this.environments.keyValue;
|
|
610
|
-
if (!keyName || !keyValue)
|
|
611
|
-
return next.handle(request);
|
|
612
|
-
if (request.headers.has(keyName))
|
|
613
|
-
return next.handle(request);
|
|
614
|
-
request = request.clone({
|
|
615
|
-
setHeaders: {
|
|
616
|
-
[keyName]: keyValue
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
return next.handle(request);
|
|
620
|
-
}
|
|
621
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiKeyInterceptor, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
622
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiKeyInterceptor }); }
|
|
623
|
-
}
|
|
624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ApiKeyInterceptor, decorators: [{
|
|
625
|
-
type: Injectable
|
|
626
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
627
|
-
type: Inject,
|
|
628
|
-
args: ['env']
|
|
629
|
-
}] }]; } });
|
|
630
|
-
|
|
631
512
|
class ApiTokenInterceptor {
|
|
632
|
-
|
|
513
|
+
environments;
|
|
514
|
+
cookie;
|
|
515
|
+
constructor(environments, cookie) {
|
|
516
|
+
this.environments = environments;
|
|
633
517
|
this.cookie = cookie;
|
|
634
518
|
}
|
|
635
519
|
/**
|
|
@@ -643,7 +527,7 @@ class ApiTokenInterceptor {
|
|
|
643
527
|
intercept(request, next) {
|
|
644
528
|
if (request.headers.has('Authorization'))
|
|
645
529
|
return next.handle(request);
|
|
646
|
-
const token = this.cookie.get(
|
|
530
|
+
const token = this.cookie.get(this.environments.tokenName);
|
|
647
531
|
if (!token)
|
|
648
532
|
return next.handle(request);
|
|
649
533
|
request = request.clone({
|
|
@@ -653,18 +537,22 @@ class ApiTokenInterceptor {
|
|
|
653
537
|
});
|
|
654
538
|
return next.handle(request);
|
|
655
539
|
}
|
|
656
|
-
static
|
|
657
|
-
static
|
|
540
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiTokenInterceptor, deps: [{ token: 'env' }, { token: i1$1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
541
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiTokenInterceptor });
|
|
658
542
|
}
|
|
659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ApiTokenInterceptor, decorators: [{
|
|
660
544
|
type: Injectable
|
|
661
|
-
}], ctorParameters:
|
|
545
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
546
|
+
type: Inject,
|
|
547
|
+
args: ['env']
|
|
548
|
+
}] }, { type: i1$1.CookieService }] });
|
|
662
549
|
|
|
663
550
|
const DEFAULT_TTL = 10000; // ttl in ms
|
|
664
551
|
class HttpCachingInterceptor {
|
|
552
|
+
envs;
|
|
553
|
+
cache = new Map();
|
|
665
554
|
constructor(envs) {
|
|
666
555
|
this.envs = envs;
|
|
667
|
-
this.cache = new Map();
|
|
668
556
|
}
|
|
669
557
|
intercept(req, next) {
|
|
670
558
|
if (req.method !== 'GET')
|
|
@@ -683,15 +571,15 @@ class HttpCachingInterceptor {
|
|
|
683
571
|
this.cache.set(req.urlWithParams, { res, ttl });
|
|
684
572
|
}));
|
|
685
573
|
}
|
|
686
|
-
static
|
|
687
|
-
static
|
|
574
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: HttpCachingInterceptor, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
575
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: HttpCachingInterceptor });
|
|
688
576
|
}
|
|
689
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: HttpCachingInterceptor, decorators: [{
|
|
690
578
|
type: Injectable
|
|
691
|
-
}], ctorParameters:
|
|
579
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
692
580
|
type: Inject,
|
|
693
581
|
args: ['env']
|
|
694
|
-
}] }]
|
|
582
|
+
}] }] });
|
|
695
583
|
|
|
696
584
|
/*
|
|
697
585
|
* Public API Surface of ngx-services
|
|
@@ -701,5 +589,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
701
589
|
* Generated bundle index. Do not edit.
|
|
702
590
|
*/
|
|
703
591
|
|
|
704
|
-
export {
|
|
592
|
+
export { ApiCompaniesService, ApiHeadersInterceptor, ApiSecurityService, ApiTokenInterceptor, HttpCachingInterceptor, NgxServicesModule, httpParams, pdfHeaders, queryString, xmlHeaders };
|
|
705
593
|
//# sourceMappingURL=experteam-mx-ngx-services.mjs.map
|