@esolve/ng-esolve-connect 0.35.1 → 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 (219) hide show
  1. package/esm2020/index.mjs +3 -1
  2. package/esm2020/lib/account/address/esolve-address-result.model.mjs +1 -1
  3. package/esm2020/lib/account/address/esolve-address.model.mjs +1 -1
  4. package/esm2020/lib/account/confirmation/esolve-account-confirmation-post-response-item.interface.mjs +1 -1
  5. package/esm2020/lib/account/confirmation/esolve-account-confirmation-result.model.mjs +1 -1
  6. package/esm2020/lib/account/esolve-account.service.mjs +46 -30
  7. package/esm2020/lib/account/index.mjs +2 -2
  8. package/esm2020/lib/account/location/classes/esolve-location-update-result.model.mjs +11 -0
  9. package/esm2020/lib/account/location/classes/index.mjs +2 -0
  10. package/esm2020/lib/account/location/index.mjs +3 -0
  11. package/esm2020/lib/account/location/interfaces/esolve-location-options.interface.mjs +2 -0
  12. package/esm2020/lib/account/location/interfaces/index.mjs +2 -0
  13. package/esm2020/lib/account/password/esolve-change-password-result.model.mjs +2 -2
  14. package/esm2020/lib/account/password/esolve-reset-password-result.model.mjs +1 -1
  15. package/esm2020/lib/account/registration/esolve-registration-post-response-item.interface.mjs +1 -1
  16. package/esm2020/lib/account/registration/esolve-registration-result.model.mjs +1 -1
  17. package/esm2020/lib/account/user-account/classes/esolve-statement-balances.model.mjs +3 -2
  18. package/esm2020/lib/account/user-account/classes/esolve-statement-transaction.model.mjs +1 -1
  19. package/esm2020/lib/account/user-account/classes/esolve-statement.model.mjs +3 -2
  20. package/esm2020/lib/account/user-account/classes/esolve-user-account-result.model.mjs +1 -1
  21. package/esm2020/lib/account/user-account/classes/esolve-user-account.model.mjs +2 -2
  22. package/esm2020/lib/account/user-account/classes/esolve-user-client-account-balances.model.mjs +1 -1
  23. package/esm2020/lib/account/user-account/classes/esolve-user-client-account.model.mjs +5 -3
  24. package/esm2020/lib/auth/esolve-auth.service.mjs +13 -15
  25. package/esm2020/lib/banners/esolve-banner-image-hotspot.model.mjs +1 -1
  26. package/esm2020/lib/banners/esolve-banner-image.model.mjs +1 -1
  27. package/esm2020/lib/banners/esolve-banner.service.mjs +3 -3
  28. package/esm2020/lib/cart/classes/esolve-cart-totals.model.mjs +1 -1
  29. package/esm2020/lib/cart/classes/esolve-empty-cart-result.model.mjs +1 -1
  30. package/esm2020/lib/cart/classes/esolve-transaction-analytics-data.model.mjs +1 -1
  31. package/esm2020/lib/cart/esolve-cart.service.mjs +1 -1
  32. package/esm2020/lib/cart/interfaces/esolve-transaction-analytics-data-record.interface.mjs +1 -1
  33. package/esm2020/lib/category-tree/esolve-category-tree-item.model.mjs +1 -1
  34. package/esm2020/lib/category-tree/esolve-category-tree.service.mjs +4 -4
  35. package/esm2020/lib/coupons/interfaces/esolve-coupon-validation-result.interface.mjs +1 -2
  36. package/esm2020/lib/enquiry/esolve-enquiry.service.mjs +2 -2
  37. package/esm2020/lib/esolve-connect-config.constant.mjs +1 -1
  38. package/esm2020/lib/locations/classes/esolve-location-address.model.mjs +1 -1
  39. package/esm2020/lib/locations/classes/esolve-location-contact-info.model.mjs +1 -1
  40. package/esm2020/lib/locations/classes/esolve-location-geo.model.mjs +1 -1
  41. package/esm2020/lib/locations/classes/esolve-location-pobox-address.model.mjs +1 -1
  42. package/esm2020/lib/locations/classes/esolve-location-trading-day.model.mjs +1 -1
  43. package/esm2020/lib/locations/classes/esolve-location-trading-times.model.mjs +1 -1
  44. package/esm2020/lib/locations/classes/esolve-location.model.mjs +3 -2
  45. package/esm2020/lib/locations/esolve-locations.service.mjs +1 -1
  46. package/esm2020/lib/manufacturers/esolve-manufacturer-image-size.type.mjs +1 -1
  47. package/esm2020/lib/manufacturers/esolve-manufacturers.service.mjs +3 -3
  48. package/esm2020/lib/menu/esolve-menu.service.mjs +2 -2
  49. package/esm2020/lib/news/esolve-news-article-author.model.mjs +1 -1
  50. package/esm2020/lib/news/esolve-news-article-list.model.mjs +1 -1
  51. package/esm2020/lib/news/esolve-news-group.model.mjs +1 -1
  52. package/esm2020/lib/news/esolve-news.service.mjs +6 -4
  53. package/esm2020/lib/ng-esolve-connect.module.mjs +4 -9
  54. package/esm2020/lib/payment/classes/esolve-banking-details.model.mjs +1 -1
  55. package/esm2020/lib/payment/classes/esolve-payment-method.model.mjs +3 -2
  56. package/esm2020/lib/payment/classes/esolve-vault-item-result.model.mjs +1 -1
  57. package/esm2020/lib/payment/types/esolve-service-provider.type.mjs +1 -1
  58. package/esm2020/lib/ranges/esolve-ranges.service.mjs +3 -3
  59. package/esm2020/lib/session/esolve-session.service.mjs +10 -6
  60. package/esm2020/lib/shared/assets/esolve-asset-type.type.mjs +1 -1
  61. package/esm2020/lib/shared/assets/esolve-assets.service.mjs +3 -3
  62. package/esm2020/lib/shared/errors/esolve-error-handler.service.mjs +16 -16
  63. package/esm2020/lib/shared/errors/esolve-http-error.model.mjs +1 -1
  64. package/esm2020/lib/shared/esolve-list.model.mjs +1 -1
  65. package/esm2020/lib/shared/esolve-result.model.mjs +1 -1
  66. package/esm2020/lib/shared/filters/classes/esolve-multiple-select-filter.model.mjs +1 -1
  67. package/esm2020/lib/shared/filters/classes/esolve-range-filter.model.mjs +3 -3
  68. package/esm2020/lib/shared/filters/classes/esolve-single-select-filter.model.mjs +1 -1
  69. package/esm2020/lib/shared/filters/classes/esolve-toggle-filter.model.mjs +1 -1
  70. package/esm2020/lib/shared/filters/classes/index.mjs +1 -1
  71. package/esm2020/lib/shared/filters/esolve-filter-factory.mjs +1 -1
  72. package/esm2020/lib/shared/filters/interfaces/esolve-filter-definitions.interface.mjs +1 -1
  73. package/esm2020/lib/shared/filters/interfaces/esolve-filter.interface.mjs +1 -1
  74. package/esm2020/lib/shared/filters/types/esolve-filter-list.type.mjs +1 -1
  75. package/esm2020/lib/shared/filters/types/esolve-filter-record-list.type.mjs +1 -1
  76. package/esm2020/lib/shared/filters/types/esolve-filter-toggle.type.mjs +1 -1
  77. package/esm2020/lib/shared/filters/types/esolve-filter-type.type.mjs +1 -1
  78. package/esm2020/lib/shared/geocoder/esolve-geocode-address-result.model.mjs +1 -1
  79. package/esm2020/lib/shared/geocoder/esolve-geocode-coords-result.model.mjs +1 -1
  80. package/esm2020/lib/shared/geocoder/esolve-geocode-result.model.mjs +1 -1
  81. package/esm2020/lib/shared/response/esolve-delete-response.interface.mjs +1 -1
  82. package/esm2020/lib/shared/response/esolve-response-handler.service.mjs +5 -5
  83. package/esm2020/lib/shared/response/esolve-response-result.model.mjs +1 -1
  84. package/esm2020/lib/shared/response/esolve-set-response.interface.mjs +1 -1
  85. package/esm2020/lib/shared/seo/esolve-seo-info.model.mjs +1 -1
  86. package/esm2020/lib/shared/seo/esolve-seo.service.mjs +8 -3
  87. package/esm2020/lib/shipping/types/esolve-insurance-calculation-method.type.mjs +1 -1
  88. package/esm2020/lib/shipping/types/esolve-shipping-calculation-method.type.mjs +1 -1
  89. package/esm2020/lib/shipping/types/esolve-shipping-location.type.mjs +1 -1
  90. package/esm2020/lib/specials/esolve-special-dates.model.mjs +1 -1
  91. package/esm2020/lib/specials/esolve-special.model.mjs +3 -5
  92. package/esm2020/lib/specials/esolve-specials.service.mjs +3 -3
  93. package/esm2020/lib/stock/classes/esolve-stock-badge.model.mjs +1 -1
  94. package/esm2020/lib/stock/classes/esolve-stock-group-item.model.mjs +1 -1
  95. package/esm2020/lib/stock/classes/esolve-stock-group.model.mjs +1 -1
  96. package/esm2020/lib/stock/classes/esolve-stock-image-collection.model.mjs +1 -2
  97. package/esm2020/lib/stock/classes/esolve-stock-item-list.model.mjs +1 -1
  98. package/esm2020/lib/stock/classes/esolve-stock-item.model.mjs +1 -1
  99. package/esm2020/lib/stock/classes/esolve-stock-price.model.mjs +3 -3
  100. package/esm2020/lib/stock/classes/esolve-stock-transaction-history.model.mjs +1 -1
  101. package/esm2020/lib/stock/interfaces/esolve-dependant-item-record.interface.mjs +1 -1
  102. package/esm2020/lib/stock/interfaces/esolve-linked-stock-record.interface.mjs +1 -1
  103. package/esm2020/lib/stock/interfaces/esolve-recipe-item-record.interface.mjs +1 -1
  104. package/esm2020/lib/stock/interfaces/esolve-stock-image-collection-record.interface.mjs +1 -2
  105. package/esm2020/lib/stock/interfaces/esolve-stock-record.interface.mjs +1 -1
  106. package/esm2020/lib/stock/types/esolve-media-stock-item-list.type.mjs +1 -1
  107. package/esm2020/lib/stock/types/esolve-stock-image-size.type.mjs +1 -1
  108. package/esm2020/lib/stock/types/esolve-stock-sort-field.type.mjs +1 -1
  109. package/esm2020/lib/suppliers/esolve-suppliers.service.mjs +3 -4
  110. package/esm2020/lib/suppliers/index.mjs +1 -1
  111. package/esm2020/lib/suppliers/interfaces/esolve-supplier-record.interface.mjs +1 -1
  112. package/esm2020/lib/tags/esolve-tags.service.mjs +1 -1
  113. package/esm2020/lib/topics/esolve-topic.service.mjs +1 -1
  114. package/esm2020/lib/transactions/classes/esolve-transaction-address.model.mjs +16 -0
  115. package/esm2020/lib/transactions/classes/esolve-transaction-client.model.mjs +13 -0
  116. package/esm2020/lib/transactions/classes/esolve-transaction-item-price.model.mjs +25 -0
  117. package/esm2020/lib/transactions/classes/esolve-transaction-item.model.mjs +72 -0
  118. package/esm2020/lib/transactions/classes/esolve-transaction-list.model.mjs +4 -0
  119. package/esm2020/lib/transactions/classes/esolve-transaction-location.model.mjs +4 -0
  120. package/esm2020/lib/transactions/classes/esolve-transaction-payment-method.model.mjs +10 -0
  121. package/esm2020/lib/transactions/classes/esolve-transaction-shipping-method.model.mjs +12 -0
  122. package/esm2020/lib/transactions/classes/esolve-transaction-user.model.mjs +11 -0
  123. package/esm2020/lib/transactions/classes/esolve-transaction.model.mjs +55 -0
  124. package/esm2020/lib/transactions/classes/index.mjs +11 -0
  125. package/esm2020/lib/transactions/esolve-transactions.service.mjs +137 -0
  126. package/esm2020/lib/transactions/index.mjs +5 -0
  127. package/esm2020/lib/transactions/interfaces/esolve-transaction-client-record.interface.mjs +2 -0
  128. package/esm2020/lib/transactions/interfaces/esolve-transaction-item-record.interface.mjs +2 -0
  129. package/esm2020/lib/transactions/interfaces/esolve-transaction-options.interface.mjs +2 -0
  130. package/esm2020/lib/transactions/interfaces/esolve-transaction-payment-method-record.interface.mjs +2 -0
  131. package/esm2020/lib/transactions/interfaces/esolve-transaction-record.interface.mjs +2 -0
  132. package/esm2020/lib/transactions/interfaces/esolve-transaction-shipping-method-record.interface.mjs +2 -0
  133. package/esm2020/lib/transactions/interfaces/esolve-transaction-user-record.interface.mjs +2 -0
  134. package/esm2020/lib/transactions/interfaces/index.mjs +8 -0
  135. package/esm2020/lib/transactions/types/esolve-transaction-location-record.type.mjs +2 -0
  136. package/esm2020/lib/transactions/types/esolve-transaction-type.type.mjs +2 -0
  137. package/esm2020/lib/transactions/types/index.mjs +3 -0
  138. package/esm2020/lib/wishlist/classes/esolve-empty-wishlist-result.model.mjs +1 -1
  139. package/esm2020/lib/wishlist/classes/esolve-wishlist-item.model.mjs +1 -1
  140. package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +2 -2
  141. package/esm2020/lib/wishlist/interfaces/esolve-wishlist-item-record.interface.mjs +1 -1
  142. package/esm2020/media/lib/classes/esolve-heading.model.mjs +1 -1
  143. package/esm2020/media/lib/components/media-layout/esolve-media-layout.component.mjs +4 -8
  144. package/esm2020/media/lib/components/media-section/esolve-media-section.component.mjs +1 -1
  145. package/esm2020/media/lib/esolve-connect-media-config.token.mjs +1 -1
  146. package/esm2020/media/lib/ng-esolve-connect-media.module.mjs +6 -14
  147. package/esm2020/media/lib/services/esolve-media.service.mjs +7 -7
  148. package/esm2020/media/lib/types/esolve-media-layout-section-type.type.mjs +1 -1
  149. package/esm2020/survey/lib/types/esolve-survey-question-type.type.mjs +1 -1
  150. package/fesm2015/esolve-ng-esolve-connect-media.mjs +12 -24
  151. package/fesm2015/esolve-ng-esolve-connect-media.mjs.map +1 -1
  152. package/fesm2015/esolve-ng-esolve-connect.mjs +302 -155
  153. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  154. package/fesm2020/esolve-ng-esolve-connect-media.mjs +12 -24
  155. package/fesm2020/esolve-ng-esolve-connect-media.mjs.map +1 -1
  156. package/fesm2020/esolve-ng-esolve-connect.mjs +299 -155
  157. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  158. package/index.d.ts +1 -0
  159. package/lib/account/esolve-account.service.d.ts +10 -2
  160. package/lib/account/index.d.ts +1 -1
  161. package/lib/account/{esolve-location-update-result.model.d.ts → location/classes/esolve-location-update-result.model.d.ts} +1 -1
  162. package/lib/account/location/classes/index.d.ts +1 -0
  163. package/lib/account/{transaction → location}/index.d.ts +0 -1
  164. package/lib/account/location/interfaces/esolve-location-options.interface.d.ts +4 -0
  165. package/lib/account/location/interfaces/index.d.ts +1 -0
  166. package/lib/cart/classes/esolve-transaction-analytics-data.model.d.ts +1 -1
  167. package/lib/cart/esolve-cart.service.d.ts +1 -1
  168. package/lib/cart/interfaces/esolve-transaction-analytics-data-record.interface.d.ts +1 -1
  169. package/lib/payment/types/esolve-service-provider.type.d.ts +1 -1
  170. package/lib/session/esolve-session.service.d.ts +1 -1
  171. package/lib/{account/transaction → transactions}/classes/esolve-transaction-address.model.d.ts +1 -1
  172. package/lib/{account/transaction → transactions}/classes/esolve-transaction-item.model.d.ts +1 -1
  173. package/lib/{account/transaction → transactions}/classes/esolve-transaction-list.model.d.ts +1 -1
  174. package/lib/{account/transaction → transactions}/classes/esolve-transaction-location.model.d.ts +1 -1
  175. package/lib/transactions/esolve-transactions.service.d.ts +26 -0
  176. package/lib/transactions/index.d.ts +4 -0
  177. package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-options.interface.d.ts +2 -1
  178. package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-record.interface.d.ts +1 -1
  179. package/lib/{account/transaction → transactions}/types/esolve-transaction-location-record.type.d.ts +1 -1
  180. package/package.json +1 -1
  181. package/esm2020/lib/account/esolve-location-update-result.model.mjs +0 -8
  182. package/esm2020/lib/account/transaction/classes/esolve-transaction-address.model.mjs +0 -16
  183. package/esm2020/lib/account/transaction/classes/esolve-transaction-client.model.mjs +0 -13
  184. package/esm2020/lib/account/transaction/classes/esolve-transaction-item-price.model.mjs +0 -25
  185. package/esm2020/lib/account/transaction/classes/esolve-transaction-item.model.mjs +0 -72
  186. package/esm2020/lib/account/transaction/classes/esolve-transaction-list.model.mjs +0 -4
  187. package/esm2020/lib/account/transaction/classes/esolve-transaction-location.model.mjs +0 -4
  188. package/esm2020/lib/account/transaction/classes/esolve-transaction-payment-method.model.mjs +0 -10
  189. package/esm2020/lib/account/transaction/classes/esolve-transaction-shipping-method.model.mjs +0 -12
  190. package/esm2020/lib/account/transaction/classes/esolve-transaction-user.model.mjs +0 -11
  191. package/esm2020/lib/account/transaction/classes/esolve-transaction.model.mjs +0 -55
  192. package/esm2020/lib/account/transaction/classes/index.mjs +0 -11
  193. package/esm2020/lib/account/transaction/index.mjs +0 -4
  194. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-client-record.interface.mjs +0 -2
  195. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-item-record.interface.mjs +0 -2
  196. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-options.interface.mjs +0 -2
  197. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-payment-method-record.interface.mjs +0 -2
  198. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-record.interface.mjs +0 -2
  199. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-shipping-method-record.interface.mjs +0 -2
  200. package/esm2020/lib/account/transaction/interfaces/esolve-transaction-user-record.interface.mjs +0 -2
  201. package/esm2020/lib/account/transaction/interfaces/index.mjs +0 -8
  202. package/esm2020/lib/account/transaction/types/esolve-transaction-location-record.type.mjs +0 -2
  203. package/esm2020/lib/account/transaction/types/esolve-transaction-type.type.mjs +0 -2
  204. package/esm2020/lib/account/transaction/types/index.mjs +0 -3
  205. /package/lib/{account/transaction → transactions}/classes/esolve-transaction-client.model.d.ts +0 -0
  206. /package/lib/{account/transaction → transactions}/classes/esolve-transaction-item-price.model.d.ts +0 -0
  207. /package/lib/{account/transaction → transactions}/classes/esolve-transaction-payment-method.model.d.ts +0 -0
  208. /package/lib/{account/transaction → transactions}/classes/esolve-transaction-shipping-method.model.d.ts +0 -0
  209. /package/lib/{account/transaction → transactions}/classes/esolve-transaction-user.model.d.ts +0 -0
  210. /package/lib/{account/transaction → transactions}/classes/esolve-transaction.model.d.ts +0 -0
  211. /package/lib/{account/transaction → transactions}/classes/index.d.ts +0 -0
  212. /package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-client-record.interface.d.ts +0 -0
  213. /package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-item-record.interface.d.ts +0 -0
  214. /package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-payment-method-record.interface.d.ts +0 -0
  215. /package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-shipping-method-record.interface.d.ts +0 -0
  216. /package/lib/{account/transaction → transactions}/interfaces/esolve-transaction-user-record.interface.d.ts +0 -0
  217. /package/lib/{account/transaction → transactions}/interfaces/index.d.ts +0 -0
  218. /package/lib/{account/transaction → transactions}/types/esolve-transaction-type.type.d.ts +0 -0
  219. /package/lib/{account/transaction → transactions}/types/index.d.ts +0 -0
@@ -5,7 +5,7 @@ import * as i1$2 from '@angular/common/http';
5
5
  import { HTTP_INTERCEPTORS, HttpClientModule, HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
6
6
  import * as i1 from 'ngx-cookie-service';
7
7
  import { CookieService } from 'ngx-cookie-service';
8
- import { BehaviorSubject, throwError, of, firstValueFrom, Subject, iif } from 'rxjs';
8
+ import { BehaviorSubject, throwError, of, firstValueFrom, map as map$1, Subject, iif } from 'rxjs';
9
9
  import * as i1$1 from '@angular/platform-browser';
10
10
  import { map, catchError, tap, switchMap } from 'rxjs/operators';
11
11
  import { __awaiter } from 'tslib';
@@ -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
  }
@@ -2259,6 +2265,53 @@ class EsolveUserClientAccountBalances {
2259
2265
  }
2260
2266
  }
2261
2267
 
2268
+ class EsolveChangePasswordResult extends EsolveResponseResult {
2269
+ constructor(response) {
2270
+ super(response);
2271
+ this.password_updated = response.status.state === 'success';
2272
+ }
2273
+ }
2274
+
2275
+ class EsolveResetPasswordResult extends EsolveResponseResult {
2276
+ constructor(response) {
2277
+ super(response);
2278
+ this.id = response.esolve_id;
2279
+ this.reset_success = response.reset_success;
2280
+ this.password_matches_old = response.password_matches_old;
2281
+ this.login_required = response.login_required;
2282
+ }
2283
+ }
2284
+
2285
+ class EsolveRegistrationResult extends EsolveResponseResult {
2286
+ constructor(response) {
2287
+ super(response);
2288
+ this.user_id = response.esolve_id;
2289
+ this.guest = response.guest;
2290
+ this.auto_login = response.auto_login;
2291
+ this.authentication_required = response.authentication_required;
2292
+ this.location_id = response.session_data.location_id;
2293
+ }
2294
+ }
2295
+
2296
+ class EsolveAccountConfirmationResult extends EsolveResponseResult {
2297
+ constructor(response) {
2298
+ super(response);
2299
+ this.user_id = +response.esolve_id;
2300
+ this.location_id = +response.location_id;
2301
+ this.recalculated_cart = !!+response.recalculated_cart;
2302
+ }
2303
+ }
2304
+
2305
+ class EsolveLocationUpdateResult extends EsolveResponseResult {
2306
+ constructor(response) {
2307
+ super(response);
2308
+ if (typeof response.esolve_id === 'string') {
2309
+ throw new Error('Invalid response id.');
2310
+ }
2311
+ this.location_updated = response.esolve_id > 0;
2312
+ }
2313
+ }
2314
+
2262
2315
  class EsolveTransactionAddress {
2263
2316
  constructor(recipient, address_type, address_description, street_number, street, suburb, city, province, country, postal_code, pobox) {
2264
2317
  this.recipient = recipient;
@@ -2455,7 +2508,8 @@ class EsolveLocation {
2455
2508
  this.head_office = !!+record.head_office;
2456
2509
  this.erp_identifier = record.erp_identifier;
2457
2510
  this.external_system_code = record.external_system_code;
2458
- 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;
2459
2513
  this.userid = +record.userid;
2460
2514
  this.importance = +record.importance;
2461
2515
  this.active = !!+record.is_active;
@@ -2653,49 +2707,131 @@ class EsolveTransaction {
2653
2707
  }
2654
2708
  }
2655
2709
 
2656
- class EsolveChangePasswordResult extends EsolveResponseResult {
2657
- constructor(response) {
2658
- super(response);
2659
- this.password_updated = (response.status.state === 'success');
2710
+ class EsolveTransactionsService {
2711
+ get user_id() {
2712
+ return this._user_id;
2660
2713
  }
2661
- }
2662
-
2663
- class EsolveResetPasswordResult extends EsolveResponseResult {
2664
- constructor(response) {
2665
- super(response);
2666
- this.id = response.esolve_id;
2667
- this.reset_success = response.reset_success;
2668
- this.password_matches_old = response.password_matches_old;
2669
- this.login_required = response.login_required;
2714
+ set user_id(value) {
2715
+ value = value > 0 ? value : 0;
2716
+ if (this._user_id !== value) {
2717
+ this._user_id = value;
2718
+ }
2670
2719
  }
2671
- }
2672
-
2673
- class EsolveRegistrationResult extends EsolveResponseResult {
2674
- constructor(response) {
2675
- super(response);
2676
- this.user_id = response.esolve_id;
2677
- this.guest = response.guest;
2678
- this.auto_login = response.auto_login;
2679
- this.authentication_required = response.authentication_required;
2680
- this.location_id = response.session_data.location_id;
2720
+ constructor(config, http, sessionService, errorHandler, responseHandler) {
2721
+ this.config = config;
2722
+ this.http = http;
2723
+ this.sessionService = sessionService;
2724
+ this.errorHandler = errorHandler;
2725
+ this.responseHandler = responseHandler;
2726
+ this._user_id = 0;
2727
+ this.sessionService.session.subscribe((session) => {
2728
+ if (session.key !== '') {
2729
+ this.user_id = session.id;
2730
+ }
2731
+ });
2681
2732
  }
2682
- }
2683
-
2684
- class EsolveAccountConfirmationResult extends EsolveResponseResult {
2685
- constructor(response) {
2686
- super(response);
2687
- this.user_id = +response.esolve_id;
2688
- this.location_id = +response.location_id;
2689
- this.recalculated_cart = !!+response.recalculated_cart;
2733
+ getTransactions(options = {}) {
2734
+ try {
2735
+ this.loginGuard();
2736
+ let params = new HttpParams();
2737
+ params = params.set('user_id', this.user_id);
2738
+ if (options.user_id && options.user_id === -1) {
2739
+ params = params.set('user_id', -1);
2740
+ }
2741
+ if (options.type) {
2742
+ params = params.set('type', options.type);
2743
+ }
2744
+ if (options.page) {
2745
+ params = params.set('page', options.page);
2746
+ }
2747
+ if (options.rows) {
2748
+ params = params.set('rows', options.rows);
2749
+ }
2750
+ if (options.from_date) {
2751
+ params = params.set('from_date', options.from_date);
2752
+ }
2753
+ if (options.to_date) {
2754
+ params = params.set('to_date', options.to_date);
2755
+ }
2756
+ if (options.filters) {
2757
+ let filters = options.filters;
2758
+ if (!Array.isArray(filters)) {
2759
+ filters = covertFromObj(filters);
2760
+ }
2761
+ params = convertToHttpParams(filters, params);
2762
+ }
2763
+ return this.http
2764
+ .get(`${this.config.api_url}/get-transactions.php`, {
2765
+ params: params,
2766
+ })
2767
+ .pipe(map$1((response) => {
2768
+ var _a, _b;
2769
+ if (response.records === undefined) {
2770
+ throw response;
2771
+ }
2772
+ const items = this.processTransactions(response.records);
2773
+ const total = (_a = +response.additional_data.total_records) !== null && _a !== void 0 ? _a : 0;
2774
+ const rows = (_b = options.rows) !== null && _b !== void 0 ? _b : total;
2775
+ const page = options.page || 1;
2776
+ return new EsolveTransactionList(items, page, rows, total);
2777
+ }));
2778
+ }
2779
+ catch (error) {
2780
+ return throwError(() => error);
2781
+ }
2690
2782
  }
2691
- }
2692
-
2693
- class EsolveLocationUpdateResult extends EsolveResponseResult {
2694
- constructor(response) {
2695
- super(response);
2696
- this.location_updated = (response.esolve_id > 0);
2783
+ getTransaction(id, user_id) {
2784
+ try {
2785
+ this.loginGuard();
2786
+ return this.http
2787
+ .get(`${this.config.api_url}/get-transactions.php`, {
2788
+ params: {
2789
+ user_id: user_id !== null && user_id !== void 0 ? user_id : this.user_id,
2790
+ transaction_id: id,
2791
+ },
2792
+ })
2793
+ .pipe(map$1((response) => {
2794
+ if (response.records === undefined ||
2795
+ response.records.length <= 0) {
2796
+ throw response;
2797
+ }
2798
+ const items = this.processTransactions(response.records);
2799
+ return items[0];
2800
+ }));
2801
+ }
2802
+ catch (error) {
2803
+ return throwError(() => error);
2804
+ }
2697
2805
  }
2698
- }
2806
+ loginGuard() {
2807
+ if (this.user_id <= 0) {
2808
+ this.errorHandler.throwError('login_required', 'Login is required');
2809
+ }
2810
+ }
2811
+ processTransactions(records) {
2812
+ const transactions = [];
2813
+ if (records) {
2814
+ for (const record of records) {
2815
+ const transaction = new EsolveTransaction(record);
2816
+ transactions.push(transaction);
2817
+ }
2818
+ }
2819
+ return transactions;
2820
+ }
2821
+ }
2822
+ EsolveTransactionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
2823
+ EsolveTransactionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, providedIn: 'root' });
2824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, decorators: [{
2825
+ type: Injectable,
2826
+ args: [{
2827
+ providedIn: 'root',
2828
+ }]
2829
+ }], ctorParameters: function () {
2830
+ return [{ type: undefined, decorators: [{
2831
+ type: Inject,
2832
+ args: [ESOLVE_CONNECT_CONFIG]
2833
+ }] }, { type: i1$2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }];
2834
+ } });
2699
2835
 
2700
2836
  class EsolveEmptyCartResult extends EsolveResponseResult {
2701
2837
  }
@@ -2871,8 +3007,6 @@ class EsolveCoupon {
2871
3007
  }
2872
3008
  }
2873
3009
 
2874
- ;
2875
-
2876
3010
  class EsolveCouponsService {
2877
3011
  constructor(platformId, config, http, cookieService) {
2878
3012
  this.platformId = platformId;
@@ -3324,7 +3458,7 @@ class EsolveAccountService {
3324
3458
  return this._user_id;
3325
3459
  }
3326
3460
  set user_id(value) {
3327
- value = ((value > 0) ? value : 0);
3461
+ value = value > 0 ? value : 0;
3328
3462
  if (this._user_id !== value) {
3329
3463
  this._user_id = value;
3330
3464
  }
@@ -3362,8 +3496,8 @@ class EsolveAccountService {
3362
3496
  return this.http
3363
3497
  .get(`${this.config.api_url}/get-account.php`)
3364
3498
  .pipe(map((response) => {
3365
- if ((response.records === undefined) ||
3366
- (response.records.length === 0)) {
3499
+ if (response.records === undefined ||
3500
+ response.records.length === 0) {
3367
3501
  throw response;
3368
3502
  }
3369
3503
  const record = response.records[0];
@@ -3377,9 +3511,9 @@ class EsolveAccountService {
3377
3511
  observe: 'body',
3378
3512
  })
3379
3513
  .pipe(map((http_response) => {
3380
- if ((http_response.result === undefined) ||
3381
- (http_response.result === null) ||
3382
- (http_response.result.status !== 'success')) {
3514
+ if (http_response.result === undefined ||
3515
+ http_response.result === null ||
3516
+ http_response.result.status !== 'success') {
3383
3517
  throw http_response;
3384
3518
  }
3385
3519
  return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
@@ -3429,9 +3563,9 @@ class EsolveAccountService {
3429
3563
  observe: 'body',
3430
3564
  })
3431
3565
  .pipe(map((http_response) => {
3432
- if ((http_response.result === undefined) ||
3433
- (http_response.result === null) ||
3434
- (http_response.result.status !== 'success')) {
3566
+ if (http_response.result === undefined ||
3567
+ http_response.result === null ||
3568
+ http_response.result.status !== 'success') {
3435
3569
  throw http_response;
3436
3570
  }
3437
3571
  return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
@@ -3519,7 +3653,7 @@ class EsolveAccountService {
3519
3653
  return this.http
3520
3654
  .get(`${this.config.api_url}/get-forgot-password.php`, { params: { email } })
3521
3655
  .pipe(map((response) => {
3522
- if ((response.records === undefined) ||
3656
+ if (response.records === undefined ||
3523
3657
  !('reset_link_sent' in response.records)) {
3524
3658
  throw response;
3525
3659
  }
@@ -3553,20 +3687,14 @@ class EsolveAccountService {
3553
3687
  }));
3554
3688
  }
3555
3689
  updateLocation(location_id) {
3556
- const body = { location_id };
3557
- return this.http
3558
- .post(`${this.config.api_url}/set-session-location.php`, body, {
3559
- headers: {
3560
- 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;',
3561
- },
3562
- responseType: 'json',
3563
- observe: 'body',
3564
- })
3565
- .pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
3566
- this.sessionService.handleUpdateSession({ location_id });
3567
- return new EsolveLocationUpdateResult(response);
3568
- })));
3690
+ return this.updateUserLocation({ location_id });
3569
3691
  }
3692
+ updateLocationOnErp(erp) {
3693
+ return this.updateUserLocation({ erp });
3694
+ }
3695
+ /**
3696
+ * @deprecated Use EsolveTransactionsService for future transaction requests
3697
+ */
3570
3698
  getTransactions(options = {}) {
3571
3699
  try {
3572
3700
  this.loginGuard();
@@ -3612,6 +3740,9 @@ class EsolveAccountService {
3612
3740
  return throwError(() => error);
3613
3741
  }
3614
3742
  }
3743
+ /**
3744
+ * @deprecated Use EsolveTransactionsService for future transaction requests
3745
+ */
3615
3746
  getTransaction(id) {
3616
3747
  try {
3617
3748
  this.loginGuard();
@@ -3623,8 +3754,8 @@ class EsolveAccountService {
3623
3754
  },
3624
3755
  })
3625
3756
  .pipe(map((response) => {
3626
- if ((response.records === undefined) ||
3627
- (response.records.length <= 0)) {
3757
+ if (response.records === undefined ||
3758
+ response.records.length <= 0) {
3628
3759
  throw response;
3629
3760
  }
3630
3761
  const items = this.processTransactions(response.records);
@@ -3662,7 +3793,7 @@ class EsolveAccountService {
3662
3793
  }
3663
3794
  processUserAddress(records) {
3664
3795
  const user_addresses = [];
3665
- if (!records || (this._user_id === 0)) {
3796
+ if (!records || this._user_id === 0) {
3666
3797
  return user_addresses;
3667
3798
  }
3668
3799
  for (const record of records) {
@@ -3698,6 +3829,25 @@ class EsolveAccountService {
3698
3829
  this.errorHandler.throwError('login_required', 'Login is required');
3699
3830
  }
3700
3831
  }
3832
+ updateUserLocation(body) {
3833
+ return this.http
3834
+ .post(`${this.config.api_url}/set-session-location.php`, body, {
3835
+ headers: {
3836
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;',
3837
+ },
3838
+ responseType: 'json',
3839
+ observe: 'body',
3840
+ })
3841
+ .pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
3842
+ if (typeof response.esolve_id === 'string') {
3843
+ throw new Error('Invalid response id.');
3844
+ }
3845
+ this.sessionService.handleUpdateSession({
3846
+ location_id: response.esolve_id,
3847
+ });
3848
+ return new EsolveLocationUpdateResult(response);
3849
+ })));
3850
+ }
3701
3851
  }
3702
3852
  EsolveAccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
3703
3853
  EsolveAccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, providedIn: 'root' });
@@ -3805,7 +3955,7 @@ class EsolveBannerService {
3805
3955
  if (image_records.length > 0) {
3806
3956
  for (const image_record of image_records) {
3807
3957
  const image = new EsolveBannerImage(+image_record.id, image_record.image_type, +image_record.width, +image_record.height, image_record.filename);
3808
- if ((banner_type === 'hotspot') && (image_record.hotspots)) {
3958
+ if (banner_type === 'hotspot' && image_record.hotspots) {
3809
3959
  const hotspots = this.processBannerImageHotspots(image_record.hotspots);
3810
3960
  image.hotspots = hotspots;
3811
3961
  }
@@ -3821,7 +3971,7 @@ class EsolveBannerService {
3821
3971
  */
3822
3972
  processBanners(records) {
3823
3973
  const banners = [];
3824
- if ((records) && (records.length > 0)) {
3974
+ if (records && records.length > 0) {
3825
3975
  for (const record of records) {
3826
3976
  const image_sets = {};
3827
3977
  if (record.images.desktop) {
@@ -3896,7 +4046,7 @@ class EsolveMenuService {
3896
4046
  return this.http
3897
4047
  .get(`${this.config.api_url}/get-menu-tree.php`, { params: { identifier } })
3898
4048
  .pipe(map((response) => {
3899
- if ((!response) || (response.records === undefined)) {
4049
+ if (!response || response.records === undefined) {
3900
4050
  throw response;
3901
4051
  }
3902
4052
  else if (response.records.length === 0) {
@@ -4028,10 +4178,12 @@ class EsolveNewsService {
4028
4178
  this.http = http;
4029
4179
  }
4030
4180
  getNewsArticle(identifier) {
4031
- const params = new HttpParams({ fromObject: { sef_title: identifier } });
4181
+ const params = new HttpParams({
4182
+ fromObject: { sef_title: identifier },
4183
+ });
4032
4184
  return this.getNewsRecords(params).pipe(map((response) => {
4033
- if ((response.records === undefined) ||
4034
- (response.records.length <= 0)) {
4185
+ if (response.records === undefined ||
4186
+ response.records.length <= 0) {
4035
4187
  throw response;
4036
4188
  }
4037
4189
  const record = response.records[0];
@@ -4191,11 +4343,11 @@ class EsolveStockPrice {
4191
4343
  this.sell_price = sell_price;
4192
4344
  this.sell_price_with_tax = sell_price_with_tax;
4193
4345
  this.tax_rate = tax_rate;
4194
- if ((this.base_price === 0) && (this.sell_price > 0)) {
4346
+ if (this.base_price === 0 && this.sell_price > 0) {
4195
4347
  this.base_price = this.sell_price;
4196
4348
  this.base_price_with_tax = this.sell_price_with_tax;
4197
4349
  }
4198
- else if ((this.base_price > 0) && (this.sell_price === 0)) {
4350
+ else if (this.base_price > 0 && this.sell_price === 0) {
4199
4351
  this.sell_price = this.base_price;
4200
4352
  this.sell_price_with_tax = this.base_price_with_tax;
4201
4353
  }
@@ -4700,13 +4852,10 @@ class EsolveStockImageCollection {
4700
4852
  }
4701
4853
  }
4702
4854
  }
4703
- }
4704
- ;
4855
+ }
4705
4856
 
4706
4857
  // Classes
4707
4858
 
4708
- ;
4709
-
4710
4859
  // Interfaces
4711
4860
 
4712
4861
  class EsolveStockService {
@@ -5183,10 +5332,8 @@ class EsolveSpecial {
5183
5332
  }
5184
5333
  }
5185
5334
  if (record.images &&
5186
- ((record.images.thumb &&
5187
- record.images.thumb.length > 0) ||
5188
- (record.images.banner &&
5189
- record.images.banner.length > 0) ||
5335
+ ((record.images.thumb && record.images.thumb.length > 0) ||
5336
+ (record.images.banner && record.images.banner.length > 0) ||
5190
5337
  (record.images.banner_mobile &&
5191
5338
  record.images.banner_mobile.length > 0)) &&
5192
5339
  record.image_container.trim() !== '') {
@@ -5253,8 +5400,8 @@ class EsolveSpecialsService {
5253
5400
  return this.http
5254
5401
  .get(`${this.config.api_url}/get-specials.php`, { params })
5255
5402
  .pipe(map((response) => {
5256
- if ((response.records === undefined) ||
5257
- (response.records.length <= 0)) {
5403
+ if (response.records === undefined ||
5404
+ response.records.length <= 0) {
5258
5405
  throw response;
5259
5406
  }
5260
5407
  return response.records;
@@ -5308,7 +5455,8 @@ class EsolvePaymentMethod {
5308
5455
  this.integration_type = record.integration_type;
5309
5456
  this.bank_gateway_id = record.bank_gateway_id;
5310
5457
  this.accepted_card_types = record.accepted_card_types;
5311
- this.post_transactions_to_gateway = !!+record.post_transactions_to_gateway;
5458
+ this.post_transactions_to_gateway =
5459
+ !!+record.post_transactions_to_gateway;
5312
5460
  this.three_d_secure_url = record.three_d_secure_url;
5313
5461
  this.gateway_url = record.gateway_url;
5314
5462
  this.generate_token_url = record.generate_token_url;
@@ -6124,12 +6272,11 @@ class EsolveSuppliersService {
6124
6272
  return this.http
6125
6273
  .get(`${this.config.api_url}/get-suppliers.php`, { params })
6126
6274
  .pipe(map((response) => {
6127
- if ((response.records === undefined) ||
6128
- (response.records.length === 0)) {
6275
+ if (response.records === undefined ||
6276
+ response.records.length === 0) {
6129
6277
  throw response;
6130
6278
  }
6131
6279
  return response.records;
6132
- ;
6133
6280
  }));
6134
6281
  }
6135
6282
  processSuppliers(record) {
@@ -6158,5 +6305,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6158
6305
  * Generated bundle index. Do not edit.
6159
6306
  */
6160
6307
 
6161
- export { ESOLVE_CONNECT_CONFIG, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, esolveFilterFactory as EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSession, EsolveSessionMetadataService, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveHexHash };
6308
+ export { ESOLVE_CONNECT_CONFIG, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, esolveFilterFactory as EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSession, EsolveSessionMetadataService, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveHexHash };
6162
6309
  //# sourceMappingURL=esolve-ng-esolve-connect.mjs.map