@experteam-mx/ngx-services 18.3.5 → 18.3.6

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.
@@ -0,0 +1,72 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+ import { map } from 'rxjs/operators';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/common/http";
5
+ export class ApiExternalPickupsService {
6
+ httpClient;
7
+ environment;
8
+ constructor(httpClient, environment) {
9
+ this.httpClient = httpClient;
10
+ this.environment = environment;
11
+ }
12
+ /**
13
+ * Getter method to retrieve the API's external operations URL.
14
+ * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
15
+ * Defaults to an empty string if the property is undefined or null.
16
+ *
17
+ * @return {string} The external operations URL or an empty string if unavailable.
18
+ */
19
+ get url() {
20
+ return this.environment.apiExternalOperationsUrl ?? '';
21
+ }
22
+ /**
23
+ * Generates a delivery confirmation by sending the provided payload to the API.
24
+ *
25
+ * @param {GenerateDeliveryConfirmationIn} payload - The input payload required to generate the delivery confirmation.
26
+ * @return {Observable<KeyOTPOut>} An observable that emits the generated delivery confirmation data.
27
+ */
28
+ generateDeliveryConfirmation(payload) {
29
+ return this.httpClient.post(`${this.url}/delivery-confirmation/generate`, payload, {
30
+ headers: { appkey: this.environment.apiExternalOperationsKey }
31
+ }).pipe(map(({ data }) => data));
32
+ }
33
+ /**
34
+ * Confirms the completion of a delivery operation by making a PATCH request.
35
+ *
36
+ * @param {Object} input - The input parameters for the method.
37
+ * @param {string} input.operationId - The unique identifier of the delivery operation to be confirmed.
38
+ * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.
39
+ * @return {Observable<Object>} - An observable containing the response data from the API.
40
+ */
41
+ completedDeliveryConfirmation({ keyOTP, operationId, }) {
42
+ return this.httpClient.patch(`${this.url}/delivery-confirmation/completed/${keyOTP}`, null, {
43
+ headers: { appkey: this.environment.apiExternalOperationsKey },
44
+ params: { operation_id: operationId }
45
+ }).pipe(map(({ data }) => data));
46
+ }
47
+ /**
48
+ * Cancels a delivery confirmation by sending an OTP and additional data to the server.
49
+ *
50
+ * @param {Object} param0 - The parameter object containing the required properties.
51
+ * @param {string} param0.otp - The one-time password to authenticate the cancellation request.
52
+ * @param {Object} param0.body - Additional body data required for cancellation.
53
+ * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
54
+ */
55
+ cancelDeliveryConfirmation({ otp, ...body }) {
56
+ return this.httpClient.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body, {
57
+ headers: { appkey: this.environment.apiExternalOperationsKey },
58
+ }).pipe(map(({ data }) => data));
59
+ }
60
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
61
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, providedIn: 'root' });
62
+ }
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, decorators: [{
64
+ type: Injectable,
65
+ args: [{
66
+ providedIn: 'root'
67
+ }]
68
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
69
+ type: Inject,
70
+ args: ['env']
71
+ }] }] });
72
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLWV4dGVybmFsLXBpY2t1cHMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V4cGVydGVhbS1teC9uZ3gtc2VydmljZXMvc3JjL2xpYi9hcGlzL2FwaS1leHRlcm5hbC1waWNrdXBzLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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cclxuICAgIH1cclxuICAgIHBhY2thZ2VfZGV0YWlsOiB7XHJcbiAgICAgIHNoaXBtZW50X3RyYWNraW5nX251bWJlcjogc3RyaW5nXHJcbiAgICAgIHBpZWNlczoge1xyXG4gICAgICAgIHRyYWNraW5nX251bWJlcjogc3RyaW5nXHJcbiAgICAgICAgc3RhdHVzOiBzdHJpbmdcclxuICAgICAgfVtdXHJcbiAgICB9W11cclxuICB9XHJcbn1cclxuXHJcbmV4cG9ydCB0eXBlIENvbXBsZXRlRGVsaXZlcnlDb25maXJtYXRpb25JbiA9IHtcclxuICBvcGVyYXRpb25JZDogbnVtYmVyXHJcbiAga2V5T1RQOiBzdHJpbmdcclxufVxyXG5cclxuZXhwb3J0IHR5cGUgQ2FuY2VsRGVsaXZlcnlDb25maXJtYXRpb25JbiA9IHtcclxuICBzaWduYXR1cmU6IHtcclxuICAgIHN0YXR1czogc3RyaW5nXHJcbiAgICBvcGVyYXRpb25faWQ6IG51bWJlclxyXG4gICAgc2lnbmF0dXJlX2Jhc2VfNjQ6IHN0cmluZ1xyXG4gICAgbWltZV90eXBlOiBzdHJpbmdcclxuICB9XHJcbiAgb3RwPzogc3RyaW5nXHJcbn1cclxuIl19
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXNlcnZpY2VzLm1vZGVscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V4cGVydGVhbS1teC9uZ3gtc2VydmljZXMvc3JjL2xpYi9uZ3gtc2VydmljZXMubW9kZWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBFbnZpcm9ubWVudCA9IHtcclxuICBhcGlDb21wYW5pZXNVcmw6IHN0cmluZ1xyXG4gIGFwaUludm9pY2VzVXJsOiBzd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gICBkZWJ1Zz86IGJvb2xlYW5cclxuICAgIHBvcnQ6IG51bWJlclxyXG4gICAgdXJsOiBzdHJpbmdcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,115 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+ import Pusher from 'pusher-js';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export class WebSocketsService {
6
+ environments;
7
+ pusher;
8
+ constructor(environments) {
9
+ this.environments = environments;
10
+ this.pusher = null;
11
+ this.connect()
12
+ .then((pusher) => {
13
+ if (!pusher)
14
+ return;
15
+ this.pusher = pusher;
16
+ });
17
+ }
18
+ /**
19
+ * Publishes an event to the specified channel with the given data.
20
+ *
21
+ * @param {Channel} channel - The channel instance where the event will be published.
22
+ * @param {string} eventName - The name of the event to be published.
23
+ * @param {T} data - The payload data to be sent with the event.
24
+ * @return {Promise<boolean>} A promise that resolves to a boolean indicating
25
+ * whether the event was successfully triggered on the channel.
26
+ */
27
+ async pub(channel, eventName, data) {
28
+ return channel.trigger(`client-${eventName}`, data);
29
+ }
30
+ /**
31
+ * Subscribes to a specified channel, retrying multiple times upon failure.
32
+ *
33
+ * @param {string} channelName - The name of the channel to be subscribed to.
34
+ * @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.
35
+ * @throws {Error} If the subscription fails after the maximum number of retry attempts.
36
+ */
37
+ async channelSub(channelName) {
38
+ const attempts = 3;
39
+ for (let attempt = 0; attempt <= attempts; attempt++) {
40
+ const channel = this.pusher?.channel(channelName);
41
+ if (channel?.subscribed) {
42
+ return channel;
43
+ }
44
+ this.pusher?.subscribe(channelName);
45
+ if (attempt < attempts) {
46
+ await this.wait();
47
+ }
48
+ }
49
+ throw new Error(`Failed to subscribe to channel "${channelName}" after ${attempts} attempts.`);
50
+ }
51
+ /**
52
+ * Binds an event listener to a specified event on a given channel using Pusher or a Channel object,
53
+ * and returns an Observable that emits event data of type T.
54
+ *
55
+ * @param {Channel|string} channel - The channel to bind the event to. It can be a Channel object or a string representing the channel name.
56
+ * @param {string} event - The name of the event to bind to the channel.
57
+ * @return {Observable<T>} An Observable that emits data of type T when the specified event is triggered.
58
+ */
59
+ eventBind(channel, event) {
60
+ return new Observable((subscriber) => {
61
+ if (channel?.name) {
62
+ channel.bind(event, (data) => subscriber.next(data));
63
+ }
64
+ else {
65
+ this.pusher?.subscribe(channel)
66
+ .bind(event, (data) => subscriber.next(data));
67
+ }
68
+ });
69
+ }
70
+ /**
71
+ * Unbinds an event from the specified channel and returns an observable
72
+ * that emits data when the event callback is triggered.
73
+ *
74
+ * @param {Channel} channel - The channel object from which the event should be unbound.
75
+ * @param {string} event - The name of the event to unbind.
76
+ * @return {Observable<T>} An observable that emits data from the unbound event callback.
77
+ */
78
+ eventUnbind(channel, event) {
79
+ return new Observable((subscriber) => channel.unbind(event, (data) => subscriber.next(data)));
80
+ }
81
+ connect() {
82
+ return new Promise((resolve) => {
83
+ const { sockets } = this.environments;
84
+ if (!sockets)
85
+ return resolve(false);
86
+ const pusher = new Pusher(sockets.app_key, {
87
+ wsHost: sockets.url,
88
+ wsPort: sockets.port,
89
+ enabledTransports: ['wss', 'ws'],
90
+ forceTLS: false,
91
+ enableStats: false,
92
+ });
93
+ if (sockets.debug) {
94
+ Pusher.logToConsole = true;
95
+ }
96
+ return resolve(pusher);
97
+ });
98
+ }
99
+ async wait() {
100
+ const waitTime = 3 * 1000;
101
+ return new Promise((resolve) => setTimeout(resolve, waitTime));
102
+ }
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
104
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, providedIn: 'root' });
105
+ }
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, decorators: [{
107
+ type: Injectable,
108
+ args: [{
109
+ providedIn: 'root',
110
+ }]
111
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
112
+ type: Inject,
113
+ args: ['env']
114
+ }] }] });
115
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLXNvY2tldHMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V4cGVydGVhbS1teC9uZ3gtc2VydmljZXMvc3JjL2xpYi93ZWJzb2NrZXRzL3dlYi1zb2NrZXRzLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDbEQsT0FBTyxNQUFtQixNQUFNLFdBQVcsQ0FBQTtBQUMzQyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sTUFBTSxDQUFBOztBQU1qQyxNQUFNLE9BQU8saUJBQWlCO0lBSUg7SUFIakIsTUFBTSxDQUFlO0lBRTdCLFlBQ3lCLFlBQXlCO1FBQXpCLGlCQUFZLEdBQVosWUFBWSxDQUFhO1FBRWhELElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFBO1FBRWxCLElBQUksQ0FBQyxPQUFPLEVBQUU7YUFDWCxJQUFJLENBQUMsQ0FBQyxNQUFNLEVBQUUsRUFBRTtZQUNmLElBQUksQ0FBQyxNQUFNO2dCQUFFLE9BQU07WUFFbkIsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUE7UUFDdEIsQ0FBQyxDQUFDLENBQUE7SUFDTixDQUFDO0lBRUQ7Ozs7Ozs7O09BUUc7SUFDSCxLQUFLLENBQUMsR0FBRyxDQUFLLE9BQWdCLEVBQUUsU0FBaUIsRUFBRSxJQUFPO1FBQ3hELE9BQU8sT0FBTyxDQ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XNvbHZlLCB3YWl0VGltZSkpXHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -4,6 +4,7 @@
4
4
  export * from './lib/ngx-services.module';
5
5
  // api services
6
6
  export * from './lib/apis/api-companies.service';
7
+ export * from './lib/apis/api-external-pickups.service';
7
8
  export * from './lib/apis/api-invoices.service';
8
9
  export * from './lib/apis/api-open-items.service';
9
10
  export * from './lib/apis/api-reports.service';
@@ -12,6 +13,7 @@ export * from './lib/apis/api-shipments.service';
12
13
  // api models
13
14
  export * from './lib/apis/models/api-companies.interfaces';
14
15
  export * from './lib/apis/models/api-companies.types';
16
+ export * from './lib/apis/models/api-external-pickups.types';
15
17
  export * from './lib/apis/models/api-invoices.interfaces';
16
18
  export * from './lib/apis/models/api-invoices.types';
17
19
  export * from './lib/apis/models/api-open-items.interfaces';
@@ -21,12 +23,16 @@ export * from './lib/apis/models/api-security.interfaces';
21
23
  export * from './lib/apis/models/api-security.types';
22
24
  export * from './lib/apis/models/api-shipments.types';
23
25
  export * from './lib/apis/models/api.models';
26
+ // websockets
27
+ export * from './lib/websockets/web-sockets.service';
24
28
  // cypher
25
29
  export * from './lib/cypher/crypto.service';
26
30
  // interceptors
27
31
  export * from './lib/interceptors/api-headers.interceptor';
28
32
  export * from './lib/interceptors/api-token.interceptor';
29
33
  export * from './lib/interceptors/http-caching.interceptor';
34
+ // pusher
35
+ export * from 'pusher-js';
30
36
  // helpers
31
37
  export * from './lib/helpers/http';
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2V4cGVydGVhbS1teC9uZ3gtc2VydmljZXMvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxjQUFjLDJCQUEyQixDQUFBO0FBRXpDLGVBQWU7Q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1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9hcGlzL21vZGVscy9hcGktc2hpcG1lbnRzLnR5cGVzJ1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9hcGlzL21vZGVscy9hcGkubW9kZWxzJ1xyXG5cclxuLy8gd2Vic29ja2V0c1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi93ZWJzb2NrZXRzL3dlYi1zb2NrZXRzLnNlcnZpY2UnXHJcblxyXG4vLyBjeXBoZXJcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY3lwaGVyL2NyeXB0by5zZXJ2aWNlJ1xyXG5cclxuLy8gaW50ZXJjZXB0b3JzXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2ludGVyY2VwdG9ycy9hcGktaGVhZGVycy5pbnRlcmNlcHRvcidcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvaW50ZXJjZXB0b3JzL2FwaS10b2tlbi5pbnRlcmNlcHRvcidcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvaW50ZXJjZXB0b3JzL2h0dHAtY2FjaGluZy5pbnRlcmNlcHRvcidcclxuXHJcbi8vIHB1c2hlclxyXG5leHBvcnQgKiBmcm9tICdwdXNoZXItanMnXHJcblxyXG4vLyBoZWxwZXJzXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2hlbHBlcnMvaHR0cCdcclxuIl19
@@ -2,9 +2,11 @@ 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
4
  import { provideHttpClient, HttpParams, HttpHeaders, HttpResponse } from '@angular/common/http';
5
- import { map, mergeMap, forkJoin, tap, of } from 'rxjs';
5
+ import { map, mergeMap, forkJoin, tap, Observable, of } from 'rxjs';
6
+ import { map as map$1, tap as tap$1 } from 'rxjs/operators';
6
7
  import * as i1$1 from 'ngx-cookie-service';
7
- import { tap as tap$1 } from 'rxjs/operators';
8
+ import Pusher__default from 'pusher-js';
9
+ export * from 'pusher-js';
8
10
 
9
11
  class NgxServicesModule {
10
12
  /**
@@ -364,6 +366,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
364
366
  args: ['env']
365
367
  }] }, { type: i1.HttpClient }] });
366
368
 
369
+ class ApiExternalPickupsService {
370
+ httpClient;
371
+ environment;
372
+ constructor(httpClient, environment) {
373
+ this.httpClient = httpClient;
374
+ this.environment = environment;
375
+ }
376
+ /**
377
+ * Getter method to retrieve the API's external operations URL.
378
+ * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
379
+ * Defaults to an empty string if the property is undefined or null.
380
+ *
381
+ * @return {string} The external operations URL or an empty string if unavailable.
382
+ */
383
+ get url() {
384
+ return this.environment.apiExternalOperationsUrl ?? '';
385
+ }
386
+ /**
387
+ * Generates a delivery confirmation by sending the provided payload to the API.
388
+ *
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.
391
+ */
392
+ generateDeliveryConfirmation(payload) {
393
+ return this.httpClient.post(`${this.url}/delivery-confirmation/generate`, payload, {
394
+ headers: { appkey: this.environment.apiExternalOperationsKey }
395
+ }).pipe(map$1(({ data }) => data));
396
+ }
397
+ /**
398
+ * Confirms the completion of a delivery operation by making a PATCH request.
399
+ *
400
+ * @param {Object} input - The input parameters for the method.
401
+ * @param {string} input.operationId - The unique identifier of the delivery operation to be confirmed.
402
+ * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.
403
+ * @return {Observable<Object>} - An observable containing the response data from the API.
404
+ */
405
+ completedDeliveryConfirmation({ keyOTP, operationId, }) {
406
+ return this.httpClient.patch(`${this.url}/delivery-confirmation/completed/${keyOTP}`, null, {
407
+ headers: { appkey: this.environment.apiExternalOperationsKey },
408
+ params: { operation_id: operationId }
409
+ }).pipe(map$1(({ data }) => data));
410
+ }
411
+ /**
412
+ * Cancels a delivery confirmation by sending an OTP and additional data to the server.
413
+ *
414
+ * @param {Object} param0 - The parameter object containing the required properties.
415
+ * @param {string} param0.otp - The one-time password to authenticate the cancellation request.
416
+ * @param {Object} param0.body - Additional body data required for cancellation.
417
+ * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
418
+ */
419
+ cancelDeliveryConfirmation({ otp, ...body }) {
420
+ return this.httpClient.put(`${this.url}/delivery-confirmation/confirmation/${otp}`, body, {
421
+ headers: { appkey: this.environment.apiExternalOperationsKey },
422
+ }).pipe(map$1(({ data }) => data));
423
+ }
424
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
425
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, providedIn: 'root' });
426
+ }
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiExternalPickupsService, decorators: [{
428
+ type: Injectable,
429
+ args: [{
430
+ providedIn: 'root'
431
+ }]
432
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
433
+ type: Inject,
434
+ args: ['env']
435
+ }] }] });
436
+
367
437
  class ApiInvoicesService {
368
438
  environments;
369
439
  http;
@@ -852,6 +922,117 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
852
922
  args: ['env']
853
923
  }] }, { type: i1.HttpClient }] });
854
924
 
925
+ class WebSocketsService {
926
+ environments;
927
+ pusher;
928
+ constructor(environments) {
929
+ this.environments = environments;
930
+ this.pusher = null;
931
+ this.connect()
932
+ .then((pusher) => {
933
+ if (!pusher)
934
+ return;
935
+ this.pusher = pusher;
936
+ });
937
+ }
938
+ /**
939
+ * Publishes an event to the specified channel with the given data.
940
+ *
941
+ * @param {Channel} channel - The channel instance where the event will be published.
942
+ * @param {string} eventName - The name of the event to be published.
943
+ * @param {T} data - The payload data to be sent with the event.
944
+ * @return {Promise<boolean>} A promise that resolves to a boolean indicating
945
+ * whether the event was successfully triggered on the channel.
946
+ */
947
+ async pub(channel, eventName, data) {
948
+ return channel.trigger(`client-${eventName}`, data);
949
+ }
950
+ /**
951
+ * Subscribes to a specified channel, retrying multiple times upon failure.
952
+ *
953
+ * @param {string} channelName - The name of the channel to be subscribed to.
954
+ * @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.
955
+ * @throws {Error} If the subscription fails after the maximum number of retry attempts.
956
+ */
957
+ async channelSub(channelName) {
958
+ const attempts = 3;
959
+ for (let attempt = 0; attempt <= attempts; attempt++) {
960
+ const channel = this.pusher?.channel(channelName);
961
+ if (channel?.subscribed) {
962
+ return channel;
963
+ }
964
+ this.pusher?.subscribe(channelName);
965
+ if (attempt < attempts) {
966
+ await this.wait();
967
+ }
968
+ }
969
+ throw new Error(`Failed to subscribe to channel "${channelName}" after ${attempts} attempts.`);
970
+ }
971
+ /**
972
+ * Binds an event listener to a specified event on a given channel using Pusher or a Channel object,
973
+ * and returns an Observable that emits event data of type T.
974
+ *
975
+ * @param {Channel|string} channel - The channel to bind the event to. It can be a Channel object or a string representing the channel name.
976
+ * @param {string} event - The name of the event to bind to the channel.
977
+ * @return {Observable<T>} An Observable that emits data of type T when the specified event is triggered.
978
+ */
979
+ eventBind(channel, event) {
980
+ return new Observable((subscriber) => {
981
+ if (channel?.name) {
982
+ channel.bind(event, (data) => subscriber.next(data));
983
+ }
984
+ else {
985
+ this.pusher?.subscribe(channel)
986
+ .bind(event, (data) => subscriber.next(data));
987
+ }
988
+ });
989
+ }
990
+ /**
991
+ * Unbinds an event from the specified channel and returns an observable
992
+ * that emits data when the event callback is triggered.
993
+ *
994
+ * @param {Channel} channel - The channel object from which the event should be unbound.
995
+ * @param {string} event - The name of the event to unbind.
996
+ * @return {Observable<T>} An observable that emits data from the unbound event callback.
997
+ */
998
+ eventUnbind(channel, event) {
999
+ return new Observable((subscriber) => channel.unbind(event, (data) => subscriber.next(data)));
1000
+ }
1001
+ connect() {
1002
+ return new Promise((resolve) => {
1003
+ const { sockets } = this.environments;
1004
+ if (!sockets)
1005
+ return resolve(false);
1006
+ const pusher = new Pusher__default(sockets.app_key, {
1007
+ wsHost: sockets.url,
1008
+ wsPort: sockets.port,
1009
+ enabledTransports: ['wss', 'ws'],
1010
+ forceTLS: false,
1011
+ enableStats: false,
1012
+ });
1013
+ if (sockets.debug) {
1014
+ Pusher__default.logToConsole = true;
1015
+ }
1016
+ return resolve(pusher);
1017
+ });
1018
+ }
1019
+ async wait() {
1020
+ const waitTime = 3 * 1000;
1021
+ return new Promise((resolve) => setTimeout(resolve, waitTime));
1022
+ }
1023
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1024
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, providedIn: 'root' });
1025
+ }
1026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: WebSocketsService, decorators: [{
1027
+ type: Injectable,
1028
+ args: [{
1029
+ providedIn: 'root',
1030
+ }]
1031
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1032
+ type: Inject,
1033
+ args: ['env']
1034
+ }] }] });
1035
+
855
1036
  class CryptoService {
856
1037
  environments;
857
1038
  constructor(environments) {
@@ -1070,5 +1251,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
1070
1251
  * Generated bundle index. Do not edit.
1071
1252
  */
1072
1253
 
1073
- export { ApiCompaniesService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, httpParams, pdfHeaders, queryString, xmlHeaders };
1254
+ export { ApiCompaniesService, ApiExternalPickupsService, ApiHeadersInterceptor, ApiInvoicesService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiShipmentsService, ApiTokenInterceptor, CryptoService, HttpCachingInterceptor, NgxServicesModule, WebSocketsService, httpParams, pdfHeaders, queryString, xmlHeaders };
1074
1255
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"experteam-mx-ngx-services.mjs","sources":["../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.module.ts","../../../../projects/experteam-mx/ngx-services/src/lib/helpers/http.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-companies.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-invoices.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-open-items.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-reports.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-security.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-shipments.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/cypher/crypto.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-headers.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-token.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/http-caching.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/public-api.ts","../../../../projects/experteam-mx/ngx-services/src/experteam-mx-ngx-services.ts"],"sourcesContent":["import { ModuleWithProviders, NgModule } from '@angular/core'\r\nimport { Environment } from './ngx-services.models'\r\nimport { provideHttpClient } from '@angular/common/http'\r\n\r\n@NgModule({\r\n providers: [provideHttpClient()]\r\n})\r\nexport class NgxServicesModule {\r\n /**\r\n * Returns a module with providers for the NgxServicesModule.\r\n *\r\n * @param {Environment} environment - The environment configuration object.\r\n *\r\n * @return {ModuleWithProviders<NgxServicesModule>} The module with providers for the NgxServicesModule.\r\n */\r\n public static forRoot (environment: Environment): ModuleWithProviders<NgxServicesModule> {\r\n return {\r\n ngModule: NgxServicesModule,\r\n providers: [\r\n {\r\n provide: 'env',\r\n useValue: environment\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n","import { HttpHeaders, HttpParams } from '@angular/common/http'\r\nimport { QueryParams } from '../apis/models/api.models'\r\n\r\n/**\r\n * Convert an object of key-value pairs into a URL query string.\r\n *\r\n * @param {Object} params - The key-value pairs to converted into a query string.\r\n *\r\n * @return {string} - The generated query string.\r\n */\r\nexport const queryString = (params: QueryParams): string => {\r\n const queryElements: string[] = []\r\n\r\n Object.entries(params).forEach(([key, value]) => {\r\n if (Array.isArray(value)) {\r\n const arrayQuery = value\r\n .map((item) => `${encodeURIComponent(key)}=${encodeURIComponent(item as string | number | boolean)}`)\r\n .join('&')\r\n\r\n queryElements.push(arrayQuery)\r\n } else {\r\n const encodedQuery = `${encodeURIComponent(key)}=${encodeURIComponent(value as string | number | boolean)}`\r\n\r\n queryElements.push(encodedQuery)\r\n }\r\n })\r\n\r\n const queryString = queryElements.join('&')\r\n\r\n return queryString.length ? `?${queryString}` : ''\r\n}\r\n\r\n/**\r\n * Creates an instance of HttpParams using the provided params object.\r\n *\r\n * @param {Object} params - The object containing the params to the HttpParams constructor.\r\n *\r\n * @returns {HttpParams} - An instance of HttpParams created from the params object.\r\n */\r\nexport const httpParams = (\r\n params: QueryParams\r\n): HttpParams => new HttpParams({\r\n fromObject: params\r\n})\r\n\r\n/**\r\n * Returns the headers for generating PDF files.\r\n *\r\n * @param {string} format - The format of the headers, 'object' or 'http_header'.\r\n *\r\n * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating PDF files.\r\n */\r\nexport const pdfHeaders = (format: 'object' | 'http_header' = 'object'): HttpHeaders | { [header: string]: string | string[] } => {\r\n const headers = {\r\n Accept: 'application/pdf'\r\n }\r\n\r\n return format === 'object'\r\n ? headers\r\n : new HttpHeaders(headers)\r\n}\r\n\r\n/**\r\n * Returns the headers for generating XML files.\r\n *\r\n * @param {string} format - The format of the headers, 'object' or 'http_header'.\r\n *\r\n * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating XML files.\r\n */\r\nexport const xmlHeaders = (format: 'object' | 'http_header' = 'object'): HttpHeaders | { [header: string]: string | string[] } => {\r\n const headers = {\r\n Accept: 'application/xml',\r\n }\r\n\r\n return format === 'object'\r\n ? headers\r\n : new HttpHeaders(headers)\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport {\r\n AccountEntitiesOut,\r\n CompanyCountriesOut,\r\n CompanyCountryOut,\r\n CompanyCountryTaxesOut,\r\n CountryExchangesOut,\r\n CountryReferenceCurrenciesOut,\r\n CountryReferenceOut,\r\n CountryReferencesOut,\r\n EmployeeOut,\r\n EmployeesOut,\r\n ExchangesOut,\r\n InstallationOut,\r\n InstallationsOut,\r\n LocationEmployeesOut,\r\n LocationOut,\r\n LocationsOut,\r\n ParametersIn,\r\n ParametersOut,\r\n ParameterValueIn,\r\n ParameterValueOut,\r\n SupplyEntitiesOut,\r\n WorkflowsOut\r\n} from './models/api-companies.types'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { forkJoin, map, mergeMap, Observable } from 'rxjs'\r\nimport { httpParams } from '../helpers/http'\r\nimport { CountryCurrencyRate } from './models/api-companies.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiCompaniesService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the companies API from the environment configurations.\r\n *\r\n * @return {string} The URL of the companies API.\r\n */\r\n get url (): string {\r\n return this.environments.apiCompaniesUrl\r\n }\r\n\r\n /**\r\n * Fetches the installations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters used to filter the installations query.\r\n * @return {Observable<InstallationsOut>} An observable that emits the installation's data.\r\n */\r\n getInstallations (params: QueryParams): Observable<InstallationsOut> {\r\n return this.http.get<ApiSuccess<InstallationsOut>>(`${this.url}/installations`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the installation details based on the given installation ID.\r\n *\r\n * @param {number} id - The unique identifier of the installation to retrieve.\r\n * @returns {Observable<InstallationOut>} An observable of the installation details.\r\n */\r\n getInstallation (id: number): Observable<InstallationOut> {\r\n return this.http.get<ApiSuccess<InstallationOut>>(`${this.url}/installations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of locations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to use for querying locations.\r\n * @return {Observable<LocationsOut>} An observable that emits the location's data.\r\n */\r\n getLocations (params: QueryParams): Observable<LocationsOut> {\r\n return this.http.get<ApiSuccess<LocationsOut>>(`${this.url}/locations`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the location details for a given location ID.\r\n *\r\n * @param {number} id - The unique identifier of the location.\r\n * @return {Observable<LocationOut>} An Observable containing the location details.\r\n */\r\n getLocation (id: number): Observable<LocationOut> {\r\n return this.http.get<ApiSuccess<LocationOut>>(`${this.url}/locations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of active supply entities.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter supply entities.\r\n * @return {Observable<SupplyEntitiesOut>} Observable emitting supply entities data.\r\n */\r\n getSupplyEntitiesActive (params: QueryParams): Observable<SupplyEntitiesOut> {\r\n return this.http.get<ApiSuccess<SupplyEntitiesOut>>(`${this.url}/supply-entities/actives`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of employees based on the specified query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to filter and sort the employees.\r\n * @return {Observable<EmployeesOut>} An observable that emits the list of employees.\r\n */\r\n getEmployees (params: QueryParams): Observable<EmployeesOut> {\r\n return this.http.get<ApiSuccess<EmployeesOut>>(`${this.url}/employees`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches an employee's details based on the provided employee ID.\r\n *\r\n * @param {number} id - The unique identifier of the employee.\r\n * @return {Observable<EmployeeOut>} An observable that emits the employee's details.\r\n */\r\n getEmployee (id: number): Observable<EmployeeOut> {\r\n return this.http.get<ApiSuccess<EmployeeOut>>(`${this.url}/employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of employees for a specified location based on provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter and retrieve the location employees.\r\n * @returns {Observable<LocationEmployeesOut>} An observable that emits the list of employees for the specified location.\r\n */\r\n getLocationEmployees (params: QueryParams): Observable<LocationEmployeesOut> {\r\n return this.http.get<ApiSuccess<LocationEmployeesOut>>(`${this.url}/location-employees`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of countries where the company operates.\r\n *\r\n * @param {QueryParams} params - The query parameters for the API request.\r\n * @return {Observable<CompanyCountriesOut>} An observable containing the list of company countries.\r\n */\r\n getCompanyCountries (params: QueryParams): Observable<CompanyCountriesOut> {\r\n return this.http.get<ApiSuccess<CompanyCountriesOut>>(`${this.url}/company-countries`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the country information for a specified company by its ID.\r\n *\r\n * @param {number} id - The unique identifier of the company.\r\n * @return {Observable<CompanyCountryOut>} An observable containing the country information of the company.\r\n */\r\n getCompanyCountry (id: number): Observable<CompanyCountryOut> {\r\n return this.http.get<ApiSuccess<CompanyCountryOut>>(`${this.url}/company-countries/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the reference currencies for a given country.\r\n *\r\n * @param {QueryParams} params - The query parameters to include in the request.\r\n * @return {Observable<CountryReferenceCurrenciesOut>} The observable containing the country reference currencies data.\r\n */\r\n getCountryReferenceCurrencies (params: QueryParams): Observable<CountryReferenceCurrenciesOut> {\r\n return this.http.get<ApiSuccess<CountryReferenceCurrenciesOut>>(\r\n `${this.url}/country-reference-currencies`,\r\n { params }\r\n ).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of currencies for different countries along with their current exchange rates.\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the country reference currencies.\r\n * @return {Observable<CountryCurrencyRate[]>} An observable that emits an array of country currency rates.\r\n */\r\n getCountryCurrenciesWithRate (params: QueryParams): Observable<CountryCurrencyRate[]> {\r\n return this.getCountryReferenceCurrencies(params)\r\n .pipe(mergeMap((currenciesData) => {\r\n const $observables = currenciesData.country_reference_currencies\r\n .map((item) =>\r\n this.getCurrentExchanges({\r\n currency_id: item.currency.id,\r\n }).pipe(\r\n map((exchangesData) => ({\r\n ...item,\r\n rate: exchangesData.exchanges[0]?.value,\r\n }))\r\n )\r\n )\r\n\r\n return forkJoin($observables)\r\n }))\r\n }\r\n\r\n /**\r\n * Fetches exchange data based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters for retrieving exchange data.\r\n * @return {Observable<CountryExchangesOut>} An observable containing the exchange data.\r\n */\r\n getExchanges (params: QueryParams): Observable<CountryExchangesOut> {\r\n return this.http.get<ApiSuccess<CountryExchangesOut>>(`${this.url}/exchanges`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the current exchanges based on the given query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the exchanges.\r\n *\r\n * @returns {Observable<ExchangesOut>} - An observable that emits the API response data containing the current exchanges.\r\n */\r\n getCurrentExchanges (params: QueryParams): Observable<ExchangesOut> {\r\n return this.http.get<ApiSuccess<ExchangesOut>>(`${this.url}/exchanges/current`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the country-specific tax information for a company.\r\n *\r\n * @param {QueryParams} params - The parameters used to filter and query the taxes.\r\n * @return {Observable<CompanyCountryTaxesOut>} An observable that emits the tax information.\r\n */\r\n getCompanyCountryTaxes (params: QueryParams): Observable<CompanyCountryTaxesOut> {\r\n return this.http.get<ApiSuccess<CompanyCountryTaxesOut>>(`${this.url}/company-country-taxes`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of active account entities based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to filter and query active account entities.\r\n * @return {Observable<AccountEntitiesOut>} An observable that emits the list of active account entities.\r\n */\r\n getActiveAccountEntities (params: QueryParams): Observable<AccountEntitiesOut> {\r\n return this.http.get<ApiSuccess<AccountEntitiesOut>>(`${this.url}/account-entities/actives`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the parameter values based on the provided parameter names.\r\n *\r\n * @param {Object} params - An object containing the required parameters.\r\n * @param {string[]} params.paramNames - An array of parameter names for which the values need to be fetched.\r\n * @return {Observable<ParametersOut>} An observable that emits the fetched parameter values.\r\n */\r\n getParameters ({\r\n paramNames,\r\n }: ParametersIn): Observable<ParametersOut> {\r\n const parameters = paramNames.map((p) => ({ name: p }))\r\n\r\n return this.http.post<ApiSuccess<ParametersOut>>(`${this.url}/parameters-values`, {\r\n parameters\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the value of a specified parameter.\r\n *\r\n * @param {Object} input - The input object containing the parameter details.\r\n * @param {string} input.paramName - The name of the parameter whose value is to be retrieved.\r\n * @return {Observable<ParameterValueOut>} An observable emitting the value of the specified parameter.\r\n */\r\n getParameterValue ({\r\n paramName,\r\n }: ParameterValueIn): Observable<ParameterValueOut> {\r\n return this.http.get<ApiSuccess<ParameterValueOut>>(`${this.url}/parameters-values/${paramName}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of country references based on the given query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters for retrieving country references.\r\n * @return {Observable<CountryReferencesOut>} An observable containing the country reference data.\r\n */\r\n getCountryReferences (params: QueryParams): Observable<CountryReferencesOut> {\r\n return this.http.get<ApiSuccess<CountryReferencesOut>>(`${this.url}/country-references`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the country reference data for a given country ID.\r\n *\r\n * @param {number} id - The unique identifier of the country for which the reference data is to be retrieved.\r\n * @return {Observable<CountryReferenceOut>} An observable containing the country reference data.\r\n */\r\n getCountryReference (id: number): Observable<CountryReferenceOut> {\r\n return this.http.get<ApiSuccess<CountryReferenceOut>>(`${this.url}/country-references/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the list of workflows based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter workflows.\r\n * @return {Observable<WorkflowsOut>} An observable containing the workflow data.\r\n */\r\n getWorkflows (params: QueryParams): Observable<WorkflowsOut> {\r\n return this.http.get<ApiSuccess<WorkflowsOut>>(`${this.url}/workflows`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http'\r\nimport { Inject, Injectable } from '@angular/core'\r\nimport { map, Observable } from 'rxjs'\r\nimport { Environment } from '../ngx-services.models'\r\nimport {\r\n AccountPaymentOperationIn,\r\n AccountPaymentOperationOut,\r\n CancelBillingIn,\r\n CancelPaymentReceiptIn,\r\n CollectionReceiptOut,\r\n OperationDocumentIn,\r\n OperationDocumentOut\r\n} from './models/api-invoices.types'\r\nimport { ApiSuccess } from './models/api.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiInvoicesService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the API URL for invoices from the environments configuration.\r\n *\r\n * @return {string} The API URL for invoices.\r\n */\r\n get url (): string {\r\n return this.environments.apiInvoicesUrl\r\n }\r\n\r\n /**\r\n * Sends an operation document to the server and processes the response.\r\n *\r\n * @param {OperationDocumentIn} body - The input data for the operation document.\r\n * @return {Observable<OperationDocumentOut>} An observable containing the processed operation document output.\r\n */\r\n operationDocument (body: OperationDocumentIn): Observable<OperationDocumentOut> {\r\n return this.http.post<ApiSuccess<OperationDocumentOut>>(`${this.url}/operation/document`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches and returns the collection receipt data for a given collection ID.\r\n *\r\n * @param {number} id - The unique identifier of the collection for which the receipt needs to be retrieved.\r\n * @return {Observable<CollectionReceiptOut>} An observable containing the collection receipt data.\r\n */\r\n printCollectionReceipt (id: number): Observable<CollectionReceiptOut> {\r\n return this.http.get<ApiSuccess<CollectionReceiptOut>>(`${this.url}/operation/print/collection-receipt/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Handles the account payment operation by sending a POST request to the specified endpoint.\r\n * Processes the response and returns the operation data.\r\n *\r\n * @param {AccountPaymentOperationIn} body The payload containing information for the account payment operation.\r\n * @return {Observable<AccountPaymentOperationOut>} An observable emitting the processed account payment operation data.\r\n */\r\n accountPaymentOperation (body: AccountPaymentOperationIn): Observable<AccountPaymentOperationOut> {\r\n return this.http.post<ApiSuccess<AccountPaymentOperationOut>>(`${this.url}/operation/account-payment`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Cancels a payment receipt based on the provided input.\r\n * This method sends a POST request to cancel a document.\r\n *\r\n * @param body The data required to cancel the payment receipt, encapsulated in a CancelPaymentReceiptIn object.\r\n * @return An Observable representing the result of the cancellation. Emits an empty object on success.\r\n */\r\n cancelPaymentReceipt (body: CancelPaymentReceiptIn): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/operation/cancel-document`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Cancels an invoice based on the provided invoice ID and additional parameters.\r\n *\r\n * @param {Object} parameters - The parameters required to cancel the invoice, encapsulated in a CancelBillingIn object.\r\n * @return {Observable<Object>} An observable that emits the response of the cancellation operation.\r\n */\r\n cancelInvoice ({ invoiceId, ...body }: CancelBillingIn): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/operation/cancel-billing/${invoiceId}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n OpenItemsOut,\r\n PaymentOpenItemOut,\r\n PaymentOtherInvoiceOut\r\n} from './models/api-open-items.types'\r\nimport { map, Observable } from 'rxjs'\r\nimport { PaymentOpenItemIn, PaymentOtherInvoiceIn } from './models/api-open-items.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiOpenItemsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) {}\r\n\r\n /**\r\n * Retrieves the API URL for open-items from the environments' configuration.\r\n *\r\n * @return {string} The API URL for open-items.\r\n */\r\n get url (): string {\r\n return this.environments.apiOpenItemsUrl\r\n }\r\n\r\n /**\r\n * Retrieves a list of open-items based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to use for querying open-items.\r\n * @return {Observable<OpenItemsOut>} An observable that emits the open-item's data.\r\n */\r\n getOpenItems (params: QueryParams): Observable<OpenItemsOut> {\r\n return this.http.get<ApiSuccess<OpenItemsOut>>(`${this.url}/open-items`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Processes a payment for an open item.\r\n *\r\n * @param {PaymentOpenItemIn} body - The payment details for the open item.\r\n * @return {Observable<PaymentOpenItemOut>} An observable that emits the result of the payment processing.\r\n */\r\n paymentOpenItem (body: PaymentOpenItemIn): Observable<PaymentOpenItemOut> {\r\n return this.http.post<ApiSuccess<PaymentOpenItemOut>>(`${this.url}/payment`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Processes a payment for other invoice.\r\n *\r\n * @param {PaymentOtherInvoiceIn} body - The payment details for the other invoice.\r\n * @return {Observable<PaymentOtherInvoiceOut>} An observable that emits the result of the payment processing.\r\n */\r\n paymentOtherInvoice (body: PaymentOtherInvoiceIn): Observable<PaymentOtherInvoiceOut> {\r\n return this.http.post<ApiSuccess<PaymentOtherInvoiceOut>>(`${this.url}/other-invoices`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { map, Observable } from 'rxjs'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n CollectionPaymentsOut,\r\n ExistPendingInvoicesIn,\r\n ExistPendingPaymentsIn,\r\n ShipmentsReportOut\r\n} from './models/api-reports.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiReportsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the reports API from the environment configurations.\r\n *\r\n * @return {string} The URL of the reports API.\r\n */\r\n get url (): string {\r\n return this.environments.apiReportsUrl\r\n }\r\n\r\n /**\r\n * Retrieves the list of collection payments\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the collection payments.\r\n * @return {Observable<CollectionPaymentsOut[]>} An observable that emits an array of collection payment.\r\n */\r\n getCollectionPayments (params: QueryParams): Observable<CollectionPaymentsOut> {\r\n return this.http.get<ApiSuccess<CollectionPaymentsOut>>(`${this.url}/collection-payment`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the list of shipments with pending payments.\r\n *\r\n * @param {ExistPendingPaymentsIn} params - The parameters to filter pending payment shipments.\r\n * @return {Observable<ShipmentsReportOut>} An observable emitting the shipments report data.\r\n */\r\n shipmentsPendingPayments (params: ExistPendingPaymentsIn): Observable<ShipmentsReportOut> {\r\n return this.http.get<ApiSuccess<ShipmentsReportOut>>(`${this.url}/shipments-report`, {\r\n params: {\r\n ...params,\r\n limit: 1,\r\n offset: 0,\r\n to_landing: true,\r\n shipment_status_code: 'PMPEN',\r\n },\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches shipment reports that are pending invoices based on the specified parameters.\r\n * This method retrieves a filtered list of shipments with pending invoice statuses.\r\n *\r\n * @param {ExistPendingInvoicesIn} params - The parameters to filter the pending invoices, including\r\n * shipment status codes, and pagination options.\r\n * @return {Observable<ShipmentsReportOut>} An observable that emits the shipment report data based on the filter criteria.\r\n */\r\n shipmentsPendingInvoices (params: ExistPendingInvoicesIn): Observable<ShipmentsReportOut> {\r\n return this.http.get<ApiSuccess<ShipmentsReportOut>>(`${this.url}/shipments-report`, {\r\n params: {\r\n ...params,\r\n limit: 1,\r\n offset: 0,\r\n to_landing: true,\r\n 'shipment_status_code[in]': 'IPMPE,IMPEN,IPPEN',\r\n },\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n ChangeLanguageIn,\r\n CreateSessionIn,\r\n CreateSessionOut,\r\n GetUserOut,\r\n LoginIn,\r\n LoginOut,\r\n MeOut,\r\n ModulePermissionsOut,\r\n RoleByIdOut,\r\n RolePermissionsIn,\r\n RolesOut,\r\n RoleTypesOut\r\n} from './models/api-security.types'\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { map, Observable, tap } from 'rxjs'\r\nimport { CookieService } from 'ngx-cookie-service'\r\nimport { ModulesOut } from './models/api-security.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiSecurityService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private cookie: CookieService,\r\n private http: HttpClient\r\n ) {}\r\n\r\n /**\r\n * Retrieves the API security URL from the environments configuration.\r\n *\r\n * @return {string} The API security URL.\r\n */\r\n get url (): string {\r\n return this.environments.apiSecurityUrl\r\n }\r\n\r\n /**\r\n * Authenticates a user with the provided credentials and role.\r\n *\r\n * @param {Object} param0 - The login input object.\r\n * @param {string} param0.username - The username of the user.\r\n * @param {string} param0.password - The password of the user.\r\n * @param {string} param0.role - The role of the user.\r\n * @return {Observable<LoginOut>} An observable emitting the login output object.\r\n */\r\n login ({\r\n username,\r\n password,\r\n role,\r\n }: LoginIn): Observable<LoginOut> {\r\n return this.http.post<ApiSuccess<LoginOut>>(`${this.url}/auth/login`, {\r\n system_name: 'CRA',\r\n username,\r\n password,\r\n role,\r\n }).pipe(\r\n map(({ data }) => data),\r\n tap(({ access_token }) => this.cookie.set(this.environments.authCookie, access_token, { path: '/' }))\r\n )\r\n }\r\n\r\n /**\r\n * Logs out the current user by making a POST request to the logout endpoint.\r\n *\r\n * This method deletes all cookies after a successful logout.\r\n *\r\n * @return {Observable<{}>} An observable that emits the server's response to the logout request.\r\n */\r\n logout (): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/auth/logout`, null)\r\n .pipe(\r\n map(({ data }) => data),\r\n tap(() => this.cookie.delete(this.environments.authCookie, '/'))\r\n )\r\n }\r\n\r\n /**\r\n * Creates a new session for a specified model.\r\n *\r\n * @param {Object} params - The parameters for creating the session.\r\n * @param {string} params.modelType - The type of the model.\r\n * @param {string} params.modelId - The ID of the model.\r\n * @param {string} [params.token] - Optional authorization token.\r\n *\r\n * @return {Observable<CreateSessionOut>} An observable containing the created session details.\r\n */\r\n createSession ({\r\n modelType,\r\n modelId,\r\n token,\r\n }: CreateSessionIn): Observable<CreateSessionOut> {\r\n let headers = new HttpHeaders({})\r\n\r\n if (token) { headers = headers.set('Authorization', `Bearer ${token}`) }\r\n\r\n return this.http.post<ApiSuccess<CreateSessionOut>>(\r\n `${this.url}/sessions`, {\r\n model_type: modelType,\r\n model_id: modelId,\r\n }, {\r\n headers\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the authenticated user's information.\r\n * Sends a GET request to the endpoint '/auth/me' to retrieve information\r\n * about the currently authenticated user.\r\n *\r\n * @return {Observable<MeOut>} An observable that emits the authenticated user's data.\r\n */\r\n me (): Observable<MeOut> {\r\n return this.http.get<ApiSuccess<MeOut>>(`${this.url}/auth/me`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the authenticated user's details from the server.\r\n *\r\n * @param token The JWT token used for authorization.\r\n * @return An Observable that emits the user's details encapsulated in a MeOut object.\r\n */\r\n otherMe (token: string): Observable<MeOut> {\r\n return this.http.get<ApiSuccess<MeOut>>(`${this.url}/auth/me`, {\r\n headers: {\r\n Authorization: `Bearer ${token}`\r\n }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a user by their unique ID.\r\n *\r\n * @param {number} id - The unique identifier of the user to be fetched.\r\n * @return {Observable<GetUserOut>} An observable containing the user information.\r\n */\r\n user (id: number): Observable<GetUserOut> {\r\n return this.http.get<ApiSuccess<GetUserOut>>(`${this.url}/users/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Changes the language for the authenticated user.\r\n *\r\n * @param {Object} params - The input parameters for changing the language.\r\n * @param {string} params.languageId - The ID of the new language to be set.\r\n * @return {Observable<ApiSuccess<MeOut>>} An observable that emits the result of the language change request.\r\n */\r\n changeLanguage ({\r\n languageId\r\n }: ChangeLanguageIn): Observable<MeOut> {\r\n return this.http.put<ApiSuccess<MeOut>>(`${this.url}/auth/me`, {\r\n language_id: languageId\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of roles with their permissions.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the roles.\r\n * @returns {Observable<RolePermissionsIn[]>} An observable that emits an array of role permissions.\r\n */\r\n getRoles(params: QueryParams): Observable<RolesOut> {\r\n return this.http.get<ApiSuccess<RolesOut>>(`${this.url}/roles`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the role types from the API.\r\n *\r\n * @param {QueryParams} params - The query parameters to be sent with the request.\r\n * @returns {Observable<RoleTypesOut>} An observable containing the role types output.\r\n */\r\n getRoleTypes (params: QueryParams): Observable<RoleTypesOut> {\r\n return this.http.get<ApiSuccess<RoleTypesOut>>(`${this.url}/role-types`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the permissions for a module.\r\n *\r\n * @param {QueryParams} params - The query parameters to be sent with the request.\r\n * @returns {Observable<ModulePermissionsOut>} An observable containing the module permissions.\r\n */\r\n getPermissions (params: QueryParams): Observable<ModulePermissionsOut> {\r\n return this.http.get<ApiSuccess<ModulePermissionsOut>>(`${this.url}/modules`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves roles by the specified ID.\r\n *\r\n * @param params - The ID of the role to retrieve.\r\n * @returns An Observable that emits the role data.\r\n */\r\n getRolesById (params: number): Observable<RoleByIdOut> {\r\n return this.http.get<ApiSuccess<RoleByIdOut>>(`${this.url}/roles/${params}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Creates a new role with the specified permissions.\r\n *\r\n * @param {RolePermissionsIn} body - The permissions and details for the new role.\r\n * @returns {Observable<ModulePermissionsOut>} An observable containing the created role's permissions.\r\n */\r\n createRole (body: RolePermissionsIn): Observable<ModulePermissionsOut> {\r\n return this.http.post<ApiSuccess<ModulePermissionsOut>>(`${this.url}/roles`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the permissions of a specific role.\r\n *\r\n * @param id - The unique identifier of the role to update.\r\n * @param body - The new permissions to assign to the role.\r\n * @returns An Observable that emits the updated module permissions.\r\n */\r\n updateRolePermissions (id: number, body: RolePermissionsIn): Observable<ModulePermissionsOut> {\r\n return this.http.put<ApiSuccess<ModulePermissionsOut>>(`${this.url}/roles/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes the permissions associated with a specific role.\r\n *\r\n * @param {number} id - The unique identifier of the role whose permissions are to be deleted.\r\n * @returns {Observable<{}>} An observable that emits the result of the delete operation.\r\n */\r\n deleteRolePermissions (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/roles/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of modules and permissions\r\n *\r\n * @param queryParams - The query parameters to filter the modules.\r\n * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.\r\n */\r\n getModules (queryParams: QueryParams): Observable<ModulesOut> {\r\n return this.http.get<ApiSuccess<ModulesOut>>(`${this.url}/modules`, {\r\n params: queryParams\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of modules and permissions\r\n *\r\n * @param params.token - Custom token for authorization.\r\n * @param params.queryParams - The query parameters to filter the modules.\r\n * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.\r\n */\r\n getModulesToken (params: {\r\n token: string,\r\n queryParams: QueryParams\r\n }): Observable<ModulesOut> {\r\n return this.http.get<ApiSuccess<ModulesOut>>(`${this.url}/modules`, {\r\n params: params.queryParams,\r\n headers: {\r\n Authorization: `Bearer ${params.token}`\r\n }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http'\r\nimport { Inject, Injectable } from '@angular/core'\r\nimport { map, Observable } from 'rxjs'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { ManifestMultipleIn, ManifestMultipleOut, ValidateAccountIn, ValidateAccountOut } from './models/api-shipments.types'\r\nimport { ApiSuccess } from './models/api.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiShipmentsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the shipments API from the environment configurations.\r\n *\r\n * @return {string} The URL of the shipments API.\r\n */\r\n get url (): string {\r\n return this.environments.apiShipmentUrl\r\n }\r\n\r\n /**\r\n * Retrieves the parameter values based on the provided parameter names.\r\n *\r\n * @param {ValidateAccountIn} body - An object of parameter names for which the values need to be fetched.\r\n * @return {Observable<ValidateAccountIn>} An observable that emits the fetched parameter values\r\n * @param body\r\n */\r\n validateAccount (body: ValidateAccountIn): Observable<ValidateAccountOut> {\r\n return this.http.post<ApiSuccess<ValidateAccountOut>>(`${this.url}/accounts`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to the shipments manifest endpoint with the provided body.\r\n *\r\n * @param body - The request payload of type `ManifestMultipleIn`.\r\n * @returns An observable that emits the response data of type `ManifestMultipleOut`.\r\n */\r\n manifestMultiple (body: ManifestMultipleIn) {\r\n return this.http.post<ApiSuccess<ManifestMultipleOut>>(`${this.url}/shipments/manifest`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CryptoService {\r\n constructor (\r\n @Inject('env') private environments: Environment\r\n ) {\r\n }\r\n\r\n public async encryptAES (plaintext: string): Promise<string> {\r\n const cryptoKey = await this.loadKey()\r\n\r\n // Convert the plaintext in Uint8Array\r\n const encoder = new TextEncoder()\r\n const encoded = encoder.encode(plaintext)\r\n\r\n // Generate a random Initialization Vector (IV)\r\n const iv = crypto.getRandomValues(new Uint8Array(12))\r\n\r\n // Encrypt the plaintext\r\n const ciphertext = await crypto.subtle.encrypt(\r\n {\r\n name: 'AES-GCM',\r\n iv,\r\n },\r\n cryptoKey,\r\n encoded\r\n )\r\n\r\n return `${this.uint8ArrayToBase64(iv)}:${this.arrayBufferToBase64(ciphertext)}`\r\n }\r\n\r\n public async decryptAES (payload: string): Promise<string> {\r\n // Extract the Initialization Vector (IV), and the cypher text\r\n const [base64IV, base64Ciphertext] = payload.split(':')\r\n\r\n if (!base64IV || !base64Ciphertext) { throw new Error('The payload must contain the IV and the cipher text.') }\r\n\r\n const cryptoKey = await this.loadKey()\r\n\r\n const iv = this.base64ToUint8Array(base64IV)\r\n const cipherText = this.base64ToArrayBuffer(base64Ciphertext)\r\n\r\n // Decrypt the cypher text\r\n const decrypted = await crypto.subtle.decrypt(\r\n {\r\n name: 'AES-GCM',\r\n iv,\r\n },\r\n cryptoKey,\r\n cipherText\r\n )\r\n\r\n // Decode the decrypted text\r\n const decoder = new TextDecoder()\r\n return decoder.decode(decrypted)\r\n }\r\n\r\n private async loadKey () {\r\n // Decode the base64 key to Uint8Array\r\n const rawKey = this.base64ToUint8Array(this.environments.secretKey)\r\n\r\n // Import the key to API Crypto\r\n return await crypto.subtle.importKey(\r\n 'raw',\r\n rawKey,\r\n { name: 'AES-GCM' },\r\n true,\r\n ['encrypt', 'decrypt']\r\n )\r\n }\r\n\r\n private uint8ArrayToBase64 (data: Uint8Array): string {\r\n let binary = ''\r\n const len = data.byteLength\r\n\r\n for (let i = 0; i < len; i++) {\r\n binary += String.fromCharCode(data[i])\r\n }\r\n\r\n return btoa(binary)\r\n }\r\n\r\n private base64ToUint8Array (base64: string): Uint8Array {\r\n const binaryString = atob(base64)\r\n const len = binaryString.length\r\n const bytes = new Uint8Array(len)\r\n for (let i = 0; i < len; i++) {\r\n bytes[i] = binaryString.charCodeAt(i)\r\n }\r\n return bytes\r\n }\r\n\r\n private arrayBufferToBase64 (buffer: ArrayBuffer): string {\r\n let binary = ''\r\n const bytes = new Uint8Array(buffer)\r\n const len = bytes.byteLength\r\n\r\n for (let i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i])\r\n }\r\n\r\n return btoa(binary)\r\n }\r\n\r\n private base64ToArrayBuffer (base64: string): ArrayBuffer {\r\n const binaryString = atob(base64)\r\n const len = binaryString.length\r\n const bytes = new Uint8Array(len)\r\n\r\n for (let i = 0; i < len; i++) {\r\n bytes[i] = binaryString.charCodeAt(i)\r\n }\r\n\r\n return bytes.buffer\r\n }\r\n}\r\n","import { Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest } from '@angular/common/http'\r\nimport { Observable } from 'rxjs'\r\n\r\n@Injectable()\r\nexport class ApiHeadersInterceptor implements HttpInterceptor {\r\n /**\r\n * Intercepts HTTP requests and modifies request headers to include caching, content type,\r\n * accept language, and other HTTP-specific configurations before forwarding the request onward.\r\n *\r\n * @param {HttpRequest<unknown>} request - The HTTP request instance to be intercepted and modified.\r\n * @param {HttpHandler} next - The next handler instance in the HTTP pipeline which processes\r\n * the modified request and forwards it.\r\n * @return {Observable<HttpEvent<unknown>>} An observable of the processed HTTP event.\r\n */\r\n intercept (request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n let headers = new HttpHeaders({\r\n 'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',\r\n expires: '0',\r\n pragma: 'no-cache'\r\n })\r\n\r\n if (!request.headers.has('Content-Type')) {\r\n headers = headers.set('Content-Type', 'application/json')\r\n }\r\n\r\n if (!request.headers.has('Accept')) {\r\n headers = headers.set('Accept', 'application/json')\r\n }\r\n\r\n if (!request.headers.has('Accept-Language')) {\r\n headers = headers.set('Accept-Language', localStorage.getItem('lang') ?? 'en')\r\n }\r\n\r\n request = request.clone({ headers })\r\n\r\n return next.handle(request)\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'\r\nimport { Observable } from 'rxjs'\r\nimport { CookieService } from 'ngx-cookie-service'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\n@Injectable()\r\nexport class ApiTokenInterceptor implements HttpInterceptor {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private cookie: CookieService\r\n ) {}\r\n\r\n /**\r\n * Intercepts and modifies the outgoing HTTP request to include an authorization token\r\n * from cookies if the request does not already have an Authorization or AppKey header.\r\n *\r\n * @param {HttpRequest<unknown>} request - The outgoing HTTP request to be intercepted.\r\n * @param {HttpHandler} next - The next handler in the HTTP request processing chain.\r\n * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event, modified or unmodified.\r\n */\r\n intercept (request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n if (request.headers.has('Authorization') || request.headers.has('AppKey')) {\r\n return next.handle(request)\r\n }\r\n\r\n const token = this.cookie.get(this.environments.authCookie)\r\n\r\n if (!token) return next.handle(request)\r\n\r\n request = request.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`\r\n }\r\n })\r\n\r\n return next.handle(request)\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'\r\n\r\nimport { Observable, of } from 'rxjs'\r\nimport { tap } from 'rxjs/operators'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\nconst DEFAULT_TTL = 10000 // ttl in ms\r\n\r\n@Injectable()\r\nexport class HttpCachingInterceptor implements HttpInterceptor {\r\n private cache = new Map<string, { ttl: number, res: HttpResponse<any> }>()\r\n\r\n constructor (@Inject('env') private envs: Environment) {}\r\n\r\n /**\r\n * Intercepts HTTP requests to add caching functionality for GET requests.\r\n * Non-GET requests are passed through without caching.\r\n *\r\n * @param {HttpRequest<any>} req - The HTTP request being intercepted.\r\n * @param {HttpHandler} next - The next handler in the HTTP pipeline to execute the request.\r\n * @return {Observable<HttpEvent<any>>} - An observable containing the HTTP response event, either from cache or the backend service.\r\n */\r\n intercept (req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n if (req.method !== 'GET') { return next.handle(req) }\r\n\r\n const cached = this.cache.get(req.urlWithParams)\r\n\r\n if (cached) {\r\n const isExpired = Date.now() > cached.ttl\r\n\r\n if (!isExpired) { return of(cached.res) }\r\n\r\n this.cache.delete(req.urlWithParams) // If expired, remove the entry from cache\r\n }\r\n\r\n return next.handle(req).pipe(\r\n tap((res) => {\r\n if (!(res instanceof HttpResponse)) { return }\r\n\r\n const ttl = Date.now() + (this.envs.cacheTtl ?? DEFAULT_TTL)\r\n\r\n this.cache.set(req.urlWithParams, { res, ttl })\r\n })\r\n )\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-services\r\n */\r\nexport * from './lib/ngx-services.module'\r\n\r\n// api services\r\nexport * from './lib/apis/api-companies.service'\r\nexport * from './lib/apis/api-invoices.service'\r\nexport * from './lib/apis/api-open-items.service'\r\nexport * from './lib/apis/api-reports.service'\r\nexport * from './lib/apis/api-security.service'\r\nexport * from './lib/apis/api-shipments.service'\r\n\r\n// api models\r\nexport * from './lib/apis/models/api-companies.interfaces'\r\nexport * from './lib/apis/models/api-companies.types'\r\nexport * from './lib/apis/models/api-invoices.interfaces'\r\nexport * from './lib/apis/models/api-invoices.types'\r\nexport * from './lib/apis/models/api-open-items.interfaces'\r\nexport * from './lib/apis/models/api-open-items.types'\r\nexport * from './lib/apis/models/api-reports.interfaces'\r\nexport * from './lib/apis/models/api-security.interfaces'\r\nexport * from './lib/apis/models/api-security.types'\r\nexport * from './lib/apis/models/api-shipments.types'\r\nexport * from './lib/apis/models/api.models'\r\n\r\n// cypher\r\nexport * from './lib/cypher/crypto.service'\r\n\r\n// interceptors\r\nexport * from './lib/interceptors/api-headers.interceptor'\r\nexport * from './lib/interceptors/api-token.interceptor'\r\nexport * from './lib/interceptors/http-caching.interceptor'\r\n\r\n// helpers\r\nexport * from './lib/helpers/http'\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","tap"],"mappings":";;;;;;;;MAOa,iBAAiB,CAAA;AAC5B;;;;;;AAMG;IACI,OAAO,OAAO,CAAE,WAAwB,EAAA;QAC7C,OAAO;AACL,YAAA,QAAQ,EAAE,iBAAiB;AAC3B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,QAAQ,EAAE,WAAW;AACtB,iBAAA;AACF,aAAA;SACF,CAAA;KACF;wGAlBU,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAjB,iBAAiB,EAAA,CAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,EAFjB,SAAA,EAAA,CAAC,iBAAiB,EAAE,CAAC,EAAA,CAAA,CAAA;;4FAErB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;AACjC,iBAAA,CAAA;;;ACHD;;;;;;AAMG;AACU,MAAA,WAAW,GAAG,CAAC,MAAmB,KAAY;IACzD,MAAM,aAAa,GAAa,EAAE,CAAA;AAElC,IAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC9C,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,MAAM,UAAU,GAAG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,CAAC,CAAA;SAChD,CAAC,CACH,CAAA;KACF;AAnCU,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,kBAGZ,KAAK,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;4GAHf,sBAAsB,EAAA,CAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;;0BAIK,MAAM;2BAAC,KAAK,CAAA;;;ACb5B;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"experteam-mx-ngx-services.mjs","sources":["../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.module.ts","../../../../projects/experteam-mx/ngx-services/src/lib/helpers/http.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-companies.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-external-pickups.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-invoices.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-open-items.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-reports.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-security.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-shipments.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/websockets/web-sockets.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/cypher/crypto.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-headers.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-token.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/http-caching.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/public-api.ts","../../../../projects/experteam-mx/ngx-services/src/experteam-mx-ngx-services.ts"],"sourcesContent":["import { ModuleWithProviders, NgModule } from '@angular/core'\r\nimport { Environment } from './ngx-services.models'\r\nimport { provideHttpClient } from '@angular/common/http'\r\n\r\n@NgModule({\r\n providers: [provideHttpClient()]\r\n})\r\nexport class NgxServicesModule {\r\n /**\r\n * Returns a module with providers for the NgxServicesModule.\r\n *\r\n * @param {Environment} environment - The environment configuration object.\r\n *\r\n * @return {ModuleWithProviders<NgxServicesModule>} The module with providers for the NgxServicesModule.\r\n */\r\n public static forRoot (environment: Environment): ModuleWithProviders<NgxServicesModule> {\r\n return {\r\n ngModule: NgxServicesModule,\r\n providers: [\r\n {\r\n provide: 'env',\r\n useValue: environment\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n","import { HttpHeaders, HttpParams } from '@angular/common/http'\r\nimport { QueryParams } from '../apis/models/api.models'\r\n\r\n/**\r\n * Convert an object of key-value pairs into a URL query string.\r\n *\r\n * @param {Object} params - The key-value pairs to converted into a query string.\r\n *\r\n * @return {string} - The generated query string.\r\n */\r\nexport const queryString = (params: QueryParams): string => {\r\n const queryElements: string[] = []\r\n\r\n Object.entries(params).forEach(([key, value]) => {\r\n if (Array.isArray(value)) {\r\n const arrayQuery = value\r\n .map((item) => `${encodeURIComponent(key)}=${encodeURIComponent(item as string | number | boolean)}`)\r\n .join('&')\r\n\r\n queryElements.push(arrayQuery)\r\n } else {\r\n const encodedQuery = `${encodeURIComponent(key)}=${encodeURIComponent(value as string | number | boolean)}`\r\n\r\n queryElements.push(encodedQuery)\r\n }\r\n })\r\n\r\n const queryString = queryElements.join('&')\r\n\r\n return queryString.length ? `?${queryString}` : ''\r\n}\r\n\r\n/**\r\n * Creates an instance of HttpParams using the provided params object.\r\n *\r\n * @param {Object} params - The object containing the params to the HttpParams constructor.\r\n *\r\n * @returns {HttpParams} - An instance of HttpParams created from the params object.\r\n */\r\nexport const httpParams = (\r\n params: QueryParams\r\n): HttpParams => new HttpParams({\r\n fromObject: params\r\n})\r\n\r\n/**\r\n * Returns the headers for generating PDF files.\r\n *\r\n * @param {string} format - The format of the headers, 'object' or 'http_header'.\r\n *\r\n * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating PDF files.\r\n */\r\nexport const pdfHeaders = (format: 'object' | 'http_header' = 'object'): HttpHeaders | { [header: string]: string | string[] } => {\r\n const headers = {\r\n Accept: 'application/pdf'\r\n }\r\n\r\n return format === 'object'\r\n ? headers\r\n : new HttpHeaders(headers)\r\n}\r\n\r\n/**\r\n * Returns the headers for generating XML files.\r\n *\r\n * @param {string} format - The format of the headers, 'object' or 'http_header'.\r\n *\r\n * @returns {HttpHeaders | { [header: string]: string | string[] }} - The headers for generating XML files.\r\n */\r\nexport const xmlHeaders = (format: 'object' | 'http_header' = 'object'): HttpHeaders | { [header: string]: string | string[] } => {\r\n const headers = {\r\n Accept: 'application/xml',\r\n }\r\n\r\n return format === 'object'\r\n ? headers\r\n : new HttpHeaders(headers)\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport {\r\n AccountEntitiesOut,\r\n CompanyCountriesOut,\r\n CompanyCountryOut,\r\n CompanyCountryTaxesOut,\r\n CountryExchangesOut,\r\n CountryReferenceCurrenciesOut,\r\n CountryReferenceOut,\r\n CountryReferencesOut,\r\n EmployeeOut,\r\n EmployeesOut,\r\n ExchangesOut,\r\n InstallationOut,\r\n InstallationsOut,\r\n LocationEmployeesOut,\r\n LocationOut,\r\n LocationsOut,\r\n ParametersIn,\r\n ParametersOut,\r\n ParameterValueIn,\r\n ParameterValueOut,\r\n SupplyEntitiesOut,\r\n WorkflowsOut\r\n} from './models/api-companies.types'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { forkJoin, map, mergeMap, Observable } from 'rxjs'\r\nimport { httpParams } from '../helpers/http'\r\nimport { CountryCurrencyRate } from './models/api-companies.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiCompaniesService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the companies API from the environment configurations.\r\n *\r\n * @return {string} The URL of the companies API.\r\n */\r\n get url (): string {\r\n return this.environments.apiCompaniesUrl\r\n }\r\n\r\n /**\r\n * Fetches the installations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters used to filter the installations query.\r\n * @return {Observable<InstallationsOut>} An observable that emits the installation's data.\r\n */\r\n getInstallations (params: QueryParams): Observable<InstallationsOut> {\r\n return this.http.get<ApiSuccess<InstallationsOut>>(`${this.url}/installations`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the installation details based on the given installation ID.\r\n *\r\n * @param {number} id - The unique identifier of the installation to retrieve.\r\n * @returns {Observable<InstallationOut>} An observable of the installation details.\r\n */\r\n getInstallation (id: number): Observable<InstallationOut> {\r\n return this.http.get<ApiSuccess<InstallationOut>>(`${this.url}/installations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of locations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to use for querying locations.\r\n * @return {Observable<LocationsOut>} An observable that emits the location's data.\r\n */\r\n getLocations (params: QueryParams): Observable<LocationsOut> {\r\n return this.http.get<ApiSuccess<LocationsOut>>(`${this.url}/locations`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the location details for a given location ID.\r\n *\r\n * @param {number} id - The unique identifier of the location.\r\n * @return {Observable<LocationOut>} An Observable containing the location details.\r\n */\r\n getLocation (id: number): Observable<LocationOut> {\r\n return this.http.get<ApiSuccess<LocationOut>>(`${this.url}/locations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of active supply entities.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter supply entities.\r\n * @return {Observable<SupplyEntitiesOut>} Observable emitting supply entities data.\r\n */\r\n getSupplyEntitiesActive (params: QueryParams): Observable<SupplyEntitiesOut> {\r\n return this.http.get<ApiSuccess<SupplyEntitiesOut>>(`${this.url}/supply-entities/actives`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of employees based on the specified query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to filter and sort the employees.\r\n * @return {Observable<EmployeesOut>} An observable that emits the list of employees.\r\n */\r\n getEmployees (params: QueryParams): Observable<EmployeesOut> {\r\n return this.http.get<ApiSuccess<EmployeesOut>>(`${this.url}/employees`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches an employee's details based on the provided employee ID.\r\n *\r\n * @param {number} id - The unique identifier of the employee.\r\n * @return {Observable<EmployeeOut>} An observable that emits the employee's details.\r\n */\r\n getEmployee (id: number): Observable<EmployeeOut> {\r\n return this.http.get<ApiSuccess<EmployeeOut>>(`${this.url}/employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of employees for a specified location based on provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter and retrieve the location employees.\r\n * @returns {Observable<LocationEmployeesOut>} An observable that emits the list of employees for the specified location.\r\n */\r\n getLocationEmployees (params: QueryParams): Observable<LocationEmployeesOut> {\r\n return this.http.get<ApiSuccess<LocationEmployeesOut>>(`${this.url}/location-employees`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of countries where the company operates.\r\n *\r\n * @param {QueryParams} params - The query parameters for the API request.\r\n * @return {Observable<CompanyCountriesOut>} An observable containing the list of company countries.\r\n */\r\n getCompanyCountries (params: QueryParams): Observable<CompanyCountriesOut> {\r\n return this.http.get<ApiSuccess<CompanyCountriesOut>>(`${this.url}/company-countries`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the country information for a specified company by its ID.\r\n *\r\n * @param {number} id - The unique identifier of the company.\r\n * @return {Observable<CompanyCountryOut>} An observable containing the country information of the company.\r\n */\r\n getCompanyCountry (id: number): Observable<CompanyCountryOut> {\r\n return this.http.get<ApiSuccess<CompanyCountryOut>>(`${this.url}/company-countries/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the reference currencies for a given country.\r\n *\r\n * @param {QueryParams} params - The query parameters to include in the request.\r\n * @return {Observable<CountryReferenceCurrenciesOut>} The observable containing the country reference currencies data.\r\n */\r\n getCountryReferenceCurrencies (params: QueryParams): Observable<CountryReferenceCurrenciesOut> {\r\n return this.http.get<ApiSuccess<CountryReferenceCurrenciesOut>>(\r\n `${this.url}/country-reference-currencies`,\r\n { params }\r\n ).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of currencies for different countries along with their current exchange rates.\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the country reference currencies.\r\n * @return {Observable<CountryCurrencyRate[]>} An observable that emits an array of country currency rates.\r\n */\r\n getCountryCurrenciesWithRate (params: QueryParams): Observable<CountryCurrencyRate[]> {\r\n return this.getCountryReferenceCurrencies(params)\r\n .pipe(mergeMap((currenciesData) => {\r\n const $observables = currenciesData.country_reference_currencies\r\n .map((item) =>\r\n this.getCurrentExchanges({\r\n currency_id: item.currency.id,\r\n }).pipe(\r\n map((exchangesData) => ({\r\n ...item,\r\n rate: exchangesData.exchanges[0]?.value,\r\n }))\r\n )\r\n )\r\n\r\n return forkJoin($observables)\r\n }))\r\n }\r\n\r\n /**\r\n * Fetches exchange data based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters for retrieving exchange data.\r\n * @return {Observable<CountryExchangesOut>} An observable containing the exchange data.\r\n */\r\n getExchanges (params: QueryParams): Observable<CountryExchangesOut> {\r\n return this.http.get<ApiSuccess<CountryExchangesOut>>(`${this.url}/exchanges`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the current exchanges based on the given query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the exchanges.\r\n *\r\n * @returns {Observable<ExchangesOut>} - An observable that emits the API response data containing the current exchanges.\r\n */\r\n getCurrentExchanges (params: QueryParams): Observable<ExchangesOut> {\r\n return this.http.get<ApiSuccess<ExchangesOut>>(`${this.url}/exchanges/current`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the country-specific tax information for a company.\r\n *\r\n * @param {QueryParams} params - The parameters used to filter and query the taxes.\r\n * @return {Observable<CompanyCountryTaxesOut>} An observable that emits the tax information.\r\n */\r\n getCompanyCountryTaxes (params: QueryParams): Observable<CompanyCountryTaxesOut> {\r\n return this.http.get<ApiSuccess<CompanyCountryTaxesOut>>(`${this.url}/company-country-taxes`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of active account entities based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to filter and query active account entities.\r\n * @return {Observable<AccountEntitiesOut>} An observable that emits the list of active account entities.\r\n */\r\n getActiveAccountEntities (params: QueryParams): Observable<AccountEntitiesOut> {\r\n return this.http.get<ApiSuccess<AccountEntitiesOut>>(`${this.url}/account-entities/actives`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the parameter values based on the provided parameter names.\r\n *\r\n * @param {Object} params - An object containing the required parameters.\r\n * @param {string[]} params.paramNames - An array of parameter names for which the values need to be fetched.\r\n * @return {Observable<ParametersOut>} An observable that emits the fetched parameter values.\r\n */\r\n getParameters ({\r\n paramNames,\r\n }: ParametersIn): Observable<ParametersOut> {\r\n const parameters = paramNames.map((p) => ({ name: p }))\r\n\r\n return this.http.post<ApiSuccess<ParametersOut>>(`${this.url}/parameters-values`, {\r\n parameters\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the value of a specified parameter.\r\n *\r\n * @param {Object} input - The input object containing the parameter details.\r\n * @param {string} input.paramName - The name of the parameter whose value is to be retrieved.\r\n * @return {Observable<ParameterValueOut>} An observable emitting the value of the specified parameter.\r\n */\r\n getParameterValue ({\r\n paramName,\r\n }: ParameterValueIn): Observable<ParameterValueOut> {\r\n return this.http.get<ApiSuccess<ParameterValueOut>>(`${this.url}/parameters-values/${paramName}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of country references based on the given query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters for retrieving country references.\r\n * @return {Observable<CountryReferencesOut>} An observable containing the country reference data.\r\n */\r\n getCountryReferences (params: QueryParams): Observable<CountryReferencesOut> {\r\n return this.http.get<ApiSuccess<CountryReferencesOut>>(`${this.url}/country-references`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the country reference data for a given country ID.\r\n *\r\n * @param {number} id - The unique identifier of the country for which the reference data is to be retrieved.\r\n * @return {Observable<CountryReferenceOut>} An observable containing the country reference data.\r\n */\r\n getCountryReference (id: number): Observable<CountryReferenceOut> {\r\n return this.http.get<ApiSuccess<CountryReferenceOut>>(`${this.url}/country-references/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the list of workflows based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter workflows.\r\n * @return {Observable<WorkflowsOut>} An observable containing the workflow data.\r\n */\r\n getWorkflows (params: QueryParams): Observable<WorkflowsOut> {\r\n return this.http.get<ApiSuccess<WorkflowsOut>>(`${this.url}/workflows`, {\r\n params: httpParams(params),\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { Environment } from '../ngx-services.models'\r\nimport {\r\n CancelDeliveryConfirmationIn,\r\n CompleteDeliveryConfirmationIn,\r\n GenerateDeliveryConfirmationIn,\r\n KeyOTPOut\r\n} from './models/api-external-pickups.types'\r\nimport { Observable } from 'rxjs'\r\nimport { map } from 'rxjs/operators'\r\nimport { ApiSuccess } from './models/api.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiExternalPickupsService {\r\n constructor (\r\n private httpClient: HttpClient,\r\n @Inject('env') private environment: Environment\r\n ) { }\r\n\r\n /**\r\n * Getter method to retrieve the API's external operations URL.\r\n * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.\r\n * Defaults to an empty string if the property is undefined or null.\r\n *\r\n * @return {string} The external operations URL or an empty string if unavailable.\r\n */\r\n get url (): string {\r\n return this.environment.apiExternalOperationsUrl ?? ''\r\n }\r\n\r\n /**\r\n * Generates a delivery confirmation by sending the provided payload to the API.\r\n *\r\n * @param {GenerateDeliveryConfirmationIn} payload - The input payload required to generate the delivery confirmation.\r\n * @return {Observable<KeyOTPOut>} An observable that emits the generated delivery confirmation data.\r\n */\r\n public generateDeliveryConfirmation (payload: GenerateDeliveryConfirmationIn): Observable<KeyOTPOut> {\r\n return this.httpClient.post<ApiSuccess<KeyOTPOut>>(\r\n `${this.url}/delivery-confirmation/generate`,\r\n payload, {\r\n headers: { appkey: this.environment.apiExternalOperationsKey }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Confirms the completion of a delivery operation by making a PATCH request.\r\n *\r\n * @param {Object} input - The input parameters for the method.\r\n * @param {string} input.operationId - The unique identifier of the delivery operation to be confirmed.\r\n * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.\r\n * @return {Observable<Object>} - An observable containing the response data from the API.\r\n */\r\n public completedDeliveryConfirmation ({\r\n keyOTP,\r\n operationId,\r\n }: CompleteDeliveryConfirmationIn): Observable<{}> {\r\n return this.httpClient.patch<ApiSuccess<{}>>(\r\n `${this.url}/delivery-confirmation/completed/${keyOTP}`,\r\n null, {\r\n headers: { appkey: this.environment.apiExternalOperationsKey },\r\n params: { operation_id: operationId }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Cancels a delivery confirmation by sending an OTP and additional data to the server.\r\n *\r\n * @param {Object} param0 - The parameter object containing the required properties.\r\n * @param {string} param0.otp - The one-time password to authenticate the cancellation request.\r\n * @param {Object} param0.body - Additional body data required for cancellation.\r\n * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.\r\n */\r\n public cancelDeliveryConfirmation ({\r\n otp,\r\n ...body\r\n }: CancelDeliveryConfirmationIn): Observable<{}> {\r\n return this.httpClient.put<ApiSuccess<{}>>(\r\n `${this.url}/delivery-confirmation/confirmation/${otp}`,\r\n body, {\r\n headers: { appkey: this.environment.apiExternalOperationsKey },\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http'\r\nimport { Inject, Injectable } from '@angular/core'\r\nimport { map, Observable } from 'rxjs'\r\nimport { Environment } from '../ngx-services.models'\r\nimport {\r\n AccountPaymentOperationIn,\r\n AccountPaymentOperationOut,\r\n CancelBillingIn,\r\n CancelPaymentReceiptIn,\r\n CollectionReceiptOut,\r\n OperationDocumentIn,\r\n OperationDocumentOut\r\n} from './models/api-invoices.types'\r\nimport { ApiSuccess } from './models/api.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiInvoicesService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the API URL for invoices from the environments configuration.\r\n *\r\n * @return {string} The API URL for invoices.\r\n */\r\n get url (): string {\r\n return this.environments.apiInvoicesUrl\r\n }\r\n\r\n /**\r\n * Sends an operation document to the server and processes the response.\r\n *\r\n * @param {OperationDocumentIn} body - The input data for the operation document.\r\n * @return {Observable<OperationDocumentOut>} An observable containing the processed operation document output.\r\n */\r\n operationDocument (body: OperationDocumentIn): Observable<OperationDocumentOut> {\r\n return this.http.post<ApiSuccess<OperationDocumentOut>>(`${this.url}/operation/document`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches and returns the collection receipt data for a given collection ID.\r\n *\r\n * @param {number} id - The unique identifier of the collection for which the receipt needs to be retrieved.\r\n * @return {Observable<CollectionReceiptOut>} An observable containing the collection receipt data.\r\n */\r\n printCollectionReceipt (id: number): Observable<CollectionReceiptOut> {\r\n return this.http.get<ApiSuccess<CollectionReceiptOut>>(`${this.url}/operation/print/collection-receipt/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Handles the account payment operation by sending a POST request to the specified endpoint.\r\n * Processes the response and returns the operation data.\r\n *\r\n * @param {AccountPaymentOperationIn} body The payload containing information for the account payment operation.\r\n * @return {Observable<AccountPaymentOperationOut>} An observable emitting the processed account payment operation data.\r\n */\r\n accountPaymentOperation (body: AccountPaymentOperationIn): Observable<AccountPaymentOperationOut> {\r\n return this.http.post<ApiSuccess<AccountPaymentOperationOut>>(`${this.url}/operation/account-payment`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Cancels a payment receipt based on the provided input.\r\n * This method sends a POST request to cancel a document.\r\n *\r\n * @param body The data required to cancel the payment receipt, encapsulated in a CancelPaymentReceiptIn object.\r\n * @return An Observable representing the result of the cancellation. Emits an empty object on success.\r\n */\r\n cancelPaymentReceipt (body: CancelPaymentReceiptIn): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/operation/cancel-document`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Cancels an invoice based on the provided invoice ID and additional parameters.\r\n *\r\n * @param {Object} parameters - The parameters required to cancel the invoice, encapsulated in a CancelBillingIn object.\r\n * @return {Observable<Object>} An observable that emits the response of the cancellation operation.\r\n */\r\n cancelInvoice ({ invoiceId, ...body }: CancelBillingIn): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/operation/cancel-billing/${invoiceId}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n OpenItemsOut,\r\n PaymentOpenItemOut,\r\n PaymentOtherInvoiceOut\r\n} from './models/api-open-items.types'\r\nimport { map, Observable } from 'rxjs'\r\nimport { PaymentOpenItemIn, PaymentOtherInvoiceIn } from './models/api-open-items.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiOpenItemsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) {}\r\n\r\n /**\r\n * Retrieves the API URL for open-items from the environments' configuration.\r\n *\r\n * @return {string} The API URL for open-items.\r\n */\r\n get url (): string {\r\n return this.environments.apiOpenItemsUrl\r\n }\r\n\r\n /**\r\n * Retrieves a list of open-items based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to use for querying open-items.\r\n * @return {Observable<OpenItemsOut>} An observable that emits the open-item's data.\r\n */\r\n getOpenItems (params: QueryParams): Observable<OpenItemsOut> {\r\n return this.http.get<ApiSuccess<OpenItemsOut>>(`${this.url}/open-items`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Processes a payment for an open item.\r\n *\r\n * @param {PaymentOpenItemIn} body - The payment details for the open item.\r\n * @return {Observable<PaymentOpenItemOut>} An observable that emits the result of the payment processing.\r\n */\r\n paymentOpenItem (body: PaymentOpenItemIn): Observable<PaymentOpenItemOut> {\r\n return this.http.post<ApiSuccess<PaymentOpenItemOut>>(`${this.url}/payment`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Processes a payment for other invoice.\r\n *\r\n * @param {PaymentOtherInvoiceIn} body - The payment details for the other invoice.\r\n * @return {Observable<PaymentOtherInvoiceOut>} An observable that emits the result of the payment processing.\r\n */\r\n paymentOtherInvoice (body: PaymentOtherInvoiceIn): Observable<PaymentOtherInvoiceOut> {\r\n return this.http.post<ApiSuccess<PaymentOtherInvoiceOut>>(`${this.url}/other-invoices`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { map, Observable } from 'rxjs'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n CollectionPaymentsOut,\r\n ExistPendingInvoicesIn,\r\n ExistPendingPaymentsIn,\r\n ShipmentsReportOut\r\n} from './models/api-reports.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiReportsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the reports API from the environment configurations.\r\n *\r\n * @return {string} The URL of the reports API.\r\n */\r\n get url (): string {\r\n return this.environments.apiReportsUrl\r\n }\r\n\r\n /**\r\n * Retrieves the list of collection payments\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the collection payments.\r\n * @return {Observable<CollectionPaymentsOut[]>} An observable that emits an array of collection payment.\r\n */\r\n getCollectionPayments (params: QueryParams): Observable<CollectionPaymentsOut> {\r\n return this.http.get<ApiSuccess<CollectionPaymentsOut>>(`${this.url}/collection-payment`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the list of shipments with pending payments.\r\n *\r\n * @param {ExistPendingPaymentsIn} params - The parameters to filter pending payment shipments.\r\n * @return {Observable<ShipmentsReportOut>} An observable emitting the shipments report data.\r\n */\r\n shipmentsPendingPayments (params: ExistPendingPaymentsIn): Observable<ShipmentsReportOut> {\r\n return this.http.get<ApiSuccess<ShipmentsReportOut>>(`${this.url}/shipments-report`, {\r\n params: {\r\n ...params,\r\n limit: 1,\r\n offset: 0,\r\n to_landing: true,\r\n shipment_status_code: 'PMPEN',\r\n },\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches shipment reports that are pending invoices based on the specified parameters.\r\n * This method retrieves a filtered list of shipments with pending invoice statuses.\r\n *\r\n * @param {ExistPendingInvoicesIn} params - The parameters to filter the pending invoices, including\r\n * shipment status codes, and pagination options.\r\n * @return {Observable<ShipmentsReportOut>} An observable that emits the shipment report data based on the filter criteria.\r\n */\r\n shipmentsPendingInvoices (params: ExistPendingInvoicesIn): Observable<ShipmentsReportOut> {\r\n return this.http.get<ApiSuccess<ShipmentsReportOut>>(`${this.url}/shipments-report`, {\r\n params: {\r\n ...params,\r\n limit: 1,\r\n offset: 0,\r\n to_landing: true,\r\n 'shipment_status_code[in]': 'IPMPE,IMPEN,IPPEN',\r\n },\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n ChangeLanguageIn,\r\n CreateSessionIn,\r\n CreateSessionOut,\r\n GetUserOut,\r\n LoginIn,\r\n LoginOut,\r\n MeOut,\r\n ModulePermissionsOut,\r\n RoleByIdOut,\r\n RolePermissionsIn,\r\n RolesOut,\r\n RoleTypesOut\r\n} from './models/api-security.types'\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { map, Observable, tap } from 'rxjs'\r\nimport { CookieService } from 'ngx-cookie-service'\r\nimport { ModulesOut } from './models/api-security.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiSecurityService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private cookie: CookieService,\r\n private http: HttpClient\r\n ) {}\r\n\r\n /**\r\n * Retrieves the API security URL from the environments configuration.\r\n *\r\n * @return {string} The API security URL.\r\n */\r\n get url (): string {\r\n return this.environments.apiSecurityUrl\r\n }\r\n\r\n /**\r\n * Authenticates a user with the provided credentials and role.\r\n *\r\n * @param {Object} param0 - The login input object.\r\n * @param {string} param0.username - The username of the user.\r\n * @param {string} param0.password - The password of the user.\r\n * @param {string} param0.role - The role of the user.\r\n * @return {Observable<LoginOut>} An observable emitting the login output object.\r\n */\r\n login ({\r\n username,\r\n password,\r\n role,\r\n }: LoginIn): Observable<LoginOut> {\r\n return this.http.post<ApiSuccess<LoginOut>>(`${this.url}/auth/login`, {\r\n system_name: 'CRA',\r\n username,\r\n password,\r\n role,\r\n }).pipe(\r\n map(({ data }) => data),\r\n tap(({ access_token }) => this.cookie.set(this.environments.authCookie, access_token, { path: '/' }))\r\n )\r\n }\r\n\r\n /**\r\n * Logs out the current user by making a POST request to the logout endpoint.\r\n *\r\n * This method deletes all cookies after a successful logout.\r\n *\r\n * @return {Observable<{}>} An observable that emits the server's response to the logout request.\r\n */\r\n logout (): Observable<{}> {\r\n return this.http.post<ApiSuccess<{}>>(`${this.url}/auth/logout`, null)\r\n .pipe(\r\n map(({ data }) => data),\r\n tap(() => this.cookie.delete(this.environments.authCookie, '/'))\r\n )\r\n }\r\n\r\n /**\r\n * Creates a new session for a specified model.\r\n *\r\n * @param {Object} params - The parameters for creating the session.\r\n * @param {string} params.modelType - The type of the model.\r\n * @param {string} params.modelId - The ID of the model.\r\n * @param {string} [params.token] - Optional authorization token.\r\n *\r\n * @return {Observable<CreateSessionOut>} An observable containing the created session details.\r\n */\r\n createSession ({\r\n modelType,\r\n modelId,\r\n token,\r\n }: CreateSessionIn): Observable<CreateSessionOut> {\r\n let headers = new HttpHeaders({})\r\n\r\n if (token) { headers = headers.set('Authorization', `Bearer ${token}`) }\r\n\r\n return this.http.post<ApiSuccess<CreateSessionOut>>(\r\n `${this.url}/sessions`, {\r\n model_type: modelType,\r\n model_id: modelId,\r\n }, {\r\n headers\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the authenticated user's information.\r\n * Sends a GET request to the endpoint '/auth/me' to retrieve information\r\n * about the currently authenticated user.\r\n *\r\n * @return {Observable<MeOut>} An observable that emits the authenticated user's data.\r\n */\r\n me (): Observable<MeOut> {\r\n return this.http.get<ApiSuccess<MeOut>>(`${this.url}/auth/me`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the authenticated user's details from the server.\r\n *\r\n * @param token The JWT token used for authorization.\r\n * @return An Observable that emits the user's details encapsulated in a MeOut object.\r\n */\r\n otherMe (token: string): Observable<MeOut> {\r\n return this.http.get<ApiSuccess<MeOut>>(`${this.url}/auth/me`, {\r\n headers: {\r\n Authorization: `Bearer ${token}`\r\n }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a user by their unique ID.\r\n *\r\n * @param {number} id - The unique identifier of the user to be fetched.\r\n * @return {Observable<GetUserOut>} An observable containing the user information.\r\n */\r\n user (id: number): Observable<GetUserOut> {\r\n return this.http.get<ApiSuccess<GetUserOut>>(`${this.url}/users/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Changes the language for the authenticated user.\r\n *\r\n * @param {Object} params - The input parameters for changing the language.\r\n * @param {string} params.languageId - The ID of the new language to be set.\r\n * @return {Observable<ApiSuccess<MeOut>>} An observable that emits the result of the language change request.\r\n */\r\n changeLanguage ({\r\n languageId\r\n }: ChangeLanguageIn): Observable<MeOut> {\r\n return this.http.put<ApiSuccess<MeOut>>(`${this.url}/auth/me`, {\r\n language_id: languageId\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of roles with their permissions.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the roles.\r\n * @returns {Observable<RolePermissionsIn[]>} An observable that emits an array of role permissions.\r\n */\r\n getRoles(params: QueryParams): Observable<RolesOut> {\r\n return this.http.get<ApiSuccess<RolesOut>>(`${this.url}/roles`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the role types from the API.\r\n *\r\n * @param {QueryParams} params - The query parameters to be sent with the request.\r\n * @returns {Observable<RoleTypesOut>} An observable containing the role types output.\r\n */\r\n getRoleTypes (params: QueryParams): Observable<RoleTypesOut> {\r\n return this.http.get<ApiSuccess<RoleTypesOut>>(`${this.url}/role-types`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the permissions for a module.\r\n *\r\n * @param {QueryParams} params - The query parameters to be sent with the request.\r\n * @returns {Observable<ModulePermissionsOut>} An observable containing the module permissions.\r\n */\r\n getPermissions (params: QueryParams): Observable<ModulePermissionsOut> {\r\n return this.http.get<ApiSuccess<ModulePermissionsOut>>(`${this.url}/modules`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves roles by the specified ID.\r\n *\r\n * @param params - The ID of the role to retrieve.\r\n * @returns An Observable that emits the role data.\r\n */\r\n getRolesById (params: number): Observable<RoleByIdOut> {\r\n return this.http.get<ApiSuccess<RoleByIdOut>>(`${this.url}/roles/${params}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Creates a new role with the specified permissions.\r\n *\r\n * @param {RolePermissionsIn} body - The permissions and details for the new role.\r\n * @returns {Observable<ModulePermissionsOut>} An observable containing the created role's permissions.\r\n */\r\n createRole (body: RolePermissionsIn): Observable<ModulePermissionsOut> {\r\n return this.http.post<ApiSuccess<ModulePermissionsOut>>(`${this.url}/roles`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the permissions of a specific role.\r\n *\r\n * @param id - The unique identifier of the role to update.\r\n * @param body - The new permissions to assign to the role.\r\n * @returns An Observable that emits the updated module permissions.\r\n */\r\n updateRolePermissions (id: number, body: RolePermissionsIn): Observable<ModulePermissionsOut> {\r\n return this.http.put<ApiSuccess<ModulePermissionsOut>>(`${this.url}/roles/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes the permissions associated with a specific role.\r\n *\r\n * @param {number} id - The unique identifier of the role whose permissions are to be deleted.\r\n * @returns {Observable<{}>} An observable that emits the result of the delete operation.\r\n */\r\n deleteRolePermissions (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/roles/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of modules and permissions\r\n *\r\n * @param queryParams - The query parameters to filter the modules.\r\n * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.\r\n */\r\n getModules (queryParams: QueryParams): Observable<ModulesOut> {\r\n return this.http.get<ApiSuccess<ModulesOut>>(`${this.url}/modules`, {\r\n params: queryParams\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of modules and permissions\r\n *\r\n * @param params.token - Custom token for authorization.\r\n * @param params.queryParams - The query parameters to filter the modules.\r\n * @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.\r\n */\r\n getModulesToken (params: {\r\n token: string,\r\n queryParams: QueryParams\r\n }): Observable<ModulesOut> {\r\n return this.http.get<ApiSuccess<ModulesOut>>(`${this.url}/modules`, {\r\n params: params.queryParams,\r\n headers: {\r\n Authorization: `Bearer ${params.token}`\r\n }\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http'\r\nimport { Inject, Injectable } from '@angular/core'\r\nimport { map, Observable } from 'rxjs'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { ManifestMultipleIn, ManifestMultipleOut, ValidateAccountIn, ValidateAccountOut } from './models/api-shipments.types'\r\nimport { ApiSuccess } from './models/api.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiShipmentsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the shipments API from the environment configurations.\r\n *\r\n * @return {string} The URL of the shipments API.\r\n */\r\n get url (): string {\r\n return this.environments.apiShipmentUrl\r\n }\r\n\r\n /**\r\n * Retrieves the parameter values based on the provided parameter names.\r\n *\r\n * @param {ValidateAccountIn} body - An object of parameter names for which the values need to be fetched.\r\n * @return {Observable<ValidateAccountIn>} An observable that emits the fetched parameter values\r\n * @param body\r\n */\r\n validateAccount (body: ValidateAccountIn): Observable<ValidateAccountOut> {\r\n return this.http.post<ApiSuccess<ValidateAccountOut>>(`${this.url}/accounts`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to the shipments manifest endpoint with the provided body.\r\n *\r\n * @param body - The request payload of type `ManifestMultipleIn`.\r\n * @returns An observable that emits the response data of type `ManifestMultipleOut`.\r\n */\r\n manifestMultiple (body: ManifestMultipleIn) {\r\n return this.http.post<ApiSuccess<ManifestMultipleOut>>(`${this.url}/shipments/manifest`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport Pusher, { Channel } from 'pusher-js'\r\nimport { Observable } from 'rxjs'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WebSocketsService {\r\n private pusher: Pusher | null\r\n\r\n constructor (\r\n @Inject('env') private environments: Environment\r\n ) {\r\n this.pusher = null\r\n\r\n this.connect()\r\n .then((pusher) => {\r\n if (!pusher) return\r\n\r\n this.pusher = pusher\r\n })\r\n }\r\n\r\n /**\r\n * Publishes an event to the specified channel with the given data.\r\n *\r\n * @param {Channel} channel - The channel instance where the event will be published.\r\n * @param {string} eventName - The name of the event to be published.\r\n * @param {T} data - The payload data to be sent with the event.\r\n * @return {Promise<boolean>} A promise that resolves to a boolean indicating\r\n * whether the event was successfully triggered on the channel.\r\n */\r\n async pub<T> (channel: Channel, eventName: string, data: T) {\r\n return channel.trigger(`client-${eventName}`, data)\r\n }\r\n\r\n /**\r\n * Subscribes to a specified channel, retrying multiple times upon failure.\r\n *\r\n * @param {string} channelName - The name of the channel to be subscribed to.\r\n * @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.\r\n * @throws {Error} If the subscription fails after the maximum number of retry attempts.\r\n */\r\n async channelSub (channelName: string): Promise<Channel> {\r\n const attempts = 3\r\n\r\n for (let attempt = 0; attempt <= attempts; attempt++) {\r\n const channel = this.pusher?.channel(channelName)\r\n\r\n if (channel?.subscribed) {\r\n return channel\r\n }\r\n\r\n this.pusher?.subscribe(channelName)\r\n\r\n if (attempt < attempts) {\r\n await this.wait()\r\n }\r\n }\r\n\r\n throw new Error(`Failed to subscribe to channel \"${channelName}\" after ${attempts} attempts.`)\r\n }\r\n\r\n /**\r\n * Binds an event listener to a specified event on a given channel using Pusher or a Channel object,\r\n * and returns an Observable that emits event data of type T.\r\n *\r\n * @param {Channel|string} channel - The channel to bind the event to. It can be a Channel object or a string representing the channel name.\r\n * @param {string} event - The name of the event to bind to the channel.\r\n * @return {Observable<T>} An Observable that emits data of type T when the specified event is triggered.\r\n */\r\n eventBind<T> (channel: Channel | string, event: string): Observable<T> {\r\n return new Observable((subscriber) => {\r\n if ((channel as Channel)?.name) {\r\n (channel as Channel).bind(event, (data: T) => subscriber.next(data))\r\n } else {\r\n this.pusher?.subscribe((channel as string))\r\n .bind(event, (data: T) => subscriber.next(data))\r\n }\r\n })\r\n }\r\n\r\n /**\r\n * Unbinds an event from the specified channel and returns an observable\r\n * that emits data when the event callback is triggered.\r\n *\r\n * @param {Channel} channel - The channel object from which the event should be unbound.\r\n * @param {string} event - The name of the event to unbind.\r\n * @return {Observable<T>} An observable that emits data from the unbound event callback.\r\n */\r\n eventUnbind<T> (channel: Channel, event: string) {\r\n return new Observable((subscriber) =>\r\n channel.unbind(event, (data: T) => subscriber.next(data)))\r\n }\r\n\r\n private connect () {\r\n return new Promise<Pusher | false>((resolve) => {\r\n const { sockets } = this.environments\r\n\r\n if (!sockets) return resolve(false)\r\n\r\n const pusher = new Pusher(sockets.app_key, {\r\n wsHost: sockets.url,\r\n wsPort: sockets.port,\r\n enabledTransports: ['wss', 'ws'],\r\n forceTLS: false,\r\n enableStats: false,\r\n })\r\n\r\n if (sockets.debug) {\r\n Pusher.logToConsole = true\r\n }\r\n\r\n return resolve(pusher)\r\n })\r\n }\r\n\r\n private async wait (): Promise<void> {\r\n const waitTime = 3 * 1000\r\n\r\n return new Promise((resolve) => setTimeout(resolve, waitTime))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CryptoService {\r\n constructor (\r\n @Inject('env') private environments: Environment\r\n ) {\r\n }\r\n\r\n public async encryptAES (plaintext: string): Promise<string> {\r\n const cryptoKey = await this.loadKey()\r\n\r\n // Convert the plaintext in Uint8Array\r\n const encoder = new TextEncoder()\r\n const encoded = encoder.encode(plaintext)\r\n\r\n // Generate a random Initialization Vector (IV)\r\n const iv = crypto.getRandomValues(new Uint8Array(12))\r\n\r\n // Encrypt the plaintext\r\n const ciphertext = await crypto.subtle.encrypt(\r\n {\r\n name: 'AES-GCM',\r\n iv,\r\n },\r\n cryptoKey,\r\n encoded\r\n )\r\n\r\n return `${this.uint8ArrayToBase64(iv)}:${this.arrayBufferToBase64(ciphertext)}`\r\n }\r\n\r\n public async decryptAES (payload: string): Promise<string> {\r\n // Extract the Initialization Vector (IV), and the cypher text\r\n const [base64IV, base64Ciphertext] = payload.split(':')\r\n\r\n if (!base64IV || !base64Ciphertext) { throw new Error('The payload must contain the IV and the cipher text.') }\r\n\r\n const cryptoKey = await this.loadKey()\r\n\r\n const iv = this.base64ToUint8Array(base64IV)\r\n const cipherText = this.base64ToArrayBuffer(base64Ciphertext)\r\n\r\n // Decrypt the cypher text\r\n const decrypted = await crypto.subtle.decrypt(\r\n {\r\n name: 'AES-GCM',\r\n iv,\r\n },\r\n cryptoKey,\r\n cipherText\r\n )\r\n\r\n // Decode the decrypted text\r\n const decoder = new TextDecoder()\r\n return decoder.decode(decrypted)\r\n }\r\n\r\n private async loadKey () {\r\n // Decode the base64 key to Uint8Array\r\n const rawKey = this.base64ToUint8Array(this.environments.secretKey)\r\n\r\n // Import the key to API Crypto\r\n return await crypto.subtle.importKey(\r\n 'raw',\r\n rawKey,\r\n { name: 'AES-GCM' },\r\n true,\r\n ['encrypt', 'decrypt']\r\n )\r\n }\r\n\r\n private uint8ArrayToBase64 (data: Uint8Array): string {\r\n let binary = ''\r\n const len = data.byteLength\r\n\r\n for (let i = 0; i < len; i++) {\r\n binary += String.fromCharCode(data[i])\r\n }\r\n\r\n return btoa(binary)\r\n }\r\n\r\n private base64ToUint8Array (base64: string): Uint8Array {\r\n const binaryString = atob(base64)\r\n const len = binaryString.length\r\n const bytes = new Uint8Array(len)\r\n for (let i = 0; i < len; i++) {\r\n bytes[i] = binaryString.charCodeAt(i)\r\n }\r\n return bytes\r\n }\r\n\r\n private arrayBufferToBase64 (buffer: ArrayBuffer): string {\r\n let binary = ''\r\n const bytes = new Uint8Array(buffer)\r\n const len = bytes.byteLength\r\n\r\n for (let i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i])\r\n }\r\n\r\n return btoa(binary)\r\n }\r\n\r\n private base64ToArrayBuffer (base64: string): ArrayBuffer {\r\n const binaryString = atob(base64)\r\n const len = binaryString.length\r\n const bytes = new Uint8Array(len)\r\n\r\n for (let i = 0; i < len; i++) {\r\n bytes[i] = binaryString.charCodeAt(i)\r\n }\r\n\r\n return bytes.buffer\r\n }\r\n}\r\n","import { Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest } from '@angular/common/http'\r\nimport { Observable } from 'rxjs'\r\n\r\n@Injectable()\r\nexport class ApiHeadersInterceptor implements HttpInterceptor {\r\n /**\r\n * Intercepts HTTP requests and modifies request headers to include caching, content type,\r\n * accept language, and other HTTP-specific configurations before forwarding the request onward.\r\n *\r\n * @param {HttpRequest<unknown>} request - The HTTP request instance to be intercepted and modified.\r\n * @param {HttpHandler} next - The next handler instance in the HTTP pipeline which processes\r\n * the modified request and forwards it.\r\n * @return {Observable<HttpEvent<unknown>>} An observable of the processed HTTP event.\r\n */\r\n intercept (request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n let headers = new HttpHeaders({\r\n 'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',\r\n expires: '0',\r\n pragma: 'no-cache'\r\n })\r\n\r\n if (!request.headers.has('Content-Type')) {\r\n headers = headers.set('Content-Type', 'application/json')\r\n }\r\n\r\n if (!request.headers.has('Accept')) {\r\n headers = headers.set('Accept', 'application/json')\r\n }\r\n\r\n if (!request.headers.has('Accept-Language')) {\r\n headers = headers.set('Accept-Language', localStorage.getItem('lang') ?? 'en')\r\n }\r\n\r\n request = request.clone({ headers })\r\n\r\n return next.handle(request)\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'\r\nimport { Observable } from 'rxjs'\r\nimport { CookieService } from 'ngx-cookie-service'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\n@Injectable()\r\nexport class ApiTokenInterceptor implements HttpInterceptor {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private cookie: CookieService\r\n ) {}\r\n\r\n /**\r\n * Intercepts and modifies the outgoing HTTP request to include an authorization token\r\n * from cookies if the request does not already have an Authorization or AppKey header.\r\n *\r\n * @param {HttpRequest<unknown>} request - The outgoing HTTP request to be intercepted.\r\n * @param {HttpHandler} next - The next handler in the HTTP request processing chain.\r\n * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event, modified or unmodified.\r\n */\r\n intercept (request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n if (request.headers.has('Authorization') || request.headers.has('AppKey')) {\r\n return next.handle(request)\r\n }\r\n\r\n const token = this.cookie.get(this.environments.authCookie)\r\n\r\n if (!token) return next.handle(request)\r\n\r\n request = request.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`\r\n }\r\n })\r\n\r\n return next.handle(request)\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'\r\n\r\nimport { Observable, of } from 'rxjs'\r\nimport { tap } from 'rxjs/operators'\r\nimport { Environment } from '../ngx-services.models'\r\n\r\nconst DEFAULT_TTL = 10000 // ttl in ms\r\n\r\n@Injectable()\r\nexport class HttpCachingInterceptor implements HttpInterceptor {\r\n private cache = new Map<string, { ttl: number, res: HttpResponse<any> }>()\r\n\r\n constructor (@Inject('env') private envs: Environment) {}\r\n\r\n /**\r\n * Intercepts HTTP requests to add caching functionality for GET requests.\r\n * Non-GET requests are passed through without caching.\r\n *\r\n * @param {HttpRequest<any>} req - The HTTP request being intercepted.\r\n * @param {HttpHandler} next - The next handler in the HTTP pipeline to execute the request.\r\n * @return {Observable<HttpEvent<any>>} - An observable containing the HTTP response event, either from cache or the backend service.\r\n */\r\n intercept (req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n if (req.method !== 'GET') { return next.handle(req) }\r\n\r\n const cached = this.cache.get(req.urlWithParams)\r\n\r\n if (cached) {\r\n const isExpired = Date.now() > cached.ttl\r\n\r\n if (!isExpired) { return of(cached.res) }\r\n\r\n this.cache.delete(req.urlWithParams) // If expired, remove the entry from cache\r\n }\r\n\r\n return next.handle(req).pipe(\r\n tap((res) => {\r\n if (!(res instanceof HttpResponse)) { return }\r\n\r\n const ttl = Date.now() + (this.envs.cacheTtl ?? DEFAULT_TTL)\r\n\r\n this.cache.set(req.urlWithParams, { res, ttl })\r\n })\r\n )\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-services\r\n */\r\nexport * from './lib/ngx-services.module'\r\n\r\n// api services\r\nexport * from './lib/apis/api-companies.service'\r\nexport * from './lib/apis/api-external-pickups.service'\r\nexport * from './lib/apis/api-invoices.service'\r\nexport * from './lib/apis/api-open-items.service'\r\nexport * from './lib/apis/api-reports.service'\r\nexport * from './lib/apis/api-security.service'\r\nexport * from './lib/apis/api-shipments.service'\r\n\r\n// api models\r\nexport * from './lib/apis/models/api-companies.interfaces'\r\nexport * from './lib/apis/models/api-companies.types'\r\nexport * from './lib/apis/models/api-external-pickups.types'\r\nexport * from './lib/apis/models/api-invoices.interfaces'\r\nexport * from './lib/apis/models/api-invoices.types'\r\nexport * from './lib/apis/models/api-open-items.interfaces'\r\nexport * from './lib/apis/models/api-open-items.types'\r\nexport * from './lib/apis/models/api-reports.interfaces'\r\nexport * from './lib/apis/models/api-security.interfaces'\r\nexport * from './lib/apis/models/api-security.types'\r\nexport * from './lib/apis/models/api-shipments.types'\r\nexport * from './lib/apis/models/api.models'\r\n\r\n// websockets\r\nexport * from './lib/websockets/web-sockets.service'\r\n\r\n// cypher\r\nexport * from './lib/cypher/crypto.service'\r\n\r\n// interceptors\r\nexport * from './lib/interceptors/api-headers.interceptor'\r\nexport * from './lib/interceptors/api-token.interceptor'\r\nexport * from './lib/interceptors/http-caching.interceptor'\r\n\r\n// pusher\r\nexport * from 'pusher-js'\r\n\r\n// helpers\r\nexport * from './lib/helpers/http'\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map","i1","i2","Pusher","tap"],"mappings":";;;;;;;;;;MAOa,iBAAiB,CAAA;AAC5B;;;;;;AAMG;IACI,OAAO,OAAO,CAAE,WAAwB,EAAA;QAC7C,OAAO;AACL,YAAA,QAAQ,EAAE,iBAAiB;AAC3B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,QAAQ,EAAE,WAAW;AACtB,iBAAA;AACF,aAAA;SACF,CAAA;KACF;wGAlBU,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAjB,iBAAiB,E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,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;SAChD,CAAC,CACH,CAAA;KACF;AAnCU,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,kBAGZ,KAAK,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;4GAHf,sBAAsB,EAAA,CAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;;0BAIK,MAAM;2BAAC,KAAK,CAAA;;;ACb5B;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,45 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Environment } from '../ngx-services.models';
3
+ import { CancelDeliveryConfirmationIn, CompleteDeliveryConfirmationIn, GenerateDeliveryConfirmationIn, KeyOTPOut } from './models/api-external-pickups.types';
4
+ import { Observable } from 'rxjs';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ApiExternalPickupsService {
7
+ private httpClient;
8
+ private environment;
9
+ constructor(httpClient: HttpClient, environment: Environment);
10
+ /**
11
+ * Getter method to retrieve the API's external operations URL.
12
+ * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
13
+ * Defaults to an empty string if the property is undefined or null.
14
+ *
15
+ * @return {string} The external operations URL or an empty string if unavailable.
16
+ */
17
+ get url(): string;
18
+ /**
19
+ * Generates a delivery confirmation by sending the provided payload to the API.
20
+ *
21
+ * @param {GenerateDeliveryConfirmationIn} payload - The input payload required to generate the delivery confirmation.
22
+ * @return {Observable<KeyOTPOut>} An observable that emits the generated delivery confirmation data.
23
+ */
24
+ generateDeliveryConfirmation(payload: GenerateDeliveryConfirmationIn): Observable<KeyOTPOut>;
25
+ /**
26
+ * Confirms the completion of a delivery operation by making a PATCH request.
27
+ *
28
+ * @param {Object} input - The input parameters for the method.
29
+ * @param {string} input.operationId - The unique identifier of the delivery operation to be confirmed.
30
+ * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.
31
+ * @return {Observable<Object>} - An observable containing the response data from the API.
32
+ */
33
+ completedDeliveryConfirmation({ keyOTP, operationId, }: CompleteDeliveryConfirmationIn): Observable<{}>;
34
+ /**
35
+ * Cancels a delivery confirmation by sending an OTP and additional data to the server.
36
+ *
37
+ * @param {Object} param0 - The parameter object containing the required properties.
38
+ * @param {string} param0.otp - The one-time password to authenticate the cancellation request.
39
+ * @param {Object} param0.body - Additional body data required for cancellation.
40
+ * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
41
+ */
42
+ cancelDeliveryConfirmation({ otp, ...body }: CancelDeliveryConfirmationIn): Observable<{}>;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiExternalPickupsService, never>;
44
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiExternalPickupsService>;
45
+ }
@@ -0,0 +1,31 @@
1
+ export type KeyOTPOut = {
2
+ code: string;
3
+ };
4
+ export type GenerateDeliveryConfirmationIn = {
5
+ operation_id: number;
6
+ signature: {
7
+ client: {
8
+ full_name: string;
9
+ };
10
+ package_detail: {
11
+ shipment_tracking_number: string;
12
+ pieces: {
13
+ tracking_number: string;
14
+ status: string;
15
+ }[];
16
+ }[];
17
+ };
18
+ };
19
+ export type CompleteDeliveryConfirmationIn = {
20
+ operationId: number;
21
+ keyOTP: string;
22
+ };
23
+ export type CancelDeliveryConfirmationIn = {
24
+ signature: {
25
+ status: string;
26
+ operation_id: number;
27
+ signature_base_64: string;
28
+ mime_type: string;
29
+ };
30
+ otp?: string;
31
+ };
@@ -1,5 +1,7 @@
1
1
  export type Environment = {
2
2
  apiCompaniesUrl: string;
3
+ apiExternalOperationsKey: string;
4
+ apiExternalOperationsUrl: string;
3
5
  apiInvoicesUrl: string;
4
6
  apiOpenItemsUrl: string;
5
7
  apiReportsUrl: string;
@@ -8,4 +10,10 @@ export type Environment = {
8
10
  authCookie: string;
9
11
  cacheTtl?: number;
10
12
  secretKey: string;
13
+ sockets?: {
14
+ app_key: string;
15
+ debug?: boolean;
16
+ port: number;
17
+ url: string;
18
+ };
11
19
  };
@@ -0,0 +1,49 @@
1
+ import { Channel } from 'pusher-js';
2
+ import { Observable } from 'rxjs';
3
+ import { Environment } from '../ngx-services.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class WebSocketsService {
6
+ private environments;
7
+ private pusher;
8
+ constructor(environments: Environment);
9
+ /**
10
+ * Publishes an event to the specified channel with the given data.
11
+ *
12
+ * @param {Channel} channel - The channel instance where the event will be published.
13
+ * @param {string} eventName - The name of the event to be published.
14
+ * @param {T} data - The payload data to be sent with the event.
15
+ * @return {Promise<boolean>} A promise that resolves to a boolean indicating
16
+ * whether the event was successfully triggered on the channel.
17
+ */
18
+ pub<T>(channel: Channel, eventName: string, data: T): Promise<boolean>;
19
+ /**
20
+ * Subscribes to a specified channel, retrying multiple times upon failure.
21
+ *
22
+ * @param {string} channelName - The name of the channel to be subscribed to.
23
+ * @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.
24
+ * @throws {Error} If the subscription fails after the maximum number of retry attempts.
25
+ */
26
+ channelSub(channelName: string): Promise<Channel>;
27
+ /**
28
+ * Binds an event listener to a specified event on a given channel using Pusher or a Channel object,
29
+ * and returns an Observable that emits event data of type T.
30
+ *
31
+ * @param {Channel|string} channel - The channel to bind the event to. It can be a Channel object or a string representing the channel name.
32
+ * @param {string} event - The name of the event to bind to the channel.
33
+ * @return {Observable<T>} An Observable that emits data of type T when the specified event is triggered.
34
+ */
35
+ eventBind<T>(channel: Channel | string, event: string): Observable<T>;
36
+ /**
37
+ * Unbinds an event from the specified channel and returns an observable
38
+ * that emits data when the event callback is triggered.
39
+ *
40
+ * @param {Channel} channel - The channel object from which the event should be unbound.
41
+ * @param {string} event - The name of the event to unbind.
42
+ * @return {Observable<T>} An observable that emits data from the unbound event callback.
43
+ */
44
+ eventUnbind<T>(channel: Channel, event: string): Observable<unknown>;
45
+ private connect;
46
+ private wait;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketsService, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketsService>;
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.3.5",
3
+ "version": "18.3.6",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
@@ -35,7 +35,8 @@
35
35
  "peerDependencies": {
36
36
  "@angular/common": "^18.2.0",
37
37
  "@angular/core": "^18.2.0",
38
- "ngx-cookie-service": "^18.0.0"
38
+ "ngx-cookie-service": "^18.0.0",
39
+ "pusher-js": "^7.5.0"
39
40
  },
40
41
  "sideEffects": false,
41
42
  "module": "fesm2022/experteam-mx-ngx-services.mjs",
package/public-api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './lib/ngx-services.module';
2
2
  export * from './lib/apis/api-companies.service';
3
+ export * from './lib/apis/api-external-pickups.service';
3
4
  export * from './lib/apis/api-invoices.service';
4
5
  export * from './lib/apis/api-open-items.service';
5
6
  export * from './lib/apis/api-reports.service';
@@ -7,6 +8,7 @@ export * from './lib/apis/api-security.service';
7
8
  export * from './lib/apis/api-shipments.service';
8
9
  export * from './lib/apis/models/api-companies.interfaces';
9
10
  export * from './lib/apis/models/api-companies.types';
11
+ export * from './lib/apis/models/api-external-pickups.types';
10
12
  export * from './lib/apis/models/api-invoices.interfaces';
11
13
  export * from './lib/apis/models/api-invoices.types';
12
14
  export * from './lib/apis/models/api-open-items.interfaces';
@@ -16,8 +18,10 @@ export * from './lib/apis/models/api-security.interfaces';
16
18
  export * from './lib/apis/models/api-security.types';
17
19
  export * from './lib/apis/models/api-shipments.types';
18
20
  export * from './lib/apis/models/api.models';
21
+ export * from './lib/websockets/web-sockets.service';
19
22
  export * from './lib/cypher/crypto.service';
20
23
  export * from './lib/interceptors/api-headers.interceptor';
21
24
  export * from './lib/interceptors/api-token.interceptor';
22
25
  export * from './lib/interceptors/http-caching.interceptor';
26
+ export * from 'pusher-js';
23
27
  export * from './lib/helpers/http';