@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.
Files changed (140) hide show
  1. package/esm2020/lib/account/address/esolve-address-result.model.mjs +1 -1
  2. package/esm2020/lib/account/address/esolve-address.model.mjs +1 -1
  3. package/esm2020/lib/account/confirmation/esolve-account-confirmation-post-response-item.interface.mjs +1 -1
  4. package/esm2020/lib/account/confirmation/esolve-account-confirmation-result.model.mjs +1 -1
  5. package/esm2020/lib/account/esolve-account.service.mjs +18 -16
  6. package/esm2020/lib/account/index.mjs +1 -1
  7. package/esm2020/lib/account/location/classes/esolve-location-update-result.model.mjs +2 -2
  8. package/esm2020/lib/account/location/classes/index.mjs +1 -1
  9. package/esm2020/lib/account/location/index.mjs +1 -1
  10. package/esm2020/lib/account/location/interfaces/esolve-location-options.interface.mjs +1 -1
  11. package/esm2020/lib/account/location/interfaces/index.mjs +1 -1
  12. package/esm2020/lib/account/password/esolve-change-password-result.model.mjs +2 -2
  13. package/esm2020/lib/account/password/esolve-reset-password-result.model.mjs +1 -1
  14. package/esm2020/lib/account/registration/esolve-registration-post-response-item.interface.mjs +1 -1
  15. package/esm2020/lib/account/registration/esolve-registration-result.model.mjs +1 -1
  16. package/esm2020/lib/account/user-account/classes/esolve-statement-balances.model.mjs +3 -2
  17. package/esm2020/lib/account/user-account/classes/esolve-statement-transaction.model.mjs +1 -1
  18. package/esm2020/lib/account/user-account/classes/esolve-statement.model.mjs +3 -2
  19. package/esm2020/lib/account/user-account/classes/esolve-user-account-result.model.mjs +1 -1
  20. package/esm2020/lib/account/user-account/classes/esolve-user-account.model.mjs +2 -2
  21. package/esm2020/lib/account/user-account/classes/esolve-user-client-account-balances.model.mjs +1 -1
  22. package/esm2020/lib/account/user-account/classes/esolve-user-client-account.model.mjs +5 -3
  23. package/esm2020/lib/auth/esolve-auth.service.mjs +13 -15
  24. package/esm2020/lib/banners/esolve-banner-image-hotspot.model.mjs +1 -1
  25. package/esm2020/lib/banners/esolve-banner-image.model.mjs +1 -1
  26. package/esm2020/lib/banners/esolve-banner.service.mjs +3 -3
  27. package/esm2020/lib/cart/classes/esolve-cart-totals.model.mjs +1 -1
  28. package/esm2020/lib/cart/classes/esolve-empty-cart-result.model.mjs +1 -1
  29. package/esm2020/lib/category-tree/esolve-category-tree-item.model.mjs +1 -1
  30. package/esm2020/lib/category-tree/esolve-category-tree.service.mjs +4 -4
  31. package/esm2020/lib/coupons/interfaces/esolve-coupon-validation-result.interface.mjs +1 -2
  32. package/esm2020/lib/enquiry/esolve-enquiry.service.mjs +2 -2
  33. package/esm2020/lib/esolve-connect-config.constant.mjs +1 -1
  34. package/esm2020/lib/locations/classes/esolve-location-address.model.mjs +1 -1
  35. package/esm2020/lib/locations/classes/esolve-location-contact-info.model.mjs +1 -1
  36. package/esm2020/lib/locations/classes/esolve-location-geo.model.mjs +1 -1
  37. package/esm2020/lib/locations/classes/esolve-location-pobox-address.model.mjs +1 -1
  38. package/esm2020/lib/locations/classes/esolve-location-trading-day.model.mjs +1 -1
  39. package/esm2020/lib/locations/classes/esolve-location-trading-times.model.mjs +1 -1
  40. package/esm2020/lib/locations/classes/esolve-location.model.mjs +3 -2
  41. package/esm2020/lib/locations/esolve-locations.service.mjs +1 -1
  42. package/esm2020/lib/manufacturers/esolve-manufacturer-image-size.type.mjs +1 -1
  43. package/esm2020/lib/manufacturers/esolve-manufacturers.service.mjs +3 -3
  44. package/esm2020/lib/menu/esolve-menu.service.mjs +2 -2
  45. package/esm2020/lib/news/esolve-news-article-author.model.mjs +1 -1
  46. package/esm2020/lib/news/esolve-news-article-list.model.mjs +1 -1
  47. package/esm2020/lib/news/esolve-news-group.model.mjs +1 -1
  48. package/esm2020/lib/news/esolve-news.service.mjs +6 -4
  49. package/esm2020/lib/ng-esolve-connect.module.mjs +4 -9
  50. package/esm2020/lib/payment/classes/esolve-banking-details.model.mjs +1 -1
  51. package/esm2020/lib/payment/classes/esolve-payment-method.model.mjs +3 -2
  52. package/esm2020/lib/payment/classes/esolve-vault-item-result.model.mjs +1 -1
  53. package/esm2020/lib/ranges/esolve-ranges.service.mjs +3 -3
  54. package/esm2020/lib/session/esolve-session.service.mjs +10 -6
  55. package/esm2020/lib/shared/assets/esolve-asset-type.type.mjs +1 -1
  56. package/esm2020/lib/shared/assets/esolve-assets.service.mjs +3 -3
  57. package/esm2020/lib/shared/errors/esolve-error-handler.service.mjs +16 -16
  58. package/esm2020/lib/shared/errors/esolve-http-error.model.mjs +1 -1
  59. package/esm2020/lib/shared/esolve-list.model.mjs +1 -1
  60. package/esm2020/lib/shared/esolve-result.model.mjs +1 -1
  61. package/esm2020/lib/shared/filters/classes/esolve-multiple-select-filter.model.mjs +1 -1
  62. package/esm2020/lib/shared/filters/classes/esolve-range-filter.model.mjs +3 -3
  63. package/esm2020/lib/shared/filters/classes/esolve-single-select-filter.model.mjs +1 -1
  64. package/esm2020/lib/shared/filters/classes/esolve-toggle-filter.model.mjs +1 -1
  65. package/esm2020/lib/shared/filters/classes/index.mjs +1 -1
  66. package/esm2020/lib/shared/filters/esolve-filter-factory.mjs +1 -1
  67. package/esm2020/lib/shared/filters/interfaces/esolve-filter-definitions.interface.mjs +1 -1
  68. package/esm2020/lib/shared/filters/interfaces/esolve-filter.interface.mjs +1 -1
  69. package/esm2020/lib/shared/filters/types/esolve-filter-list.type.mjs +1 -1
  70. package/esm2020/lib/shared/filters/types/esolve-filter-record-list.type.mjs +1 -1
  71. package/esm2020/lib/shared/filters/types/esolve-filter-toggle.type.mjs +1 -1
  72. package/esm2020/lib/shared/filters/types/esolve-filter-type.type.mjs +1 -1
  73. package/esm2020/lib/shared/geocoder/esolve-geocode-address-result.model.mjs +1 -1
  74. package/esm2020/lib/shared/geocoder/esolve-geocode-coords-result.model.mjs +1 -1
  75. package/esm2020/lib/shared/geocoder/esolve-geocode-result.model.mjs +1 -1
  76. package/esm2020/lib/shared/response/esolve-delete-response.interface.mjs +1 -1
  77. package/esm2020/lib/shared/response/esolve-response-handler.service.mjs +5 -5
  78. package/esm2020/lib/shared/response/esolve-response-result.model.mjs +1 -1
  79. package/esm2020/lib/shared/response/esolve-set-response.interface.mjs +1 -1
  80. package/esm2020/lib/shared/seo/esolve-seo-info.model.mjs +1 -1
  81. package/esm2020/lib/shared/seo/esolve-seo.service.mjs +8 -3
  82. package/esm2020/lib/shipping/types/esolve-insurance-calculation-method.type.mjs +1 -1
  83. package/esm2020/lib/shipping/types/esolve-shipping-calculation-method.type.mjs +1 -1
  84. package/esm2020/lib/shipping/types/esolve-shipping-location.type.mjs +1 -1
  85. package/esm2020/lib/specials/esolve-special-dates.model.mjs +1 -1
  86. package/esm2020/lib/specials/esolve-special.model.mjs +3 -5
  87. package/esm2020/lib/specials/esolve-specials.service.mjs +3 -3
  88. package/esm2020/lib/stock/classes/esolve-stock-badge.model.mjs +1 -1
  89. package/esm2020/lib/stock/classes/esolve-stock-group-item.model.mjs +1 -1
  90. package/esm2020/lib/stock/classes/esolve-stock-group.model.mjs +1 -1
  91. package/esm2020/lib/stock/classes/esolve-stock-image-collection.model.mjs +1 -2
  92. package/esm2020/lib/stock/classes/esolve-stock-item-list.model.mjs +1 -1
  93. package/esm2020/lib/stock/classes/esolve-stock-item.model.mjs +1 -1
  94. package/esm2020/lib/stock/classes/esolve-stock-price.model.mjs +3 -3
  95. package/esm2020/lib/stock/classes/esolve-stock-transaction-history.model.mjs +1 -1
  96. package/esm2020/lib/stock/interfaces/esolve-dependant-item-record.interface.mjs +1 -1
  97. package/esm2020/lib/stock/interfaces/esolve-linked-stock-record.interface.mjs +1 -1
  98. package/esm2020/lib/stock/interfaces/esolve-recipe-item-record.interface.mjs +1 -1
  99. package/esm2020/lib/stock/interfaces/esolve-stock-image-collection-record.interface.mjs +1 -2
  100. package/esm2020/lib/stock/interfaces/esolve-stock-record.interface.mjs +1 -1
  101. package/esm2020/lib/stock/types/esolve-media-stock-item-list.type.mjs +1 -1
  102. package/esm2020/lib/stock/types/esolve-stock-image-size.type.mjs +1 -1
  103. package/esm2020/lib/stock/types/esolve-stock-sort-field.type.mjs +1 -1
  104. package/esm2020/lib/suppliers/esolve-suppliers.service.mjs +3 -4
  105. package/esm2020/lib/suppliers/index.mjs +1 -1
  106. package/esm2020/lib/suppliers/interfaces/esolve-supplier-record.interface.mjs +1 -1
  107. package/esm2020/lib/tags/esolve-tags.service.mjs +1 -1
  108. package/esm2020/lib/topics/esolve-topic.service.mjs +1 -1
  109. package/esm2020/lib/transactions/classes/esolve-transaction-address.model.mjs +1 -1
  110. package/esm2020/lib/transactions/classes/esolve-transaction-client.model.mjs +1 -1
  111. package/esm2020/lib/transactions/classes/esolve-transaction-item-price.model.mjs +1 -1
  112. package/esm2020/lib/transactions/classes/esolve-transaction-location.model.mjs +1 -1
  113. package/esm2020/lib/transactions/classes/esolve-transaction-payment-method.model.mjs +1 -1
  114. package/esm2020/lib/transactions/classes/esolve-transaction-shipping-method.model.mjs +1 -1
  115. package/esm2020/lib/transactions/classes/esolve-transaction-user.model.mjs +1 -1
  116. package/esm2020/lib/transactions/classes/esolve-transaction.model.mjs +1 -1
  117. package/esm2020/lib/transactions/esolve-transactions.service.mjs +4 -4
  118. package/esm2020/lib/wishlist/classes/esolve-empty-wishlist-result.model.mjs +1 -1
  119. package/esm2020/lib/wishlist/classes/esolve-wishlist-item.model.mjs +1 -1
  120. package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +2 -2
  121. package/esm2020/lib/wishlist/interfaces/esolve-wishlist-item-record.interface.mjs +1 -1
  122. package/esm2020/media/lib/classes/esolve-heading.model.mjs +1 -1
  123. package/esm2020/media/lib/components/media-layout/esolve-media-layout.component.mjs +4 -8
  124. package/esm2020/media/lib/components/media-section/esolve-media-section.component.mjs +1 -1
  125. package/esm2020/media/lib/esolve-connect-media-config.token.mjs +1 -1
  126. package/esm2020/media/lib/ng-esolve-connect-media.module.mjs +6 -14
  127. package/esm2020/media/lib/services/esolve-media.service.mjs +7 -7
  128. package/esm2020/media/lib/types/esolve-media-layout-section-type.type.mjs +1 -1
  129. package/esm2020/survey/lib/types/esolve-survey-question-type.type.mjs +1 -1
  130. package/fesm2015/esolve-ng-esolve-connect-media.mjs +12 -24
  131. package/fesm2015/esolve-ng-esolve-connect-media.mjs.map +1 -1
  132. package/fesm2015/esolve-ng-esolve-connect.mjs +112 -108
  133. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  134. package/fesm2020/esolve-ng-esolve-connect-media.mjs +12 -24
  135. package/fesm2020/esolve-ng-esolve-connect-media.mjs.map +1 -1
  136. package/fesm2020/esolve-ng-esolve-connect.mjs +112 -108
  137. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  138. package/lib/session/esolve-session.service.d.ts +1 -1
  139. package/lib/transactions/esolve-transactions.service.d.ts +1 -1
  140. 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 = (json_data ? JSON.parse(json_data) : null);
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 = (json_data ? JSON.parse(json_data) : null);
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, }, callback) {
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 ((typeof this.config.user_session_storage_key === 'string') &&
279
- (this.config.user_session_storage_key !== '')) {
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
- HttpClientModule] });
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 ((max > 0) && (min > max)) {
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 ((max > 0) && (min > max)) {
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 ((http_response.responses === undefined) ||
650
- (http_response.responses.length <= 0)) {
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 ((response.status.state === 'error') ||
655
- (response.status.state === 'none')) {
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
- (('id' in errorRes) &&
696
- ('esolve_id' in errorRes) &&
697
- ('transaction_type' in errorRes) &&
698
- ('status' in errorRes) &&
699
- ('log' in errorRes))) {
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 = (!(errorRes instanceof HttpErrorResponse) &&
704
+ const is_not_base = !(errorRes instanceof HttpErrorResponse) &&
706
705
  !('service_type' in errorRes) &&
707
- (('id' in errorRes) &&
708
- ('status' in errorRes) &&
709
- ('message' in errorRes) &&
710
- ('code' in errorRes)));
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 (('service_type' in server_error) &&
721
- (server_error.service_type === service_type)) {
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 (('service_type' in error_response) &&
728
- (error_response.service_type === service_type)) {
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 ((response.status.state === 'none') && (response.log.length > 0)) {
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({ property: 'og:description', content: description });
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.replace(/[^a-zA-Z0-9. ]+/gi, '').trim();
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 ((response.records === undefined) ||
1131
- (response.records.length <= 0)) {
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 = (type_code === '<<CAT>>' ? 'category' : 'subcategory');
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 ((response.records === undefined) ||
1303
- (response.records.length <= 0)) {
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 ((response.records === undefined) ||
1429
- (response.records.length <= 0)) {
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 ((response.records === undefined) ||
1712
- (response.records.length <= 0)) {
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 ((responseData.type === 'error') ||
1903
- (responseData.type === 'exception')) {
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 ((response.responses === undefined) ||
1939
- (response.responses.length <= 0)) {
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 ((login_response.status.state !== 'success') &&
1944
- (login_response.status.state !== 'warning')) {
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 ((response_log.type === 'success') &&
1949
- (response_log.message_code === 'login_success')) {
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 ((responseData.type === 'error') ||
2009
- (responseData.type === 'exception') ||
2010
- (!responseData.additional_data.key_okay)) {
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 ((!errorRes.type) ||
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 = (_c = (_b = record.ageing) === null || _b === void 0 ? void 0 : _b.map((e) => new EsolveStatementAgeing(e))) !== null && _c !== void 0 ? _c : [];
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 = (_b = (_a = record.transactions) === null || _a === void 0 ? void 0 : _a.map((e) => new EsolveStatementTransaction(e))) !== null && _b !== void 0 ? _b : [];
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 = (_1 = record.override_stock_listing_identifiers) !== null && _1 !== void 0 ? _1 : '';
2212
- this.requires_transaction_approval = (_2 = record.requires_transaction_approval) !== null && _2 !== void 0 ? _2 : '';
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 && (record.client_details.account !== '')) {
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 = (response.status.state === 'success');
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 = (response.esolve_id > 0);
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 = !!+record.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 && (options.user_id === -1)) {
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 = ((value > 0) ? value : 0);
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 ((response.records === undefined) ||
3495
- (response.records.length === 0)) {
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 ((http_response.result === undefined) ||
3510
- (http_response.result === null) ||
3511
- (http_response.result.status !== 'success')) {
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 ((http_response.result === undefined) ||
3562
- (http_response.result === null) ||
3563
- (http_response.result.status !== 'success')) {
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 ((response.records === undefined) ||
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 ((response.records === undefined) ||
3753
- (response.records.length <= 0)) {
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 || (this._user_id === 0)) {
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({ location_id: response.esolve_id });
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 ((banner_type === 'hotspot') && (image_record.hotspots)) {
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 ((records) && (records.length > 0)) {
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 ((!response) || (response.records === undefined)) {
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({ fromObject: { sef_title: identifier } });
4181
+ const params = new HttpParams({
4182
+ fromObject: { sef_title: identifier },
4183
+ });
4175
4184
  return this.getNewsRecords(params).pipe(map((response) => {
4176
- if ((response.records === undefined) ||
4177
- (response.records.length <= 0)) {
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 ((this.base_price === 0) && (this.sell_price > 0)) {
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 ((this.base_price > 0) && (this.sell_price === 0)) {
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.thumb.length > 0) ||
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 ((response.records === undefined) ||
5400
- (response.records.length <= 0)) {
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 = !!+record.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 ((response.records === undefined) ||
6271
- (response.records.length === 0)) {
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) {