@experteam-mx/ngx-services 18.3.6 → 18.3.8

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 +30 -39
  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 +299 -143
  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 +28 -34
  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 +9 -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
  }
@@ -665,20 +765,22 @@ class ApiSecurityService {
665
765
  return this.environments.apiSecurityUrl;
666
766
  }
667
767
  /**
668
- * Authenticates a user with the provided credentials and role.
768
+ * Performs user authentication by sending login credentials to the server.
669
769
  *
670
- * @param {Object} param0 - The login input object.
671
- * @param {string} param0.username - The username of the user.
672
- * @param {string} param0.password - The password of the user.
673
- * @param {string} param0.role - The role of the user.
674
- * @return {Observable<LoginOut>} An observable emitting the login output object.
770
+ * @param {Object} params - An object containing the user's login credentials and system details.
771
+ * @param {string} params.username - The username of the user attempting to log in.
772
+ * @param {string} params.password - The user's password.
773
+ * @param {string} params.role - The role of the user (e.g., admin, user).
774
+ * @param {string} params.system_name - The name of the system the user is logging into.
775
+ *
776
+ * @return {Observable<AuthLoginOut>} An observable that emits the authentication result, including tokens and user information.
675
777
  */
676
- login({ username, password, role, }) {
778
+ postAuthLogin({ username, password, role, system_name }) {
677
779
  return this.http.post(`${this.url}/auth/login`, {
678
- system_name: 'CRA',
679
780
  username,
680
781
  password,
681
782
  role,
783
+ system_name,
682
784
  }).pipe(map(({ data }) => data), tap(({ access_token }) => this.cookie.set(this.environments.authCookie, access_token, { path: '/' })));
683
785
  }
684
786
  /**
@@ -688,7 +790,7 @@ class ApiSecurityService {
688
790
  *
689
791
  * @return {Observable<{}>} An observable that emits the server's response to the logout request.
690
792
  */
691
- logout() {
793
+ postAuthLogout() {
692
794
  return this.http.post(`${this.url}/auth/logout`, null)
693
795
  .pipe(map(({ data }) => data), tap(() => this.cookie.delete(this.environments.authCookie, '/')));
694
796
  }
@@ -700,9 +802,9 @@ class ApiSecurityService {
700
802
  * @param {string} params.modelId - The ID of the model.
701
803
  * @param {string} [params.token] - Optional authorization token.
702
804
  *
703
- * @return {Observable<CreateSessionOut>} An observable containing the created session details.
805
+ * @return {Observable<SessionOut>} An observable containing the created session details.
704
806
  */
705
- createSession({ modelType, modelId, token, }) {
807
+ postSession({ modelType, modelId, token, }) {
706
808
  let headers = new HttpHeaders({});
707
809
  if (token) {
708
810
  headers = headers.set('Authorization', `Bearer ${token}`);
@@ -719,9 +821,9 @@ class ApiSecurityService {
719
821
  * Sends a GET request to the endpoint '/auth/me' to retrieve information
720
822
  * about the currently authenticated user.
721
823
  *
722
- * @return {Observable<MeOut>} An observable that emits the authenticated user's data.
824
+ * @return {Observable<AuthMeOut>} An observable that emits the authenticated user's data.
723
825
  */
724
- me() {
826
+ getAuthMe() {
725
827
  return this.http.get(`${this.url}/auth/me`)
726
828
  .pipe(map(({ data }) => data));
727
829
  }
@@ -731,7 +833,7 @@ class ApiSecurityService {
731
833
  * @param token The JWT token used for authorization.
732
834
  * @return An Observable that emits the user's details encapsulated in a MeOut object.
733
835
  */
734
- otherMe(token) {
836
+ getOtherMe(token) {
735
837
  return this.http.get(`${this.url}/auth/me`, {
736
838
  headers: {
737
839
  Authorization: `Bearer ${token}`
@@ -744,7 +846,7 @@ class ApiSecurityService {
744
846
  * @param {number} id - The unique identifier of the user to be fetched.
745
847
  * @return {Observable<GetUserOut>} An observable containing the user information.
746
848
  */
747
- user(id) {
849
+ getUser(id) {
748
850
  return this.http.get(`${this.url}/users/${id}`)
749
851
  .pipe(map(({ data }) => data));
750
852
  }
@@ -753,9 +855,9 @@ class ApiSecurityService {
753
855
  *
754
856
  * @param {Object} params - The input parameters for changing the language.
755
857
  * @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.
858
+ * @return {Observable<ApiSuccess<AuthMeOut>>} An observable that emits the result of the language change request.
757
859
  */
758
- changeLanguage({ languageId }) {
860
+ putChangeLanguage({ languageId }) {
759
861
  return this.http.put(`${this.url}/auth/me`, {
760
862
  language_id: languageId
761
863
  }).pipe(map(({ data }) => data));
@@ -764,7 +866,7 @@ class ApiSecurityService {
764
866
  * Retrieves a list of roles with their permissions.
765
867
  *
766
868
  * @param {QueryParams} params - The query parameters to filter the roles.
767
- * @returns {Observable<RolePermissionsIn[]>} An observable that emits an array of role permissions.
869
+ * @returns {Observable<RoleIn[]>} An observable that emits an array of role permissions.
768
870
  */
769
871
  getRoles(params) {
770
872
  return this.http.get(`${this.url}/roles`, {
@@ -782,34 +884,23 @@ class ApiSecurityService {
782
884
  params
783
885
  }).pipe(map(({ data }) => data));
784
886
  }
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
887
  /**
797
888
  * Retrieves roles by the specified ID.
798
889
  *
799
- * @param params - The ID of the role to retrieve.
890
+ * @param id - The ID of the role to retrieve.
800
891
  * @returns An Observable that emits the role data.
801
892
  */
802
- getRolesById(params) {
803
- return this.http.get(`${this.url}/roles/${params}`)
893
+ getRole(id) {
894
+ return this.http.get(`${this.url}/roles/${id}`)
804
895
  .pipe(map(({ data }) => data));
805
896
  }
806
897
  /**
807
898
  * Creates a new role with the specified permissions.
808
899
  *
809
- * @param {RolePermissionsIn} body - The permissions and details for the new role.
810
- * @returns {Observable<ModulePermissionsOut>} An observable containing the created role's permissions.
900
+ * @param {RoleIn} body - The permissions and details for the new role.
901
+ * @returns {Observable<RoleOut>} An observable containing the created role's permissions.
811
902
  */
812
- createRole(body) {
903
+ postRole(body) {
813
904
  return this.http.post(`${this.url}/roles`, body)
814
905
  .pipe(map(({ data }) => data));
815
906
  }
@@ -820,7 +911,7 @@ class ApiSecurityService {
820
911
  * @param body - The new permissions to assign to the role.
821
912
  * @returns An Observable that emits the updated module permissions.
822
913
  */
823
- updateRolePermissions(id, body) {
914
+ putRole(id, body) {
824
915
  return this.http.put(`${this.url}/roles/${id}`, body)
825
916
  .pipe(map(({ data }) => data));
826
917
  }
@@ -830,7 +921,7 @@ class ApiSecurityService {
830
921
  * @param {number} id - The unique identifier of the role whose permissions are to be deleted.
831
922
  * @returns {Observable<{}>} An observable that emits the result of the delete operation.
832
923
  */
833
- deleteRolePermissions(id) {
924
+ deleteRole(id) {
834
925
  return this.http.delete(`${this.url}/roles/${id}`)
835
926
  .pipe(map(({ data }) => data));
836
927
  }
@@ -852,7 +943,7 @@ class ApiSecurityService {
852
943
  * @param params.queryParams - The query parameters to filter the modules.
853
944
  * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.
854
945
  */
855
- getModulesToken(params) {
946
+ getModulesByToken(params) {
856
947
  return this.http.get(`${this.url}/modules`, {
857
948
  params: params.queryParams,
858
949
  headers: {
@@ -895,7 +986,7 @@ class ApiShipmentsService {
895
986
  * @return {Observable<ValidateAccountIn>} An observable that emits the fetched parameter values
896
987
  * @param body
897
988
  */
898
- validateAccount(body) {
989
+ postValidateAccount(body) {
899
990
  return this.http.post(`${this.url}/accounts`, body)
900
991
  .pipe(map(({ data }) => data));
901
992
  }
@@ -905,7 +996,7 @@ class ApiShipmentsService {
905
996
  * @param body - The request payload of type `ManifestMultipleIn`.
906
997
  * @returns An observable that emits the response data of type `ManifestMultipleOut`.
907
998
  */
908
- manifestMultiple(body) {
999
+ postManifestMultiple(body) {
909
1000
  return this.http.post(`${this.url}/shipments/manifest`, body)
910
1001
  .pipe(map(({ data }) => data));
911
1002
  }
@@ -1243,6 +1334,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
1243
1334
  args: ['env']
1244
1335
  }] }] });
1245
1336
 
1337
+ /**
1338
+ * Convert an object of key-value pairs into a URL query string.
1339
+ *
1340
+ * @param {Object} params - The key-value pairs to converted into a query string.
1341
+ *
1342
+ * @return {string} - The generated query string.
1343
+ */
1344
+ const queryString = (params) => {
1345
+ const queryElements = [];
1346
+ Object.entries(params).forEach(([key, value]) => {
1347
+ if (Array.isArray(value)) {
1348
+ const arrayQuery = value
1349
+ .map((item) => `${encodeURIComponent(key)}=${encodeURIComponent(item)}`)
1350
+ .join('&');
1351
+ queryElements.push(arrayQuery);
1352
+ }
1353
+ else {
1354
+ const encodedQuery = `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
1355
+ queryElements.push(encodedQuery);
1356
+ }
1357
+ });
1358
+ const queryString = queryElements.join('&');
1359
+ return queryString.length ? `?${queryString}` : '';
1360
+ };
1361
+ /**
1362
+ * Creates an instance of HttpParams using the provided params object.
1363
+ *
1364
+ * @param {Object} params - The object containing the params to the HttpParams constructor.
1365
+ *
1366
+ * @returns {HttpParams} - An instance of HttpParams created from the params object.
1367
+ */
1368
+ const httpParams = (params) => new HttpParams({
1369
+ fromObject: params
1370
+ });
1371
+ /**
1372
+ * Returns the headers for generating PDF files.
1373
+ *
1374
+ * @param {string} format - The format of the headers, 'object' or 'http_header'.
1375
+ *
1376
+ * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating PDF files.
1377
+ */
1378
+ const pdfHeaders = (format = 'object') => {
1379
+ const headers = {
1380
+ Accept: 'application/pdf'
1381
+ };
1382
+ return format === 'object'
1383
+ ? headers
1384
+ : new HttpHeaders(headers);
1385
+ };
1386
+ /**
1387
+ * Returns the headers for generating XML files.
1388
+ *
1389
+ * @param {string} format - The format of the headers, 'object' or 'http_header'.
1390
+ *
1391
+ * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating XML files.
1392
+ */
1393
+ const xmlHeaders = (format = 'object') => {
1394
+ const headers = {
1395
+ Accept: 'application/xml',
1396
+ };
1397
+ return format === 'object'
1398
+ ? headers
1399
+ : new HttpHeaders(headers);
1400
+ };
1401
+
1246
1402
  /*
1247
1403
  * Public API Surface of ngx-services
1248
1404
  */
@@ -1251,5 +1407,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
1251
1407
  * Generated bundle index. Do not edit.
1252
1408
  */
1253
1409
 
1254
- export { ApiCompaniesService, ApiExternalPickupsService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, WebSocketsService, httpParams, pdfHeaders, queryString, xmlHeaders };
1410
+ export { ApiBillingDOService, ApiBillingMxService, ApiCompaniesService, ApiExternalPickupsService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, WebSocketsService, httpParams, pdfHeaders, queryString, xmlHeaders };
1255
1411
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map