@esolve/ng-esolve-connect 0.36.0 → 0.37.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/esm2020/lib/account/address/esolve-address-result.model.mjs +1 -1
- package/esm2020/lib/account/address/esolve-address.model.mjs +1 -1
- package/esm2020/lib/account/confirmation/esolve-account-confirmation-post-response-item.interface.mjs +1 -1
- package/esm2020/lib/account/confirmation/esolve-account-confirmation-result.model.mjs +1 -1
- package/esm2020/lib/account/esolve-account.service.mjs +18 -16
- package/esm2020/lib/account/index.mjs +1 -1
- package/esm2020/lib/account/location/classes/esolve-location-update-result.model.mjs +2 -2
- package/esm2020/lib/account/location/classes/index.mjs +1 -1
- package/esm2020/lib/account/location/index.mjs +1 -1
- package/esm2020/lib/account/location/interfaces/esolve-location-options.interface.mjs +1 -1
- package/esm2020/lib/account/location/interfaces/index.mjs +1 -1
- package/esm2020/lib/account/password/esolve-change-password-result.model.mjs +2 -2
- package/esm2020/lib/account/password/esolve-reset-password-result.model.mjs +1 -1
- package/esm2020/lib/account/registration/esolve-registration-post-response-item.interface.mjs +1 -1
- package/esm2020/lib/account/registration/esolve-registration-result.model.mjs +1 -1
- package/esm2020/lib/account/user-account/classes/esolve-statement-balances.model.mjs +3 -2
- package/esm2020/lib/account/user-account/classes/esolve-statement-transaction.model.mjs +1 -1
- package/esm2020/lib/account/user-account/classes/esolve-statement.model.mjs +3 -2
- package/esm2020/lib/account/user-account/classes/esolve-user-account-result.model.mjs +1 -1
- package/esm2020/lib/account/user-account/classes/esolve-user-account.model.mjs +2 -2
- package/esm2020/lib/account/user-account/classes/esolve-user-client-account-balances.model.mjs +1 -1
- package/esm2020/lib/account/user-account/classes/esolve-user-client-account.model.mjs +5 -3
- package/esm2020/lib/auth/esolve-auth.service.mjs +13 -15
- package/esm2020/lib/banners/esolve-banner-image-hotspot.model.mjs +1 -1
- package/esm2020/lib/banners/esolve-banner-image.model.mjs +1 -1
- package/esm2020/lib/banners/esolve-banner.service.mjs +3 -3
- package/esm2020/lib/cart/classes/esolve-cart-totals.model.mjs +1 -1
- package/esm2020/lib/cart/classes/esolve-empty-cart-result.model.mjs +1 -1
- package/esm2020/lib/category-tree/esolve-category-tree-item.model.mjs +1 -1
- package/esm2020/lib/category-tree/esolve-category-tree.service.mjs +4 -4
- package/esm2020/lib/coupons/interfaces/esolve-coupon-validation-result.interface.mjs +1 -2
- package/esm2020/lib/enquiry/esolve-enquiry.service.mjs +2 -2
- package/esm2020/lib/esolve-connect-config.constant.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-address.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-contact-info.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-geo.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-pobox-address.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-trading-day.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location-trading-times.model.mjs +1 -1
- package/esm2020/lib/locations/classes/esolve-location.model.mjs +3 -2
- package/esm2020/lib/locations/esolve-locations.service.mjs +1 -1
- package/esm2020/lib/manufacturers/esolve-manufacturer-image-size.type.mjs +1 -1
- package/esm2020/lib/manufacturers/esolve-manufacturers.service.mjs +3 -3
- package/esm2020/lib/menu/esolve-menu.service.mjs +2 -2
- package/esm2020/lib/news/esolve-news-article-author.model.mjs +1 -1
- package/esm2020/lib/news/esolve-news-article-list.model.mjs +1 -1
- package/esm2020/lib/news/esolve-news-group.model.mjs +1 -1
- package/esm2020/lib/news/esolve-news.service.mjs +6 -4
- package/esm2020/lib/ng-esolve-connect.module.mjs +4 -9
- package/esm2020/lib/payment/classes/esolve-banking-details.model.mjs +1 -1
- package/esm2020/lib/payment/classes/esolve-payment-method.model.mjs +3 -2
- package/esm2020/lib/payment/classes/esolve-vault-item-result.model.mjs +1 -1
- package/esm2020/lib/ranges/esolve-ranges.service.mjs +3 -3
- package/esm2020/lib/session/esolve-session.service.mjs +10 -6
- package/esm2020/lib/shared/assets/esolve-asset-type.type.mjs +1 -1
- package/esm2020/lib/shared/assets/esolve-assets.service.mjs +3 -3
- package/esm2020/lib/shared/errors/esolve-error-handler.service.mjs +16 -16
- package/esm2020/lib/shared/errors/esolve-http-error.model.mjs +1 -1
- package/esm2020/lib/shared/esolve-list.model.mjs +1 -1
- package/esm2020/lib/shared/esolve-result.model.mjs +1 -1
- package/esm2020/lib/shared/filters/classes/esolve-multiple-select-filter.model.mjs +1 -1
- package/esm2020/lib/shared/filters/classes/esolve-range-filter.model.mjs +3 -3
- package/esm2020/lib/shared/filters/classes/esolve-single-select-filter.model.mjs +1 -1
- package/esm2020/lib/shared/filters/classes/esolve-toggle-filter.model.mjs +1 -1
- package/esm2020/lib/shared/filters/classes/index.mjs +1 -1
- package/esm2020/lib/shared/filters/esolve-filter-factory.mjs +1 -1
- package/esm2020/lib/shared/filters/interfaces/esolve-filter-definitions.interface.mjs +1 -1
- package/esm2020/lib/shared/filters/interfaces/esolve-filter.interface.mjs +1 -1
- package/esm2020/lib/shared/filters/types/esolve-filter-list.type.mjs +1 -1
- package/esm2020/lib/shared/filters/types/esolve-filter-record-list.type.mjs +1 -1
- package/esm2020/lib/shared/filters/types/esolve-filter-toggle.type.mjs +1 -1
- package/esm2020/lib/shared/filters/types/esolve-filter-type.type.mjs +1 -1
- package/esm2020/lib/shared/geocoder/esolve-geocode-address-result.model.mjs +1 -1
- package/esm2020/lib/shared/geocoder/esolve-geocode-coords-result.model.mjs +1 -1
- package/esm2020/lib/shared/geocoder/esolve-geocode-result.model.mjs +1 -1
- package/esm2020/lib/shared/response/esolve-delete-response.interface.mjs +1 -1
- package/esm2020/lib/shared/response/esolve-response-handler.service.mjs +5 -5
- package/esm2020/lib/shared/response/esolve-response-result.model.mjs +1 -1
- package/esm2020/lib/shared/response/esolve-set-response.interface.mjs +1 -1
- package/esm2020/lib/shared/seo/esolve-seo-info.model.mjs +1 -1
- package/esm2020/lib/shared/seo/esolve-seo.service.mjs +8 -3
- package/esm2020/lib/shipping/types/esolve-insurance-calculation-method.type.mjs +1 -1
- package/esm2020/lib/shipping/types/esolve-shipping-calculation-method.type.mjs +1 -1
- package/esm2020/lib/shipping/types/esolve-shipping-location.type.mjs +1 -1
- package/esm2020/lib/specials/esolve-special-dates.model.mjs +1 -1
- package/esm2020/lib/specials/esolve-special.model.mjs +3 -5
- package/esm2020/lib/specials/esolve-specials.service.mjs +3 -3
- package/esm2020/lib/stock/classes/esolve-stock-badge.model.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-group-item.model.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-group.model.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-image-collection.model.mjs +1 -2
- package/esm2020/lib/stock/classes/esolve-stock-item-list.model.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-item.model.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-price.model.mjs +3 -3
- package/esm2020/lib/stock/classes/esolve-stock-transaction-history.model.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-dependant-item-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-linked-stock-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-recipe-item-record.interface.mjs +1 -1
- package/esm2020/lib/stock/interfaces/esolve-stock-image-collection-record.interface.mjs +1 -2
- package/esm2020/lib/stock/interfaces/esolve-stock-record.interface.mjs +1 -1
- package/esm2020/lib/stock/types/esolve-media-stock-item-list.type.mjs +1 -1
- package/esm2020/lib/stock/types/esolve-stock-image-size.type.mjs +1 -1
- package/esm2020/lib/stock/types/esolve-stock-sort-field.type.mjs +1 -1
- package/esm2020/lib/suppliers/esolve-suppliers.service.mjs +3 -4
- package/esm2020/lib/suppliers/index.mjs +1 -1
- package/esm2020/lib/suppliers/interfaces/esolve-supplier-record.interface.mjs +1 -1
- package/esm2020/lib/tags/esolve-tags.service.mjs +1 -1
- package/esm2020/lib/topics/esolve-topic.service.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-address.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-client.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-item-price.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-location.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-payment-method.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-shipping-method.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction-user.model.mjs +1 -1
- package/esm2020/lib/transactions/classes/esolve-transaction.model.mjs +1 -1
- package/esm2020/lib/transactions/esolve-transactions.service.mjs +4 -4
- package/esm2020/lib/wishlist/classes/esolve-empty-wishlist-result.model.mjs +1 -1
- package/esm2020/lib/wishlist/classes/esolve-wishlist-item.model.mjs +1 -1
- package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +2 -2
- package/esm2020/lib/wishlist/interfaces/esolve-wishlist-item-record.interface.mjs +1 -1
- package/esm2020/media/lib/classes/esolve-heading.model.mjs +1 -1
- package/esm2020/media/lib/components/media-layout/esolve-media-layout.component.mjs +4 -8
- package/esm2020/media/lib/components/media-section/esolve-media-section.component.mjs +1 -1
- package/esm2020/media/lib/esolve-connect-media-config.token.mjs +1 -1
- package/esm2020/media/lib/ng-esolve-connect-media.module.mjs +6 -14
- package/esm2020/media/lib/services/esolve-media.service.mjs +7 -7
- package/esm2020/media/lib/types/esolve-media-layout-section-type.type.mjs +1 -1
- package/esm2020/survey/lib/types/esolve-survey-question-type.type.mjs +1 -1
- package/fesm2015/esolve-ng-esolve-connect-media.mjs +12 -24
- package/fesm2015/esolve-ng-esolve-connect-media.mjs.map +1 -1
- package/fesm2015/esolve-ng-esolve-connect.mjs +112 -108
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect-media.mjs +12 -24
- package/fesm2020/esolve-ng-esolve-connect-media.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +112 -108
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/session/esolve-session.service.d.ts +1 -1
- package/lib/transactions/esolve-transactions.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -210,7 +210,9 @@ class EsolveSessionService {
|
|
|
210
210
|
json_data = local_store_data;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
const stored_session =
|
|
213
|
+
const stored_session = json_data
|
|
214
|
+
? JSON.parse(json_data)
|
|
215
|
+
: null;
|
|
214
216
|
if (!stored_session) {
|
|
215
217
|
return null;
|
|
216
218
|
}
|
|
@@ -233,7 +235,9 @@ class EsolveSessionService {
|
|
|
233
235
|
json_data = local_store_data;
|
|
234
236
|
}
|
|
235
237
|
}
|
|
236
|
-
const stored_session =
|
|
238
|
+
const stored_session = json_data
|
|
239
|
+
? JSON.parse(json_data)
|
|
240
|
+
: null;
|
|
237
241
|
if (!stored_session) {
|
|
238
242
|
invalidSessionCallback();
|
|
239
243
|
return;
|
|
@@ -258,7 +262,7 @@ class EsolveSessionService {
|
|
|
258
262
|
this._session.next(session);
|
|
259
263
|
this.startTimer(expirationCallback, expires * 1000);
|
|
260
264
|
}
|
|
261
|
-
handleUpdateSession({ user_id, location_id
|
|
265
|
+
handleUpdateSession({ user_id, location_id }, callback) {
|
|
262
266
|
const current_session = this.currentSession;
|
|
263
267
|
if (typeof user_id !== 'undefined') {
|
|
264
268
|
current_session.updateUser(user_id);
|
|
@@ -275,8 +279,8 @@ class EsolveSessionService {
|
|
|
275
279
|
}
|
|
276
280
|
}
|
|
277
281
|
setStorageKey() {
|
|
278
|
-
if (
|
|
279
|
-
|
|
282
|
+
if (typeof this.config.user_session_storage_key === 'string' &&
|
|
283
|
+
this.config.user_session_storage_key !== '') {
|
|
280
284
|
this.storage_key = this.config.user_session_storage_key;
|
|
281
285
|
}
|
|
282
286
|
}
|
|
@@ -393,18 +397,13 @@ class NgEsolveConnectModule {
|
|
|
393
397
|
}
|
|
394
398
|
}
|
|
395
399
|
NgEsolveConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
396
|
-
NgEsolveConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule,
|
|
397
|
-
|
|
398
|
-
NgEsolveConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, providers: [CookieService], imports: [CommonModule,
|
|
399
|
-
HttpClientModule] });
|
|
400
|
+
NgEsolveConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] });
|
|
401
|
+
NgEsolveConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, providers: [CookieService], imports: [CommonModule, HttpClientModule] });
|
|
400
402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, decorators: [{
|
|
401
403
|
type: NgModule,
|
|
402
404
|
args: [{
|
|
403
405
|
declarations: [],
|
|
404
|
-
imports: [
|
|
405
|
-
CommonModule,
|
|
406
|
-
HttpClientModule,
|
|
407
|
-
],
|
|
406
|
+
imports: [CommonModule, HttpClientModule],
|
|
408
407
|
providers: [CookieService],
|
|
409
408
|
exports: [],
|
|
410
409
|
}]
|
|
@@ -469,7 +468,7 @@ class EsolveRangeFilter {
|
|
|
469
468
|
};
|
|
470
469
|
this.options.min = min;
|
|
471
470
|
this.options.max = max;
|
|
472
|
-
if (
|
|
471
|
+
if (max > 0 && min > max) {
|
|
473
472
|
this.options.min = max;
|
|
474
473
|
this.options.max = min;
|
|
475
474
|
}
|
|
@@ -477,7 +476,7 @@ class EsolveRangeFilter {
|
|
|
477
476
|
setValue(min, max) {
|
|
478
477
|
this.min = min;
|
|
479
478
|
this.max = max;
|
|
480
|
-
if (
|
|
479
|
+
if (max > 0 && min > max) {
|
|
481
480
|
this.min = max;
|
|
482
481
|
this.max = min;
|
|
483
482
|
}
|
|
@@ -646,13 +645,13 @@ class EsolveResponseHandlerService {
|
|
|
646
645
|
* @returns Parsed result of response
|
|
647
646
|
*/
|
|
648
647
|
validateSingleHttpResponse(http_response, resultHandler) {
|
|
649
|
-
if (
|
|
650
|
-
|
|
648
|
+
if (http_response.responses === undefined ||
|
|
649
|
+
http_response.responses.length <= 0) {
|
|
651
650
|
throw http_response;
|
|
652
651
|
}
|
|
653
652
|
const response = http_response.responses[0];
|
|
654
|
-
if (
|
|
655
|
-
|
|
653
|
+
if (response.status.state === 'error' ||
|
|
654
|
+
response.status.state === 'none') {
|
|
656
655
|
throw response;
|
|
657
656
|
}
|
|
658
657
|
return resultHandler(response);
|
|
@@ -692,22 +691,22 @@ class EsolveErrorHandlerService {
|
|
|
692
691
|
handleHttpPostError(service_type, errorRes) {
|
|
693
692
|
if (!(errorRes instanceof HttpErrorResponse) &&
|
|
694
693
|
!('service_type' in errorRes) &&
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
694
|
+
'id' in errorRes &&
|
|
695
|
+
'esolve_id' in errorRes &&
|
|
696
|
+
'transaction_type' in errorRes &&
|
|
697
|
+
'status' in errorRes &&
|
|
698
|
+
'log' in errorRes) {
|
|
700
699
|
return throwError(() => this.parsePostErrors(errorRes));
|
|
701
700
|
}
|
|
702
701
|
return this.handleHttpError(service_type, errorRes);
|
|
703
702
|
}
|
|
704
703
|
handleHttpDeleteError(service_type, errorRes) {
|
|
705
|
-
const is_not_base =
|
|
704
|
+
const is_not_base = !(errorRes instanceof HttpErrorResponse) &&
|
|
706
705
|
!('service_type' in errorRes) &&
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
706
|
+
'id' in errorRes &&
|
|
707
|
+
'status' in errorRes &&
|
|
708
|
+
'message' in errorRes &&
|
|
709
|
+
'code' in errorRes;
|
|
711
710
|
if (is_not_base) {
|
|
712
711
|
return throwError(() => this.parseDeleteError(errorRes));
|
|
713
712
|
}
|
|
@@ -717,15 +716,15 @@ class EsolveErrorHandlerService {
|
|
|
717
716
|
if (error_response instanceof HttpErrorResponse) {
|
|
718
717
|
if (error_response.status === 500) {
|
|
719
718
|
const server_error = error_response.error;
|
|
720
|
-
if (
|
|
721
|
-
|
|
719
|
+
if ('service_type' in server_error &&
|
|
720
|
+
server_error.service_type === service_type) {
|
|
722
721
|
return throwError(() => this.parseException(server_error));
|
|
723
722
|
}
|
|
724
723
|
}
|
|
725
724
|
}
|
|
726
725
|
else {
|
|
727
|
-
if (
|
|
728
|
-
|
|
726
|
+
if ('service_type' in error_response &&
|
|
727
|
+
error_response.service_type === service_type) {
|
|
729
728
|
if (error_response.type === 'exception') {
|
|
730
729
|
return throwError(() => this.parseException(error_response));
|
|
731
730
|
}
|
|
@@ -747,7 +746,7 @@ class EsolveErrorHandlerService {
|
|
|
747
746
|
parsePostErrors(response) {
|
|
748
747
|
let error_code = 'unknown';
|
|
749
748
|
let message = 'Unknown error has occurred';
|
|
750
|
-
if (
|
|
749
|
+
if (response.status.state === 'none' && response.log.length > 0) {
|
|
751
750
|
error_code = 'no_response';
|
|
752
751
|
message = 'Response was provided';
|
|
753
752
|
}
|
|
@@ -833,7 +832,10 @@ class EsolveSeoService {
|
|
|
833
832
|
}
|
|
834
833
|
setPageDescriptionTags(description) {
|
|
835
834
|
this.meta.updateTag({ name: 'description', content: description });
|
|
836
|
-
this.meta.updateTag({
|
|
835
|
+
this.meta.updateTag({
|
|
836
|
+
property: 'og:description',
|
|
837
|
+
content: description,
|
|
838
|
+
});
|
|
837
839
|
}
|
|
838
840
|
setPageKeywordsTags(keywords) {
|
|
839
841
|
this.meta.updateTag({ name: 'keywords', content: keywords });
|
|
@@ -860,7 +862,9 @@ class EsolveSeoService {
|
|
|
860
862
|
}
|
|
861
863
|
pageSeo.title = titlePartsArray.join(' ');
|
|
862
864
|
if (seoInfo.keywords.trim() === '') {
|
|
863
|
-
const clean_title = seoInfo.title
|
|
865
|
+
const clean_title = seoInfo.title
|
|
866
|
+
.replace(/[^a-zA-Z0-9. ]+/gi, '')
|
|
867
|
+
.trim();
|
|
864
868
|
const keywords = clean_title.split(' ');
|
|
865
869
|
const clean_keywords = [];
|
|
866
870
|
for (let keyword of keywords) {
|
|
@@ -1127,8 +1131,8 @@ class EsolveCategoryTreeService {
|
|
|
1127
1131
|
return this.http
|
|
1128
1132
|
.get(`${this.config.api_url}/get-tree-item.php`, { params })
|
|
1129
1133
|
.pipe(map((response) => {
|
|
1130
|
-
if (
|
|
1131
|
-
|
|
1134
|
+
if (response.records === undefined ||
|
|
1135
|
+
response.records.length <= 0) {
|
|
1132
1136
|
throw response;
|
|
1133
1137
|
}
|
|
1134
1138
|
return this.processTreeItem(response.records[0]);
|
|
@@ -1172,7 +1176,7 @@ class EsolveCategoryTreeService {
|
|
|
1172
1176
|
const match_results = id.match(type_code_regex);
|
|
1173
1177
|
if (match_results) {
|
|
1174
1178
|
const type_code = match_results[0];
|
|
1175
|
-
type =
|
|
1179
|
+
type = type_code === '<<CAT>>' ? 'category' : 'subcategory';
|
|
1176
1180
|
esolve_id = id.replace(type_code_regex, '');
|
|
1177
1181
|
return {
|
|
1178
1182
|
type,
|
|
@@ -1299,8 +1303,8 @@ class EsolveManufacturersService {
|
|
|
1299
1303
|
return this.http
|
|
1300
1304
|
.get(`${this.config.api_url}/get-manufacturers.php`, { params })
|
|
1301
1305
|
.pipe(map((response) => {
|
|
1302
|
-
if (
|
|
1303
|
-
|
|
1306
|
+
if (response.records === undefined ||
|
|
1307
|
+
response.records.length <= 0) {
|
|
1304
1308
|
throw response;
|
|
1305
1309
|
}
|
|
1306
1310
|
return response.records;
|
|
@@ -1425,8 +1429,8 @@ class EsolveRangesService {
|
|
|
1425
1429
|
return this.http
|
|
1426
1430
|
.get(`${this.config.api_url}/get-ranges.php`, { params })
|
|
1427
1431
|
.pipe(map((response) => {
|
|
1428
|
-
if (
|
|
1429
|
-
|
|
1432
|
+
if (response.records === undefined ||
|
|
1433
|
+
response.records.length <= 0) {
|
|
1430
1434
|
throw response;
|
|
1431
1435
|
}
|
|
1432
1436
|
return response.records;
|
|
@@ -1708,8 +1712,8 @@ class EsolveAssetsService {
|
|
|
1708
1712
|
getAsset(id) {
|
|
1709
1713
|
const params = new HttpParams({ fromObject: { assets_id: id } });
|
|
1710
1714
|
return this.getAssetRecords(params).pipe(map((response) => {
|
|
1711
|
-
if (
|
|
1712
|
-
|
|
1715
|
+
if (response.records === undefined ||
|
|
1716
|
+
response.records.length <= 0) {
|
|
1713
1717
|
throw response;
|
|
1714
1718
|
}
|
|
1715
1719
|
const record = response.records[0];
|
|
@@ -1899,8 +1903,8 @@ class EsolveAuthService {
|
|
|
1899
1903
|
}),
|
|
1900
1904
|
})
|
|
1901
1905
|
.pipe(tap((responseData) => {
|
|
1902
|
-
if (
|
|
1903
|
-
|
|
1906
|
+
if (responseData.type === 'error' ||
|
|
1907
|
+
responseData.type === 'exception') {
|
|
1904
1908
|
throw responseData;
|
|
1905
1909
|
}
|
|
1906
1910
|
}), catchError(this.handleError), tap((responseData) => {
|
|
@@ -1935,18 +1939,18 @@ class EsolveAuthService {
|
|
|
1935
1939
|
observe: 'body',
|
|
1936
1940
|
})
|
|
1937
1941
|
.pipe(map((response) => {
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
1942
|
+
if (response.responses === undefined ||
|
|
1943
|
+
response.responses.length <= 0) {
|
|
1940
1944
|
throw response;
|
|
1941
1945
|
}
|
|
1942
1946
|
const login_response = response.responses[0];
|
|
1943
|
-
if (
|
|
1944
|
-
|
|
1947
|
+
if (login_response.status.state !== 'success' &&
|
|
1948
|
+
login_response.status.state !== 'warning') {
|
|
1945
1949
|
throw login_response;
|
|
1946
1950
|
}
|
|
1947
1951
|
for (const response_log of login_response.log) {
|
|
1948
|
-
if (
|
|
1949
|
-
|
|
1952
|
+
if (response_log.type === 'success' &&
|
|
1953
|
+
response_log.message_code === 'login_success') {
|
|
1950
1954
|
const session_data = login_response.session_data;
|
|
1951
1955
|
const user_id = +login_response.esolve_id;
|
|
1952
1956
|
const location_id = +session_data.location_id;
|
|
@@ -2005,9 +2009,9 @@ class EsolveAuthService {
|
|
|
2005
2009
|
}),
|
|
2006
2010
|
})
|
|
2007
2011
|
.pipe(map((responseData) => {
|
|
2008
|
-
if (
|
|
2009
|
-
|
|
2010
|
-
|
|
2012
|
+
if (responseData.type === 'error' ||
|
|
2013
|
+
responseData.type === 'exception' ||
|
|
2014
|
+
!responseData.additional_data.key_okay) {
|
|
2011
2015
|
throw responseData;
|
|
2012
2016
|
}
|
|
2013
2017
|
const additional_data = responseData.additional_data;
|
|
@@ -2044,9 +2048,7 @@ class EsolveAuthService {
|
|
|
2044
2048
|
message: 'An unknown error occurred',
|
|
2045
2049
|
data: {},
|
|
2046
2050
|
};
|
|
2047
|
-
if (
|
|
2048
|
-
(!errorRes.service_type) ||
|
|
2049
|
-
(!errorRes.message)) {
|
|
2051
|
+
if (!errorRes.type || !errorRes.service_type || !errorRes.message) {
|
|
2050
2052
|
return throwError(() => error);
|
|
2051
2053
|
}
|
|
2052
2054
|
if (errorRes.message.trim() !== '') {
|
|
@@ -2147,7 +2149,8 @@ class EsolveStatementBalances {
|
|
|
2147
2149
|
var _a, _b, _c;
|
|
2148
2150
|
if (record) {
|
|
2149
2151
|
this.total = +((_a = record.total) !== null && _a !== void 0 ? _a : 0);
|
|
2150
|
-
this.ageing =
|
|
2152
|
+
this.ageing =
|
|
2153
|
+
(_c = (_b = record.ageing) === null || _b === void 0 ? void 0 : _b.map((e) => new EsolveStatementAgeing(e))) !== null && _c !== void 0 ? _c : [];
|
|
2151
2154
|
}
|
|
2152
2155
|
}
|
|
2153
2156
|
}
|
|
@@ -2173,7 +2176,8 @@ class EsolveStatement {
|
|
|
2173
2176
|
var _a, _b;
|
|
2174
2177
|
if (record) {
|
|
2175
2178
|
this.balances = new EsolveStatementBalances(record.balances);
|
|
2176
|
-
this.transactions =
|
|
2179
|
+
this.transactions =
|
|
2180
|
+
(_b = (_a = record.transactions) === null || _a === void 0 ? void 0 : _a.map((e) => new EsolveStatementTransaction(e))) !== null && _b !== void 0 ? _b : [];
|
|
2177
2181
|
}
|
|
2178
2182
|
}
|
|
2179
2183
|
}
|
|
@@ -2208,8 +2212,10 @@ class EsolveUserClientAccount {
|
|
|
2208
2212
|
this.ageing = (_y = record.ageing) !== null && _y !== void 0 ? _y : '';
|
|
2209
2213
|
this.balance_last_updated = (_z = record.balance_last_updated) !== null && _z !== void 0 ? _z : '';
|
|
2210
2214
|
this.client_classification = (_0 = record.client_classification) !== null && _0 !== void 0 ? _0 : '';
|
|
2211
|
-
this.override_stock_listing_identifiers =
|
|
2212
|
-
|
|
2215
|
+
this.override_stock_listing_identifiers =
|
|
2216
|
+
(_1 = record.override_stock_listing_identifiers) !== null && _1 !== void 0 ? _1 : '';
|
|
2217
|
+
this.requires_transaction_approval =
|
|
2218
|
+
(_2 = record.requires_transaction_approval) !== null && _2 !== void 0 ? _2 : '';
|
|
2213
2219
|
this.latitude = +((_3 = record.latitude) !== null && _3 !== void 0 ? _3 : 0);
|
|
2214
2220
|
this.longitude = +((_4 = record.longitude) !== null && _4 !== void 0 ? _4 : 0);
|
|
2215
2221
|
this.price_list = +((_5 = record.price_list) !== null && _5 !== void 0 ? _5 : 0);
|
|
@@ -2239,7 +2245,7 @@ class EsolveUserAccount {
|
|
|
2239
2245
|
this.identification_number = (_j = record.idnumber) !== null && _j !== void 0 ? _j : '';
|
|
2240
2246
|
this.contact_details = new EsolveUserAccountContact(record);
|
|
2241
2247
|
this.business_details = new EsolveUserAccountBusiness(record);
|
|
2242
|
-
if (record.client_details &&
|
|
2248
|
+
if (record.client_details && record.client_details.account !== '') {
|
|
2243
2249
|
this.client_details = new EsolveUserClientAccount(record.client_details);
|
|
2244
2250
|
}
|
|
2245
2251
|
}
|
|
@@ -2262,7 +2268,7 @@ class EsolveUserClientAccountBalances {
|
|
|
2262
2268
|
class EsolveChangePasswordResult extends EsolveResponseResult {
|
|
2263
2269
|
constructor(response) {
|
|
2264
2270
|
super(response);
|
|
2265
|
-
this.password_updated =
|
|
2271
|
+
this.password_updated = response.status.state === 'success';
|
|
2266
2272
|
}
|
|
2267
2273
|
}
|
|
2268
2274
|
|
|
@@ -2302,7 +2308,7 @@ class EsolveLocationUpdateResult extends EsolveResponseResult {
|
|
|
2302
2308
|
if (typeof response.esolve_id === 'string') {
|
|
2303
2309
|
throw new Error('Invalid response id.');
|
|
2304
2310
|
}
|
|
2305
|
-
this.location_updated =
|
|
2311
|
+
this.location_updated = response.esolve_id > 0;
|
|
2306
2312
|
}
|
|
2307
2313
|
}
|
|
2308
2314
|
|
|
@@ -2502,7 +2508,8 @@ class EsolveLocation {
|
|
|
2502
2508
|
this.head_office = !!+record.head_office;
|
|
2503
2509
|
this.erp_identifier = record.erp_identifier;
|
|
2504
2510
|
this.external_system_code = record.external_system_code;
|
|
2505
|
-
this.default_location_for_payment_methods =
|
|
2511
|
+
this.default_location_for_payment_methods =
|
|
2512
|
+
!!+record.default_location_for_payment_methods;
|
|
2506
2513
|
this.userid = +record.userid;
|
|
2507
2514
|
this.importance = +record.importance;
|
|
2508
2515
|
this.active = !!+record.is_active;
|
|
@@ -2728,7 +2735,7 @@ class EsolveTransactionsService {
|
|
|
2728
2735
|
this.loginGuard();
|
|
2729
2736
|
let params = new HttpParams();
|
|
2730
2737
|
params = params.set('user_id', this.user_id);
|
|
2731
|
-
if (options.user_id &&
|
|
2738
|
+
if (options.user_id && options.user_id === -1) {
|
|
2732
2739
|
params = params.set('user_id', -1);
|
|
2733
2740
|
}
|
|
2734
2741
|
if (options.type) {
|
|
@@ -2773,13 +2780,13 @@ class EsolveTransactionsService {
|
|
|
2773
2780
|
return throwError(() => error);
|
|
2774
2781
|
}
|
|
2775
2782
|
}
|
|
2776
|
-
getTransaction(id) {
|
|
2783
|
+
getTransaction(id, user_id) {
|
|
2777
2784
|
try {
|
|
2778
2785
|
this.loginGuard();
|
|
2779
2786
|
return this.http
|
|
2780
2787
|
.get(`${this.config.api_url}/get-transactions.php`, {
|
|
2781
2788
|
params: {
|
|
2782
|
-
user_id: this.user_id,
|
|
2789
|
+
user_id: user_id !== null && user_id !== void 0 ? user_id : this.user_id,
|
|
2783
2790
|
transaction_id: id,
|
|
2784
2791
|
},
|
|
2785
2792
|
})
|
|
@@ -3000,8 +3007,6 @@ class EsolveCoupon {
|
|
|
3000
3007
|
}
|
|
3001
3008
|
}
|
|
3002
3009
|
|
|
3003
|
-
;
|
|
3004
|
-
|
|
3005
3010
|
class EsolveCouponsService {
|
|
3006
3011
|
constructor(platformId, config, http, cookieService) {
|
|
3007
3012
|
this.platformId = platformId;
|
|
@@ -3453,7 +3458,7 @@ class EsolveAccountService {
|
|
|
3453
3458
|
return this._user_id;
|
|
3454
3459
|
}
|
|
3455
3460
|
set user_id(value) {
|
|
3456
|
-
value =
|
|
3461
|
+
value = value > 0 ? value : 0;
|
|
3457
3462
|
if (this._user_id !== value) {
|
|
3458
3463
|
this._user_id = value;
|
|
3459
3464
|
}
|
|
@@ -3491,8 +3496,8 @@ class EsolveAccountService {
|
|
|
3491
3496
|
return this.http
|
|
3492
3497
|
.get(`${this.config.api_url}/get-account.php`)
|
|
3493
3498
|
.pipe(map((response) => {
|
|
3494
|
-
if (
|
|
3495
|
-
|
|
3499
|
+
if (response.records === undefined ||
|
|
3500
|
+
response.records.length === 0) {
|
|
3496
3501
|
throw response;
|
|
3497
3502
|
}
|
|
3498
3503
|
const record = response.records[0];
|
|
@@ -3506,9 +3511,9 @@ class EsolveAccountService {
|
|
|
3506
3511
|
observe: 'body',
|
|
3507
3512
|
})
|
|
3508
3513
|
.pipe(map((http_response) => {
|
|
3509
|
-
if (
|
|
3510
|
-
|
|
3511
|
-
|
|
3514
|
+
if (http_response.result === undefined ||
|
|
3515
|
+
http_response.result === null ||
|
|
3516
|
+
http_response.result.status !== 'success') {
|
|
3512
3517
|
throw http_response;
|
|
3513
3518
|
}
|
|
3514
3519
|
return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
|
|
@@ -3558,9 +3563,9 @@ class EsolveAccountService {
|
|
|
3558
3563
|
observe: 'body',
|
|
3559
3564
|
})
|
|
3560
3565
|
.pipe(map((http_response) => {
|
|
3561
|
-
if (
|
|
3562
|
-
|
|
3563
|
-
|
|
3566
|
+
if (http_response.result === undefined ||
|
|
3567
|
+
http_response.result === null ||
|
|
3568
|
+
http_response.result.status !== 'success') {
|
|
3564
3569
|
throw http_response;
|
|
3565
3570
|
}
|
|
3566
3571
|
return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
|
|
@@ -3648,7 +3653,7 @@ class EsolveAccountService {
|
|
|
3648
3653
|
return this.http
|
|
3649
3654
|
.get(`${this.config.api_url}/get-forgot-password.php`, { params: { email } })
|
|
3650
3655
|
.pipe(map((response) => {
|
|
3651
|
-
if (
|
|
3656
|
+
if (response.records === undefined ||
|
|
3652
3657
|
!('reset_link_sent' in response.records)) {
|
|
3653
3658
|
throw response;
|
|
3654
3659
|
}
|
|
@@ -3749,8 +3754,8 @@ class EsolveAccountService {
|
|
|
3749
3754
|
},
|
|
3750
3755
|
})
|
|
3751
3756
|
.pipe(map((response) => {
|
|
3752
|
-
if (
|
|
3753
|
-
|
|
3757
|
+
if (response.records === undefined ||
|
|
3758
|
+
response.records.length <= 0) {
|
|
3754
3759
|
throw response;
|
|
3755
3760
|
}
|
|
3756
3761
|
const items = this.processTransactions(response.records);
|
|
@@ -3788,7 +3793,7 @@ class EsolveAccountService {
|
|
|
3788
3793
|
}
|
|
3789
3794
|
processUserAddress(records) {
|
|
3790
3795
|
const user_addresses = [];
|
|
3791
|
-
if (!records ||
|
|
3796
|
+
if (!records || this._user_id === 0) {
|
|
3792
3797
|
return user_addresses;
|
|
3793
3798
|
}
|
|
3794
3799
|
for (const record of records) {
|
|
@@ -3837,7 +3842,9 @@ class EsolveAccountService {
|
|
|
3837
3842
|
if (typeof response.esolve_id === 'string') {
|
|
3838
3843
|
throw new Error('Invalid response id.');
|
|
3839
3844
|
}
|
|
3840
|
-
this.sessionService.handleUpdateSession({
|
|
3845
|
+
this.sessionService.handleUpdateSession({
|
|
3846
|
+
location_id: response.esolve_id,
|
|
3847
|
+
});
|
|
3841
3848
|
return new EsolveLocationUpdateResult(response);
|
|
3842
3849
|
})));
|
|
3843
3850
|
}
|
|
@@ -3948,7 +3955,7 @@ class EsolveBannerService {
|
|
|
3948
3955
|
if (image_records.length > 0) {
|
|
3949
3956
|
for (const image_record of image_records) {
|
|
3950
3957
|
const image = new EsolveBannerImage(+image_record.id, image_record.image_type, +image_record.width, +image_record.height, image_record.filename);
|
|
3951
|
-
if (
|
|
3958
|
+
if (banner_type === 'hotspot' && image_record.hotspots) {
|
|
3952
3959
|
const hotspots = this.processBannerImageHotspots(image_record.hotspots);
|
|
3953
3960
|
image.hotspots = hotspots;
|
|
3954
3961
|
}
|
|
@@ -3964,7 +3971,7 @@ class EsolveBannerService {
|
|
|
3964
3971
|
*/
|
|
3965
3972
|
processBanners(records) {
|
|
3966
3973
|
const banners = [];
|
|
3967
|
-
if (
|
|
3974
|
+
if (records && records.length > 0) {
|
|
3968
3975
|
for (const record of records) {
|
|
3969
3976
|
const image_sets = {};
|
|
3970
3977
|
if (record.images.desktop) {
|
|
@@ -4039,7 +4046,7 @@ class EsolveMenuService {
|
|
|
4039
4046
|
return this.http
|
|
4040
4047
|
.get(`${this.config.api_url}/get-menu-tree.php`, { params: { identifier } })
|
|
4041
4048
|
.pipe(map((response) => {
|
|
4042
|
-
if (
|
|
4049
|
+
if (!response || response.records === undefined) {
|
|
4043
4050
|
throw response;
|
|
4044
4051
|
}
|
|
4045
4052
|
else if (response.records.length === 0) {
|
|
@@ -4171,10 +4178,12 @@ class EsolveNewsService {
|
|
|
4171
4178
|
this.http = http;
|
|
4172
4179
|
}
|
|
4173
4180
|
getNewsArticle(identifier) {
|
|
4174
|
-
const params = new HttpParams({
|
|
4181
|
+
const params = new HttpParams({
|
|
4182
|
+
fromObject: { sef_title: identifier },
|
|
4183
|
+
});
|
|
4175
4184
|
return this.getNewsRecords(params).pipe(map((response) => {
|
|
4176
|
-
if (
|
|
4177
|
-
|
|
4185
|
+
if (response.records === undefined ||
|
|
4186
|
+
response.records.length <= 0) {
|
|
4178
4187
|
throw response;
|
|
4179
4188
|
}
|
|
4180
4189
|
const record = response.records[0];
|
|
@@ -4334,11 +4343,11 @@ class EsolveStockPrice {
|
|
|
4334
4343
|
this.sell_price = sell_price;
|
|
4335
4344
|
this.sell_price_with_tax = sell_price_with_tax;
|
|
4336
4345
|
this.tax_rate = tax_rate;
|
|
4337
|
-
if (
|
|
4346
|
+
if (this.base_price === 0 && this.sell_price > 0) {
|
|
4338
4347
|
this.base_price = this.sell_price;
|
|
4339
4348
|
this.base_price_with_tax = this.sell_price_with_tax;
|
|
4340
4349
|
}
|
|
4341
|
-
else if (
|
|
4350
|
+
else if (this.base_price > 0 && this.sell_price === 0) {
|
|
4342
4351
|
this.sell_price = this.base_price;
|
|
4343
4352
|
this.sell_price_with_tax = this.base_price_with_tax;
|
|
4344
4353
|
}
|
|
@@ -4843,13 +4852,10 @@ class EsolveStockImageCollection {
|
|
|
4843
4852
|
}
|
|
4844
4853
|
}
|
|
4845
4854
|
}
|
|
4846
|
-
}
|
|
4847
|
-
;
|
|
4855
|
+
}
|
|
4848
4856
|
|
|
4849
4857
|
// Classes
|
|
4850
4858
|
|
|
4851
|
-
;
|
|
4852
|
-
|
|
4853
4859
|
// Interfaces
|
|
4854
4860
|
|
|
4855
4861
|
class EsolveStockService {
|
|
@@ -5326,10 +5332,8 @@ class EsolveSpecial {
|
|
|
5326
5332
|
}
|
|
5327
5333
|
}
|
|
5328
5334
|
if (record.images &&
|
|
5329
|
-
((record.images.thumb &&
|
|
5330
|
-
record.images.
|
|
5331
|
-
(record.images.banner &&
|
|
5332
|
-
record.images.banner.length > 0) ||
|
|
5335
|
+
((record.images.thumb && record.images.thumb.length > 0) ||
|
|
5336
|
+
(record.images.banner && record.images.banner.length > 0) ||
|
|
5333
5337
|
(record.images.banner_mobile &&
|
|
5334
5338
|
record.images.banner_mobile.length > 0)) &&
|
|
5335
5339
|
record.image_container.trim() !== '') {
|
|
@@ -5396,8 +5400,8 @@ class EsolveSpecialsService {
|
|
|
5396
5400
|
return this.http
|
|
5397
5401
|
.get(`${this.config.api_url}/get-specials.php`, { params })
|
|
5398
5402
|
.pipe(map((response) => {
|
|
5399
|
-
if (
|
|
5400
|
-
|
|
5403
|
+
if (response.records === undefined ||
|
|
5404
|
+
response.records.length <= 0) {
|
|
5401
5405
|
throw response;
|
|
5402
5406
|
}
|
|
5403
5407
|
return response.records;
|
|
@@ -5451,7 +5455,8 @@ class EsolvePaymentMethod {
|
|
|
5451
5455
|
this.integration_type = record.integration_type;
|
|
5452
5456
|
this.bank_gateway_id = record.bank_gateway_id;
|
|
5453
5457
|
this.accepted_card_types = record.accepted_card_types;
|
|
5454
|
-
this.post_transactions_to_gateway =
|
|
5458
|
+
this.post_transactions_to_gateway =
|
|
5459
|
+
!!+record.post_transactions_to_gateway;
|
|
5455
5460
|
this.three_d_secure_url = record.three_d_secure_url;
|
|
5456
5461
|
this.gateway_url = record.gateway_url;
|
|
5457
5462
|
this.generate_token_url = record.generate_token_url;
|
|
@@ -6267,12 +6272,11 @@ class EsolveSuppliersService {
|
|
|
6267
6272
|
return this.http
|
|
6268
6273
|
.get(`${this.config.api_url}/get-suppliers.php`, { params })
|
|
6269
6274
|
.pipe(map((response) => {
|
|
6270
|
-
if (
|
|
6271
|
-
|
|
6275
|
+
if (response.records === undefined ||
|
|
6276
|
+
response.records.length === 0) {
|
|
6272
6277
|
throw response;
|
|
6273
6278
|
}
|
|
6274
6279
|
return response.records;
|
|
6275
|
-
;
|
|
6276
6280
|
}));
|
|
6277
6281
|
}
|
|
6278
6282
|
processSuppliers(record) {
|