@experteam-mx/ngx-services 20.4.0 → 20.5.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.
|
@@ -2973,7 +2973,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
2973
2973
|
class ApiExternalOperationsService {
|
|
2974
2974
|
http = inject(HttpClient);
|
|
2975
2975
|
environment = inject(ENVIRONMENT_TOKEN);
|
|
2976
|
-
appKey = this.environment.apiExternalOperationsKey ?? '';
|
|
2977
2976
|
/**
|
|
2978
2977
|
* Getter method to retrieve the API's external operations URL.
|
|
2979
2978
|
* Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
|
|
@@ -3001,9 +3000,8 @@ class ApiExternalOperationsService {
|
|
|
3001
3000
|
* @return {Observable<DeliveryConfirmationGenerateOut>} An observable that emits the generated delivery confirmation data.
|
|
3002
3001
|
*/
|
|
3003
3002
|
postDeliveryConfirmationGenerate(payload) {
|
|
3004
|
-
return this.http.post(`${this.url}/delivery-confirmation/generate`, payload
|
|
3005
|
-
|
|
3006
|
-
}).pipe(map$1(({ data }) => data));
|
|
3003
|
+
return this.http.post(`${this.url}/delivery-confirmation/generate`, payload)
|
|
3004
|
+
.pipe(map$1(({ data }) => data));
|
|
3007
3005
|
}
|
|
3008
3006
|
/**
|
|
3009
3007
|
* Confirms the completion of a delivery operation by making a PATCH request.
|
|
@@ -3015,7 +3013,6 @@ class ApiExternalOperationsService {
|
|
|
3015
3013
|
*/
|
|
3016
3014
|
patchDeliveryConfirmationComplete({ keyOTP, operationId, }) {
|
|
3017
3015
|
return this.http.patch(`${this.url}/delivery-confirmation/completed/${keyOTP}`, null, {
|
|
3018
|
-
headers: this.getAppKeyHeader(),
|
|
3019
3016
|
params: { operation_id: operationId }
|
|
3020
3017
|
}).pipe(map$1(({ data }) => data));
|
|
3021
3018
|
}
|
|
@@ -3028,12 +3025,8 @@ class ApiExternalOperationsService {
|
|
|
3028
3025
|
* @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
|
|
3029
3026
|
*/
|
|
3030
3027
|
putDeliveryConfirmation({ otp, ...body }) {
|
|
3031
|
-
return this.http.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body
|
|
3032
|
-
|
|
3033
|
-
}).pipe(map$1(({ data }) => data));
|
|
3034
|
-
}
|
|
3035
|
-
getAppKeyHeader() {
|
|
3036
|
-
return { ...(this.appKey && { AppKey: this.appKey }) };
|
|
3028
|
+
return this.http.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body)
|
|
3029
|
+
.pipe(map$1(({ data }) => data));
|
|
3037
3030
|
}
|
|
3038
3031
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3039
3032
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, providedIn: 'root' });
|
|
@@ -4839,7 +4832,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
4839
4832
|
class ApiSurveysService {
|
|
4840
4833
|
environments = inject(ENVIRONMENT_TOKEN);
|
|
4841
4834
|
http = inject(HttpClient);
|
|
4842
|
-
appKey = this.environments.apiSurveysKey ?? '';
|
|
4843
4835
|
/**
|
|
4844
4836
|
* Base URL for surveys API endpoints.
|
|
4845
4837
|
* @returns The configured surveys API URL or an empty string.
|
|
@@ -4847,9 +4839,6 @@ class ApiSurveysService {
|
|
|
4847
4839
|
get url() {
|
|
4848
4840
|
return this.environments.apiSurveysUrl ?? '';
|
|
4849
4841
|
}
|
|
4850
|
-
appKeyHeader() {
|
|
4851
|
-
return { ...(this.appKey && { AppKey: this.appKey }) };
|
|
4852
|
-
}
|
|
4853
4842
|
/**
|
|
4854
4843
|
* Retrieves surveys list based on query parameters.
|
|
4855
4844
|
* @param params Query parameters used to filter, paginate, or sort surveys.
|
|
@@ -4943,9 +4932,8 @@ class ApiSurveysService {
|
|
|
4943
4932
|
* @returns Observable stream with customer survey data.
|
|
4944
4933
|
*/
|
|
4945
4934
|
getCustomerSurvey(uuid) {
|
|
4946
|
-
return this.http.get(`${this.url}/customer-surveys/${uuid}
|
|
4947
|
-
|
|
4948
|
-
}).pipe(map(({ data }) => data));
|
|
4935
|
+
return this.http.get(`${this.url}/customer-surveys/${uuid}`)
|
|
4936
|
+
.pipe(map(({ data }) => data));
|
|
4949
4937
|
}
|
|
4950
4938
|
/**
|
|
4951
4939
|
* Updates an existing customer survey by UUID.
|
|
@@ -4954,9 +4942,8 @@ class ApiSurveysService {
|
|
|
4954
4942
|
* @returns Observable stream with updated customer survey data.
|
|
4955
4943
|
*/
|
|
4956
4944
|
putCustomerSurvey(uuid, body) {
|
|
4957
|
-
return this.http.put(`${this.url}/customer-surveys/${uuid}`, body
|
|
4958
|
-
|
|
4959
|
-
}).pipe(map(({ data }) => data));
|
|
4945
|
+
return this.http.put(`${this.url}/customer-surveys/${uuid}`, body)
|
|
4946
|
+
.pipe(map(({ data }) => data));
|
|
4960
4947
|
}
|
|
4961
4948
|
/**
|
|
4962
4949
|
* Marks a customer survey as finished by UUID.
|
|
@@ -4965,9 +4952,8 @@ class ApiSurveysService {
|
|
|
4965
4952
|
* @returns Observable stream with updated customer survey data.
|
|
4966
4953
|
*/
|
|
4967
4954
|
postCustomerSurveyFinish(uuid, body) {
|
|
4968
|
-
return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body
|
|
4969
|
-
|
|
4970
|
-
}).pipe(map(({ data }) => data));
|
|
4955
|
+
return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body)
|
|
4956
|
+
.pipe(map(({ data }) => data));
|
|
4971
4957
|
}
|
|
4972
4958
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4973
4959
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
|
|
@@ -5261,7 +5247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
5261
5247
|
}]
|
|
5262
5248
|
}] });
|
|
5263
5249
|
|
|
5264
|
-
function isStaticAsset
|
|
5250
|
+
function isStaticAsset(url) {
|
|
5265
5251
|
return url.startsWith('assets/') || url.includes('/i18n/');
|
|
5266
5252
|
}
|
|
5267
5253
|
/**
|
|
@@ -5274,7 +5260,7 @@ function isStaticAsset$1(url) {
|
|
|
5274
5260
|
* @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event resulting from the processed request.
|
|
5275
5261
|
*/
|
|
5276
5262
|
function apiHeadersInterceptor(req, next) {
|
|
5277
|
-
if (isStaticAsset
|
|
5263
|
+
if (isStaticAsset(req.url)) {
|
|
5278
5264
|
return next(req);
|
|
5279
5265
|
}
|
|
5280
5266
|
let headers = req.headers;
|
|
@@ -5291,56 +5277,6 @@ function apiHeadersInterceptor(req, next) {
|
|
|
5291
5277
|
return next(req);
|
|
5292
5278
|
}
|
|
5293
5279
|
|
|
5294
|
-
const isStaticAsset = (url) => url.startsWith('assets/') || url.includes('/i18n/');
|
|
5295
|
-
/**
|
|
5296
|
-
* HTTP interceptor that injects the external operations API key into outbound requests.
|
|
5297
|
-
*
|
|
5298
|
-
* The interceptor:
|
|
5299
|
-
* 1. Reads `apiExternalOperationsKey` from the injected `ENVIRONMENT_TOKEN`.
|
|
5300
|
-
* 2. Skips modification if the key is absent.
|
|
5301
|
-
* 3. Leaves the request unchanged if it already contains an `AppKey` header (caller override).
|
|
5302
|
-
* 4. Otherwise clones the request adding `AppKey: apiExternalOperationsKey`.
|
|
5303
|
-
*
|
|
5304
|
-
* This enables centralized, transparent authentication for services targeting external
|
|
5305
|
-
* operations endpoints while allowing explicit per-request overrides.
|
|
5306
|
-
*
|
|
5307
|
-
* Example:
|
|
5308
|
-
* ```ts
|
|
5309
|
-
* provideHttpClient(
|
|
5310
|
-
* withInterceptors([apiKeyInterceptor])
|
|
5311
|
-
* );
|
|
5312
|
-
* ```
|
|
5313
|
-
*
|
|
5314
|
-
* @param request The original immutable `HttpRequest` instance.
|
|
5315
|
-
* @param next The next handler in the interceptor chain, used to forward the (possibly cloned) request.
|
|
5316
|
-
* @returns An `Observable` stream of the HTTP events for the (potentially augmented) request.
|
|
5317
|
-
*
|
|
5318
|
-
* @remarks
|
|
5319
|
-
* - If you need to intentionally send a different key for a specific request, set the `AppKey`
|
|
5320
|
-
* header manually before this interceptor runs.
|
|
5321
|
-
* - If `apiExternalOperationsKey` is undefined (e.g., missing configuration), the request is passed through unchanged.
|
|
5322
|
-
* - Order matters: place this interceptor before others that rely on the presence of the `AppKey` header.
|
|
5323
|
-
*
|
|
5324
|
-
* @see HttpRequest
|
|
5325
|
-
* @see HttpHandlerFn
|
|
5326
|
-
*/
|
|
5327
|
-
function apiKeyInterceptor(request, next) {
|
|
5328
|
-
if (isStaticAsset(request.url)) {
|
|
5329
|
-
return next(request);
|
|
5330
|
-
}
|
|
5331
|
-
const { apiExternalOperationsKey } = inject(ENVIRONMENT_TOKEN);
|
|
5332
|
-
if (!apiExternalOperationsKey)
|
|
5333
|
-
return next(request);
|
|
5334
|
-
if (request.headers.has('AppKey'))
|
|
5335
|
-
return next(request);
|
|
5336
|
-
request = request.clone({
|
|
5337
|
-
setHeaders: {
|
|
5338
|
-
AppKey: apiExternalOperationsKey
|
|
5339
|
-
}
|
|
5340
|
-
});
|
|
5341
|
-
return next(request);
|
|
5342
|
-
}
|
|
5343
|
-
|
|
5344
5280
|
/**
|
|
5345
5281
|
* An HTTP interceptor to append an Authorization header with a Bearer token
|
|
5346
5282
|
* to outgoing HTTP requests if certain conditions are met.
|
|
@@ -5490,5 +5426,5 @@ const xmlHeaders = (format = 'object') => {
|
|
|
5490
5426
|
* Generated bundle index. Do not edit.
|
|
5491
5427
|
*/
|
|
5492
5428
|
|
|
5493
|
-
export { AlphaNumeric, ApiBillingCOService, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, ApiSurveysService, CryptoService, DefaultValueType, DepositTypeCode, DocumentStatusCode, ENVIRONMENT_TOKEN, Event, Group, NgxServicesModule, OpeningStatusCode, OperationModuleStatus, PaymentTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor,
|
|
5429
|
+
export { AlphaNumeric, ApiBillingCOService, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, ApiSurveysService, CryptoService, DefaultValueType, DepositTypeCode, DocumentStatusCode, ENVIRONMENT_TOKEN, Event, Group, NgxServicesModule, OpeningStatusCode, OperationModuleStatus, PaymentTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
|
|
5494
5430
|
//# sourceMappingURL=experteam-mx-ngx-services.mjs.map
|