@esolve/ng-esolve-connect 0.109.1 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/auth/index.mjs +3 -4
- package/esm2022/lib/auth/interceptors/esolve-auth.interceptor.mjs +32 -0
- package/esm2022/lib/auth/interceptors/index.mjs +2 -0
- package/esm2022/lib/auth/providers/esolve-eurus-auto-login.provider.mjs +2 -2
- package/esm2022/lib/auth/services/esolve-auth.service.mjs +288 -0
- package/esm2022/lib/auth/services/esolve-otp.service.mjs +77 -0
- package/esm2022/lib/auth/services/index.mjs +3 -0
- package/esm2022/lib/core/esolve-config.service.mjs +37 -40
- package/esm2022/lib/core/esolve-connect-config.interface.mjs +1 -1
- package/esm2022/lib/core/providers/index.mjs +2 -2
- package/esm2022/lib/core/providers/ng-esolve-connect.provider.mjs +19 -0
- package/esm2022/lib/coupons/esolve-coupons.service.mjs +8 -6
- package/esm2022/lib/session/esolve-session.service.mjs +86 -88
- package/esm2022/lib/shared/cookie/esolve-cookie-options.interface.mjs +2 -0
- package/esm2022/lib/shared/cookie/esolve-cookie.service.mjs +5 -5
- package/esm2022/lib/shared/cookie/index.mjs +2 -2
- package/esm2022/lib/vouchers/esolve-vouchers.service.mjs +8 -6
- package/fesm2022/esolve-ng-esolve-connect.mjs +301 -314
- package/fesm2022/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/auth/index.d.ts +2 -3
- package/lib/auth/interceptors/esolve-auth.interceptor.d.ts +2 -0
- package/lib/auth/interceptors/index.d.ts +1 -0
- package/lib/auth/{esolve-auth.service.d.ts → services/esolve-auth.service.d.ts} +1 -1
- package/lib/auth/{esolve-otp.service.d.ts → services/esolve-otp.service.d.ts} +3 -3
- package/lib/auth/services/index.d.ts +2 -0
- package/lib/core/esolve-config.service.d.ts +14 -10
- package/lib/core/esolve-connect-config.interface.d.ts +6 -6
- package/lib/core/providers/index.d.ts +1 -1
- package/lib/session/esolve-session.service.d.ts +12 -5
- package/lib/shared/cookie/esolve-cookie-options.interface.d.ts +7 -0
- package/lib/shared/cookie/esolve-cookie.service.d.ts +3 -2
- package/lib/shared/cookie/index.d.ts +2 -1
- package/package.json +1 -1
- package/esm2022/lib/auth/esolve-auth-interceptor.service.mjs +0 -42
- package/esm2022/lib/auth/esolve-auth.service.mjs +0 -286
- package/esm2022/lib/auth/esolve-otp.service.mjs +0 -77
- package/esm2022/lib/core/providers/provide-ng-esolve-connect.function.mjs +0 -24
- package/lib/auth/esolve-auth-interceptor.service.d.ts +0 -10
- /package/lib/core/providers/{provide-ng-esolve-connect.function.d.ts → ng-esolve-connect.provider.d.ts} +0 -0
|
@@ -1,59 +1,57 @@
|
|
|
1
1
|
import { isPlatformBrowser, CommonModule, IMAGE_LOADER, DOCUMENT } from '@angular/common';
|
|
2
|
-
import { HttpErrorResponse, HttpClient, HttpParams, HttpHeaders,
|
|
2
|
+
import { HttpErrorResponse, HttpClient, HttpParams, HttpHeaders, provideHttpClient, withInterceptors, withInterceptorsFromDi } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, Injectable, PLATFORM_ID, APP_INITIALIZER, NgModule, ElementRef, Directive, Input, HostListener } from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, Injectable, PLATFORM_ID, signal, computed, APP_INITIALIZER, NgModule, ElementRef, Directive, Input, HostListener } from '@angular/core';
|
|
5
5
|
import { SsrCookieService } from 'ngx-cookie-service-ssr';
|
|
6
|
-
import { throwError,
|
|
6
|
+
import { throwError, Subject, switchMap, timer, takeUntil, filter, distinctUntilChanged, catchError as catchError$1, of, tap, firstValueFrom, map as map$1, BehaviorSubject, iif } from 'rxjs';
|
|
7
|
+
import { toObservable } from '@angular/core/rxjs-interop';
|
|
7
8
|
import { fromUnixTime, parseISO } from 'date-fns';
|
|
8
|
-
import { map
|
|
9
|
+
import { map, catchError, switchMap as switchMap$1 } from 'rxjs/operators';
|
|
9
10
|
import { Title, Meta } from '@angular/platform-browser';
|
|
10
11
|
|
|
11
12
|
const ESOLVE_CONNECT_CONFIG = new InjectionToken('esolve.connect.config');
|
|
12
13
|
|
|
13
14
|
class EsolveConfigService {
|
|
14
15
|
constructor() {
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
this.config = inject(ESOLVE_CONNECT_CONFIG);
|
|
17
|
+
this.wsid = this.config.wsid;
|
|
18
|
+
this.api_url = this.config.api_url;
|
|
19
|
+
this.site_url = this.config.site_url;
|
|
20
|
+
// Device specific
|
|
21
|
+
this.native = this.config.native ?? false;
|
|
22
|
+
this.device_designation = this.config.device_designation ?? 'web';
|
|
23
|
+
// SEO configuration
|
|
24
|
+
this.title_prefix = this.config.title_prefix ?? '';
|
|
25
|
+
this.title_suffix = this.config.title_suffix ?? '';
|
|
26
|
+
this.title_separator = this.config.title_separator ?? '|';
|
|
27
|
+
this.default_seo_title = this.config.default_seo_title ?? '';
|
|
28
|
+
this.default_seo_description = this.config.default_seo_description ?? '';
|
|
29
|
+
this.default_seo_keywords = this.config.default_seo_keywords ?? '';
|
|
30
|
+
// Storage keys
|
|
31
|
+
this.session_cookie_key = this.config.session_cookie_key ?? '_ng_eslv_token';
|
|
32
|
+
this.coupon_cookie_key = this.config.coupon_cookie_key ?? '_ng_eslv_coupons';
|
|
33
|
+
this.voucher_cookie_key = this.config.voucher_cookie_key ?? '_ng_eslv_vouchers';
|
|
34
|
+
// CDN settings
|
|
35
|
+
this.legacy_cdn = this.config.legacy_cdn;
|
|
36
|
+
this.cdn = this.config.cdn;
|
|
37
|
+
this.ftg_cdn = this.config.ftg_cdn;
|
|
38
|
+
this.error_image_path = this.config.error_image_path;
|
|
39
|
+
if (this.api_url === '' || this.wsid === '') {
|
|
25
40
|
throw new Error('Invalid eSolve Eurus config');
|
|
26
41
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.title_suffix = config.title_suffix ?? '';
|
|
32
|
-
this.default_seo_title = config.default_seo_title ?? '';
|
|
33
|
-
this.default_seo_description = config.default_seo_description ?? '';
|
|
34
|
-
this.default_seo_keywords = config.default_seo_keywords ?? '';
|
|
35
|
-
this.native = config.native ?? false;
|
|
36
|
-
if (config.session_storage_key) {
|
|
37
|
-
this.session_storage_key = config.session_storage_key;
|
|
38
|
-
}
|
|
39
|
-
if (config.title_separator) {
|
|
40
|
-
this.title_separator = config.title_separator;
|
|
41
|
-
}
|
|
42
|
-
if (config.coupon_storage_key) {
|
|
43
|
-
this.coupon_storage_key = config.coupon_storage_key;
|
|
44
|
-
}
|
|
45
|
-
if (config.voucher_storage_key) {
|
|
46
|
-
this.voucher_storage_key = config.voucher_storage_key;
|
|
47
|
-
}
|
|
48
|
-
if (this.native && config.device_designation) {
|
|
49
|
-
this.device_designation = config.device_designation;
|
|
50
|
-
}
|
|
51
|
-
this.legacy_cdn = config.legacy_cdn;
|
|
52
|
-
this.cdn = config.cdn;
|
|
53
|
-
if (config.ftg_cdn) {
|
|
54
|
-
this.ftg_cdn = config.ftg_cdn;
|
|
42
|
+
}
|
|
43
|
+
updateWsid(wsid) {
|
|
44
|
+
if (wsid === '') {
|
|
45
|
+
throw new Error('Invalid WSID');
|
|
55
46
|
}
|
|
56
|
-
this.
|
|
47
|
+
this.wsid = wsid;
|
|
48
|
+
}
|
|
49
|
+
udpateCdn(cdn, ftg_cdn) {
|
|
50
|
+
this.cdn = cdn;
|
|
51
|
+
this.ftg_cdn = ftg_cdn;
|
|
52
|
+
}
|
|
53
|
+
udpateLegacyCdn(cdn) {
|
|
54
|
+
this.legacy_cdn = cdn;
|
|
57
55
|
}
|
|
58
56
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
59
57
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveConfigService, providedIn: 'root' }); }
|
|
@@ -75,11 +73,11 @@ class EsolveCookieService {
|
|
|
75
73
|
get(name) {
|
|
76
74
|
return this.cookieService.get(name);
|
|
77
75
|
}
|
|
78
|
-
set(name, value,
|
|
79
|
-
this.cookieService.set(name, value,
|
|
76
|
+
set(name, value, options) {
|
|
77
|
+
this.cookieService.set(name, value, options);
|
|
80
78
|
}
|
|
81
|
-
delete(name,
|
|
82
|
-
this.cookieService.delete(name, path, domain, secure);
|
|
79
|
+
delete(name, options) {
|
|
80
|
+
this.cookieService.delete(name, options?.path, options?.domain, options?.secure, options?.sameSite);
|
|
83
81
|
}
|
|
84
82
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveCookieService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
85
83
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveCookieService, providedIn: 'root' }); }
|
|
@@ -522,33 +520,41 @@ class EsolveSessionService {
|
|
|
522
520
|
this.is_browser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
523
521
|
this.config = inject(EsolveConfigService);
|
|
524
522
|
this.cookieService = inject(EsolveCookieService);
|
|
525
|
-
this.
|
|
526
|
-
this.
|
|
527
|
-
this.
|
|
528
|
-
this.
|
|
529
|
-
this.
|
|
530
|
-
this.
|
|
531
|
-
this.
|
|
532
|
-
this.
|
|
533
|
-
this.
|
|
523
|
+
this.storage_key = this.setStorageKey();
|
|
524
|
+
this.token = signal('');
|
|
525
|
+
this.user_id = signal(0);
|
|
526
|
+
this.access_level = signal(0);
|
|
527
|
+
this.location_id = signal(0);
|
|
528
|
+
this.addresses_id = signal(0);
|
|
529
|
+
this.shipping_id = signal(0);
|
|
530
|
+
this.clients_id = signal(0);
|
|
531
|
+
this.state_hash = computed(() => esolveHexHash(this.token(), this.user_id(), this.location_id(), this.clients_id()));
|
|
532
|
+
this.session = computed(() => {
|
|
533
|
+
return {
|
|
534
|
+
token: this.token(),
|
|
535
|
+
user_id: this.user_id(),
|
|
536
|
+
access_level: this.access_level(),
|
|
537
|
+
location_id: this.location_id(),
|
|
538
|
+
addresses_id: this.addresses_id(),
|
|
539
|
+
shipping_id: this.shipping_id(),
|
|
540
|
+
clients_id: this.clients_id(),
|
|
541
|
+
};
|
|
542
|
+
});
|
|
543
|
+
this.token$ = toObservable(this.token);
|
|
544
|
+
this.user_id$ = toObservable(this.user_id);
|
|
545
|
+
this.access_level$ = toObservable(this.access_level);
|
|
546
|
+
this.location_id$ = toObservable(this.location_id);
|
|
547
|
+
this.addresses_id$ = toObservable(this.addresses_id);
|
|
548
|
+
this.shipping_id$ = toObservable(this.shipping_id);
|
|
549
|
+
this.clients_id$ = toObservable(this.clients_id);
|
|
550
|
+
this.session$ = toObservable(this.session);
|
|
534
551
|
/* These are RxJS subjects used for managing the expiration of the user session. */
|
|
535
552
|
this.timer_start = new Subject();
|
|
536
553
|
this.timer_stop = new Subject();
|
|
537
554
|
this.expire = new Subject();
|
|
538
555
|
this.session_end = new Subject();
|
|
539
|
-
this.setStorageKey();
|
|
540
|
-
this._session = this.initSession();
|
|
541
|
-
this.getSession()
|
|
542
|
-
.pipe(map(({ token, user_id, location_id, clients_id }) => {
|
|
543
|
-
return esolveHexHash(token, user_id, location_id, clients_id);
|
|
544
|
-
}))
|
|
545
|
-
.subscribe((hash) => {
|
|
546
|
-
this.state_hash = hash;
|
|
547
|
-
});
|
|
548
556
|
this.timer_start
|
|
549
|
-
.pipe(switchMap((time) =>
|
|
550
|
-
return timer(time).pipe(takeUntil(this.timer_stop));
|
|
551
|
-
}))
|
|
557
|
+
.pipe(switchMap((time) => timer(time).pipe(takeUntil(this.timer_stop))))
|
|
552
558
|
.subscribe(() => {
|
|
553
559
|
// Stored time expired. Check if session is valid
|
|
554
560
|
this.session_end.next();
|
|
@@ -562,18 +568,10 @@ class EsolveSessionService {
|
|
|
562
568
|
return this.getToken() !== '';
|
|
563
569
|
}
|
|
564
570
|
getSession() {
|
|
565
|
-
return this.
|
|
571
|
+
return this.session$;
|
|
566
572
|
}
|
|
567
573
|
getSessionValue() {
|
|
568
|
-
return
|
|
569
|
-
token: this.token$.getValue(),
|
|
570
|
-
user_id: this.user_id$.getValue(),
|
|
571
|
-
access_level: this.access_level$.getValue(),
|
|
572
|
-
location_id: this.location_id$.getValue(),
|
|
573
|
-
addresses_id: this.addresses_id$.getValue(),
|
|
574
|
-
shipping_id: this.shipping_id$.getValue(),
|
|
575
|
-
clients_id: this.clients_id$.getValue(),
|
|
576
|
-
};
|
|
574
|
+
return this.session();
|
|
577
575
|
}
|
|
578
576
|
onSessionEnd() {
|
|
579
577
|
return this.session_end.asObservable();
|
|
@@ -585,70 +583,70 @@ class EsolveSessionService {
|
|
|
585
583
|
this.expire.next();
|
|
586
584
|
}
|
|
587
585
|
getToken() {
|
|
588
|
-
return this.token
|
|
586
|
+
return this.token();
|
|
589
587
|
}
|
|
590
588
|
onTokenUpdate() {
|
|
591
|
-
return this.token$.
|
|
589
|
+
return this.token$.pipe(filter((token) => token !== ''), distinctUntilChanged());
|
|
592
590
|
}
|
|
593
591
|
updateToken(token) {
|
|
594
|
-
this.token
|
|
592
|
+
this.token.set(token);
|
|
595
593
|
}
|
|
596
594
|
getUserId() {
|
|
597
|
-
return this.user_id
|
|
595
|
+
return this.user_id();
|
|
598
596
|
}
|
|
599
597
|
onUserIdUpdate() {
|
|
600
|
-
return this.user_id
|
|
598
|
+
return this.user_id$;
|
|
601
599
|
}
|
|
602
600
|
updateUserId(user_id) {
|
|
603
|
-
this.user_id
|
|
601
|
+
this.user_id.set(user_id);
|
|
604
602
|
}
|
|
605
603
|
getAccessLevel() {
|
|
606
|
-
return this.access_level
|
|
604
|
+
return this.access_level();
|
|
607
605
|
}
|
|
608
606
|
onAccessLevelUpdate() {
|
|
609
|
-
return this.access_level
|
|
607
|
+
return this.access_level$;
|
|
610
608
|
}
|
|
611
609
|
updateAccessLevel(access_level) {
|
|
612
|
-
this.access_level
|
|
610
|
+
this.access_level.set(access_level);
|
|
613
611
|
}
|
|
614
612
|
getLocationId() {
|
|
615
|
-
return this.location_id
|
|
613
|
+
return this.location_id();
|
|
616
614
|
}
|
|
617
615
|
onLocationIdUpdate() {
|
|
618
|
-
return this.location_id
|
|
616
|
+
return this.location_id$;
|
|
619
617
|
}
|
|
620
618
|
updateLocationId(location_id) {
|
|
621
|
-
this.location_id
|
|
619
|
+
this.location_id.set(location_id);
|
|
622
620
|
}
|
|
623
621
|
getAddressesId() {
|
|
624
|
-
return this.addresses_id
|
|
622
|
+
return this.addresses_id();
|
|
625
623
|
}
|
|
626
624
|
onAddressesIdUpdate() {
|
|
627
|
-
return this.addresses_id
|
|
625
|
+
return this.addresses_id$;
|
|
628
626
|
}
|
|
629
627
|
updateAddressesId(addresses_id) {
|
|
630
|
-
this.addresses_id
|
|
628
|
+
this.addresses_id.set(addresses_id);
|
|
631
629
|
}
|
|
632
630
|
getShippingId() {
|
|
633
|
-
return this.shipping_id
|
|
631
|
+
return this.shipping_id();
|
|
634
632
|
}
|
|
635
633
|
onShippingIdUpdate() {
|
|
636
|
-
return this.shipping_id
|
|
634
|
+
return this.shipping_id$;
|
|
637
635
|
}
|
|
638
636
|
updateShippingId(shipping_id) {
|
|
639
|
-
this.shipping_id
|
|
637
|
+
this.shipping_id.set(shipping_id);
|
|
640
638
|
}
|
|
641
639
|
getClientsId() {
|
|
642
|
-
return this.clients_id
|
|
640
|
+
return this.clients_id();
|
|
643
641
|
}
|
|
644
642
|
onClientsIdUpdate() {
|
|
645
|
-
return this.clients_id
|
|
643
|
+
return this.clients_id$;
|
|
646
644
|
}
|
|
647
645
|
updateClientsId(clients_id) {
|
|
648
|
-
this.clients_id
|
|
646
|
+
this.clients_id.set(clients_id);
|
|
649
647
|
}
|
|
650
648
|
getStateHash() {
|
|
651
|
-
return this.state_hash;
|
|
649
|
+
return this.state_hash();
|
|
652
650
|
}
|
|
653
651
|
stopTimer() {
|
|
654
652
|
this.timer_stop.next();
|
|
@@ -679,45 +677,33 @@ class EsolveSessionService {
|
|
|
679
677
|
this.startTimer(expiry_date);
|
|
680
678
|
}
|
|
681
679
|
}
|
|
682
|
-
handleUpdateSession(
|
|
683
|
-
if (typeof user_id !== 'undefined') {
|
|
684
|
-
this.updateUserId(user_id);
|
|
680
|
+
handleUpdateSession(options) {
|
|
681
|
+
if (typeof options.user_id !== 'undefined') {
|
|
682
|
+
this.updateUserId(options.user_id);
|
|
685
683
|
}
|
|
686
|
-
if (typeof location_id !== 'undefined') {
|
|
687
|
-
this.updateLocationId(location_id);
|
|
684
|
+
if (typeof options.location_id !== 'undefined') {
|
|
685
|
+
this.updateLocationId(options.location_id);
|
|
688
686
|
}
|
|
689
|
-
if (typeof addresses_id !== 'undefined') {
|
|
690
|
-
this.updateAddressesId(addresses_id);
|
|
687
|
+
if (typeof options.addresses_id !== 'undefined') {
|
|
688
|
+
this.updateAddressesId(options.addresses_id);
|
|
691
689
|
}
|
|
692
|
-
if (typeof shipping_id !== 'undefined') {
|
|
693
|
-
this.updateShippingId(shipping_id);
|
|
690
|
+
if (typeof options.shipping_id !== 'undefined') {
|
|
691
|
+
this.updateShippingId(options.shipping_id);
|
|
694
692
|
}
|
|
695
|
-
if (typeof clients_id !== 'undefined') {
|
|
696
|
-
this.updateClientsId(clients_id);
|
|
693
|
+
if (typeof options.clients_id !== 'undefined') {
|
|
694
|
+
this.updateClientsId(options.clients_id);
|
|
697
695
|
}
|
|
698
|
-
if (typeof token !== 'undefined' &&
|
|
699
|
-
|
|
696
|
+
if (typeof options.token !== 'undefined' &&
|
|
697
|
+
options.token.trim() !== '') {
|
|
698
|
+
this.updateToken(options.token);
|
|
700
699
|
}
|
|
701
700
|
}
|
|
702
|
-
initSession() {
|
|
703
|
-
const session = {
|
|
704
|
-
token: this.onTokenUpdate(),
|
|
705
|
-
user_id: this.onUserIdUpdate(),
|
|
706
|
-
access_level: this.onAccessLevelUpdate(),
|
|
707
|
-
location_id: this.onLocationIdUpdate(),
|
|
708
|
-
addresses_id: this.onAddressesIdUpdate(),
|
|
709
|
-
shipping_id: this.onShippingIdUpdate(),
|
|
710
|
-
clients_id: this.onClientsIdUpdate(),
|
|
711
|
-
};
|
|
712
|
-
return combineLatest(session).pipe(
|
|
713
|
-
// Delays the emit only slightly incase multiple values are set
|
|
714
|
-
debounceTime(10), shareReplay(1));
|
|
715
|
-
}
|
|
716
701
|
setStorageKey() {
|
|
717
|
-
if (typeof this.config.
|
|
718
|
-
this.config.
|
|
719
|
-
|
|
702
|
+
if (typeof this.config.session_cookie_key === 'string' &&
|
|
703
|
+
this.config.session_cookie_key !== '') {
|
|
704
|
+
return this.config.session_cookie_key;
|
|
720
705
|
}
|
|
706
|
+
return '_ng_eslv_token';
|
|
721
707
|
}
|
|
722
708
|
getCache() {
|
|
723
709
|
const data = this.cookieService.get(this.storage_key);
|
|
@@ -730,14 +716,23 @@ class EsolveSessionService {
|
|
|
730
716
|
return localStorage.getItem(this.storage_key);
|
|
731
717
|
}
|
|
732
718
|
setCache(data, expiration_date) {
|
|
733
|
-
this.cookieService.set(this.storage_key, data,
|
|
719
|
+
this.cookieService.set(this.storage_key, data, {
|
|
720
|
+
expires: expiration_date,
|
|
721
|
+
path: '/',
|
|
722
|
+
sameSite: 'None',
|
|
723
|
+
secure: true,
|
|
724
|
+
});
|
|
734
725
|
if (!this.is_browser || !localStorage) {
|
|
735
726
|
return;
|
|
736
727
|
}
|
|
737
728
|
localStorage.setItem(this.storage_key, data);
|
|
738
729
|
}
|
|
739
730
|
removeCache() {
|
|
740
|
-
this.cookieService.delete(this.storage_key,
|
|
731
|
+
this.cookieService.delete(this.storage_key, {
|
|
732
|
+
path: '/',
|
|
733
|
+
sameSite: 'None',
|
|
734
|
+
secure: true,
|
|
735
|
+
});
|
|
741
736
|
if (!this.is_browser || !localStorage) {
|
|
742
737
|
return;
|
|
743
738
|
}
|
|
@@ -770,7 +765,7 @@ class EsolveSessionMetadataService {
|
|
|
770
765
|
observe: 'body',
|
|
771
766
|
params: { type },
|
|
772
767
|
})
|
|
773
|
-
.pipe(map
|
|
768
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError((errorRes) => {
|
|
774
769
|
return this.errorHandler.handleHttpPostError('set-sessions-metadata', errorRes);
|
|
775
770
|
}));
|
|
776
771
|
}
|
|
@@ -779,7 +774,7 @@ class EsolveSessionMetadataService {
|
|
|
779
774
|
.get(`${this.config.api_url}/get-sessions-metadata.php`, {
|
|
780
775
|
params: { type },
|
|
781
776
|
})
|
|
782
|
-
.pipe(map
|
|
777
|
+
.pipe(map((response) => {
|
|
783
778
|
if (response.records === undefined ||
|
|
784
779
|
(Array.isArray(response.records) &&
|
|
785
780
|
response.records.length === 0)) {
|
|
@@ -795,7 +790,7 @@ class EsolveSessionMetadataService {
|
|
|
795
790
|
responseType: 'json',
|
|
796
791
|
observe: 'body',
|
|
797
792
|
})
|
|
798
|
-
.pipe(map
|
|
793
|
+
.pipe(map((http_response) => {
|
|
799
794
|
if (http_response.result === undefined ||
|
|
800
795
|
http_response.result === null ||
|
|
801
796
|
http_response.result.status !== 'success') {
|
|
@@ -844,11 +839,13 @@ class EsolveAuthService {
|
|
|
844
839
|
if (anonymous) {
|
|
845
840
|
params = params.set('anonymous', true);
|
|
846
841
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
842
|
+
else {
|
|
843
|
+
if (email !== '') {
|
|
844
|
+
params = params.set('email', email);
|
|
845
|
+
}
|
|
846
|
+
if (password !== '') {
|
|
847
|
+
params = params.set('password', password);
|
|
848
|
+
}
|
|
852
849
|
}
|
|
853
850
|
return this.http
|
|
854
851
|
.get(`${this.config.api_url}/get-access-token.php`, {
|
|
@@ -897,7 +894,7 @@ class EsolveAuthService {
|
|
|
897
894
|
responseType: 'json',
|
|
898
895
|
observe: 'body',
|
|
899
896
|
})
|
|
900
|
-
.pipe(map((response) => {
|
|
897
|
+
.pipe(map$1((response) => {
|
|
901
898
|
if (response.responses === undefined ||
|
|
902
899
|
response.responses.length <= 0) {
|
|
903
900
|
throw response;
|
|
@@ -945,7 +942,7 @@ class EsolveAuthService {
|
|
|
945
942
|
responseType: 'json',
|
|
946
943
|
observe: 'body',
|
|
947
944
|
})
|
|
948
|
-
.pipe(map((response) => {
|
|
945
|
+
.pipe(map$1((response) => {
|
|
949
946
|
if (response.responses === undefined ||
|
|
950
947
|
response.responses.length <= 0) {
|
|
951
948
|
throw response;
|
|
@@ -1040,7 +1037,7 @@ class EsolveAuthService {
|
|
|
1040
1037
|
try {
|
|
1041
1038
|
const token = this.session.getCachedSession();
|
|
1042
1039
|
if (!token) {
|
|
1043
|
-
throw new Error('Invalid token');
|
|
1040
|
+
throw new Error('Invalid token. Resetting session');
|
|
1044
1041
|
}
|
|
1045
1042
|
const result = await this.checkAccessToken(token);
|
|
1046
1043
|
return result;
|
|
@@ -1095,44 +1092,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
1095
1092
|
}]
|
|
1096
1093
|
}], ctorParameters: () => [] });
|
|
1097
1094
|
|
|
1098
|
-
class EsolveAuthInterceptorService {
|
|
1099
|
-
constructor() {
|
|
1100
|
-
this.config = inject(EsolveConfigService);
|
|
1101
|
-
this.session = inject(EsolveSessionService);
|
|
1102
|
-
}
|
|
1103
|
-
intercept(req, next) {
|
|
1104
|
-
if (req.url.startsWith(`${this.config.api_url}/`)) {
|
|
1105
|
-
const service_identifier = req.url.replace(`${this.config.api_url}/`, '');
|
|
1106
|
-
const modified_url = req.url;
|
|
1107
|
-
let params = req.params;
|
|
1108
|
-
let headers = req.headers;
|
|
1109
|
-
if (this.session.isValid()) {
|
|
1110
|
-
if (service_identifier !== 'get-access-token.php') {
|
|
1111
|
-
headers = headers.set('Authorization', `Bearer ${this.session.getToken()}`);
|
|
1112
|
-
}
|
|
1113
|
-
const state_hash = this.session.getStateHash();
|
|
1114
|
-
headers = headers.set('X-Esolve-State-Hash', state_hash);
|
|
1115
|
-
}
|
|
1116
|
-
params = params.set('ws_id', this.config.wsid);
|
|
1117
|
-
if (this.config.native && this.config.device_designation) {
|
|
1118
|
-
headers = headers.set('X-Device-Designation', this.config.device_designation);
|
|
1119
|
-
}
|
|
1120
|
-
const modified_req = req.clone({
|
|
1121
|
-
url: modified_url,
|
|
1122
|
-
params,
|
|
1123
|
-
headers,
|
|
1124
|
-
});
|
|
1125
|
-
return next.handle(modified_req);
|
|
1126
|
-
}
|
|
1127
|
-
return next.handle(req);
|
|
1128
|
-
}
|
|
1129
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveAuthInterceptorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1130
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveAuthInterceptorService }); }
|
|
1131
|
-
}
|
|
1132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: EsolveAuthInterceptorService, decorators: [{
|
|
1133
|
-
type: Injectable
|
|
1134
|
-
}] });
|
|
1135
|
-
|
|
1136
1095
|
class EsolveOtp {
|
|
1137
1096
|
constructor(record) {
|
|
1138
1097
|
this.otp_generated = false;
|
|
@@ -1185,7 +1144,7 @@ class EsolveOtpService {
|
|
|
1185
1144
|
try {
|
|
1186
1145
|
return this.http
|
|
1187
1146
|
.get(`${this.config.api_url}/get-otp.php`, { params })
|
|
1188
|
-
.pipe(map
|
|
1147
|
+
.pipe(map((response) => {
|
|
1189
1148
|
if (response.records === undefined ||
|
|
1190
1149
|
Array.isArray(response.records)) {
|
|
1191
1150
|
throw response;
|
|
@@ -1209,7 +1168,7 @@ class EsolveOtpService {
|
|
|
1209
1168
|
cellnumber,
|
|
1210
1169
|
},
|
|
1211
1170
|
})
|
|
1212
|
-
.pipe(map
|
|
1171
|
+
.pipe(map((response) => {
|
|
1213
1172
|
if (response.records === undefined ||
|
|
1214
1173
|
Array.isArray(response.records)) {
|
|
1215
1174
|
throw response;
|
|
@@ -1236,6 +1195,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
1236
1195
|
}]
|
|
1237
1196
|
}] });
|
|
1238
1197
|
|
|
1198
|
+
const esolveAuthInterceptor = (req, next) => {
|
|
1199
|
+
const config = inject(EsolveConfigService);
|
|
1200
|
+
const session = inject(EsolveSessionService);
|
|
1201
|
+
if (req.url.startsWith(`${config.api_url}/`)) {
|
|
1202
|
+
const service_identifier = req.url.replace(`${config.api_url}/`, '');
|
|
1203
|
+
const modified_url = req.url;
|
|
1204
|
+
let params = req.params;
|
|
1205
|
+
let headers = req.headers;
|
|
1206
|
+
if (session.isValid()) {
|
|
1207
|
+
if (service_identifier !== 'get-access-token.php') {
|
|
1208
|
+
headers = headers.set('Authorization', `Bearer ${session.getToken()}`);
|
|
1209
|
+
}
|
|
1210
|
+
const state_hash = session.getStateHash();
|
|
1211
|
+
headers = headers.set('X-Esolve-State-Hash', state_hash);
|
|
1212
|
+
}
|
|
1213
|
+
params = params.set('ws_id', config.wsid);
|
|
1214
|
+
if (config.native && config.device_designation) {
|
|
1215
|
+
headers = headers.set('X-Device-Designation', config.device_designation);
|
|
1216
|
+
}
|
|
1217
|
+
const modified_req = req.clone({
|
|
1218
|
+
url: modified_url,
|
|
1219
|
+
params,
|
|
1220
|
+
headers,
|
|
1221
|
+
});
|
|
1222
|
+
return next(modified_req);
|
|
1223
|
+
}
|
|
1224
|
+
return next(req);
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1239
1227
|
const ESOLVE_EURUS_AUTO_LOGIN = {
|
|
1240
1228
|
provide: APP_INITIALIZER,
|
|
1241
1229
|
multi: true,
|
|
@@ -1253,12 +1241,7 @@ function provideNgEsolveConnect(config, auto_login = false) {
|
|
|
1253
1241
|
provide: ESOLVE_CONNECT_CONFIG,
|
|
1254
1242
|
useValue: config,
|
|
1255
1243
|
},
|
|
1256
|
-
|
|
1257
|
-
provide: HTTP_INTERCEPTORS,
|
|
1258
|
-
useClass: EsolveAuthInterceptorService,
|
|
1259
|
-
multi: true,
|
|
1260
|
-
},
|
|
1261
|
-
provideHttpClient(withInterceptorsFromDi()),
|
|
1244
|
+
provideHttpClient(withInterceptors([esolveAuthInterceptor])),
|
|
1262
1245
|
];
|
|
1263
1246
|
if (auto_login) {
|
|
1264
1247
|
providers.push(ESOLVE_EURUS_AUTO_LOGIN);
|
|
@@ -1581,7 +1564,7 @@ class EsolveGeocoderService {
|
|
|
1581
1564
|
postal_code,
|
|
1582
1565
|
},
|
|
1583
1566
|
})
|
|
1584
|
-
.pipe(map
|
|
1567
|
+
.pipe(map((response) => {
|
|
1585
1568
|
if (response.records === undefined ||
|
|
1586
1569
|
Array.isArray(response.records)) {
|
|
1587
1570
|
throw response;
|
|
@@ -1598,7 +1581,7 @@ class EsolveGeocoderService {
|
|
|
1598
1581
|
longitude: longitude,
|
|
1599
1582
|
},
|
|
1600
1583
|
})
|
|
1601
|
-
.pipe(map
|
|
1584
|
+
.pipe(map((response) => {
|
|
1602
1585
|
if (response.records === undefined ||
|
|
1603
1586
|
Array.isArray(response.records)) {
|
|
1604
1587
|
throw response;
|
|
@@ -1714,7 +1697,7 @@ class EsolveCategoryTreeService {
|
|
|
1714
1697
|
}
|
|
1715
1698
|
return this.http
|
|
1716
1699
|
.get(`${this.config.api_url}/get-tree.php`, { params })
|
|
1717
|
-
.pipe(map
|
|
1700
|
+
.pipe(map((response) => {
|
|
1718
1701
|
if (response.records === undefined) {
|
|
1719
1702
|
throw response;
|
|
1720
1703
|
}
|
|
@@ -1734,7 +1717,7 @@ class EsolveCategoryTreeService {
|
|
|
1734
1717
|
params = params.set('special_id', special_id);
|
|
1735
1718
|
return this.http
|
|
1736
1719
|
.get(`${this.config.api_url}/get-special-tree.php`, { params })
|
|
1737
|
-
.pipe(map
|
|
1720
|
+
.pipe(map((response) => {
|
|
1738
1721
|
if (response.records === undefined) {
|
|
1739
1722
|
throw response;
|
|
1740
1723
|
}
|
|
@@ -1780,7 +1763,7 @@ class EsolveCategoryTreeService {
|
|
|
1780
1763
|
.get(`${this.config.api_url}/get-tree-item.php`, {
|
|
1781
1764
|
params,
|
|
1782
1765
|
})
|
|
1783
|
-
.pipe(map
|
|
1766
|
+
.pipe(map((response) => {
|
|
1784
1767
|
if (response.records === undefined ||
|
|
1785
1768
|
response.records.length <= 0) {
|
|
1786
1769
|
throw response;
|
|
@@ -1927,7 +1910,7 @@ class EsolveManufacturersService {
|
|
|
1927
1910
|
if (options?.featured_only) {
|
|
1928
1911
|
params = params.set('featured_only', options.featured_only);
|
|
1929
1912
|
}
|
|
1930
|
-
return this.getManufacturerRecords(params).pipe(map
|
|
1913
|
+
return this.getManufacturerRecords(params).pipe(map((records) => {
|
|
1931
1914
|
const manufacturers = [];
|
|
1932
1915
|
for (const record of records) {
|
|
1933
1916
|
manufacturers.push(this.processManufacturer(record));
|
|
@@ -1938,7 +1921,7 @@ class EsolveManufacturersService {
|
|
|
1938
1921
|
}));
|
|
1939
1922
|
}
|
|
1940
1923
|
getManufacturerSingle(params) {
|
|
1941
|
-
return this.getManufacturerRecords(params).pipe(map
|
|
1924
|
+
return this.getManufacturerRecords(params).pipe(map((records) => {
|
|
1942
1925
|
const record = records[0];
|
|
1943
1926
|
return this.processManufacturer(record);
|
|
1944
1927
|
}));
|
|
@@ -1948,7 +1931,7 @@ class EsolveManufacturersService {
|
|
|
1948
1931
|
.get(`${this.config.api_url}/get-manufacturers.php`, {
|
|
1949
1932
|
params,
|
|
1950
1933
|
})
|
|
1951
|
-
.pipe(map
|
|
1934
|
+
.pipe(map((response) => {
|
|
1952
1935
|
if (response.records === undefined ||
|
|
1953
1936
|
response.records.length <= 0) {
|
|
1954
1937
|
throw response;
|
|
@@ -2047,7 +2030,7 @@ class EsolveRangesService {
|
|
|
2047
2030
|
if (options?.manufacturers_id) {
|
|
2048
2031
|
params = params.set('manufacturers_id', options.manufacturers_id);
|
|
2049
2032
|
}
|
|
2050
|
-
return this.getRangeRecords(params).pipe(map
|
|
2033
|
+
return this.getRangeRecords(params).pipe(map((records) => {
|
|
2051
2034
|
const ranges = [];
|
|
2052
2035
|
for (const record of records) {
|
|
2053
2036
|
ranges.push(this.processRange(record));
|
|
@@ -2058,7 +2041,7 @@ class EsolveRangesService {
|
|
|
2058
2041
|
}));
|
|
2059
2042
|
}
|
|
2060
2043
|
getRangeSingle(params) {
|
|
2061
|
-
return this.getRangeRecords(params).pipe(map
|
|
2044
|
+
return this.getRangeRecords(params).pipe(map((records) => {
|
|
2062
2045
|
const record = records[0];
|
|
2063
2046
|
return this.processRange(record);
|
|
2064
2047
|
}));
|
|
@@ -2068,7 +2051,7 @@ class EsolveRangesService {
|
|
|
2068
2051
|
.get(`${this.config.api_url}/get-ranges.php`, {
|
|
2069
2052
|
params,
|
|
2070
2053
|
})
|
|
2071
|
-
.pipe(map
|
|
2054
|
+
.pipe(map((response) => {
|
|
2072
2055
|
if (response.records === undefined ||
|
|
2073
2056
|
response.records.length <= 0) {
|
|
2074
2057
|
throw response;
|
|
@@ -2140,7 +2123,7 @@ class EsolveTagsService {
|
|
|
2140
2123
|
.get(`${this.config.api_url}/get-tags.php`, {
|
|
2141
2124
|
params: this.parseOptions(options),
|
|
2142
2125
|
})
|
|
2143
|
-
.pipe(map
|
|
2126
|
+
.pipe(map((response) => {
|
|
2144
2127
|
if (response.records === undefined) {
|
|
2145
2128
|
throw response;
|
|
2146
2129
|
}
|
|
@@ -2228,7 +2211,7 @@ class EsolveTopicService {
|
|
|
2228
2211
|
.get(`${this.config.api_url}/get-topics.php`, {
|
|
2229
2212
|
params,
|
|
2230
2213
|
})
|
|
2231
|
-
.pipe(map
|
|
2214
|
+
.pipe(map((response) => {
|
|
2232
2215
|
if (response.records === undefined) {
|
|
2233
2216
|
throw response;
|
|
2234
2217
|
}
|
|
@@ -2334,7 +2317,7 @@ class EsolveAssetsService {
|
|
|
2334
2317
|
}
|
|
2335
2318
|
getAsset(id) {
|
|
2336
2319
|
const params = new HttpParams({ fromObject: { assets_id: id } });
|
|
2337
|
-
return this.getAssetRecords(params).pipe(map
|
|
2320
|
+
return this.getAssetRecords(params).pipe(map((response) => {
|
|
2338
2321
|
if (response.records === undefined ||
|
|
2339
2322
|
response.records.length <= 0) {
|
|
2340
2323
|
throw response;
|
|
@@ -2345,7 +2328,7 @@ class EsolveAssetsService {
|
|
|
2345
2328
|
}
|
|
2346
2329
|
getAssets(options) {
|
|
2347
2330
|
const params = this.parseOptions(options);
|
|
2348
|
-
return this.getAssetRecords(params).pipe(map
|
|
2331
|
+
return this.getAssetRecords(params).pipe(map((response) => {
|
|
2349
2332
|
if (response.records === undefined) {
|
|
2350
2333
|
throw response;
|
|
2351
2334
|
}
|
|
@@ -2369,7 +2352,7 @@ class EsolveAssetsService {
|
|
|
2369
2352
|
}
|
|
2370
2353
|
return this.http
|
|
2371
2354
|
.get(`${this.config.api_url}/get-media-assets.php`, { params })
|
|
2372
|
-
.pipe(map
|
|
2355
|
+
.pipe(map((response) => {
|
|
2373
2356
|
if (response.records === undefined) {
|
|
2374
2357
|
throw response;
|
|
2375
2358
|
}
|
|
@@ -2394,7 +2377,7 @@ class EsolveAssetsService {
|
|
|
2394
2377
|
.get(`${this.config.api_url}/get-stock-assets.php`, {
|
|
2395
2378
|
params,
|
|
2396
2379
|
})
|
|
2397
|
-
.pipe(map
|
|
2380
|
+
.pipe(map((response) => {
|
|
2398
2381
|
if (response.records === undefined) {
|
|
2399
2382
|
throw response;
|
|
2400
2383
|
}
|
|
@@ -3163,7 +3146,7 @@ class EsolveCouponsService {
|
|
|
3163
3146
|
coupon_key,
|
|
3164
3147
|
},
|
|
3165
3148
|
})
|
|
3166
|
-
.pipe(map
|
|
3149
|
+
.pipe(map((response) => {
|
|
3167
3150
|
if (response.records === undefined ||
|
|
3168
3151
|
Array.isArray(response.records)) {
|
|
3169
3152
|
throw response;
|
|
@@ -3217,7 +3200,7 @@ class EsolveCouponsService {
|
|
|
3217
3200
|
coupons: coupon_ids.join(','),
|
|
3218
3201
|
},
|
|
3219
3202
|
})
|
|
3220
|
-
.pipe(map
|
|
3203
|
+
.pipe(map((response) => {
|
|
3221
3204
|
if (response.records === undefined) {
|
|
3222
3205
|
throw response;
|
|
3223
3206
|
}
|
|
@@ -3249,7 +3232,9 @@ class EsolveCouponsService {
|
|
|
3249
3232
|
cacheCoupons() {
|
|
3250
3233
|
if (this.cache.size > 0) {
|
|
3251
3234
|
const coupons_json = this.jsonEncodeMap(this.cache);
|
|
3252
|
-
this.cookieService.set(this.storage_key, coupons_json,
|
|
3235
|
+
this.cookieService.set(this.storage_key, coupons_json, {
|
|
3236
|
+
path: '/',
|
|
3237
|
+
});
|
|
3253
3238
|
this.setBackup(coupons_json);
|
|
3254
3239
|
}
|
|
3255
3240
|
else {
|
|
@@ -3258,7 +3243,7 @@ class EsolveCouponsService {
|
|
|
3258
3243
|
}
|
|
3259
3244
|
deleteCoupons() {
|
|
3260
3245
|
this.cache.clear();
|
|
3261
|
-
this.cookieService.delete(this.storage_key, '/');
|
|
3246
|
+
this.cookieService.delete(this.storage_key, { path: '/' });
|
|
3262
3247
|
this.removeBackup();
|
|
3263
3248
|
}
|
|
3264
3249
|
getBackup() {
|
|
@@ -3296,9 +3281,9 @@ class EsolveCouponsService {
|
|
|
3296
3281
|
this.applied.next();
|
|
3297
3282
|
}
|
|
3298
3283
|
setStorageKey() {
|
|
3299
|
-
if (typeof this.config.
|
|
3300
|
-
this.config.
|
|
3301
|
-
this.storage_key = this.config.
|
|
3284
|
+
if (typeof this.config.coupon_cookie_key === 'string' &&
|
|
3285
|
+
this.config.coupon_cookie_key !== '') {
|
|
3286
|
+
this.storage_key = this.config.coupon_cookie_key;
|
|
3302
3287
|
}
|
|
3303
3288
|
}
|
|
3304
3289
|
jsonEncodeMap(data) {
|
|
@@ -3397,7 +3382,7 @@ class EsolveVouchersService {
|
|
|
3397
3382
|
voucher_key,
|
|
3398
3383
|
},
|
|
3399
3384
|
})
|
|
3400
|
-
.pipe(map
|
|
3385
|
+
.pipe(map((response) => {
|
|
3401
3386
|
if (response.records === undefined ||
|
|
3402
3387
|
Array.isArray(response.records)) {
|
|
3403
3388
|
throw response;
|
|
@@ -3451,7 +3436,7 @@ class EsolveVouchersService {
|
|
|
3451
3436
|
vouchers: voucher_ids.join(','),
|
|
3452
3437
|
},
|
|
3453
3438
|
})
|
|
3454
|
-
.pipe(map
|
|
3439
|
+
.pipe(map((response) => {
|
|
3455
3440
|
if (response.records === undefined) {
|
|
3456
3441
|
throw response;
|
|
3457
3442
|
}
|
|
@@ -3483,7 +3468,9 @@ class EsolveVouchersService {
|
|
|
3483
3468
|
cacheVouchers() {
|
|
3484
3469
|
if (this.cache.size > 0) {
|
|
3485
3470
|
const vouchers_json = this.jsonEncodeMap(this.cache);
|
|
3486
|
-
this.cookieService.set(this.storage_key, vouchers_json,
|
|
3471
|
+
this.cookieService.set(this.storage_key, vouchers_json, {
|
|
3472
|
+
path: '/',
|
|
3473
|
+
});
|
|
3487
3474
|
this.setBackup(vouchers_json);
|
|
3488
3475
|
}
|
|
3489
3476
|
else {
|
|
@@ -3492,7 +3479,7 @@ class EsolveVouchersService {
|
|
|
3492
3479
|
}
|
|
3493
3480
|
deleteVouchers() {
|
|
3494
3481
|
this.cache.clear();
|
|
3495
|
-
this.cookieService.delete(this.storage_key, '/');
|
|
3482
|
+
this.cookieService.delete(this.storage_key, { path: '/' });
|
|
3496
3483
|
this.removeBackup();
|
|
3497
3484
|
}
|
|
3498
3485
|
getBackup() {
|
|
@@ -3530,9 +3517,9 @@ class EsolveVouchersService {
|
|
|
3530
3517
|
this.applied.next();
|
|
3531
3518
|
}
|
|
3532
3519
|
setStorageKey() {
|
|
3533
|
-
if (typeof this.config.
|
|
3534
|
-
this.config.
|
|
3535
|
-
this.storage_key = this.config.
|
|
3520
|
+
if (typeof this.config.voucher_cookie_key === 'string' &&
|
|
3521
|
+
this.config.voucher_cookie_key !== '') {
|
|
3522
|
+
this.storage_key = this.config.voucher_cookie_key;
|
|
3536
3523
|
}
|
|
3537
3524
|
}
|
|
3538
3525
|
jsonEncodeMap(data) {
|
|
@@ -3610,7 +3597,7 @@ class EsolveCartService {
|
|
|
3610
3597
|
}
|
|
3611
3598
|
return this.http
|
|
3612
3599
|
.get(`${this.config.api_url}/get-cart.php`, { params })
|
|
3613
|
-
.pipe(map
|
|
3600
|
+
.pipe(map((response) => {
|
|
3614
3601
|
if (response.records === undefined) {
|
|
3615
3602
|
throw response;
|
|
3616
3603
|
}
|
|
@@ -3638,7 +3625,7 @@ class EsolveCartService {
|
|
|
3638
3625
|
responseType: 'json',
|
|
3639
3626
|
observe: 'body',
|
|
3640
3627
|
})
|
|
3641
|
-
.pipe(map
|
|
3628
|
+
.pipe(map((response) => {
|
|
3642
3629
|
if (response.responses === undefined) {
|
|
3643
3630
|
throw response;
|
|
3644
3631
|
}
|
|
@@ -3658,7 +3645,7 @@ class EsolveCartService {
|
|
|
3658
3645
|
responseType: 'json',
|
|
3659
3646
|
observe: 'body',
|
|
3660
3647
|
})
|
|
3661
|
-
.pipe(map
|
|
3648
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
3662
3649
|
this._cached_tracking = 0;
|
|
3663
3650
|
return new EsolveEmptyCartResult(response);
|
|
3664
3651
|
})), catchError((errorRes) => {
|
|
@@ -3682,7 +3669,7 @@ class EsolveCartService {
|
|
|
3682
3669
|
}
|
|
3683
3670
|
return this.http
|
|
3684
3671
|
.get(`${this.config.api_url}/get-cart-totals.php`, { params })
|
|
3685
|
-
.pipe(map
|
|
3672
|
+
.pipe(map((response) => {
|
|
3686
3673
|
if (response.records === undefined ||
|
|
3687
3674
|
Array.isArray(response.records)) {
|
|
3688
3675
|
throw response;
|
|
@@ -3698,7 +3685,7 @@ class EsolveCartService {
|
|
|
3698
3685
|
getTrackingCode() {
|
|
3699
3686
|
return iif(() => this._cached_tracking > 0, of(this._cached_tracking), this.http
|
|
3700
3687
|
.get(`${this.config.api_url}/get-checkout-tracking.php`)
|
|
3701
|
-
.pipe(map
|
|
3688
|
+
.pipe(map((response) => {
|
|
3702
3689
|
if (response.records === undefined ||
|
|
3703
3690
|
Array.isArray(response.records)) {
|
|
3704
3691
|
throw response;
|
|
@@ -3721,7 +3708,7 @@ class EsolveCartService {
|
|
|
3721
3708
|
transaction_id,
|
|
3722
3709
|
},
|
|
3723
3710
|
})
|
|
3724
|
-
.pipe(map
|
|
3711
|
+
.pipe(map((response) => {
|
|
3725
3712
|
if (response.records === undefined ||
|
|
3726
3713
|
Array.isArray(response.records)) {
|
|
3727
3714
|
throw response;
|
|
@@ -3774,7 +3761,7 @@ class EsolveCartService {
|
|
|
3774
3761
|
responseType: 'json',
|
|
3775
3762
|
observe: 'body',
|
|
3776
3763
|
})
|
|
3777
|
-
.pipe(map
|
|
3764
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
3778
3765
|
this._cached_tracking = 0;
|
|
3779
3766
|
this.coupons.reset();
|
|
3780
3767
|
this.vouchers.reset();
|
|
@@ -3787,7 +3774,7 @@ class EsolveCartService {
|
|
|
3787
3774
|
getCartAlternatives() {
|
|
3788
3775
|
return this.http
|
|
3789
3776
|
.get(`${this.config.api_url}/get-cart-alternatives.php`)
|
|
3790
|
-
.pipe(map
|
|
3777
|
+
.pipe(map((response) => {
|
|
3791
3778
|
if (response.records === undefined) {
|
|
3792
3779
|
throw response;
|
|
3793
3780
|
}
|
|
@@ -3813,7 +3800,7 @@ class EsolveCartService {
|
|
|
3813
3800
|
responseType: 'json',
|
|
3814
3801
|
observe: 'body',
|
|
3815
3802
|
})
|
|
3816
|
-
.pipe(map
|
|
3803
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError((errorRes) => {
|
|
3817
3804
|
return this.errorHandler.handleHttpPostError('set-cart-alternatives', errorRes);
|
|
3818
3805
|
}));
|
|
3819
3806
|
}
|
|
@@ -3824,7 +3811,7 @@ class EsolveCartService {
|
|
|
3824
3811
|
responseType: 'json',
|
|
3825
3812
|
observe: 'body',
|
|
3826
3813
|
})
|
|
3827
|
-
.pipe(map
|
|
3814
|
+
.pipe(map((http_response) => {
|
|
3828
3815
|
if (http_response.result === undefined ||
|
|
3829
3816
|
http_response.result === null ||
|
|
3830
3817
|
http_response.result.status !== 'success') {
|
|
@@ -4201,7 +4188,7 @@ class EsolveLocationsService {
|
|
|
4201
4188
|
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
4202
4189
|
}
|
|
4203
4190
|
}
|
|
4204
|
-
return this.getLocationRecords(params).pipe(map
|
|
4191
|
+
return this.getLocationRecords(params).pipe(map((response) => {
|
|
4205
4192
|
if (response.records === undefined ||
|
|
4206
4193
|
response.records.length <= 0) {
|
|
4207
4194
|
throw response;
|
|
@@ -4233,7 +4220,7 @@ class EsolveLocationsService {
|
|
|
4233
4220
|
longitude,
|
|
4234
4221
|
},
|
|
4235
4222
|
})
|
|
4236
|
-
.pipe(map
|
|
4223
|
+
.pipe(map((response) => {
|
|
4237
4224
|
if (response.records === undefined) {
|
|
4238
4225
|
throw response;
|
|
4239
4226
|
}
|
|
@@ -4252,7 +4239,7 @@ class EsolveLocationsService {
|
|
|
4252
4239
|
.get(`${this.config.api_url}/get-location-filters.php`, {
|
|
4253
4240
|
params,
|
|
4254
4241
|
})
|
|
4255
|
-
.pipe(map
|
|
4242
|
+
.pipe(map((response) => {
|
|
4256
4243
|
if (response.records === undefined) {
|
|
4257
4244
|
throw response;
|
|
4258
4245
|
}
|
|
@@ -4571,7 +4558,7 @@ class EsolveTransactionsService {
|
|
|
4571
4558
|
.get(`${this.config.api_url}/get-transactions.php`, {
|
|
4572
4559
|
params: params,
|
|
4573
4560
|
})
|
|
4574
|
-
.pipe(map((response) => {
|
|
4561
|
+
.pipe(map$1((response) => {
|
|
4575
4562
|
if (response.records === undefined) {
|
|
4576
4563
|
throw response;
|
|
4577
4564
|
}
|
|
@@ -4596,7 +4583,7 @@ class EsolveTransactionsService {
|
|
|
4596
4583
|
transaction_id: id,
|
|
4597
4584
|
},
|
|
4598
4585
|
})
|
|
4599
|
-
.pipe(map((response) => {
|
|
4586
|
+
.pipe(map$1((response) => {
|
|
4600
4587
|
if (response.records === undefined ||
|
|
4601
4588
|
response.records.length <= 0) {
|
|
4602
4589
|
throw response;
|
|
@@ -4689,14 +4676,14 @@ class EsolveAccountService {
|
|
|
4689
4676
|
responseType: 'json',
|
|
4690
4677
|
observe: 'body',
|
|
4691
4678
|
})
|
|
4692
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveUserAccountResult(response))), catchError$1((errorRes) => {
|
|
4679
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveUserAccountResult(response))), catchError$1((errorRes) => {
|
|
4693
4680
|
return this.errorHandler.handleHttpPostError('set-user-account', errorRes);
|
|
4694
4681
|
}));
|
|
4695
4682
|
}
|
|
4696
4683
|
getUserAccount() {
|
|
4697
4684
|
return this.http
|
|
4698
4685
|
.get(`${this.config.api_url}/get-account.php`)
|
|
4699
|
-
.pipe(map((response) => {
|
|
4686
|
+
.pipe(map$1((response) => {
|
|
4700
4687
|
if (response.records === undefined ||
|
|
4701
4688
|
response.records.length === 0) {
|
|
4702
4689
|
throw response;
|
|
@@ -4711,7 +4698,7 @@ class EsolveAccountService {
|
|
|
4711
4698
|
responseType: 'json',
|
|
4712
4699
|
observe: 'body',
|
|
4713
4700
|
})
|
|
4714
|
-
.pipe(map((http_response) => {
|
|
4701
|
+
.pipe(map$1((http_response) => {
|
|
4715
4702
|
if (http_response.result === undefined ||
|
|
4716
4703
|
http_response.result === null ||
|
|
4717
4704
|
http_response.result.status !== 'success') {
|
|
@@ -4734,7 +4721,7 @@ class EsolveAccountService {
|
|
|
4734
4721
|
responseType: 'json',
|
|
4735
4722
|
observe: 'body',
|
|
4736
4723
|
})
|
|
4737
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveAddressResult(response))), catchError$1((errorRes) => {
|
|
4724
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveAddressResult(response))), catchError$1((errorRes) => {
|
|
4738
4725
|
return this.errorHandler.handleHttpPostError('set-address', errorRes);
|
|
4739
4726
|
}));
|
|
4740
4727
|
}
|
|
@@ -4745,7 +4732,7 @@ class EsolveAccountService {
|
|
|
4745
4732
|
.get(`${this.config.api_url}/get-addresses.php`, {
|
|
4746
4733
|
params: { user_id: this.user_id },
|
|
4747
4734
|
})
|
|
4748
|
-
.pipe(map((response) => {
|
|
4735
|
+
.pipe(map$1((response) => {
|
|
4749
4736
|
if (response.records === undefined) {
|
|
4750
4737
|
throw response;
|
|
4751
4738
|
}
|
|
@@ -4761,7 +4748,7 @@ class EsolveAccountService {
|
|
|
4761
4748
|
this.loginGuard();
|
|
4762
4749
|
return this.http
|
|
4763
4750
|
.get(`${this.config.api_url}/get-user-clients.php`)
|
|
4764
|
-
.pipe(map((response) => {
|
|
4751
|
+
.pipe(map$1((response) => {
|
|
4765
4752
|
if (response.records === undefined) {
|
|
4766
4753
|
throw response;
|
|
4767
4754
|
}
|
|
@@ -4779,7 +4766,7 @@ class EsolveAccountService {
|
|
|
4779
4766
|
responseType: 'json',
|
|
4780
4767
|
observe: 'body',
|
|
4781
4768
|
})
|
|
4782
|
-
.pipe(map((http_response) => {
|
|
4769
|
+
.pipe(map$1((http_response) => {
|
|
4783
4770
|
if (http_response.result === undefined ||
|
|
4784
4771
|
http_response.result === null ||
|
|
4785
4772
|
http_response.result.status !== 'success') {
|
|
@@ -4803,7 +4790,7 @@ class EsolveAccountService {
|
|
|
4803
4790
|
responseType: 'json',
|
|
4804
4791
|
observe: 'body',
|
|
4805
4792
|
})
|
|
4806
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response, additional_data) => {
|
|
4793
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response, additional_data) => {
|
|
4807
4794
|
if (response.auto_login) {
|
|
4808
4795
|
const session_data = response.session_data;
|
|
4809
4796
|
let token = '';
|
|
@@ -4837,7 +4824,7 @@ class EsolveAccountService {
|
|
|
4837
4824
|
responseType: 'json',
|
|
4838
4825
|
observe: 'body',
|
|
4839
4826
|
})
|
|
4840
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4827
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4841
4828
|
return new EsolveChangePasswordResult(response);
|
|
4842
4829
|
})), catchError$1((errorRes) => {
|
|
4843
4830
|
return this.errorHandler.handleHttpPostError('set-change-password', errorRes);
|
|
@@ -4863,7 +4850,7 @@ class EsolveAccountService {
|
|
|
4863
4850
|
responseType: 'json',
|
|
4864
4851
|
observe: 'body',
|
|
4865
4852
|
})
|
|
4866
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4853
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4867
4854
|
if (response.auto_login) {
|
|
4868
4855
|
this.sessionService.handleUpdateSession({
|
|
4869
4856
|
user_id: +response.esolve_id,
|
|
@@ -4892,7 +4879,7 @@ class EsolveAccountService {
|
|
|
4892
4879
|
.get(`${this.config.api_url}/get-forgot-password.php`, {
|
|
4893
4880
|
params,
|
|
4894
4881
|
})
|
|
4895
|
-
.pipe(map((response) => {
|
|
4882
|
+
.pipe(map$1((response) => {
|
|
4896
4883
|
if (response.records === undefined ||
|
|
4897
4884
|
!('reset_link_sent' in response.records)) {
|
|
4898
4885
|
throw response;
|
|
@@ -4914,7 +4901,7 @@ class EsolveAccountService {
|
|
|
4914
4901
|
responseType: 'json',
|
|
4915
4902
|
observe: 'body',
|
|
4916
4903
|
})
|
|
4917
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4904
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4918
4905
|
if (!response.login_required) {
|
|
4919
4906
|
const session_data = response.session_data;
|
|
4920
4907
|
this.sessionService.handleUpdateSession({
|
|
@@ -4947,7 +4934,7 @@ class EsolveAccountService {
|
|
|
4947
4934
|
responseType: 'json',
|
|
4948
4935
|
observe: 'body',
|
|
4949
4936
|
})
|
|
4950
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4937
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4951
4938
|
if (typeof response.esolve_id === 'string') {
|
|
4952
4939
|
throw new Error('Invalid response id.');
|
|
4953
4940
|
}
|
|
@@ -4968,7 +4955,7 @@ class EsolveAccountService {
|
|
|
4968
4955
|
responseType: 'json',
|
|
4969
4956
|
observe: 'body',
|
|
4970
4957
|
})
|
|
4971
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4958
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4972
4959
|
if (typeof response.esolve_id === 'string') {
|
|
4973
4960
|
throw new Error('Invalid response id.');
|
|
4974
4961
|
}
|
|
@@ -4989,7 +4976,7 @@ class EsolveAccountService {
|
|
|
4989
4976
|
responseType: 'json',
|
|
4990
4977
|
observe: 'body',
|
|
4991
4978
|
})
|
|
4992
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4979
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
4993
4980
|
if (typeof response.esolve_id === 'string') {
|
|
4994
4981
|
throw new Error('Invalid response id.');
|
|
4995
4982
|
}
|
|
@@ -5033,7 +5020,7 @@ class EsolveAccountService {
|
|
|
5033
5020
|
.get(`${this.config.api_url}/get-transactions.php`, {
|
|
5034
5021
|
params,
|
|
5035
5022
|
})
|
|
5036
|
-
.pipe(map((response) => {
|
|
5023
|
+
.pipe(map$1((response) => {
|
|
5037
5024
|
if (response.records === undefined) {
|
|
5038
5025
|
throw response;
|
|
5039
5026
|
}
|
|
@@ -5061,7 +5048,7 @@ class EsolveAccountService {
|
|
|
5061
5048
|
transaction_id: id,
|
|
5062
5049
|
},
|
|
5063
5050
|
})
|
|
5064
|
-
.pipe(map((response) => {
|
|
5051
|
+
.pipe(map$1((response) => {
|
|
5065
5052
|
if (response.records === undefined ||
|
|
5066
5053
|
response.records.length <= 0) {
|
|
5067
5054
|
throw response;
|
|
@@ -5079,7 +5066,7 @@ class EsolveAccountService {
|
|
|
5079
5066
|
this.loginGuard();
|
|
5080
5067
|
return this.http
|
|
5081
5068
|
.get(`${this.config.api_url}/get-client-account-balances.php`)
|
|
5082
|
-
.pipe(map((response) => {
|
|
5069
|
+
.pipe(map$1((response) => {
|
|
5083
5070
|
if (response.records === undefined) {
|
|
5084
5071
|
throw response;
|
|
5085
5072
|
}
|
|
@@ -5133,7 +5120,7 @@ class EsolveAccountService {
|
|
|
5133
5120
|
responseType: 'json',
|
|
5134
5121
|
observe: 'body',
|
|
5135
5122
|
})
|
|
5136
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveErpDocumentsRequestResult(response))), catchError$1((errorRes) => {
|
|
5123
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveErpDocumentsRequestResult(response))), catchError$1((errorRes) => {
|
|
5137
5124
|
return this.errorHandler.handleHttpPostError('set-request-erp-document', errorRes);
|
|
5138
5125
|
}));
|
|
5139
5126
|
}
|
|
@@ -5147,7 +5134,7 @@ class EsolveAccountService {
|
|
|
5147
5134
|
.get(`${this.config.api_url}/get-erp-document-request.php`, {
|
|
5148
5135
|
params,
|
|
5149
5136
|
})
|
|
5150
|
-
.pipe(map((response) => {
|
|
5137
|
+
.pipe(map$1((response) => {
|
|
5151
5138
|
if (response.records === undefined) {
|
|
5152
5139
|
throw response;
|
|
5153
5140
|
}
|
|
@@ -5224,7 +5211,7 @@ class EsolveAccountService {
|
|
|
5224
5211
|
responseType: 'json',
|
|
5225
5212
|
observe: 'body',
|
|
5226
5213
|
})
|
|
5227
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
5214
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
5228
5215
|
if (typeof response.esolve_id === 'string') {
|
|
5229
5216
|
throw new Error('Invalid response id.');
|
|
5230
5217
|
}
|
|
@@ -5327,7 +5314,7 @@ class EsolveBannerService {
|
|
|
5327
5314
|
.get(`${this.config.api_url}/get-banners.php`, {
|
|
5328
5315
|
params,
|
|
5329
5316
|
})
|
|
5330
|
-
.pipe(map
|
|
5317
|
+
.pipe(map((response) => {
|
|
5331
5318
|
if (response.records === undefined) {
|
|
5332
5319
|
throw response;
|
|
5333
5320
|
}
|
|
@@ -5437,7 +5424,7 @@ class EsolveMenuService {
|
|
|
5437
5424
|
.get(`${this.config.api_url}/get-menu-tree.php`, {
|
|
5438
5425
|
params: { identifier },
|
|
5439
5426
|
})
|
|
5440
|
-
.pipe(map
|
|
5427
|
+
.pipe(map((response) => {
|
|
5441
5428
|
if (!response || response.records === undefined) {
|
|
5442
5429
|
throw response;
|
|
5443
5430
|
}
|
|
@@ -5593,7 +5580,7 @@ class EsolveNewsService {
|
|
|
5593
5580
|
const params = new HttpParams({
|
|
5594
5581
|
fromObject: { sef_title: identifier },
|
|
5595
5582
|
});
|
|
5596
|
-
return this.getNewsRecords(params).pipe(map
|
|
5583
|
+
return this.getNewsRecords(params).pipe(map((response) => {
|
|
5597
5584
|
if (response.records === undefined ||
|
|
5598
5585
|
response.records.length <= 0) {
|
|
5599
5586
|
throw response;
|
|
@@ -5607,7 +5594,7 @@ class EsolveNewsService {
|
|
|
5607
5594
|
}
|
|
5608
5595
|
getNewsArticles(options) {
|
|
5609
5596
|
const params = this.parseOptions(options);
|
|
5610
|
-
return this.getNewsRecords(params).pipe(map
|
|
5597
|
+
return this.getNewsRecords(params).pipe(map((response) => {
|
|
5611
5598
|
if (response.records === undefined) {
|
|
5612
5599
|
throw response;
|
|
5613
5600
|
}
|
|
@@ -5627,7 +5614,7 @@ class EsolveNewsService {
|
|
|
5627
5614
|
enable_images,
|
|
5628
5615
|
},
|
|
5629
5616
|
})
|
|
5630
|
-
.pipe(map
|
|
5617
|
+
.pipe(map((response) => {
|
|
5631
5618
|
if (response.records === undefined) {
|
|
5632
5619
|
throw response;
|
|
5633
5620
|
}
|
|
@@ -5690,7 +5677,7 @@ class EsolveNewsService {
|
|
|
5690
5677
|
responseType: 'json',
|
|
5691
5678
|
observe: 'body',
|
|
5692
5679
|
})
|
|
5693
|
-
.pipe(map
|
|
5680
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveNewsletterResult(response))), catchError((errorRes) => {
|
|
5694
5681
|
return this.errorHandler.handleHttpPostError('set-newsletter', errorRes);
|
|
5695
5682
|
}));
|
|
5696
5683
|
}
|
|
@@ -6391,7 +6378,7 @@ class EsolveStockService {
|
|
|
6391
6378
|
code,
|
|
6392
6379
|
},
|
|
6393
6380
|
});
|
|
6394
|
-
return this.getStockRecords(params).pipe(map
|
|
6381
|
+
return this.getStockRecords(params).pipe(map((response) => {
|
|
6395
6382
|
if (response.records === undefined ||
|
|
6396
6383
|
response.records.length <= 0) {
|
|
6397
6384
|
throw response;
|
|
@@ -6411,7 +6398,7 @@ class EsolveStockService {
|
|
|
6411
6398
|
sef_name,
|
|
6412
6399
|
},
|
|
6413
6400
|
});
|
|
6414
|
-
return this.getStockRecords(params).pipe(map
|
|
6401
|
+
return this.getStockRecords(params).pipe(map((response) => {
|
|
6415
6402
|
if (response.records === undefined ||
|
|
6416
6403
|
response.records.length <= 0) {
|
|
6417
6404
|
throw response;
|
|
@@ -6479,7 +6466,7 @@ class EsolveStockService {
|
|
|
6479
6466
|
}
|
|
6480
6467
|
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
6481
6468
|
}
|
|
6482
|
-
return this.getStockRecords(params).pipe(map
|
|
6469
|
+
return this.getStockRecords(params).pipe(map((response) => {
|
|
6483
6470
|
if (response.records === undefined ||
|
|
6484
6471
|
response.records.length <= 0) {
|
|
6485
6472
|
throw response;
|
|
@@ -6550,7 +6537,7 @@ class EsolveStockService {
|
|
|
6550
6537
|
}
|
|
6551
6538
|
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
6552
6539
|
}
|
|
6553
|
-
return this.getStockHistoryRecords(params).pipe(map
|
|
6540
|
+
return this.getStockHistoryRecords(params).pipe(map((response) => {
|
|
6554
6541
|
if (response.records === undefined ||
|
|
6555
6542
|
response.records.length <= 0) {
|
|
6556
6543
|
throw response;
|
|
@@ -6572,7 +6559,7 @@ class EsolveStockService {
|
|
|
6572
6559
|
.get(`${this.config.api_url}/get-linked-items.php`, {
|
|
6573
6560
|
params: { code },
|
|
6574
6561
|
})
|
|
6575
|
-
.pipe(map
|
|
6562
|
+
.pipe(map((response) => {
|
|
6576
6563
|
if (response.records === undefined ||
|
|
6577
6564
|
response.records.length <= 0) {
|
|
6578
6565
|
throw response;
|
|
@@ -6608,7 +6595,7 @@ class EsolveStockService {
|
|
|
6608
6595
|
.get(`${this.config.api_url}/get-recipe-items.php`, {
|
|
6609
6596
|
params,
|
|
6610
6597
|
})
|
|
6611
|
-
.pipe(map
|
|
6598
|
+
.pipe(map((response) => {
|
|
6612
6599
|
if (response.records === undefined ||
|
|
6613
6600
|
response.records.length <= 0) {
|
|
6614
6601
|
throw response;
|
|
@@ -6651,7 +6638,7 @@ class EsolveStockService {
|
|
|
6651
6638
|
.get(`${this.config.api_url}/get-media-linked-items.php`, {
|
|
6652
6639
|
params,
|
|
6653
6640
|
})
|
|
6654
|
-
.pipe(map
|
|
6641
|
+
.pipe(map((response) => {
|
|
6655
6642
|
if (response.records === undefined ||
|
|
6656
6643
|
response.records.length <= 0) {
|
|
6657
6644
|
throw response;
|
|
@@ -6670,7 +6657,7 @@ class EsolveStockService {
|
|
|
6670
6657
|
.get(`${this.config.api_url}/get-suggested-items.php`, {
|
|
6671
6658
|
params: { code },
|
|
6672
6659
|
})
|
|
6673
|
-
.pipe(map
|
|
6660
|
+
.pipe(map((response) => {
|
|
6674
6661
|
if (response.records === undefined ||
|
|
6675
6662
|
response.records.length <= 0) {
|
|
6676
6663
|
throw response;
|
|
@@ -6688,7 +6675,7 @@ class EsolveStockService {
|
|
|
6688
6675
|
.get(`${this.config.api_url}/get-item-image-collection.php`, {
|
|
6689
6676
|
params: { code },
|
|
6690
6677
|
})
|
|
6691
|
-
.pipe(map
|
|
6678
|
+
.pipe(map((response) => {
|
|
6692
6679
|
if (response.records === undefined ||
|
|
6693
6680
|
Array.isArray(response.records)) {
|
|
6694
6681
|
throw response;
|
|
@@ -6712,7 +6699,7 @@ class EsolveStockService {
|
|
|
6712
6699
|
.get(`${this.config.api_url}/get-item-filters.php`, {
|
|
6713
6700
|
params,
|
|
6714
6701
|
})
|
|
6715
|
-
.pipe(map
|
|
6702
|
+
.pipe(map((response) => {
|
|
6716
6703
|
if (response.records === undefined) {
|
|
6717
6704
|
throw response;
|
|
6718
6705
|
}
|
|
@@ -6829,7 +6816,7 @@ class EsolveStockService {
|
|
|
6829
6816
|
responseType: 'json',
|
|
6830
6817
|
observe: 'body',
|
|
6831
6818
|
})
|
|
6832
|
-
.pipe(map
|
|
6819
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveSetNotifyResult(response))), catchError((errorRes) => {
|
|
6833
6820
|
return this.errorHandler.handleHttpPostError('set-notify', errorRes);
|
|
6834
6821
|
}));
|
|
6835
6822
|
}
|
|
@@ -6950,7 +6937,7 @@ class EsolveSpecialsService {
|
|
|
6950
6937
|
if (options?.special_type) {
|
|
6951
6938
|
params = params.set('special_type', options.special_type);
|
|
6952
6939
|
}
|
|
6953
|
-
return this.getSpecialRecords(params).pipe(map
|
|
6940
|
+
return this.getSpecialRecords(params).pipe(map((records) => {
|
|
6954
6941
|
const specials = [];
|
|
6955
6942
|
for (const record of records) {
|
|
6956
6943
|
specials.push(this.processSpecial(record));
|
|
@@ -6961,7 +6948,7 @@ class EsolveSpecialsService {
|
|
|
6961
6948
|
}));
|
|
6962
6949
|
}
|
|
6963
6950
|
getSpecialSingle(params) {
|
|
6964
|
-
return this.getSpecialRecords(params).pipe(map
|
|
6951
|
+
return this.getSpecialRecords(params).pipe(map((records) => {
|
|
6965
6952
|
const record = records[0];
|
|
6966
6953
|
return this.processSpecial(record);
|
|
6967
6954
|
}));
|
|
@@ -6969,7 +6956,7 @@ class EsolveSpecialsService {
|
|
|
6969
6956
|
getSpecialRecords(params) {
|
|
6970
6957
|
return this.http
|
|
6971
6958
|
.get(`${this.config.api_url}/get-specials.php`, { params })
|
|
6972
|
-
.pipe(map
|
|
6959
|
+
.pipe(map((response) => {
|
|
6973
6960
|
if (response.records === undefined ||
|
|
6974
6961
|
response.records.length <= 0) {
|
|
6975
6962
|
throw response;
|
|
@@ -7154,7 +7141,7 @@ class EsolvePaymentService {
|
|
|
7154
7141
|
...options,
|
|
7155
7142
|
},
|
|
7156
7143
|
})
|
|
7157
|
-
.pipe(map
|
|
7144
|
+
.pipe(map((response) => {
|
|
7158
7145
|
if (response.records === undefined) {
|
|
7159
7146
|
throw response;
|
|
7160
7147
|
}
|
|
@@ -7175,7 +7162,7 @@ class EsolvePaymentService {
|
|
|
7175
7162
|
cart_id: transaction_id,
|
|
7176
7163
|
},
|
|
7177
7164
|
})
|
|
7178
|
-
.pipe(map
|
|
7165
|
+
.pipe(map((response) => {
|
|
7179
7166
|
if (response.records === undefined ||
|
|
7180
7167
|
Array.isArray(response.records)) {
|
|
7181
7168
|
throw response;
|
|
@@ -7199,7 +7186,7 @@ class EsolvePaymentService {
|
|
|
7199
7186
|
.get(`${this.config.api_url}/get-vault.php`, {
|
|
7200
7187
|
params,
|
|
7201
7188
|
})
|
|
7202
|
-
.pipe(map
|
|
7189
|
+
.pipe(map((response) => {
|
|
7203
7190
|
if (response.records === undefined) {
|
|
7204
7191
|
throw response;
|
|
7205
7192
|
}
|
|
@@ -7232,7 +7219,7 @@ class EsolvePaymentService {
|
|
|
7232
7219
|
responseType: 'json',
|
|
7233
7220
|
observe: 'body',
|
|
7234
7221
|
})
|
|
7235
|
-
.pipe(map
|
|
7222
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveVaultItemResult(response))), catchError((errorRes) => {
|
|
7236
7223
|
return this.errorHandler.handleHttpPostError('set-vault', errorRes);
|
|
7237
7224
|
}));
|
|
7238
7225
|
}
|
|
@@ -7250,7 +7237,7 @@ class EsolvePaymentService {
|
|
|
7250
7237
|
responseType: 'json',
|
|
7251
7238
|
observe: 'body',
|
|
7252
7239
|
})
|
|
7253
|
-
.pipe(map
|
|
7240
|
+
.pipe(map((http_response) => {
|
|
7254
7241
|
if (http_response.result === undefined ||
|
|
7255
7242
|
http_response.result === null ||
|
|
7256
7243
|
http_response.result.status !== 'success') {
|
|
@@ -7302,7 +7289,7 @@ class EsolvePaymentService {
|
|
|
7302
7289
|
responseType: 'json',
|
|
7303
7290
|
observe: 'body',
|
|
7304
7291
|
})
|
|
7305
|
-
.pipe(map
|
|
7292
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolvePaymentResult(response))), catchError((errorRes) => {
|
|
7306
7293
|
return this.errorHandler.handleHttpPostError('set-payment', errorRes);
|
|
7307
7294
|
}));
|
|
7308
7295
|
}
|
|
@@ -7349,7 +7336,7 @@ class EsolvePaymentService {
|
|
|
7349
7336
|
responseType: 'json',
|
|
7350
7337
|
observe: 'body',
|
|
7351
7338
|
})
|
|
7352
|
-
.pipe(map
|
|
7339
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolvePaymentResult(response))), catchError((errorRes) => {
|
|
7353
7340
|
return this.errorHandler.handleHttpPostError('set-payment', errorRes);
|
|
7354
7341
|
}));
|
|
7355
7342
|
}
|
|
@@ -7365,7 +7352,7 @@ class EsolvePaymentService {
|
|
|
7365
7352
|
.get(`${this.config.api_url}/get-account-payments.php`, {
|
|
7366
7353
|
params: { ...options },
|
|
7367
7354
|
})
|
|
7368
|
-
.pipe(map
|
|
7355
|
+
.pipe(map((response) => {
|
|
7369
7356
|
if (response.records === undefined) {
|
|
7370
7357
|
throw response;
|
|
7371
7358
|
}
|
|
@@ -7605,7 +7592,7 @@ class EsolveShippingService {
|
|
|
7605
7592
|
}
|
|
7606
7593
|
return this.http
|
|
7607
7594
|
.get(`${this.config.api_url}/get-shipping-methods.php`, { params })
|
|
7608
|
-
.pipe(map
|
|
7595
|
+
.pipe(map((response) => {
|
|
7609
7596
|
if (response.records === undefined) {
|
|
7610
7597
|
throw response;
|
|
7611
7598
|
}
|
|
@@ -7642,7 +7629,7 @@ class EsolveShippingService {
|
|
|
7642
7629
|
params = params.set('type', type);
|
|
7643
7630
|
return this.http
|
|
7644
7631
|
.get(`${this.config.api_url}/get-shipping-cost.php`, { params })
|
|
7645
|
-
.pipe(map
|
|
7632
|
+
.pipe(map((response) => {
|
|
7646
7633
|
if (response.records === undefined) {
|
|
7647
7634
|
throw response;
|
|
7648
7635
|
}
|
|
@@ -7671,7 +7658,7 @@ class EsolveShippingService {
|
|
|
7671
7658
|
}
|
|
7672
7659
|
return this.http
|
|
7673
7660
|
.get(`${this.config.api_url}/get-time-slots.php`, { params })
|
|
7674
|
-
.pipe(map
|
|
7661
|
+
.pipe(map((response) => {
|
|
7675
7662
|
if (response.records === undefined ||
|
|
7676
7663
|
Array.isArray(response.records)) {
|
|
7677
7664
|
throw response;
|
|
@@ -7744,7 +7731,7 @@ class EsolveEnquiryService {
|
|
|
7744
7731
|
responseType: 'json',
|
|
7745
7732
|
observe: 'body',
|
|
7746
7733
|
})
|
|
7747
|
-
.pipe(map
|
|
7734
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveEnquiryResult(response))), catchError((errorRes) => {
|
|
7748
7735
|
return this.errorHandler.handleHttpPostError('set-enquiry', errorRes);
|
|
7749
7736
|
}));
|
|
7750
7737
|
}
|
|
@@ -7788,7 +7775,7 @@ class EsolveWishlistService {
|
|
|
7788
7775
|
* @returns An `Observable` with an array of cart items
|
|
7789
7776
|
*/
|
|
7790
7777
|
getWishlist() {
|
|
7791
|
-
return this.getWishlistRecords().pipe(map
|
|
7778
|
+
return this.getWishlistRecords().pipe(map((response) => {
|
|
7792
7779
|
if (response.records === undefined) {
|
|
7793
7780
|
throw response;
|
|
7794
7781
|
}
|
|
@@ -7816,7 +7803,7 @@ class EsolveWishlistService {
|
|
|
7816
7803
|
responseType: 'json',
|
|
7817
7804
|
observe: 'body',
|
|
7818
7805
|
})
|
|
7819
|
-
.pipe(map
|
|
7806
|
+
.pipe(map((response) => {
|
|
7820
7807
|
if (response.responses === undefined) {
|
|
7821
7808
|
throw response;
|
|
7822
7809
|
}
|
|
@@ -7837,7 +7824,7 @@ class EsolveWishlistService {
|
|
|
7837
7824
|
responseType: 'json',
|
|
7838
7825
|
observe: 'body',
|
|
7839
7826
|
})
|
|
7840
|
-
.pipe(map
|
|
7827
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
7841
7828
|
return new EsolveEmptyWishlistResult(response);
|
|
7842
7829
|
})), catchError((errorRes) => {
|
|
7843
7830
|
return this.errorHandler.handleHttpPostError('set-wishlist-empty', errorRes);
|
|
@@ -7919,7 +7906,7 @@ class EsolveSuppliersService {
|
|
|
7919
7906
|
if (options?.internal_account) {
|
|
7920
7907
|
params = params.set('internal_account', options.internal_account);
|
|
7921
7908
|
}
|
|
7922
|
-
return this.getSupplierRecords(params).pipe(map
|
|
7909
|
+
return this.getSupplierRecords(params).pipe(map((records) => {
|
|
7923
7910
|
const suppliers = [];
|
|
7924
7911
|
for (const record of records) {
|
|
7925
7912
|
suppliers.push(this.processSuppliers(record));
|
|
@@ -7934,7 +7921,7 @@ class EsolveSuppliersService {
|
|
|
7934
7921
|
.get(`${this.config.api_url}/get-suppliers.php`, {
|
|
7935
7922
|
params,
|
|
7936
7923
|
})
|
|
7937
|
-
.pipe(map
|
|
7924
|
+
.pipe(map((response) => {
|
|
7938
7925
|
if (response.records === undefined ||
|
|
7939
7926
|
response.records.length === 0) {
|
|
7940
7927
|
throw response;
|
|
@@ -8008,7 +7995,7 @@ class EsolveDeviceService {
|
|
|
8008
7995
|
responseType: 'json',
|
|
8009
7996
|
observe: 'body',
|
|
8010
7997
|
})
|
|
8011
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveSetDeviceResult(response))), catchError$1((errorRes) => {
|
|
7998
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveSetDeviceResult(response))), catchError$1((errorRes) => {
|
|
8012
7999
|
return this.errorHandler.handleHttpPostError('set-device', errorRes);
|
|
8013
8000
|
}));
|
|
8014
8001
|
}
|
|
@@ -8025,7 +8012,7 @@ class EsolveDeviceService {
|
|
|
8025
8012
|
params = params.set('user_id', options.user_id);
|
|
8026
8013
|
}
|
|
8027
8014
|
}
|
|
8028
|
-
return this.getUserDeviceRecords(params).pipe(map((response) => {
|
|
8015
|
+
return this.getUserDeviceRecords(params).pipe(map$1((response) => {
|
|
8029
8016
|
if (response.records === undefined ||
|
|
8030
8017
|
response.records.length <= 0) {
|
|
8031
8018
|
throw response;
|
|
@@ -8126,7 +8113,7 @@ class EsolveWalletService {
|
|
|
8126
8113
|
getBalances() {
|
|
8127
8114
|
return this.http
|
|
8128
8115
|
.get(`${this.config.api_url}/get-wallet-totals.php`)
|
|
8129
|
-
.pipe(map((response) => {
|
|
8116
|
+
.pipe(map$1((response) => {
|
|
8130
8117
|
if (response.records === undefined ||
|
|
8131
8118
|
Array.isArray(response.records)) {
|
|
8132
8119
|
throw response;
|
|
@@ -8163,7 +8150,7 @@ class EsolveWalletService {
|
|
|
8163
8150
|
.get(`${this.config.api_url}/get-wallet-transactions.php`, {
|
|
8164
8151
|
params: params,
|
|
8165
8152
|
})
|
|
8166
|
-
.pipe(map((response) => {
|
|
8153
|
+
.pipe(map$1((response) => {
|
|
8167
8154
|
if (response.records === undefined) {
|
|
8168
8155
|
throw response;
|
|
8169
8156
|
}
|
|
@@ -8189,7 +8176,7 @@ class EsolveWalletService {
|
|
|
8189
8176
|
responseType: 'json',
|
|
8190
8177
|
observe: 'body',
|
|
8191
8178
|
})
|
|
8192
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError$1((errorRes) => {
|
|
8179
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError$1((errorRes) => {
|
|
8193
8180
|
return this.errorHandler.handleHttpPostError('set-wallet-cash-out', errorRes);
|
|
8194
8181
|
}));
|
|
8195
8182
|
}
|
|
@@ -8308,7 +8295,7 @@ class EsolveDeliveriesService {
|
|
|
8308
8295
|
.get(`${this.config.api_url}/get-delivery-status.php`, {
|
|
8309
8296
|
params,
|
|
8310
8297
|
})
|
|
8311
|
-
.pipe(map((response) => {
|
|
8298
|
+
.pipe(map$1((response) => {
|
|
8312
8299
|
if (response.records === undefined ||
|
|
8313
8300
|
Array.isArray(response.records)) {
|
|
8314
8301
|
throw response;
|
|
@@ -8367,7 +8354,7 @@ class EsolveDeliveriesService {
|
|
|
8367
8354
|
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
8368
8355
|
}
|
|
8369
8356
|
}
|
|
8370
|
-
return this.getDeliveriesRecords(params).pipe(map((response) => {
|
|
8357
|
+
return this.getDeliveriesRecords(params).pipe(map$1((response) => {
|
|
8371
8358
|
if (response.records === undefined ||
|
|
8372
8359
|
response.records.length <= 0) {
|
|
8373
8360
|
throw response;
|
|
@@ -8599,7 +8586,7 @@ class EsolveCompetitionsService {
|
|
|
8599
8586
|
if (options?.identifier) {
|
|
8600
8587
|
params = params.set('identifier', options.identifier);
|
|
8601
8588
|
}
|
|
8602
|
-
return this.getCompetitionRecords(params).pipe(map((records) => {
|
|
8589
|
+
return this.getCompetitionRecords(params).pipe(map$1((records) => {
|
|
8603
8590
|
const competitions = [];
|
|
8604
8591
|
for (const record of records) {
|
|
8605
8592
|
competitions.push(this.processCompetition(record));
|
|
@@ -8631,12 +8618,12 @@ class EsolveCompetitionsService {
|
|
|
8631
8618
|
observe: 'body',
|
|
8632
8619
|
params,
|
|
8633
8620
|
})
|
|
8634
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveCompetitionEntryResult(response))), catchError$1((errorRes) => {
|
|
8621
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveCompetitionEntryResult(response))), catchError$1((errorRes) => {
|
|
8635
8622
|
return this.errorHandler.handleHttpPostError('set-competition-entry', errorRes);
|
|
8636
8623
|
}));
|
|
8637
8624
|
}
|
|
8638
8625
|
getCompetitionSingle(params) {
|
|
8639
|
-
return this.getCompetitionRecords(params).pipe(map((records) => {
|
|
8626
|
+
return this.getCompetitionRecords(params).pipe(map$1((records) => {
|
|
8640
8627
|
const record = records[0];
|
|
8641
8628
|
return this.processCompetition(record);
|
|
8642
8629
|
}));
|
|
@@ -8646,7 +8633,7 @@ class EsolveCompetitionsService {
|
|
|
8646
8633
|
.get(`${this.config.api_url}/get-competitions.php`, {
|
|
8647
8634
|
params,
|
|
8648
8635
|
})
|
|
8649
|
-
.pipe(map((response) => {
|
|
8636
|
+
.pipe(map$1((response) => {
|
|
8650
8637
|
if (response.records === undefined ||
|
|
8651
8638
|
response.records.length <= 0) {
|
|
8652
8639
|
throw response;
|
|
@@ -8766,7 +8753,7 @@ class EsolveReviewsService {
|
|
|
8766
8753
|
.get(`${this.config.api_url}/get-item-reviews.php`, {
|
|
8767
8754
|
params: params,
|
|
8768
8755
|
})
|
|
8769
|
-
.pipe(map((response) => {
|
|
8756
|
+
.pipe(map$1((response) => {
|
|
8770
8757
|
if (response.records === undefined) {
|
|
8771
8758
|
throw response;
|
|
8772
8759
|
}
|
|
@@ -8808,7 +8795,7 @@ class EsolveReviewsService {
|
|
|
8808
8795
|
observe: 'body',
|
|
8809
8796
|
params,
|
|
8810
8797
|
})
|
|
8811
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveReviewResult(response))), catchError$1((errorRes) => {
|
|
8798
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveReviewResult(response))), catchError$1((errorRes) => {
|
|
8812
8799
|
return this.errorHandler.handleHttpPostError('set-item-review', errorRes);
|
|
8813
8800
|
}));
|
|
8814
8801
|
}
|
|
@@ -8957,7 +8944,7 @@ class EsolveAlbumsService {
|
|
|
8957
8944
|
if (options?.rows) {
|
|
8958
8945
|
params = params.set('rows', options.rows);
|
|
8959
8946
|
}
|
|
8960
|
-
return this.getAlbumsStream(params).pipe(map((response) => {
|
|
8947
|
+
return this.getAlbumsStream(params).pipe(map$1((response) => {
|
|
8961
8948
|
if (response.records === undefined) {
|
|
8962
8949
|
throw response;
|
|
8963
8950
|
}
|
|
@@ -8998,7 +8985,7 @@ class EsolveAlbumsService {
|
|
|
8998
8985
|
.get(`${this.config.api_url}/get-album-images.php`, {
|
|
8999
8986
|
params,
|
|
9000
8987
|
})
|
|
9001
|
-
.pipe(map((response) => {
|
|
8988
|
+
.pipe(map$1((response) => {
|
|
9002
8989
|
if (response.records === undefined) {
|
|
9003
8990
|
throw response;
|
|
9004
8991
|
}
|
|
@@ -9010,7 +8997,7 @@ class EsolveAlbumsService {
|
|
|
9010
8997
|
}));
|
|
9011
8998
|
}
|
|
9012
8999
|
getAlbumSingle(params) {
|
|
9013
|
-
return this.getAlbumsStream(params).pipe(map((response) => {
|
|
9000
|
+
return this.getAlbumsStream(params).pipe(map$1((response) => {
|
|
9014
9001
|
if (response.records === undefined ||
|
|
9015
9002
|
response.records.length <= 0) {
|
|
9016
9003
|
throw response;
|
|
@@ -9088,7 +9075,7 @@ class EsolveCaptchaService {
|
|
|
9088
9075
|
.get(`${this.config.api_url}/get-captcha.php`, {
|
|
9089
9076
|
params,
|
|
9090
9077
|
})
|
|
9091
|
-
.pipe(map((response) => {
|
|
9078
|
+
.pipe(map$1((response) => {
|
|
9092
9079
|
if (response.records === undefined ||
|
|
9093
9080
|
Array.isArray(response.records)) {
|
|
9094
9081
|
throw response;
|
|
@@ -9251,7 +9238,7 @@ class EsolveAffiliateService {
|
|
|
9251
9238
|
.get(`${this.config.api_url}/get-affiliates.php`, {
|
|
9252
9239
|
params,
|
|
9253
9240
|
})
|
|
9254
|
-
.pipe(map((response) => {
|
|
9241
|
+
.pipe(map$1((response) => {
|
|
9255
9242
|
if (response.records === undefined ||
|
|
9256
9243
|
response.records.length <= 0) {
|
|
9257
9244
|
throw response;
|
|
@@ -9291,7 +9278,7 @@ class EsolveAffiliateService {
|
|
|
9291
9278
|
.get(`${this.config.api_url}/get-affiliate-check.php`, {
|
|
9292
9279
|
params,
|
|
9293
9280
|
})
|
|
9294
|
-
.pipe(map((response) => {
|
|
9281
|
+
.pipe(map$1((response) => {
|
|
9295
9282
|
let record = response.records;
|
|
9296
9283
|
if (Array.isArray(record)) {
|
|
9297
9284
|
record = undefined;
|
|
@@ -9331,7 +9318,7 @@ class EsolveAffiliateService {
|
|
|
9331
9318
|
responseType: 'json',
|
|
9332
9319
|
observe: 'body',
|
|
9333
9320
|
})
|
|
9334
|
-
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveAffiliateLinkResult(response))), catchError$1((errorRes) => {
|
|
9321
|
+
.pipe(map$1((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveAffiliateLinkResult(response))), catchError$1((errorRes) => {
|
|
9335
9322
|
return this.errorHandler.handleHttpPostError('set-enquiry', errorRes);
|
|
9336
9323
|
}));
|
|
9337
9324
|
}
|
|
@@ -9372,5 +9359,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
9372
9359
|
* Generated bundle index. Do not edit.
|
|
9373
9360
|
*/
|
|
9374
9361
|
|
|
9375
|
-
export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountPayment, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAffiliate, EsolveAffiliateCheckResult, EsolveAffiliateLinkResult, EsolveAffiliateService, EsolveAlbum, EsolveAlbumImage, EsolveAlbumImageList, EsolveAlbumList, EsolveAlbumsService, EsolveAsset, EsolveAssetsService,
|
|
9362
|
+
export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountPayment, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAffiliate, EsolveAffiliateCheckResult, EsolveAffiliateLinkResult, EsolveAffiliateService, EsolveAlbum, EsolveAlbumImage, EsolveAlbumImageList, EsolveAlbumList, EsolveAlbumsService, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCaptcha, EsolveCaptchaService, EsolveCartAlternative, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCdnSrcDirective, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCompetition, EsolveCompetitionDates, EsolveCompetitionEntryResult, EsolveCompetitionWinner, EsolveCompetitionsService, EsolveConfigService, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDeliveriesService, EsolveDelivery, EsolveDeliveryCategoryTotals, EsolveDeliveryList, EsolveDeliveryStatus, EsolveDependantItem, EsolveDeviceService, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErpDocumentRequest, EsolveErpDocumentsRequestResult, EsolveErrorHandlerService, EsolveFilterFactory, EsolveGenericFilter, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationList, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolveNewsletterResult, EsolveOtp, EsolveOtpService, EsolveOtpValidation, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveReview, EsolveReviewList, EsolveReviewResult, EsolveReviewsService, EsolveSeoInfo, EsolveSeoService, EsolveSessionAddressUpdateResult, EsolveSessionClientUpdateResult, EsolveSessionMetadataService, EsolveSessionService, EsolveSessionShippingUpdateResult, EsolveSetDeviceResult, EsolveSetNotifyResult, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockReviewsReport, EsolveStockService, EsolveSuggestedStockItem, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionDelivery, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionPick, EsolveTransactionShippingMethod, EsolveTransactionTimeSlot, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveUserDevice, EsolveVaultItem, EsolveVaultItemResult, EsolveVoucher, EsolveVouchersService, EsolveWalletBalances, EsolveWalletService, EsolveWalletTransaction, EsolveWalletTransactionsList, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveAuthInterceptor, esolveHexHash, isEsolveCdnPath, isFtgCdnPath, isLegacyEsolveCdnPath, processEsolveImageSrc, provideEsolveImageLoader, provideNgEsolveConnect };
|
|
9376
9363
|
//# sourceMappingURL=esolve-ng-esolve-connect.mjs.map
|