@experteam-mx/ngx-services 20.0.0-beta.4 → 20.0.1
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 +24 -24
- package/esm2022/experteam-mx-ngx-services.mjs +5 -0
- package/esm2022/lib/apis/api-billing-do.service.mjs +41 -0
- package/esm2022/lib/apis/api-billing-gt.service.mjs +61 -0
- package/esm2022/lib/apis/api-billing-mx.service.mjs +62 -0
- package/esm2022/lib/apis/api-billing-pa.service.mjs +105 -0
- package/esm2022/lib/apis/api-billing-sv.service.mjs +83 -0
- package/esm2022/lib/apis/api-cash-operations.service.mjs +93 -0
- package/esm2022/lib/apis/api-catalogs.service.mjs +626 -0
- package/esm2022/lib/apis/api-companies.service.mjs +1031 -0
- package/esm2022/lib/apis/api-composition.service.mjs +55 -0
- package/esm2022/lib/apis/api-customs.service.mjs +157 -0
- package/esm2022/lib/apis/api-discounts.service.mjs +243 -0
- package/esm2022/lib/apis/api-e-tools-auto-billing.service.mjs +75 -0
- package/esm2022/lib/apis/api-events.service.mjs +53 -0
- package/esm2022/lib/apis/api-external-pickups.service.mjs +74 -0
- package/esm2022/lib/apis/api-inventories.service.mjs +208 -0
- package/esm2022/lib/apis/api-invoices.service.mjs +398 -0
- package/esm2022/lib/apis/api-notifications.service.mjs +104 -0
- package/esm2022/lib/apis/api-open-items.service.mjs +62 -0
- package/esm2022/lib/apis/api-reports.service.mjs +172 -0
- package/esm2022/lib/apis/api-security.service.mjs +245 -0
- package/esm2022/lib/apis/api-services.service.mjs +93 -0
- package/esm2022/lib/apis/api-shipments.service.mjs +116 -0
- package/esm2022/lib/apis/api-supplies.service.mjs +133 -0
- package/esm2022/lib/apis/models/api-billing-do.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-do.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-mx.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-mx.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-pa.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-pa.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-sv.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing-sv.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-billing.models.mjs +2 -0
- package/esm2022/lib/apis/models/api-cash-operations.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-cash-operations.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-catalog.enum.mjs +9 -0
- package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-catalog.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-companies.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-companies.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-composition.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-composition.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-customs.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-customs.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-discounts.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-discounts.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-e-tools-auto-billing.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-e-tools-auto-billing.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-events.enum.mjs +7 -0
- package/esm2022/lib/apis/models/api-events.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-events.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-external-pickups.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-inventories.enum.mjs +22 -0
- package/esm2022/lib/apis/models/api-inventories.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-inventories.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-invoices.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-invoices.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-notifications.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-notifications.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-open-items.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-open-items.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-reports.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-reports.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-security.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-security.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-services.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-services.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-shipments.enums.mjs +8 -0
- package/esm2022/lib/apis/models/api-shipments.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-shipments.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-supplies.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-supplies.types.mjs +2 -0
- package/esm2022/lib/apis/models/api.models.mjs +2 -0
- package/esm2022/lib/cypher/crypto.service.mjs +93 -0
- package/esm2022/lib/helpers/files.mjs +9 -0
- package/esm2022/lib/helpers/http.mjs +66 -0
- package/esm2022/lib/interceptors/api-headers.interceptor.mjs +24 -0
- package/esm2022/lib/interceptors/api-token.interceptor.mjs +28 -0
- package/esm2022/lib/interceptors/http-caching.interceptor.mjs +37 -0
- package/esm2022/lib/ngx-services.models.mjs +11 -0
- package/esm2022/lib/ngx-services.module.mjs +33 -0
- package/esm2022/lib/websockets/web-sockets.service.mjs +115 -0
- package/esm2022/public-api.mjs +90 -0
- package/fesm2022/experteam-mx-ngx-services.mjs +126 -5
- package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
- package/index.d.ts +287 -4
- package/lib/apis/api-billing-do.service.d.ts +24 -0
- package/lib/apis/api-billing-gt.service.d.ts +38 -0
- package/lib/apis/api-billing-mx.service.d.ts +39 -0
- package/lib/apis/api-billing-pa.service.d.ts +68 -0
- package/lib/apis/api-billing-sv.service.d.ts +55 -0
- package/lib/apis/api-cash-operations.service.d.ts +62 -0
- package/lib/apis/api-catalogs.service.d.ts +458 -0
- package/lib/apis/api-companies.service.d.ts +714 -0
- package/lib/apis/api-composition.service.d.ts +35 -0
- package/lib/apis/api-customs.service.d.ts +110 -0
- package/lib/apis/api-discounts.service.d.ts +167 -0
- package/lib/apis/api-e-tools-auto-billing.service.d.ts +49 -0
- package/lib/apis/api-events.service.d.ts +33 -0
- package/lib/apis/api-external-pickups.service.d.ts +46 -0
- package/lib/apis/api-inventories.service.d.ts +145 -0
- package/lib/apis/api-invoices.service.d.ts +280 -0
- package/lib/apis/api-notifications.service.d.ts +70 -0
- package/lib/apis/api-open-items.service.d.ts +41 -0
- package/lib/apis/api-reports.service.d.ts +120 -0
- package/lib/apis/api-security.service.d.ts +162 -0
- package/lib/apis/api-services.service.d.ts +61 -0
- package/lib/apis/api-shipments.service.d.ts +77 -0
- package/lib/apis/api-supplies.service.d.ts +93 -0
- package/lib/apis/models/api-billing-do.interfaces.d.ts +6 -0
- package/lib/apis/models/api-billing-do.types.d.ts +5 -0
- package/lib/apis/models/api-billing-mx.interfaces.d.ts +21 -0
- package/lib/apis/models/api-billing-mx.types.d.ts +13 -0
- package/lib/apis/models/api-billing-pa.interfaces.d.ts +26 -0
- package/lib/apis/models/api-billing-pa.types.d.ts +16 -0
- package/lib/apis/models/api-billing-sv.interfaces.d.ts +22 -0
- package/lib/apis/models/api-billing-sv.types.d.ts +21 -0
- package/lib/apis/models/api-billing.models.d.ts +27 -0
- package/lib/apis/models/api-cash-operations.interfaces.d.ts +40 -0
- package/lib/apis/models/api-cash-operations.types.d.ts +30 -0
- package/lib/apis/models/api-catalog.enum.d.ts +7 -0
- package/lib/apis/models/api-catalog.interfaces.d.ts +219 -0
- package/lib/apis/models/api-catalog.types.d.ts +217 -0
- package/lib/apis/models/api-companies.interfaces.d.ts +341 -0
- package/lib/apis/models/api-companies.types.d.ts +457 -0
- package/lib/apis/models/api-composition.interfaces.d.ts +272 -0
- package/lib/apis/models/api-composition.types.d.ts +9 -0
- package/lib/apis/models/api-customs.interfaces.d.ts +125 -0
- package/lib/apis/models/api-customs.types.d.ts +90 -0
- package/lib/apis/models/api-discounts.interfaces.d.ts +78 -0
- package/lib/apis/models/api-discounts.types.d.ts +89 -0
- package/lib/apis/models/api-e-tools-auto-billing.interfaces.d.ts +45 -0
- package/lib/apis/models/api-e-tools-auto-billing.types.d.ts +30 -0
- package/lib/apis/models/api-events.enum.d.ts +5 -0
- package/lib/apis/models/api-events.interfaces.d.ts +21 -0
- package/lib/apis/models/api-events.types.d.ts +14 -0
- package/lib/apis/models/api-external-pickups.types.d.ts +31 -0
- package/lib/apis/models/api-inventories.enum.d.ts +18 -0
- package/lib/apis/models/api-inventories.interfaces.d.ts +40 -0
- package/lib/apis/models/api-inventories.types.d.ts +62 -0
- package/lib/apis/models/api-invoices.interfaces.d.ts +267 -0
- package/lib/apis/models/api-invoices.types.d.ts +195 -0
- package/lib/apis/models/api-notifications.interfaces.d.ts +36 -0
- package/lib/apis/models/api-notifications.types.d.ts +34 -0
- package/lib/apis/models/api-open-items.interfaces.d.ts +32 -0
- package/lib/apis/models/api-open-items.types.d.ts +58 -0
- package/lib/apis/models/api-reports.interfaces.d.ts +342 -0
- package/lib/apis/models/api-reports.types.d.ts +59 -0
- package/lib/apis/models/api-security.interfaces.d.ts +68 -0
- package/lib/apis/models/api-security.types.d.ts +72 -0
- package/lib/apis/models/api-services.interfaces.d.ts +43 -0
- package/lib/apis/models/api-services.types.d.ts +57 -0
- package/lib/apis/models/api-shipments.enums.d.ts +6 -0
- package/lib/apis/models/api-shipments.interfaces.d.ts +41 -0
- package/lib/apis/models/api-shipments.types.d.ts +121 -0
- package/lib/apis/models/api-supplies.interfaces.d.ts +40 -0
- package/lib/apis/models/api-supplies.types.d.ts +50 -0
- package/lib/apis/models/api.models.d.ts +36 -0
- package/lib/cypher/crypto.service.d.ts +15 -0
- package/lib/helpers/files.d.ts +2 -0
- package/lib/helpers/http.d.ts +38 -0
- package/lib/interceptors/api-headers.interceptor.d.ts +12 -0
- package/lib/interceptors/api-token.interceptor.d.ts +11 -0
- package/lib/interceptors/http-caching.interceptor.d.ts +12 -0
- package/lib/ngx-services.models.d.ts +62 -0
- package/lib/ngx-services.module.d.ts +16 -0
- package/lib/websockets/web-sockets.service.d.ts +49 -0
- package/package.json +1 -1
- package/public-api.d.ts +80 -0
|
@@ -531,7 +531,7 @@ class ApiCatalogsService {
|
|
|
531
531
|
* @param body - The identification type payload to create (IdentificationTypeIn).
|
|
532
532
|
* @returns Observable<IdentificationTypeOut> that emits the created identification type on success.
|
|
533
533
|
*/
|
|
534
|
-
|
|
534
|
+
postIdentificationType(body) {
|
|
535
535
|
return this.http.post(`${this.url}/identification-types`, body)
|
|
536
536
|
.pipe(map(({ data }) => data));
|
|
537
537
|
}
|
|
@@ -567,6 +567,21 @@ class ApiCatalogsService {
|
|
|
567
567
|
return this.http.delete(`${this.url}/identification-types/${id}`)
|
|
568
568
|
.pipe(map(({ data }) => data));
|
|
569
569
|
}
|
|
570
|
+
/**
|
|
571
|
+
* Sends a POST request to validate identification type number.
|
|
572
|
+
*
|
|
573
|
+
* The request payload is sent as an object with a `body` property containing the provided
|
|
574
|
+
* IdentificationTypeNumberValidationIn value (i.e. { body: IdentificationTypeNumberValidationIn }). On success the HTTP response is expected
|
|
575
|
+
* to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
|
|
576
|
+
* object and emits it as a IdentificationTypeNumberValidationOut.
|
|
577
|
+
*
|
|
578
|
+
* @param body - The identification type number validation payload to validate (IdentificationTypeNumberValidationIn).
|
|
579
|
+
* @returns Observable<IdentificationTypeNumberValidationOut> that emits the validate status.
|
|
580
|
+
*/
|
|
581
|
+
postIdentificationTypeNumberValidation(body) {
|
|
582
|
+
return this.http.post(`${this.url}/identification-types/number-validation`, body)
|
|
583
|
+
.pipe(map(({ data }) => data));
|
|
584
|
+
}
|
|
570
585
|
/**
|
|
571
586
|
* Fetches the extra charges based on the provided query parameters.
|
|
572
587
|
*
|
|
@@ -1045,6 +1060,14 @@ class ApiCatalogsService {
|
|
|
1045
1060
|
return this.http.delete(`${this.url}/holidays/${id}`)
|
|
1046
1061
|
.pipe(map(({ data }) => data));
|
|
1047
1062
|
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Retrieves a list of business party trader types
|
|
1065
|
+
* @param {QueryParams} params - Query parameters for filtering and pagination (optional)
|
|
1066
|
+
* @returns {Observable<BusinessPartyTraderTypesOut>} Observable containing the list of trader types
|
|
1067
|
+
*/
|
|
1068
|
+
getBusinessPartyTraderTypes(params) {
|
|
1069
|
+
return this.http.get(`${this.url}/business-party-trader-types`, { params }).pipe(map(({ data }) => data));
|
|
1070
|
+
}
|
|
1048
1071
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiCatalogsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1049
1072
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiCatalogsService, providedIn: 'root' });
|
|
1050
1073
|
}
|
|
@@ -2907,6 +2930,20 @@ class ApiInventoriesService {
|
|
|
2907
2930
|
return this.http.delete(`${this.url}/incident-reason-complements/${id}`)
|
|
2908
2931
|
.pipe(map(({ data }) => data));
|
|
2909
2932
|
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Posts packages that are currently in stock.
|
|
2935
|
+
*
|
|
2936
|
+
* @param body - The input data containing package stock information
|
|
2937
|
+
* @returns {Observable<PackagesInStockOut>} An Observable that emits the packages in stock output data
|
|
2938
|
+
*
|
|
2939
|
+
* @remarks
|
|
2940
|
+
* This method sends a POST request to the `/packages/in-stock` endpoint and
|
|
2941
|
+
* extracts the data property from the API success response.
|
|
2942
|
+
*/
|
|
2943
|
+
postPackagesInStock(body) {
|
|
2944
|
+
return this.http.post(`${this.url}/packages/in-stock`, body)
|
|
2945
|
+
.pipe(map(({ data }) => data));
|
|
2946
|
+
}
|
|
2910
2947
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiInventoriesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2911
2948
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiInventoriesService, providedIn: 'root' });
|
|
2912
2949
|
}
|
|
@@ -3508,6 +3545,34 @@ class ApiReportsService {
|
|
|
3508
3545
|
return this.http.get(`${this.url}/shipments-report`, { params })
|
|
3509
3546
|
.pipe(map(({ data }) => data));
|
|
3510
3547
|
}
|
|
3548
|
+
/**
|
|
3549
|
+
* Retrieves the shipments landing report from the reports API.
|
|
3550
|
+
*
|
|
3551
|
+
* Sends a GET request to the `/shipments-landing-report` endpoint with the provided query parameters.
|
|
3552
|
+
* The HTTP response is expected to be wrapped in an `ApiSuccess` envelope, from which the `data`
|
|
3553
|
+
* payload is extracted and returned as the stream value.
|
|
3554
|
+
*
|
|
3555
|
+
* @param params - Query parameters used to filter or paginate the shipments landing report.
|
|
3556
|
+
* @returns An observable that emits the parsed `ShipmentsLandingReportOut` data from the API response.
|
|
3557
|
+
*
|
|
3558
|
+
* @remarks
|
|
3559
|
+
* - The underlying HTTP call uses `HttpClient.get` with `params` serialized as query string values.
|
|
3560
|
+
* - The response is piped through `map` to unwrap `data` from `ApiSuccess<T>`.
|
|
3561
|
+
* - Errors from the HTTP request are propagated through the observable stream.
|
|
3562
|
+
*
|
|
3563
|
+
* @example
|
|
3564
|
+
* ```ts
|
|
3565
|
+
* // Basic usage:
|
|
3566
|
+
* service.getShipmentsLandingReport({ page: 1, perPage: 25 })
|
|
3567
|
+
* .subscribe(report => {
|
|
3568
|
+
* // handle ShipmentsLandingReportOut
|
|
3569
|
+
* });
|
|
3570
|
+
* ```
|
|
3571
|
+
*/
|
|
3572
|
+
getShipmentsLandingReport(params) {
|
|
3573
|
+
return this.http.get(`${this.url}/shipments-landing-report`, { params })
|
|
3574
|
+
.pipe(map(({ data }) => data));
|
|
3575
|
+
}
|
|
3511
3576
|
/**
|
|
3512
3577
|
* Retrieves a report of external shipments based on the provided query parameters.
|
|
3513
3578
|
*
|
|
@@ -3583,6 +3648,22 @@ class ApiReportsService {
|
|
|
3583
3648
|
return this.http.get(`${this.url}/invoices`, { params })
|
|
3584
3649
|
.pipe(map(({ data }) => data));
|
|
3585
3650
|
}
|
|
3651
|
+
/**
|
|
3652
|
+
* Retrieves the sales book report based on the provided query parameters.
|
|
3653
|
+
*
|
|
3654
|
+
* @param params - The query parameters to filter or customize the report.
|
|
3655
|
+
* @returns An Observable that emits the sales book report data.
|
|
3656
|
+
*
|
|
3657
|
+
* @example
|
|
3658
|
+
* ```typescript
|
|
3659
|
+
* this.apiReportsService.getSalesBookReport({ page: 1, limit: 10 })
|
|
3660
|
+
* .subscribe(report => console.log(report));
|
|
3661
|
+
* ```
|
|
3662
|
+
*/
|
|
3663
|
+
getSalesBookReport(params) {
|
|
3664
|
+
return this.http.get(`${this.url}/sales-book-report`, { params })
|
|
3665
|
+
.pipe(map(({ data }) => data));
|
|
3666
|
+
}
|
|
3586
3667
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiReportsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3587
3668
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiReportsService, providedIn: 'root' });
|
|
3588
3669
|
}
|
|
@@ -3621,7 +3702,11 @@ class ApiSecurityService {
|
|
|
3621
3702
|
*/
|
|
3622
3703
|
postAuthLogin(body) {
|
|
3623
3704
|
return this.http.post(`${this.url}/auth/login`, body)
|
|
3624
|
-
.pipe(map(({ data }) => data), tap(({ access_token }) =>
|
|
3705
|
+
.pipe(map(({ data }) => data), tap(({ access_token }) => {
|
|
3706
|
+
if (this.environments.authCookie) {
|
|
3707
|
+
this.cookie.set(this.environments.authCookie, access_token, { path: '/' });
|
|
3708
|
+
}
|
|
3709
|
+
}));
|
|
3625
3710
|
}
|
|
3626
3711
|
/**
|
|
3627
3712
|
* Handles the user login process by sending user credentials to the authentication endpoint.
|
|
@@ -3642,7 +3727,11 @@ class ApiSecurityService {
|
|
|
3642
3727
|
*/
|
|
3643
3728
|
postAuthLogout() {
|
|
3644
3729
|
return this.http.post(`${this.url}/auth/logout`, null)
|
|
3645
|
-
.pipe(map(({ data }) => data), tap(() =>
|
|
3730
|
+
.pipe(map(({ data }) => data), tap(() => {
|
|
3731
|
+
if (this.environments.authCookie) {
|
|
3732
|
+
this.cookie.delete(this.environments.authCookie, '/');
|
|
3733
|
+
}
|
|
3734
|
+
}));
|
|
3646
3735
|
}
|
|
3647
3736
|
/**
|
|
3648
3737
|
* Creates a new session for a specified model.
|
|
@@ -4004,6 +4093,35 @@ class ApiShipmentsService {
|
|
|
4004
4093
|
params
|
|
4005
4094
|
}).pipe(map(({ data }) => data));
|
|
4006
4095
|
}
|
|
4096
|
+
/**
|
|
4097
|
+
* Retrieves a paginated list of embassy shipments
|
|
4098
|
+
* @param {QueryParams} params - Query parameters for filtering and pagination
|
|
4099
|
+
* @returns {Observable<EmbassyShipmentsOut>} Observable containing the list of shipments and pagination metadata
|
|
4100
|
+
*/
|
|
4101
|
+
getEmbassyShipments(params) {
|
|
4102
|
+
return this.http.get(`${this.url}/embassy-shipments`, {
|
|
4103
|
+
params
|
|
4104
|
+
}).pipe(map(({ data }) => data));
|
|
4105
|
+
}
|
|
4106
|
+
/**
|
|
4107
|
+
* Creates a new embassy shipment
|
|
4108
|
+
* @param {EmbassyShipmentIn} body - The shipment data to create
|
|
4109
|
+
* @returns {Observable<EmbassyShipmentOut>} Observable containing the created shipment with its assigned ID
|
|
4110
|
+
*/
|
|
4111
|
+
postEmbassyShipments(body) {
|
|
4112
|
+
return this.http.post(`${this.url}/embassy-shipments`, body)
|
|
4113
|
+
.pipe(map(({ data }) => data));
|
|
4114
|
+
}
|
|
4115
|
+
/**
|
|
4116
|
+
* Updates an existing embassy shipment
|
|
4117
|
+
* @param {number} id - The unique identifier of the shipment to update
|
|
4118
|
+
* @param {EmbassyShipmentIn} body - The updated shipment data
|
|
4119
|
+
* @returns {Observable<EmbassyShipmentOut>} Observable containing the updated shipment
|
|
4120
|
+
*/
|
|
4121
|
+
putEmbassyShipments(id, body) {
|
|
4122
|
+
return this.http.put(`${this.url}/embassy-shipments/${id}`, body)
|
|
4123
|
+
.pipe(map(({ data }) => data));
|
|
4124
|
+
}
|
|
4007
4125
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiShipmentsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4008
4126
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ApiShipmentsService, providedIn: 'root' });
|
|
4009
4127
|
}
|
|
@@ -4333,6 +4451,9 @@ class CryptoService {
|
|
|
4333
4451
|
return decoder.decode(decrypted);
|
|
4334
4452
|
}
|
|
4335
4453
|
async loadKey() {
|
|
4454
|
+
if (!this.environments.secretKey) {
|
|
4455
|
+
throw new Error('The secret key is not defined in the environment configuration.');
|
|
4456
|
+
}
|
|
4336
4457
|
// Decode the base64 key to Uint8Array
|
|
4337
4458
|
const rawKey = this.base64ToUint8Array(this.environments.secretKey);
|
|
4338
4459
|
// Import the key to API Crypto
|
|
@@ -4402,7 +4523,7 @@ function apiHeadersInterceptor(req, next) {
|
|
|
4402
4523
|
if (isStaticAsset$1(req.url)) {
|
|
4403
4524
|
return next(req);
|
|
4404
4525
|
}
|
|
4405
|
-
let
|
|
4526
|
+
let headers = req.headers;
|
|
4406
4527
|
if (!headers.has('Content-Type') && !(req.body instanceof FormData)) {
|
|
4407
4528
|
headers = headers.set('Content-Type', 'application/json');
|
|
4408
4529
|
}
|
|
@@ -4477,7 +4598,7 @@ function apiKeyInterceptor(request, next) {
|
|
|
4477
4598
|
function apiTokenInterceptor(req, next) {
|
|
4478
4599
|
const { authCookie } = inject(ENVIRONMENT_TOKEN);
|
|
4479
4600
|
const cookie = inject(CookieService);
|
|
4480
|
-
if (req.headers.has('Authorization') || req.headers.has('AppKey')) {
|
|
4601
|
+
if (req.headers.has('Authorization') || req.headers.has('AppKey') || !authCookie) {
|
|
4481
4602
|
return next(req);
|
|
4482
4603
|
}
|
|
4483
4604
|
const token = cookie.get(authCookie);
|