@experteam-mx/ngx-services 18.3.6 → 18.3.7

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.
Files changed (49) hide show
  1. package/esm2022/lib/apis/api-billing-do.service.mjs +41 -0
  2. package/esm2022/lib/apis/api-billing-mx.service.mjs +62 -0
  3. package/esm2022/lib/apis/api-companies.service.mjs +20 -21
  4. package/esm2022/lib/apis/api-external-pickups.service.mjs +6 -6
  5. package/esm2022/lib/apis/api-invoices.service.mjs +69 -9
  6. package/esm2022/lib/apis/api-open-items.service.mjs +6 -6
  7. package/esm2022/lib/apis/api-reports.service.mjs +11 -1
  8. package/esm2022/lib/apis/api-security.service.mjs +22 -33
  9. package/esm2022/lib/apis/api-shipments.service.mjs +3 -3
  10. package/esm2022/lib/apis/models/api-billing.interfaces.mjs +2 -0
  11. package/esm2022/lib/apis/models/api-billing.types.mjs +2 -0
  12. package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +1 -1
  13. package/esm2022/lib/apis/models/api-companies.types.mjs +1 -1
  14. package/esm2022/lib/apis/models/api-external-pickups.types.mjs +1 -1
  15. package/esm2022/lib/apis/models/api-invoices.interfaces.mjs +1 -1
  16. package/esm2022/lib/apis/models/api-invoices.types.mjs +1 -1
  17. package/esm2022/lib/apis/models/api-open-items.interfaces.mjs +1 -1
  18. package/esm2022/lib/apis/models/api-open-items.types.mjs +1 -1
  19. package/esm2022/lib/apis/models/api-reports.types.mjs +1 -1
  20. package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
  21. package/esm2022/lib/apis/models/api-security.types.mjs +1 -1
  22. package/esm2022/lib/ngx-services.models.mjs +1 -1
  23. package/esm2022/public-api.mjs +4 -1
  24. package/fesm2022/experteam-mx-ngx-services.mjs +291 -137
  25. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
  26. package/lib/apis/api-billing-do.service.d.ts +24 -0
  27. package/lib/apis/api-billing-mx.service.d.ts +39 -0
  28. package/lib/apis/api-companies.service.d.ts +9 -9
  29. package/lib/apis/api-external-pickups.service.d.ts +6 -6
  30. package/lib/apis/api-invoices.service.d.ts +52 -9
  31. package/lib/apis/api-open-items.service.d.ts +7 -7
  32. package/lib/apis/api-reports.service.d.ts +7 -0
  33. package/lib/apis/api-security.service.d.ts +21 -29
  34. package/lib/apis/api-shipments.service.d.ts +2 -2
  35. package/lib/apis/models/api-billing.interfaces.d.ts +41 -0
  36. package/lib/apis/models/api-billing.types.d.ts +17 -0
  37. package/lib/apis/models/api-catalog.interfaces.d.ts +6 -0
  38. package/lib/apis/models/api-companies.types.d.ts +7 -13
  39. package/lib/apis/models/api-external-pickups.types.d.ts +4 -4
  40. package/lib/apis/models/api-invoices.interfaces.d.ts +35 -1
  41. package/lib/apis/models/api-invoices.types.d.ts +28 -5
  42. package/lib/apis/models/api-open-items.interfaces.d.ts +2 -2
  43. package/lib/apis/models/api-open-items.types.d.ts +2 -2
  44. package/lib/apis/models/api-reports.types.d.ts +2 -3
  45. package/lib/apis/models/api-security.interfaces.d.ts +0 -4
  46. package/lib/apis/models/api-security.types.d.ts +8 -8
  47. package/lib/ngx-services.models.d.ts +2 -0
  48. package/package.json +9 -1
  49. package/public-api.d.ts +3 -0
@@ -1,7 +1,7 @@
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 { provideHttpClient, HttpParams, HttpHeaders, HttpResponse } from '@angular/common/http';
4
+ import { provideHttpClient, HttpHeaders, HttpResponse, HttpParams } from '@angular/common/http';
5
5
  import { map, mergeMap, forkJoin, tap, Observable, of } from 'rxjs';
6
6
  import { map as map$1, tap as tap$1 } from 'rxjs/operators';
7
7
  import * as i1$1 from 'ngx-cookie-service';
@@ -38,70 +38,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
38
38
  }]
39
39
  }] });
40
40
 
41
- /**
42
- * Convert an object of key-value pairs into a URL query string.
43
- *
44
- * @param {Object} params - The key-value pairs to converted into a query string.
45
- *
46
- * @return {string} - The generated query string.
47
- */
48
- const queryString = (params) => {
49
- const queryElements = [];
50
- Object.entries(params).forEach(([key, value]) => {
51
- if (Array.isArray(value)) {
52
- const arrayQuery = value
53
- .map((item) => `${encodeURIComponent(key)}=${encodeURIComponent(item)}`)
54
- .join('&');
55
- queryElements.push(arrayQuery);
56
- }
57
- else {
58
- const encodedQuery = `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
59
- queryElements.push(encodedQuery);
60
- }
61
- });
62
- const queryString = queryElements.join('&');
63
- return queryString.length ? `?${queryString}` : '';
64
- };
65
- /**
66
- * Creates an instance of HttpParams using the provided params object.
67
- *
68
- * @param {Object} params - The object containing the params to the HttpParams constructor.
69
- *
70
- * @returns {HttpParams} - An instance of HttpParams created from the params object.
71
- */
72
- const httpParams = (params) => new HttpParams({
73
- fromObject: params
74
- });
75
- /**
76
- * Returns the headers for generating PDF files.
77
- *
78
- * @param {string} format - The format of the headers, 'object' or 'http_header'.
79
- *
80
- * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating PDF files.
81
- */
82
- const pdfHeaders = (format = 'object') => {
83
- const headers = {
84
- Accept: 'application/pdf'
85
- };
86
- return format === 'object'
87
- ? headers
88
- : new HttpHeaders(headers);
89
- };
90
- /**
91
- * Returns the headers for generating XML files.
92
- *
93
- * @param {string} format - The format of the headers, 'object' or 'http_header'.
94
- *
95
- * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating XML files.
96
- */
97
- const xmlHeaders = (format = 'object') => {
98
- const headers = {
99
- Accept: 'application/xml',
100
- };
101
- return format === 'object'
102
- ? headers
103
- : new HttpHeaders(headers);
104
- };
41
+ class ApiBillingDOService {
42
+ environments;
43
+ http;
44
+ constructor(environments, http) {
45
+ this.environments = environments;
46
+ this.http = http;
47
+ }
48
+ /**
49
+ * Retrieves the URL for the shipments API from the environment configurations.
50
+ *
51
+ * @return {string} The URL of the shipments API.
52
+ */
53
+ get url() {
54
+ return this.environments.apiBillingDO;
55
+ }
56
+ /**
57
+ * Retrieves a list of income types
58
+ *
59
+ * @return {Observable<ApiSuccess<IncomeTypesOut>>} An observable that emits the income types data.
60
+ */
61
+ getIncomeTypes() {
62
+ return this.http.get(`${this.url}/income-types`)
63
+ .pipe(map(({ data }) => data));
64
+ }
65
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingDOService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
66
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingDOService, providedIn: 'root' });
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingDOService, decorators: [{
69
+ type: Injectable,
70
+ args: [{
71
+ providedIn: 'root'
72
+ }]
73
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
74
+ type: Inject,
75
+ args: ['env']
76
+ }] }, { type: i1.HttpClient }] });
77
+
78
+ class ApiBillingMxService {
79
+ environments;
80
+ http;
81
+ constructor(environments, http) {
82
+ this.environments = environments;
83
+ this.http = http;
84
+ }
85
+ /**
86
+ * Retrieves the URL for the shipments API from the environment configurations.
87
+ *
88
+ * @return {string} The URL of the shipments API.
89
+ */
90
+ get url() {
91
+ return this.environments.apiBillingMX;
92
+ }
93
+ /**
94
+ * Fetches the tax regimen data from the server.
95
+ *
96
+ * @return {Observable<FiscalRegimensOut>} An observable that emits the fiscal regimen data.
97
+ */
98
+ getFiscalRegimens() {
99
+ return this.http.get(`${this.url}/fiscal-regimens`)
100
+ .pipe(map(({ data }) => data));
101
+ }
102
+ /**
103
+ * Fetches a paginated list of CFDIs (Comprobante Fiscal Digital por Internet) based on the provided fiscal regimen.
104
+ *
105
+ * @param {number} fiscalRegimen - The fiscal regimen identifier to filter the CFDIs.
106
+ * @return {Observable<FiscalRegimensAcceptedOut>} An observable containing the paginated list of CFDIs.
107
+ */
108
+ getFiscalRegimensAccepted(fiscalRegimen) {
109
+ const params = { 'fiscal-regimen': fiscalRegimen };
110
+ return this.http.get(`${this.url}/cfdi-uses/fiscal-regimen-accepted/list`, { params })
111
+ .pipe(map(({ data }) => data));
112
+ }
113
+ /**
114
+ * Fetches and validates postal code data from the server.
115
+ *
116
+ * @param {QueryParams} params - Query parameters used to filter the postal code data.
117
+ * @return {Observable<PostalCodesOut>} - An observable emitting the validated postal code data.
118
+ */
119
+ getPostalCodes(params) {
120
+ return this.http.get(`${this.url}/postal-codes`, { params })
121
+ .pipe(map(({ data }) => data));
122
+ }
123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingMxService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
124
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingMxService, providedIn: 'root' });
125
+ }
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiBillingMxService, decorators: [{
127
+ type: Injectable,
128
+ args: [{
129
+ providedIn: 'root'
130
+ }]
131
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
132
+ type: Inject,
133
+ args: ['env']
134
+ }] }, { type: i1.HttpClient }] });
105
135
 
106
136
  class ApiCompaniesService {
107
137
  environments;
@@ -126,7 +156,7 @@ class ApiCompaniesService {
126
156
  */
127
157
  getInstallations(params) {
128
158
  return this.http.get(`${this.url}/installations`, {
129
- params: httpParams(params),
159
+ params,
130
160
  }).pipe(map(({ data }) => data));
131
161
  }
132
162
  /**
@@ -147,7 +177,7 @@ class ApiCompaniesService {
147
177
  */
148
178
  getLocations(params) {
149
179
  return this.http.get(`${this.url}/locations`, {
150
- params: httpParams(params),
180
+ params,
151
181
  }).pipe(map(({ data }) => data));
152
182
  }
153
183
  /**
@@ -164,11 +194,11 @@ class ApiCompaniesService {
164
194
  * Retrieves a list of active supply entities.
165
195
  *
166
196
  * @param {QueryParams} params - The query parameters to filter supply entities.
167
- * @return {Observable<SupplyEntitiesOut>} Observable emitting supply entities data.
197
+ * @return {Observable<SupplyEntitiesActivesOut>} Observable emitting supply entities data.
168
198
  */
169
- getSupplyEntitiesActive(params) {
199
+ getSupplyEntitiesActives(params) {
170
200
  return this.http.get(`${this.url}/supply-entities/actives`, {
171
- params: httpParams(params),
201
+ params,
172
202
  }).pipe(map(({ data }) => data));
173
203
  }
174
204
  /**
@@ -179,7 +209,7 @@ class ApiCompaniesService {
179
209
  */
180
210
  getEmployees(params) {
181
211
  return this.http.get(`${this.url}/employees`, {
182
- params: httpParams(params),
212
+ params,
183
213
  }).pipe(map(({ data }) => data));
184
214
  }
185
215
  /**
@@ -200,7 +230,7 @@ class ApiCompaniesService {
200
230
  */
201
231
  getLocationEmployees(params) {
202
232
  return this.http.get(`${this.url}/location-employees`, {
203
- params: httpParams(params),
233
+ params,
204
234
  }).pipe(map(({ data }) => data));
205
235
  }
206
236
  /**
@@ -211,7 +241,7 @@ class ApiCompaniesService {
211
241
  */
212
242
  getCompanyCountries(params) {
213
243
  return this.http.get(`${this.url}/company-countries`, {
214
- params: httpParams(params),
244
+ params,
215
245
  }).pipe(map(({ data }) => data));
216
246
  }
217
247
  /**
@@ -256,11 +286,11 @@ class ApiCompaniesService {
256
286
  * Fetches exchange data based on the provided query parameters.
257
287
  *
258
288
  * @param {QueryParams} params - The query parameters for retrieving exchange data.
259
- * @return {Observable<CountryExchangesOut>} An observable containing the exchange data.
289
+ * @return {Observable<ExchangesOut>} An observable containing the exchange data.
260
290
  */
261
291
  getExchanges(params) {
262
292
  return this.http.get(`${this.url}/exchanges`, {
263
- params: httpParams(params),
293
+ params,
264
294
  }).pipe(map(({ data }) => data));
265
295
  }
266
296
  /**
@@ -272,7 +302,7 @@ class ApiCompaniesService {
272
302
  */
273
303
  getCurrentExchanges(params) {
274
304
  return this.http.get(`${this.url}/exchanges/current`, {
275
- params: httpParams(params),
305
+ params,
276
306
  }).pipe(map(({ data }) => data));
277
307
  }
278
308
  /**
@@ -283,18 +313,18 @@ class ApiCompaniesService {
283
313
  */
284
314
  getCompanyCountryTaxes(params) {
285
315
  return this.http.get(`${this.url}/company-country-taxes`, {
286
- params: httpParams(params),
316
+ params,
287
317
  }).pipe(map(({ data }) => data));
288
318
  }
289
319
  /**
290
320
  * Retrieves the list of active account entities based on the provided query parameters.
291
321
  *
292
322
  * @param {QueryParams} params - The parameters to filter and query active account entities.
293
- * @return {Observable<AccountEntitiesOut>} An observable that emits the list of active account entities.
323
+ * @return {Observable<AccountEntitiesActivesOut>} An observable that emits the list of active account entities.
294
324
  */
295
- getActiveAccountEntities(params) {
325
+ getAccountEntitiesActives(params) {
296
326
  return this.http.get(`${this.url}/account-entities/actives`, {
297
- params: httpParams(params),
327
+ params,
298
328
  }).pipe(map(({ data }) => data));
299
329
  }
300
330
  /**
@@ -302,9 +332,9 @@ class ApiCompaniesService {
302
332
  *
303
333
  * @param {Object} params - An object containing the required parameters.
304
334
  * @param {string[]} params.paramNames - An array of parameter names for which the values need to be fetched.
305
- * @return {Observable<ParametersOut>} An observable that emits the fetched parameter values.
335
+ * @return {Observable<ParametersValuesOut>} An observable that emits the fetched parameter values.
306
336
  */
307
- getParameters({ paramNames, }) {
337
+ getParametersValues({ paramNames, }) {
308
338
  const parameters = paramNames.map((p) => ({ name: p }));
309
339
  return this.http.post(`${this.url}/parameters-values`, {
310
340
  parameters
@@ -329,7 +359,7 @@ class ApiCompaniesService {
329
359
  */
330
360
  getCountryReferences(params) {
331
361
  return this.http.get(`${this.url}/country-references`, {
332
- params: httpParams(params),
362
+ params,
333
363
  }).pipe(map(({ data }) => data));
334
364
  }
335
365
  /**
@@ -350,7 +380,7 @@ class ApiCompaniesService {
350
380
  */
351
381
  getWorkflows(params) {
352
382
  return this.http.get(`${this.url}/workflows`, {
353
- params: httpParams(params),
383
+ params,
354
384
  }).pipe(map(({ data }) => data));
355
385
  }
356
386
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiCompaniesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -386,10 +416,10 @@ class ApiExternalPickupsService {
386
416
  /**
387
417
  * Generates a delivery confirmation by sending the provided payload to the API.
388
418
  *
389
- * @param {GenerateDeliveryConfirmationIn} payload - The input payload required to generate the delivery confirmation.
390
- * @return {Observable<KeyOTPOut>} An observable that emits the generated delivery confirmation data.
419
+ * @param {DeliveryConfirmationGenerateIn} payload - The input payload required to generate the delivery confirmation.
420
+ * @return {Observable<DeliveryConfirmationGenerateOut>} An observable that emits the generated delivery confirmation data.
391
421
  */
392
- generateDeliveryConfirmation(payload) {
422
+ postDeliveryConfirmationGenerate(payload) {
393
423
  return this.httpClient.post(`${this.url}/delivery-confirmation/generate`, payload, {
394
424
  headers: { appkey: this.environment.apiExternalOperationsKey }
395
425
  }).pipe(map$1(({ data }) => data));
@@ -402,7 +432,7 @@ class ApiExternalPickupsService {
402
432
  * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.
403
433
  * @return {Observable<Object>} - An observable containing the response data from the API.
404
434
  */
405
- completedDeliveryConfirmation({ keyOTP, operationId, }) {
435
+ patchDeliveryConfirmationComplete({ keyOTP, operationId, }) {
406
436
  return this.httpClient.patch(`${this.url}/delivery-confirmation/completed/${keyOTP}`, null, {
407
437
  headers: { appkey: this.environment.apiExternalOperationsKey },
408
438
  params: { operation_id: operationId }
@@ -416,7 +446,7 @@ class ApiExternalPickupsService {
416
446
  * @param {Object} param0.body - Additional body data required for cancellation.
417
447
  * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
418
448
  */
419
- cancelDeliveryConfirmation({ otp, ...body }) {
449
+ putDeliveryConfirmation({ otp, ...body }) {
420
450
  return this.httpClient.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body, {
421
451
  headers: { appkey: this.environment.apiExternalOperationsKey },
422
452
  }).pipe(map$1(({ data }) => data));
@@ -455,7 +485,7 @@ class ApiInvoicesService {
455
485
  * @param {OperationDocumentIn} body - The input data for the operation document.
456
486
  * @return {Observable<OperationDocumentOut>} An observable containing the processed operation document output.
457
487
  */
458
- operationDocument(body) {
488
+ postOperationDocument(body) {
459
489
  return this.http.post(`${this.url}/operation/document`, body)
460
490
  .pipe(map(({ data }) => data));
461
491
  }
@@ -463,9 +493,9 @@ class ApiInvoicesService {
463
493
  * Fetches and returns the collection receipt data for a given collection ID.
464
494
  *
465
495
  * @param {number} id - The unique identifier of the collection for which the receipt needs to be retrieved.
466
- * @return {Observable<CollectionReceiptOut>} An observable containing the collection receipt data.
496
+ * @return {Observable<PrintCollectionReceiptOut>} An observable containing the collection receipt data.
467
497
  */
468
- printCollectionReceipt(id) {
498
+ getPrintCollectionReceipt(id) {
469
499
  return this.http.get(`${this.url}/operation/print/collection-receipt/${id}`)
470
500
  .pipe(map(({ data }) => data));
471
501
  }
@@ -473,10 +503,10 @@ class ApiInvoicesService {
473
503
  * Handles the account payment operation by sending a POST request to the specified endpoint.
474
504
  * Processes the response and returns the operation data.
475
505
  *
476
- * @param {AccountPaymentOperationIn} body The payload containing information for the account payment operation.
477
- * @return {Observable<AccountPaymentOperationOut>} An observable emitting the processed account payment operation data.
506
+ * @param {OperationAccountPaymentIn} body The payload containing information for the account payment operation.
507
+ * @return {Observable<OperationAccountPaymentOut>} An observable emitting the processed account payment operation data.
478
508
  */
479
- accountPaymentOperation(body) {
509
+ postOperationAccountPayment(body) {
480
510
  return this.http.post(`${this.url}/operation/account-payment`, body)
481
511
  .pipe(map(({ data }) => data));
482
512
  }
@@ -487,7 +517,7 @@ class ApiInvoicesService {
487
517
  * @param body The data required to cancel the payment receipt, encapsulated in a CancelPaymentReceiptIn object.
488
518
  * @return An Observable representing the result of the cancellation. Emits an empty object on success.
489
519
  */
490
- cancelPaymentReceipt(body) {
520
+ postOperationCancelDocument(body) {
491
521
  return this.http.post(`${this.url}/operation/cancel-document`, body)
492
522
  .pipe(map(({ data }) => data));
493
523
  }
@@ -497,10 +527,70 @@ class ApiInvoicesService {
497
527
  * @param {Object} parameters - The parameters required to cancel the invoice, encapsulated in a CancelBillingIn object.
498
528
  * @return {Observable<Object>} An observable that emits the response of the cancellation operation.
499
529
  */
500
- cancelInvoice({ invoiceId, ...body }) {
530
+ postOperationCancelBilling({ invoiceId, ...body }) {
501
531
  return this.http.post(`${this.url}/operation/cancel-billing/${invoiceId}`, body)
502
532
  .pipe(map(({ data }) => data));
503
533
  }
534
+ /**
535
+ * Fetches a list of customer types from the server.
536
+ *
537
+ * @param {QueryParams} params - Query parameters to filter or customize the request.
538
+ * @return {Observable<CustomerTypesOut>} An observable emitting the customer types fetched from the server.
539
+ */
540
+ getCustomerTypes(params) {
541
+ return this.http.get(`${this.url}/customer-types`, { params })
542
+ .pipe(map(({ data }) => data));
543
+ }
544
+ /**
545
+ * Retrieves document types specific to a given country.
546
+ *
547
+ * @param {QueryParams} params - The query parameters containing country-specific information.
548
+ * @return {Observable<CustomerDocumentTypesOut>} An observable emitting the document types available for the specified country.
549
+ */
550
+ getCustomerDocumentTypes(params) {
551
+ return this.http.get(`${this.url}/customer-country-document-types`, { params })
552
+ .pipe(map(({ data }) => data));
553
+ }
554
+ /**
555
+ * Fetches customer invoice details filtered by a custom invoice type.
556
+ *
557
+ * @param {InvoiceTypeCustomParamsIn} params - An object containing the filter parameters for the custom invoice type.
558
+ * @return {Observable<CustomersOut>} An observable containing customer invoice details of the specified type.
559
+ */
560
+ getCustomers(params) {
561
+ return this.http.get(`${this.url}/customers`, { params })
562
+ .pipe(map(({ data }) => data));
563
+ }
564
+ /**
565
+ * Sends a POST request to create or update an external shipment operation.
566
+ *
567
+ * @param {OperationShipmentExternalIn} params - The input parameters for the external shipment operation.
568
+ * @return {Observable<OperationShipmentExternalOut>} An observable that emits the result of the external shipment operation.
569
+ */
570
+ postOperationShipmentExternal(params) {
571
+ return this.http.post(`${this.url}/operation/shipment/external`, params)
572
+ .pipe(map(({ data }) => data));
573
+ }
574
+ /**
575
+ * Processes an external payment operation for a shipment.
576
+ *
577
+ * @param {OperationShipmentExternalIn} params - The input parameters required for the external payment operation.
578
+ * @return {Observable<OperationShipmentExternalOut>} An observable that emits the result of the external payment operation for a shipment.
579
+ */
580
+ postOperationShipmentExternalPayment(params) {
581
+ return this.http.post(`${this.url}/operation/shipment/external/payment`, params)
582
+ .pipe(map(({ data }) => data));
583
+ }
584
+ /**
585
+ * Retrieves and returns billing operation print details for a given document ID.
586
+ *
587
+ * @param {number} documentId - The ID of the document for which to fetch the print billing operation details.
588
+ * @return {Observable<OperationPrintDocumentOut>} An observable emitting the print billing operation details for the specified document.
589
+ */
590
+ getOperationPrintDocument(documentId) {
591
+ return this.http.get(`${this.url}/operation/print/document/${documentId}`)
592
+ .pipe(map(({ data }) => data));
593
+ }
504
594
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiInvoicesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
505
595
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
506
596
  }
@@ -543,19 +633,19 @@ class ApiOpenItemsService {
543
633
  * Processes a payment for an open item.
544
634
  *
545
635
  * @param {PaymentOpenItemIn} body - The payment details for the open item.
546
- * @return {Observable<PaymentOpenItemOut>} An observable that emits the result of the payment processing.
636
+ * @return {Observable<PaymentOut>} An observable that emits the result of the payment processing.
547
637
  */
548
- paymentOpenItem(body) {
638
+ postPayment(body) {
549
639
  return this.http.post(`${this.url}/payment`, body)
550
640
  .pipe(map(({ data }) => data));
551
641
  }
552
642
  /**
553
643
  * Processes a payment for other invoice.
554
644
  *
555
- * @param {PaymentOtherInvoiceIn} body - The payment details for the other invoice.
556
- * @return {Observable<PaymentOtherInvoiceOut>} An observable that emits the result of the payment processing.
645
+ * @param {OtherInvoiceIn} body - The payment details for the other invoice.
646
+ * @return {Observable<OtherInvoiceOut>} An observable that emits the result of the payment processing.
557
647
  */
558
- paymentOtherInvoice(body) {
648
+ postOtherInvoice(body) {
559
649
  return this.http.post(`${this.url}/other-invoices`, body)
560
650
  .pipe(map(({ data }) => data));
561
651
  }
@@ -634,6 +724,16 @@ class ApiReportsService {
634
724
  },
635
725
  }).pipe(map(({ data }) => data));
636
726
  }
727
+ /**
728
+ * Fetches shipment reports based on the provided query parameters.
729
+ *
730
+ * @param {QueryParams} params - The query parameters used to filter or define the shipment reports.
731
+ * @return {Observable<ShipmentsReportOut>} An observable emitting the shipment report data.
732
+ */
733
+ getShipmentsReport(params) {
734
+ return this.http.get(`${this.url}/shipments-report`, { params })
735
+ .pipe(map(({ data }) => data));
736
+ }
637
737
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiReportsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
638
738
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiReportsService, providedIn: 'root' });
639
739
  }
@@ -671,9 +771,9 @@ class ApiSecurityService {
671
771
  * @param {string} param0.username - The username of the user.
672
772
  * @param {string} param0.password - The password of the user.
673
773
  * @param {string} param0.role - The role of the user.
674
- * @return {Observable<LoginOut>} An observable emitting the login output object.
774
+ * @return {Observable<AuthLoginOut>} An observable emitting the login output object.
675
775
  */
676
- login({ username, password, role, }) {
776
+ postAuthLogin({ username, password, role, }) {
677
777
  return this.http.post(`${this.url}/auth/login`, {
678
778
  system_name: 'CRA',
679
779
  username,
@@ -688,7 +788,7 @@ class ApiSecurityService {
688
788
  *
689
789
  * @return {Observable<{}>} An observable that emits the server's response to the logout request.
690
790
  */
691
- logout() {
791
+ postAuthLogout() {
692
792
  return this.http.post(`${this.url}/auth/logout`, null)
693
793
  .pipe(map(({ data }) => data), tap(() => this.cookie.delete(this.environments.authCookie, '/')));
694
794
  }
@@ -700,9 +800,9 @@ class ApiSecurityService {
700
800
  * @param {string} params.modelId - The ID of the model.
701
801
  * @param {string} [params.token] - Optional authorization token.
702
802
  *
703
- * @return {Observable<CreateSessionOut>} An observable containing the created session details.
803
+ * @return {Observable<SessionOut>} An observable containing the created session details.
704
804
  */
705
- createSession({ modelType, modelId, token, }) {
805
+ postSession({ modelType, modelId, token, }) {
706
806
  let headers = new HttpHeaders({});
707
807
  if (token) {
708
808
  headers = headers.set('Authorization', `Bearer ${token}`);
@@ -719,9 +819,9 @@ class ApiSecurityService {
719
819
  * Sends a GET request to the endpoint '/auth/me' to retrieve information
720
820
  * about the currently authenticated user.
721
821
  *
722
- * @return {Observable<MeOut>} An observable that emits the authenticated user's data.
822
+ * @return {Observable<AuthMeOut>} An observable that emits the authenticated user's data.
723
823
  */
724
- me() {
824
+ getAuthMe() {
725
825
  return this.http.get(`${this.url}/auth/me`)
726
826
  .pipe(map(({ data }) => data));
727
827
  }
@@ -731,7 +831,7 @@ class ApiSecurityService {
731
831
  * @param token The JWT token used for authorization.
732
832
  * @return An Observable that emits the user's details encapsulated in a MeOut object.
733
833
  */
734
- otherMe(token) {
834
+ getOtherMe(token) {
735
835
  return this.http.get(`${this.url}/auth/me`, {
736
836
  headers: {
737
837
  Authorization: `Bearer ${token}`
@@ -744,7 +844,7 @@ class ApiSecurityService {
744
844
  * @param {number} id - The unique identifier of the user to be fetched.
745
845
  * @return {Observable<GetUserOut>} An observable containing the user information.
746
846
  */
747
- user(id) {
847
+ getUser(id) {
748
848
  return this.http.get(`${this.url}/users/${id}`)
749
849
  .pipe(map(({ data }) => data));
750
850
  }
@@ -753,9 +853,9 @@ class ApiSecurityService {
753
853
  *
754
854
  * @param {Object} params - The input parameters for changing the language.
755
855
  * @param {string} params.languageId - The ID of the new language to be set.
756
- * @return {Observable<ApiSuccess<MeOut>>} An observable that emits the result of the language change request.
856
+ * @return {Observable<ApiSuccess<AuthMeOut>>} An observable that emits the result of the language change request.
757
857
  */
758
- changeLanguage({ languageId }) {
858
+ putChangeLanguage({ languageId }) {
759
859
  return this.http.put(`${this.url}/auth/me`, {
760
860
  language_id: languageId
761
861
  }).pipe(map(({ data }) => data));
@@ -764,7 +864,7 @@ class ApiSecurityService {
764
864
  * Retrieves a list of roles with their permissions.
765
865
  *
766
866
  * @param {QueryParams} params - The query parameters to filter the roles.
767
- * @returns {Observable<RolePermissionsIn[]>} An observable that emits an array of role permissions.
867
+ * @returns {Observable<RoleIn[]>} An observable that emits an array of role permissions.
768
868
  */
769
869
  getRoles(params) {
770
870
  return this.http.get(`${this.url}/roles`, {
@@ -782,34 +882,23 @@ class ApiSecurityService {
782
882
  params
783
883
  }).pipe(map(({ data }) => data));
784
884
  }
785
- /**
786
- * Retrieves the permissions for a module.
787
- *
788
- * @param {QueryParams} params - The query parameters to be sent with the request.
789
- * @returns {Observable<ModulePermissionsOut>} An observable containing the module permissions.
790
- */
791
- getPermissions(params) {
792
- return this.http.get(`${this.url}/modules`, {
793
- params
794
- }).pipe(map(({ data }) => data));
795
- }
796
885
  /**
797
886
  * Retrieves roles by the specified ID.
798
887
  *
799
- * @param params - The ID of the role to retrieve.
888
+ * @param id - The ID of the role to retrieve.
800
889
  * @returns An Observable that emits the role data.
801
890
  */
802
- getRolesById(params) {
803
- return this.http.get(`${this.url}/roles/${params}`)
891
+ getRole(id) {
892
+ return this.http.get(`${this.url}/roles/${id}`)
804
893
  .pipe(map(({ data }) => data));
805
894
  }
806
895
  /**
807
896
  * Creates a new role with the specified permissions.
808
897
  *
809
- * @param {RolePermissionsIn} body - The permissions and details for the new role.
810
- * @returns {Observable<ModulePermissionsOut>} An observable containing the created role's permissions.
898
+ * @param {RoleIn} body - The permissions and details for the new role.
899
+ * @returns {Observable<RoleOut>} An observable containing the created role's permissions.
811
900
  */
812
- createRole(body) {
901
+ postRole(body) {
813
902
  return this.http.post(`${this.url}/roles`, body)
814
903
  .pipe(map(({ data }) => data));
815
904
  }
@@ -820,7 +909,7 @@ class ApiSecurityService {
820
909
  * @param body - The new permissions to assign to the role.
821
910
  * @returns An Observable that emits the updated module permissions.
822
911
  */
823
- updateRolePermissions(id, body) {
912
+ putRole(id, body) {
824
913
  return this.http.put(`${this.url}/roles/${id}`, body)
825
914
  .pipe(map(({ data }) => data));
826
915
  }
@@ -830,7 +919,7 @@ class ApiSecurityService {
830
919
  * @param {number} id - The unique identifier of the role whose permissions are to be deleted.
831
920
  * @returns {Observable<{}>} An observable that emits the result of the delete operation.
832
921
  */
833
- deleteRolePermissions(id) {
922
+ deleteRole(id) {
834
923
  return this.http.delete(`${this.url}/roles/${id}`)
835
924
  .pipe(map(({ data }) => data));
836
925
  }
@@ -852,7 +941,7 @@ class ApiSecurityService {
852
941
  * @param params.queryParams - The query parameters to filter the modules.
853
942
  * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.
854
943
  */
855
- getModulesToken(params) {
944
+ getModulesByToken(params) {
856
945
  return this.http.get(`${this.url}/modules`, {
857
946
  params: params.queryParams,
858
947
  headers: {
@@ -895,7 +984,7 @@ class ApiShipmentsService {
895
984
  * @return {Observable<ValidateAccountIn>} An observable that emits the fetched parameter values
896
985
  * @param body
897
986
  */
898
- validateAccount(body) {
987
+ postValidateAccount(body) {
899
988
  return this.http.post(`${this.url}/accounts`, body)
900
989
  .pipe(map(({ data }) => data));
901
990
  }
@@ -905,7 +994,7 @@ class ApiShipmentsService {
905
994
  * @param body - The request payload of type `ManifestMultipleIn`.
906
995
  * @returns An observable that emits the response data of type `ManifestMultipleOut`.
907
996
  */
908
- manifestMultiple(body) {
997
+ postManifestMultiple(body) {
909
998
  return this.http.post(`${this.url}/shipments/manifest`, body)
910
999
  .pipe(map(({ data }) => data));
911
1000
  }
@@ -1243,6 +1332,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
1243
1332
  args: ['env']
1244
1333
  }] }] });
1245
1334
 
1335
+ /**
1336
+ * Convert an object of key-value pairs into a URL query string.
1337
+ *
1338
+ * @param {Object} params - The key-value pairs to converted into a query string.
1339
+ *
1340
+ * @return {string} - The generated query string.
1341
+ */
1342
+ const queryString = (params) => {
1343
+ const queryElements = [];
1344
+ Object.entries(params).forEach(([key, value]) => {
1345
+ if (Array.isArray(value)) {
1346
+ const arrayQuery = value
1347
+ .map((item) => `${encodeURIComponent(key)}=${encodeURIComponent(item)}`)
1348
+ .join('&');
1349
+ queryElements.push(arrayQuery);
1350
+ }
1351
+ else {
1352
+ const encodedQuery = `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
1353
+ queryElements.push(encodedQuery);
1354
+ }
1355
+ });
1356
+ const queryString = queryElements.join('&');
1357
+ return queryString.length ? `?${queryString}` : '';
1358
+ };
1359
+ /**
1360
+ * Creates an instance of HttpParams using the provided params object.
1361
+ *
1362
+ * @param {Object} params - The object containing the params to the HttpParams constructor.
1363
+ *
1364
+ * @returns {HttpParams} - An instance of HttpParams created from the params object.
1365
+ */
1366
+ const httpParams = (params) => new HttpParams({
1367
+ fromObject: params
1368
+ });
1369
+ /**
1370
+ * Returns the headers for generating PDF files.
1371
+ *
1372
+ * @param {string} format - The format of the headers, 'object' or 'http_header'.
1373
+ *
1374
+ * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating PDF files.
1375
+ */
1376
+ const pdfHeaders = (format = 'object') => {
1377
+ const headers = {
1378
+ Accept: 'application/pdf'
1379
+ };
1380
+ return format === 'object'
1381
+ ? headers
1382
+ : new HttpHeaders(headers);
1383
+ };
1384
+ /**
1385
+ * Returns the headers for generating XML files.
1386
+ *
1387
+ * @param {string} format - The format of the headers, 'object' or 'http_header'.
1388
+ *
1389
+ * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating XML files.
1390
+ */
1391
+ const xmlHeaders = (format = 'object') => {
1392
+ const headers = {
1393
+ Accept: 'application/xml',
1394
+ };
1395
+ return format === 'object'
1396
+ ? headers
1397
+ : new HttpHeaders(headers);
1398
+ };
1399
+
1246
1400
  /*
1247
1401
  * Public API Surface of ngx-services
1248
1402
  */
@@ -1251,5 +1405,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
1251
1405
  * Generated bundle index. Do not edit.
1252
1406
  */
1253
1407
 
1254
- export { ApiCompaniesService, ApiExternalPickupsService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, WebSocketsService, httpParams, pdfHeaders, queryString, xmlHeaders };
1408
+ export { ApiBillingDOService, ApiBillingMxService, ApiCompaniesService, ApiExternalPickupsService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, WebSocketsService, httpParams, pdfHeaders, queryString, xmlHeaders };
1255
1409
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map