@experteam-mx/ngx-services 20.4.0 → 20.6.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.
@@ -680,7 +680,7 @@ class ApiCatalogsService {
680
680
  }).pipe(map(({ data }) => data));
681
681
  }
682
682
  /**
683
- * Retrieves the list of identificatios types
683
+ * Retrieves the list of identifications types
684
684
  *
685
685
  * @param {QueryParams} params - The query parameters used to fetch the identification types.
686
686
  * @return {Observable<IdentificationTypesOut[]>} An observable that emits an array of identification type.
@@ -693,7 +693,7 @@ class ApiCatalogsService {
693
693
  /**
694
694
  * Retrieve a single identification type by its id.
695
695
  *
696
- * Sends an HTTP GET request to the indentification type endpoint and returns an Observable that emits
696
+ * Sends an HTTP GET request to the identification type endpoint and returns an Observable that emits
697
697
  * the IdentificationTypeOut payload extracted from the API success envelope.
698
698
  *
699
699
  * @param id - The numeric identifier of the identification type to fetch.
@@ -849,6 +849,16 @@ class ApiCatalogsService {
849
849
  return this.http.get(`${this.url}/zones`, { params })
850
850
  .pipe(map(({ data }) => data));
851
851
  }
852
+ /**
853
+ * Retrieves a zone by its ID.
854
+ *
855
+ * @param {number} id - The ID of the zone.
856
+ * @return {Observable<ZoneOut>} An observable containing the zone data.
857
+ */
858
+ getZone(id) {
859
+ return this.http.get(`${this.url}/zones/${id}`)
860
+ .pipe(map(({ data }) => data));
861
+ }
852
862
  /**
853
863
  * Fetches the management areas based on the provided query parameters.
854
864
  *
@@ -919,6 +929,16 @@ class ApiCatalogsService {
919
929
  return this.http.get(`${this.url}/languages`, { params })
920
930
  .pipe(map(({ data }) => data));
921
931
  }
932
+ /**
933
+ * Retrieves a language by its ID.
934
+ *
935
+ * @param {number} id - The ID of the language.
936
+ * @return {Observable<LanguageOut>} An observable containing the language data.
937
+ */
938
+ getLanguage(id) {
939
+ return this.http.get(`${this.url}/languages/${id}`)
940
+ .pipe(map(({ data }) => data));
941
+ }
922
942
  /**
923
943
  * Fetches the available units from the API based on the provided query parameters.
924
944
  *
@@ -959,6 +979,17 @@ class ApiCatalogsService {
959
979
  return this.http.get(`${this.url}/generic-folios`, { params })
960
980
  .pipe(map(({ data }) => data));
961
981
  }
982
+ /**
983
+ * Retrieves a generic folio by its country ID and code.
984
+ *
985
+ * @param {number} countryId - The ID of the country.
986
+ * @param {string} code - The code of the generic folio.
987
+ * @return {Observable<GenericFolioOut>} An observable containing the generic folio data.
988
+ */
989
+ getGenericFolioByCountryAndCode(countryId, code) {
990
+ return this.http.get(`${this.url}/generic-folios/${countryId}/${code}`)
991
+ .pipe(map(({ data }) => data));
992
+ }
962
993
  /**
963
994
  * Sends a POST request to create or update a generic folio.
964
995
  *
@@ -991,6 +1022,16 @@ class ApiCatalogsService {
991
1022
  return this.http.put(`${this.url}/generic-folios/${id}`, body)
992
1023
  .pipe(map(({ data }) => data));
993
1024
  }
1025
+ /**
1026
+ * Retrieves a product by its unique identifier.
1027
+ *
1028
+ * @param {number} id - The unique identifier of the product to retrieve.
1029
+ * @return {Observable<ProductOut>} An observable containing the product data.
1030
+ */
1031
+ getProduct(id) {
1032
+ return this.http.get(`${this.url}/products/${id}`)
1033
+ .pipe(map(({ data }) => data));
1034
+ }
994
1035
  /**
995
1036
  * Sends a POST request to create a new product.
996
1037
  *
@@ -1270,6 +1311,69 @@ class ApiCatalogsService {
1270
1311
  return this.http.get(`${this.url}/package-locations`, { params })
1271
1312
  .pipe(map(({ data }) => data));
1272
1313
  }
1314
+ /**
1315
+ * Retrieves trading transaction types based on the provided query parameters.
1316
+ * @param params - Query parameters to filter or configure the trading transaction types request
1317
+ * @returns An Observable that emits the trading transaction types data
1318
+ */
1319
+ getTradingTransactionTypes(params) {
1320
+ return this.http.get(`${this.url}/trading-transaction-types`, { params })
1321
+ .pipe(map(({ data }) => data));
1322
+ }
1323
+ /**
1324
+ * Retrieves document types based on the provided query parameters.
1325
+ * @param params - Query parameters to filter or configure the document types request
1326
+ * @returns An Observable that emits the document types data
1327
+ */
1328
+ getDocumentTypes(params) {
1329
+ return this.http.get(`${this.url}/document-types`, { params })
1330
+ .pipe(map(({ data }) => data));
1331
+ }
1332
+ /**
1333
+ * Retrieves commodities based on the provided query parameters.
1334
+ * @param params - Query parameters to filter or configure the commodities request
1335
+ * @returns An Observable that emits the commodities data
1336
+ */
1337
+ getCommodities(params) {
1338
+ return this.http.get(`${this.url}/commodities`, { params })
1339
+ .pipe(map(({ data }) => data));
1340
+ }
1341
+ /**
1342
+ * Retrieves quantity units based on the provided query parameters.
1343
+ * @param params - Query parameters to filter or configure the quantity units request
1344
+ * @returns An Observable that emits the quantity units data
1345
+ */
1346
+ getQuantityUnits(params) {
1347
+ return this.http.get(`${this.url}/quantity-units`, { params })
1348
+ .pipe(map(({ data }) => data));
1349
+ }
1350
+ /**
1351
+ * Retrieves shipment descriptions based on the provided query parameters.
1352
+ * @param params - Query parameters to filter or configure the shipment descriptions request
1353
+ * @returns An Observable that emits the shipment descriptions data
1354
+ */
1355
+ getShipmentDescriptions(params) {
1356
+ return this.http.get(`${this.url}/shipment-descriptions`, { params })
1357
+ .pipe(map(({ data }) => data));
1358
+ }
1359
+ /**
1360
+ * Retrieves price override approvers based on the provided query parameters.
1361
+ * @param params - Query parameters to filter or configure the price override approvers request
1362
+ * @returns An Observable that emits the price override approvers data
1363
+ */
1364
+ getPriceOverrideApprovers(params) {
1365
+ return this.http.get(`${this.url}/price-override-approvers`, { params })
1366
+ .pipe(map(({ data }) => data));
1367
+ }
1368
+ /**
1369
+ * Retrieves price override reasons based on the provided query parameters.
1370
+ * @param params - Query parameters to filter or configure the price override reasons request
1371
+ * @returns An Observable that emits the price override reasons data
1372
+ */
1373
+ getPriceOverrideReasons(params) {
1374
+ return this.http.get(`${this.url}/price-override-reasons`, { params })
1375
+ .pipe(map(({ data }) => data));
1376
+ }
1273
1377
  /**
1274
1378
  * Retrieves export reasons based on the provided query parameters.
1275
1379
  * @param params - Query parameters to filter, sort, or paginate export reasons
@@ -1314,9 +1418,7 @@ class ApiCatalogsService {
1314
1418
  * @returns An Observable that emits the operation result
1315
1419
  */
1316
1420
  patchExportReason(id, isActive) {
1317
- return this.http.patch(`${this.url}/export-reasons/${id}`, {
1318
- isActive
1319
- })
1421
+ return this.http.patch(`${this.url}/export-reasons/${id}`, { isActive })
1320
1422
  .pipe(map(({ data }) => data));
1321
1423
  }
1322
1424
  /**
@@ -2973,7 +3075,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
2973
3075
  class ApiExternalOperationsService {
2974
3076
  http = inject(HttpClient);
2975
3077
  environment = inject(ENVIRONMENT_TOKEN);
2976
- appKey = this.environment.apiExternalOperationsKey ?? '';
2977
3078
  /**
2978
3079
  * Getter method to retrieve the API's external operations URL.
2979
3080
  * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
@@ -3001,9 +3102,8 @@ class ApiExternalOperationsService {
3001
3102
  * @return {Observable<DeliveryConfirmationGenerateOut>} An observable that emits the generated delivery confirmation data.
3002
3103
  */
3003
3104
  postDeliveryConfirmationGenerate(payload) {
3004
- return this.http.post(`${this.url}/delivery-confirmation/generate`, payload, {
3005
- headers: this.getAppKeyHeader(),
3006
- }).pipe(map$1(({ data }) => data));
3105
+ return this.http.post(`${this.url}/delivery-confirmation/generate`, payload)
3106
+ .pipe(map$1(({ data }) => data));
3007
3107
  }
3008
3108
  /**
3009
3109
  * Confirms the completion of a delivery operation by making a PATCH request.
@@ -3015,7 +3115,6 @@ class ApiExternalOperationsService {
3015
3115
  */
3016
3116
  patchDeliveryConfirmationComplete({ keyOTP, operationId, }) {
3017
3117
  return this.http.patch(`${this.url}/delivery-confirmation/completed/${keyOTP}`, null, {
3018
- headers: this.getAppKeyHeader(),
3019
3118
  params: { operation_id: operationId }
3020
3119
  }).pipe(map$1(({ data }) => data));
3021
3120
  }
@@ -3028,12 +3127,8 @@ class ApiExternalOperationsService {
3028
3127
  * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
3029
3128
  */
3030
3129
  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 }) };
3130
+ return this.http.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body)
3131
+ .pipe(map$1(({ data }) => data));
3037
3132
  }
3038
3133
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3039
3134
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiExternalOperationsService, providedIn: 'root' });
@@ -4839,7 +4934,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
4839
4934
  class ApiSurveysService {
4840
4935
  environments = inject(ENVIRONMENT_TOKEN);
4841
4936
  http = inject(HttpClient);
4842
- appKey = this.environments.apiSurveysKey ?? '';
4843
4937
  /**
4844
4938
  * Base URL for surveys API endpoints.
4845
4939
  * @returns The configured surveys API URL or an empty string.
@@ -4847,9 +4941,6 @@ class ApiSurveysService {
4847
4941
  get url() {
4848
4942
  return this.environments.apiSurveysUrl ?? '';
4849
4943
  }
4850
- appKeyHeader() {
4851
- return { ...(this.appKey && { AppKey: this.appKey }) };
4852
- }
4853
4944
  /**
4854
4945
  * Retrieves surveys list based on query parameters.
4855
4946
  * @param params Query parameters used to filter, paginate, or sort surveys.
@@ -4943,9 +5034,8 @@ class ApiSurveysService {
4943
5034
  * @returns Observable stream with customer survey data.
4944
5035
  */
4945
5036
  getCustomerSurvey(uuid) {
4946
- return this.http.get(`${this.url}/customer-surveys/${uuid}`, {
4947
- headers: this.appKeyHeader(),
4948
- }).pipe(map(({ data }) => data));
5037
+ return this.http.get(`${this.url}/customer-surveys/${uuid}`)
5038
+ .pipe(map(({ data }) => data));
4949
5039
  }
4950
5040
  /**
4951
5041
  * Updates an existing customer survey by UUID.
@@ -4954,9 +5044,8 @@ class ApiSurveysService {
4954
5044
  * @returns Observable stream with updated customer survey data.
4955
5045
  */
4956
5046
  putCustomerSurvey(uuid, body) {
4957
- return this.http.put(`${this.url}/customer-surveys/${uuid}`, body, {
4958
- headers: this.appKeyHeader(),
4959
- }).pipe(map(({ data }) => data));
5047
+ return this.http.put(`${this.url}/customer-surveys/${uuid}`, body)
5048
+ .pipe(map(({ data }) => data));
4960
5049
  }
4961
5050
  /**
4962
5051
  * Marks a customer survey as finished by UUID.
@@ -4965,9 +5054,8 @@ class ApiSurveysService {
4965
5054
  * @returns Observable stream with updated customer survey data.
4966
5055
  */
4967
5056
  postCustomerSurveyFinish(uuid, body) {
4968
- return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body, {
4969
- headers: this.appKeyHeader(),
4970
- }).pipe(map(({ data }) => data));
5057
+ return this.http.post(`${this.url}/customer-surveys/${uuid}/finish`, body)
5058
+ .pipe(map(({ data }) => data));
4971
5059
  }
4972
5060
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4973
5061
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
@@ -5008,6 +5096,14 @@ var ViewSectionOption;
5008
5096
  ViewSectionOption["BILLING"] = "billing";
5009
5097
  ViewSectionOption["CUSTOMER_RESTRICTION"] = "customerRestriction";
5010
5098
  })(ViewSectionOption || (ViewSectionOption = {}));
5099
+ var ShipmentIncomeTypeCode;
5100
+ (function (ShipmentIncomeTypeCode) {
5101
+ ShipmentIncomeTypeCode["MANUAL"] = "EM";
5102
+ ShipmentIncomeTypeCode["MOBILE"] = "EE";
5103
+ ShipmentIncomeTypeCode["FOLIO"] = "EF";
5104
+ ShipmentIncomeTypeCode["EMPLOYEE"] = "EEM";
5105
+ ShipmentIncomeTypeCode["EMBASSY"] = "EMB";
5106
+ })(ShipmentIncomeTypeCode || (ShipmentIncomeTypeCode = {}));
5011
5107
 
5012
5108
  var OperationModuleStatus;
5013
5109
  (function (OperationModuleStatus) {
@@ -5261,7 +5357,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
5261
5357
  }]
5262
5358
  }] });
5263
5359
 
5264
- function isStaticAsset$1(url) {
5360
+ function isStaticAsset(url) {
5265
5361
  return url.startsWith('assets/') || url.includes('/i18n/');
5266
5362
  }
5267
5363
  /**
@@ -5274,7 +5370,7 @@ function isStaticAsset$1(url) {
5274
5370
  * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event resulting from the processed request.
5275
5371
  */
5276
5372
  function apiHeadersInterceptor(req, next) {
5277
- if (isStaticAsset$1(req.url)) {
5373
+ if (isStaticAsset(req.url)) {
5278
5374
  return next(req);
5279
5375
  }
5280
5376
  let headers = req.headers;
@@ -5291,56 +5387,6 @@ function apiHeadersInterceptor(req, next) {
5291
5387
  return next(req);
5292
5388
  }
5293
5389
 
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
5390
  /**
5345
5391
  * An HTTP interceptor to append an Authorization header with a Bearer token
5346
5392
  * to outgoing HTTP requests if certain conditions are met.
@@ -5490,5 +5536,5 @@ const xmlHeaders = (format = 'object') => {
5490
5536
  * Generated bundle index. Do not edit.
5491
5537
  */
5492
5538
 
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, apiKeyInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
5539
+ 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, ShipmentIncomeTypeCode, TransferenceTypeCode, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
5494
5540
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map