@experteam-mx/ngx-services 18.3.4 → 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.
- package/esm2022/lib/apis/api-companies.service.mjs +3 -3
- package/esm2022/lib/apis/api-external-pickups.service.mjs +72 -0
- package/esm2022/lib/apis/api-invoices.service.mjs +3 -3
- package/esm2022/lib/apis/api-open-items.service.mjs +3 -3
- package/esm2022/lib/apis/api-reports.service.mjs +3 -3
- package/esm2022/lib/apis/api-security.service.mjs +30 -4
- package/esm2022/lib/apis/api-shipments.service.mjs +3 -3
- package/esm2022/lib/apis/models/api-external-pickups.types.mjs +2 -0
- package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
- package/esm2022/lib/cypher/crypto.service.mjs +3 -3
- package/esm2022/lib/interceptors/api-headers.interceptor.mjs +3 -3
- package/esm2022/lib/interceptors/api-token.interceptor.mjs +3 -3
- package/esm2022/lib/interceptors/http-caching.interceptor.mjs +3 -3
- package/esm2022/lib/ngx-services.models.mjs +1 -1
- package/esm2022/lib/ngx-services.module.mjs +4 -4
- package/esm2022/lib/websockets/web-sockets.service.mjs +115 -0
- package/esm2022/public-api.mjs +7 -1
- package/fesm2022/experteam-mx-ngx-services.mjs +244 -37
- package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
- package/lib/apis/api-external-pickups.service.d.ts +45 -0
- package/lib/apis/api-security.service.d.ts +19 -0
- package/lib/apis/models/api-external-pickups.types.d.ts +31 -0
- package/lib/apis/models/api-security.interfaces.d.ts +4 -0
- package/lib/ngx-services.models.d.ts +8 -0
- package/lib/websockets/web-sockets.service.d.ts +49 -0
- package/package.json +3 -2
- package/public-api.d.ts +4 -0
|
@@ -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
|
|
8
|
+
import Pusher__default from 'pusher-js';
|
|
9
|
+
export * from 'pusher-js';
|
|
8
10
|
|
|
9
11
|
class NgxServicesModule {
|
|
10
12
|
/**
|
|
@@ -25,11 +27,11 @@ class NgxServicesModule {
|
|
|
25
27
|
]
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
29
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
30
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgxServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
31
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.11", ngImport: i0, type: NgxServicesModule });
|
|
32
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgxServicesModule, providers: [provideHttpClient()] });
|
|
31
33
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgxServicesModule, decorators: [{
|
|
33
35
|
type: NgModule,
|
|
34
36
|
args: [{
|
|
35
37
|
providers: [provideHttpClient()]
|
|
@@ -351,10 +353,10 @@ class ApiCompaniesService {
|
|
|
351
353
|
params: httpParams(params),
|
|
352
354
|
}).pipe(map(({ data }) => data));
|
|
353
355
|
}
|
|
354
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
355
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
356
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiCompaniesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
357
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiCompaniesService, providedIn: 'root' });
|
|
356
358
|
}
|
|
357
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiCompaniesService, decorators: [{
|
|
358
360
|
type: Injectable,
|
|
359
361
|
args: [{
|
|
360
362
|
providedIn: 'root'
|
|
@@ -364,6 +366,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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;
|
|
@@ -431,10 +501,10 @@ class ApiInvoicesService {
|
|
|
431
501
|
return this.http.post(`${this.url}/operation/cancel-billing/${invoiceId}`, body)
|
|
432
502
|
.pipe(map(({ data }) => data));
|
|
433
503
|
}
|
|
434
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
435
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
504
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiInvoicesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
505
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiInvoicesService, providedIn: 'root' });
|
|
436
506
|
}
|
|
437
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiInvoicesService, decorators: [{
|
|
438
508
|
type: Injectable,
|
|
439
509
|
args: [{
|
|
440
510
|
providedIn: 'root'
|
|
@@ -489,10 +559,10 @@ class ApiOpenItemsService {
|
|
|
489
559
|
return this.http.post(`${this.url}/other-invoices`, body)
|
|
490
560
|
.pipe(map(({ data }) => data));
|
|
491
561
|
}
|
|
492
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
493
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
562
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiOpenItemsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
563
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiOpenItemsService, providedIn: 'root' });
|
|
494
564
|
}
|
|
495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiOpenItemsService, decorators: [{
|
|
496
566
|
type: Injectable,
|
|
497
567
|
args: [{
|
|
498
568
|
providedIn: 'root'
|
|
@@ -564,10 +634,10 @@ class ApiReportsService {
|
|
|
564
634
|
},
|
|
565
635
|
}).pipe(map(({ data }) => data));
|
|
566
636
|
}
|
|
567
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
568
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
637
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiReportsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
638
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiReportsService, providedIn: 'root' });
|
|
569
639
|
}
|
|
570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiReportsService, decorators: [{
|
|
571
641
|
type: Injectable,
|
|
572
642
|
args: [{
|
|
573
643
|
providedIn: 'root'
|
|
@@ -764,10 +834,36 @@ class ApiSecurityService {
|
|
|
764
834
|
return this.http.delete(`${this.url}/roles/${id}`)
|
|
765
835
|
.pipe(map(({ data }) => data));
|
|
766
836
|
}
|
|
767
|
-
|
|
768
|
-
|
|
837
|
+
/**
|
|
838
|
+
* Retrieves a list of modules and permissions
|
|
839
|
+
*
|
|
840
|
+
* @param queryParams - The query parameters to filter the modules.
|
|
841
|
+
* @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.
|
|
842
|
+
*/
|
|
843
|
+
getModules(queryParams) {
|
|
844
|
+
return this.http.get(`${this.url}/modules`, {
|
|
845
|
+
params: queryParams
|
|
846
|
+
}).pipe(map(({ data }) => data));
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Retrieves a list of modules and permissions
|
|
850
|
+
*
|
|
851
|
+
* @param params.token - Custom token for authorization.
|
|
852
|
+
* @param params.queryParams - The query parameters to filter the modules.
|
|
853
|
+
* @returns Observable<ModulesOut[]> - An observable that emits an array of modules and permissions.
|
|
854
|
+
*/
|
|
855
|
+
getModulesToken(params) {
|
|
856
|
+
return this.http.get(`${this.url}/modules`, {
|
|
857
|
+
params: params.queryParams,
|
|
858
|
+
headers: {
|
|
859
|
+
Authorization: `Bearer ${params.token}`
|
|
860
|
+
}
|
|
861
|
+
}).pipe(map(({ data }) => data));
|
|
862
|
+
}
|
|
863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiSecurityService, deps: [{ token: 'env' }, { token: i1$1.CookieService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
864
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiSecurityService, providedIn: 'root' });
|
|
769
865
|
}
|
|
770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiSecurityService, decorators: [{
|
|
771
867
|
type: Injectable,
|
|
772
868
|
args: [{
|
|
773
869
|
providedIn: 'root'
|
|
@@ -813,10 +909,10 @@ class ApiShipmentsService {
|
|
|
813
909
|
return this.http.post(`${this.url}/shipments/manifest`, body)
|
|
814
910
|
.pipe(map(({ data }) => data));
|
|
815
911
|
}
|
|
816
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
817
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
912
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiShipmentsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
913
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiShipmentsService, providedIn: 'root' });
|
|
818
914
|
}
|
|
819
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiShipmentsService, decorators: [{
|
|
820
916
|
type: Injectable,
|
|
821
917
|
args: [{
|
|
822
918
|
providedIn: 'root'
|
|
@@ -826,6 +922,117 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
826
922
|
args: ['env']
|
|
827
923
|
}] }, { type: i1.HttpClient }] });
|
|
828
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
|
+
|
|
829
1036
|
class CryptoService {
|
|
830
1037
|
environments;
|
|
831
1038
|
constructor(environments) {
|
|
@@ -904,10 +1111,10 @@ class CryptoService {
|
|
|
904
1111
|
}
|
|
905
1112
|
return bytes.buffer;
|
|
906
1113
|
}
|
|
907
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
908
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
1114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CryptoService, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1115
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CryptoService, providedIn: 'root' });
|
|
909
1116
|
}
|
|
910
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: CryptoService, decorators: [{
|
|
911
1118
|
type: Injectable,
|
|
912
1119
|
args: [{
|
|
913
1120
|
providedIn: 'root'
|
|
@@ -945,10 +1152,10 @@ class ApiHeadersInterceptor {
|
|
|
945
1152
|
request = request.clone({ headers });
|
|
946
1153
|
return next.handle(request);
|
|
947
1154
|
}
|
|
948
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
949
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
1155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiHeadersInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1156
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiHeadersInterceptor });
|
|
950
1157
|
}
|
|
951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiHeadersInterceptor, decorators: [{
|
|
952
1159
|
type: Injectable
|
|
953
1160
|
}] });
|
|
954
1161
|
|
|
@@ -981,10 +1188,10 @@ class ApiTokenInterceptor {
|
|
|
981
1188
|
});
|
|
982
1189
|
return next.handle(request);
|
|
983
1190
|
}
|
|
984
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
985
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
1191
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiTokenInterceptor, deps: [{ token: 'env' }, { token: i1$1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1192
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiTokenInterceptor });
|
|
986
1193
|
}
|
|
987
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: ApiTokenInterceptor, decorators: [{
|
|
988
1195
|
type: Injectable
|
|
989
1196
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
990
1197
|
type: Inject,
|
|
@@ -1026,10 +1233,10 @@ class HttpCachingInterceptor {
|
|
|
1026
1233
|
this.cache.set(req.urlWithParams, { res, ttl });
|
|
1027
1234
|
}));
|
|
1028
1235
|
}
|
|
1029
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1030
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
1236
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: HttpCachingInterceptor, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1237
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: HttpCachingInterceptor });
|
|
1031
1238
|
}
|
|
1032
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: HttpCachingInterceptor, decorators: [{
|
|
1033
1240
|
type: Injectable
|
|
1034
1241
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1035
1242
|
type: Inject,
|
|
@@ -1044,5 +1251,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1044
1251
|
* Generated bundle index. Do not edit.
|
|
1045
1252
|
*/
|
|
1046
1253
|
|
|
1047
|
-
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 };
|
|
1048
1255
|
//# sourceMappingURL=experteam-mx-ngx-services.mjs.map
|