@experteam-mx/ngx-services 20.3.6 → 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
- headers: this.getAppKeyHeader(),
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
- headers: this.getAppKeyHeader(),
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' });
@@ -3756,6 +3749,16 @@ class ApiInvoicesService {
3756
3749
  return this.http.get(`${this.url}/country-document-types`, { params })
3757
3750
  .pipe(map(({ data }) => data));
3758
3751
  }
3752
+ /**
3753
+ * Updates the customer information for a specific document customer.
3754
+ * @param id - The unique identifier of the document customer
3755
+ * @param data - The customer information to update
3756
+ * @returns An Observable that emits the updated DocumentTypeRangeOut object
3757
+ */
3758
+ putOperationDocumentCustomer(id, data) {
3759
+ return this.http.put(`${this.url}/operation/document/${id}/customer`, data)
3760
+ .pipe(map(({ data }) => data));
3761
+ }
3759
3762
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInvoicesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3760
3763
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
3761
3764
  }
@@ -4829,7 +4832,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
4829
4832
  class ApiSurveysService {
4830
4833
  environments = inject(ENVIRONMENT_TOKEN);
4831
4834
  http = inject(HttpClient);
4832
- appKey = this.environments.apiSurveysKey ?? '';
4833
4835
  /**
4834
4836
  * Base URL for surveys API endpoints.
4835
4837
  * @returns The configured surveys API URL or an empty string.
@@ -4837,9 +4839,6 @@ class ApiSurveysService {
4837
4839
  get url() {
4838
4840
  return this.environments.apiSurveysUrl ?? '';
4839
4841
  }
4840
- appKeyHeader() {
4841
- return { ...(this.appKey && { AppKey: this.appKey }) };
4842
- }
4843
4842
  /**
4844
4843
  * Retrieves surveys list based on query parameters.
4845
4844
  * @param params Query parameters used to filter, paginate, or sort surveys.
@@ -4933,9 +4932,8 @@ class ApiSurveysService {
4933
4932
  * @returns Observable stream with customer survey data.
4934
4933
  */
4935
4934
  getCustomerSurvey(uuid) {
4936
- return this.http.get(`${this.url}/customer-surveys/${uuid}`, {
4937
- headers: this.appKeyHeader(),
4938
- }).pipe(map(({ data }) => data));
4935
+ return this.http.get(`${this.url}/customer-surveys/${uuid}`)
4936
+ .pipe(map(({ data }) => data));
4939
4937
  }
4940
4938
  /**
4941
4939
  * Updates an existing customer survey by UUID.
@@ -4944,9 +4942,8 @@ class ApiSurveysService {
4944
4942
  * @returns Observable stream with updated customer survey data.
4945
4943
  */
4946
4944
  putCustomerSurvey(uuid, body) {
4947
- return this.http.put(`${this.url}/customer-surveys/${uuid}`, body, {
4948
- headers: this.appKeyHeader(),
4949
- }).pipe(map(({ data }) => data));
4945
+ return this.http.put(`${this.url}/customer-surveys/${uuid}`, body)
4946
+ .pipe(map(({ data }) => data));
4950
4947
  }
4951
4948
  /**
4952
4949
  * Marks a customer survey as finished by UUID.
@@ -4955,9 +4952,8 @@ class ApiSurveysService {
4955
4952
  * @returns Observable stream with updated customer survey data.
4956
4953
  */
4957
4954
  postCustomerSurveyFinish(uuid, body) {
4958
- return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body, {
4959
- headers: this.appKeyHeader(),
4960
- }).pipe(map(({ data }) => data));
4955
+ return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body)
4956
+ .pipe(map(({ data }) => data));
4961
4957
  }
4962
4958
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4963
4959
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
@@ -5047,6 +5043,14 @@ var PaymentTypeCode;
5047
5043
  PaymentTypeCode["DEPOSIT"] = "deposit";
5048
5044
  })(PaymentTypeCode || (PaymentTypeCode = {}));
5049
5045
 
5046
+ var DocumentStatusCode;
5047
+ (function (DocumentStatusCode) {
5048
+ DocumentStatusCode[DocumentStatusCode["CANCELLED"] = 2] = "CANCELLED";
5049
+ DocumentStatusCode[DocumentStatusCode["COMPLETED"] = 1] = "COMPLETED";
5050
+ DocumentStatusCode[DocumentStatusCode["PROCESSING"] = 0] = "PROCESSING";
5051
+ DocumentStatusCode[DocumentStatusCode["WITH_ERRORS"] = 3] = "WITH_ERRORS";
5052
+ })(DocumentStatusCode || (DocumentStatusCode = {}));
5053
+
5050
5054
  class WebSocketsService {
5051
5055
  pusher;
5052
5056
  environments = inject(ENVIRONMENT_TOKEN);
@@ -5243,7 +5247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
5243
5247
  }]
5244
5248
  }] });
5245
5249
 
5246
- function isStaticAsset$1(url) {
5250
+ function isStaticAsset(url) {
5247
5251
  return url.startsWith('assets/') || url.includes('/i18n/');
5248
5252
  }
5249
5253
  /**
@@ -5256,7 +5260,7 @@ function isStaticAsset$1(url) {
5256
5260
  * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event resulting from the processed request.
5257
5261
  */
5258
5262
  function apiHeadersInterceptor(req, next) {
5259
- if (isStaticAsset$1(req.url)) {
5263
+ if (isStaticAsset(req.url)) {
5260
5264
  return next(req);
5261
5265
  }
5262
5266
  let headers = req.headers;
@@ -5273,56 +5277,6 @@ function apiHeadersInterceptor(req, next) {
5273
5277
  return next(req);
5274
5278
  }
5275
5279
 
5276
- const isStaticAsset = (url) => url.startsWith('assets/') || url.includes('/i18n/');
5277
- /**
5278
- * HTTP interceptor that injects the external operations API key into outbound requests.
5279
- *
5280
- * The interceptor:
5281
- * 1. Reads `apiExternalOperationsKey` from the injected `ENVIRONMENT_TOKEN`.
5282
- * 2. Skips modification if the key is absent.
5283
- * 3. Leaves the request unchanged if it already contains an `AppKey` header (caller override).
5284
- * 4. Otherwise clones the request adding `AppKey: apiExternalOperationsKey`.
5285
- *
5286
- * This enables centralized, transparent authentication for services targeting external
5287
- * operations endpoints while allowing explicit per-request overrides.
5288
- *
5289
- * Example:
5290
- * ```ts
5291
- * provideHttpClient(
5292
- * withInterceptors([apiKeyInterceptor])
5293
- * );
5294
- * ```
5295
- *
5296
- * @param request The original immutable `HttpRequest` instance.
5297
- * @param next The next handler in the interceptor chain, used to forward the (possibly cloned) request.
5298
- * @returns An `Observable` stream of the HTTP events for the (potentially augmented) request.
5299
- *
5300
- * @remarks
5301
- * - If you need to intentionally send a different key for a specific request, set the `AppKey`
5302
- * header manually before this interceptor runs.
5303
- * - If `apiExternalOperationsKey` is undefined (e.g., missing configuration), the request is passed through unchanged.
5304
- * - Order matters: place this interceptor before others that rely on the presence of the `AppKey` header.
5305
- *
5306
- * @see HttpRequest
5307
- * @see HttpHandlerFn
5308
- */
5309
- function apiKeyInterceptor(request, next) {
5310
- if (isStaticAsset(request.url)) {
5311
- return next(request);
5312
- }
5313
- const { apiExternalOperationsKey } = inject(ENVIRONMENT_TOKEN);
5314
- if (!apiExternalOperationsKey)
5315
- return next(request);
5316
- if (request.headers.has('AppKey'))
5317
- return next(request);
5318
- request = request.clone({
5319
- setHeaders: {
5320
- AppKey: apiExternalOperationsKey
5321
- }
5322
- });
5323
- return next(request);
5324
- }
5325
-
5326
5280
  /**
5327
5281
  * An HTTP interceptor to append an Authorization header with a Bearer token
5328
5282
  * to outgoing HTTP requests if certain conditions are met.
@@ -5472,5 +5426,5 @@ const xmlHeaders = (format = 'object') => {
5472
5426
  * Generated bundle index. Do not edit.
5473
5427
  */
5474
5428
 
5475
- 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, ENVIRONMENT_TOKEN, Event, Group, NgxServicesModule, OpeningStatusCode, OperationModuleStatus, PaymentTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiKeyInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
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 };
5476
5430
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map