@daffodil/cart 0.39.11 → 0.40.1

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 (789) hide show
  1. package/daffodil-cart.d.ts +1 -1
  2. package/driver/daffodil-cart-driver.d.ts +1 -0
  3. package/driver/errors/map.d.ts +0 -1
  4. package/driver/in-memory/backend/cart/cart.service.d.ts +3 -0
  5. package/driver/in-memory/backend/cart-address/cart-address.service.d.ts +3 -0
  6. package/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.d.ts +3 -0
  7. package/driver/in-memory/backend/cart-coupon/cart-coupon.service.d.ts +3 -0
  8. package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +3 -0
  9. package/driver/in-memory/backend/cart-order/cart-order.service.d.ts +3 -0
  10. package/driver/in-memory/backend/cart-payment/cart-payment.service.d.ts +3 -0
  11. package/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
  12. package/driver/in-memory/backend/cart-root.service.d.ts +3 -0
  13. package/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
  14. package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
  15. package/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
  16. package/driver/in-memory/daffodil-cart-driver-in-memory.d.ts +1 -1
  17. package/driver/in-memory/drivers/cart/cart.service.d.ts +6 -2
  18. package/driver/in-memory/drivers/cart-address/cart-address.service.d.ts +3 -0
  19. package/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.d.ts +3 -0
  20. package/driver/in-memory/drivers/cart-coupon/cart-coupon.service.d.ts +3 -0
  21. package/driver/in-memory/drivers/cart-driver.module.d.ts +5 -0
  22. package/driver/in-memory/drivers/cart-item/cart-item.service.d.ts +3 -0
  23. package/driver/in-memory/drivers/cart-order/cart-order.service.d.ts +3 -0
  24. package/driver/in-memory/drivers/cart-payment/cart-payment.service.d.ts +3 -0
  25. package/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
  26. package/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
  27. package/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
  28. package/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
  29. package/driver/in-memory/package.json +5 -6
  30. package/driver/interfaces/cart-service.interface.d.ts +2 -1
  31. package/driver/magento/cart-address.service.d.ts +3 -0
  32. package/driver/magento/cart-billing-address.service.d.ts +4 -1
  33. package/driver/magento/cart-coupon.service.d.ts +3 -0
  34. package/driver/magento/cart-driver.module.d.ts +5 -0
  35. package/driver/magento/cart-item.service.d.ts +4 -1
  36. package/driver/magento/cart-order.service.d.ts +3 -0
  37. package/driver/magento/cart-payment-methods.service.d.ts +4 -1
  38. package/driver/magento/cart-payment.service.d.ts +4 -1
  39. package/driver/magento/cart-shipping-address.service.d.ts +4 -1
  40. package/driver/magento/cart-shipping-information.service.d.ts +4 -1
  41. package/driver/magento/cart-shipping-methods.service.d.ts +4 -1
  42. package/driver/magento/cart.service.d.ts +6 -2
  43. package/driver/magento/daffodil-cart-driver-magento.d.ts +1 -5
  44. package/driver/magento/errors/map.d.ts +0 -1
  45. package/driver/magento/errors/transform.d.ts +13 -1
  46. package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +1 -1
  47. package/driver/magento/package.json +5 -6
  48. package/driver/magento/queries/add-cart-item.d.ts +1 -1
  49. package/driver/magento/queries/apply-coupon.d.ts +1 -1
  50. package/driver/magento/queries/create-cart.d.ts +1 -1
  51. package/driver/magento/queries/fragments/available-payment-method.d.ts +1 -1
  52. package/driver/magento/queries/fragments/available-shipping-method.d.ts +1 -1
  53. package/driver/magento/queries/fragments/cart-address.d.ts +1 -1
  54. package/driver/magento/queries/fragments/cart-coupon.d.ts +1 -1
  55. package/driver/magento/queries/fragments/cart-item.d.ts +2 -2
  56. package/driver/magento/queries/fragments/cart-totals.d.ts +1 -1
  57. package/driver/magento/queries/fragments/cart.d.ts +1 -1
  58. package/driver/magento/queries/fragments/money.d.ts +1 -1
  59. package/driver/magento/queries/fragments/prices.d.ts +1 -1
  60. package/driver/magento/queries/fragments/selected-payment-method.d.ts +1 -1
  61. package/driver/magento/queries/fragments/selected-shipping-method.d.ts +1 -1
  62. package/driver/magento/queries/get-billing-address.d.ts +1 -1
  63. package/driver/magento/queries/get-cart.d.ts +1 -1
  64. package/driver/magento/queries/get-selected-payment-method.d.ts +1 -1
  65. package/driver/magento/queries/get-selected-shipping-method.d.ts +1 -1
  66. package/driver/magento/queries/get-shipping-address.d.ts +1 -1
  67. package/driver/magento/queries/list-cart-coupons.d.ts +1 -1
  68. package/driver/magento/queries/list-cart-items.d.ts +1 -1
  69. package/driver/magento/queries/list-payment-methods.d.ts +1 -1
  70. package/driver/magento/queries/list-shipping-methods.d.ts +1 -1
  71. package/driver/magento/queries/place-order.d.ts +1 -1
  72. package/driver/magento/queries/remove-all-coupons.d.ts +1 -1
  73. package/driver/magento/queries/remove-cart-item.d.ts +1 -1
  74. package/driver/magento/queries/set-selected-payment-method-with-billing-and-email.d.ts +1 -1
  75. package/driver/magento/queries/set-selected-payment-method-with-billing.d.ts +1 -1
  76. package/driver/magento/queries/set-selected-payment-method.d.ts +1 -1
  77. package/driver/magento/queries/set-selected-shipping-method.d.ts +1 -1
  78. package/driver/magento/queries/update-address-with-email.d.ts +1 -1
  79. package/driver/magento/queries/update-address.d.ts +1 -1
  80. package/driver/magento/queries/update-billing-address-with-email.d.ts +1 -1
  81. package/driver/magento/queries/update-billing-address.d.ts +1 -1
  82. package/driver/magento/queries/update-cart-item.d.ts +1 -1
  83. package/driver/magento/queries/update-shipping-address-with-email.d.ts +1 -1
  84. package/driver/magento/queries/update-shipping-address.d.ts +1 -1
  85. package/driver/magento/testing/daffodil-cart-driver-magento-testing.d.ts +1 -0
  86. package/driver/magento/testing/factories/cart-address-input.factory.d.ts +3 -0
  87. package/driver/magento/testing/factories/cart-address.factory.d.ts +3 -0
  88. package/driver/magento/testing/factories/cart-coupon.factory.d.ts +3 -0
  89. package/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.d.ts +3 -0
  90. package/driver/magento/testing/factories/cart-item/cart-item.factory.d.ts +3 -0
  91. package/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.d.ts +3 -0
  92. package/driver/magento/testing/factories/cart-payment-method.factory.d.ts +3 -0
  93. package/driver/magento/testing/factories/cart-shipping-method.factory.d.ts +3 -0
  94. package/driver/magento/testing/factories/cart.factory.d.ts +3 -0
  95. package/driver/magento/testing/factories/shipping-address.factory.d.ts +3 -0
  96. package/driver/magento/testing/package.json +5 -6
  97. package/driver/magento/transforms/inputs/billing-address.service.d.ts +3 -0
  98. package/driver/magento/transforms/inputs/cart-address.service.d.ts +3 -0
  99. package/driver/magento/transforms/inputs/cart-item-update.service.d.ts +3 -0
  100. package/driver/magento/transforms/inputs/payment-method.service.d.ts +3 -0
  101. package/driver/magento/transforms/inputs/shipping-address.service.d.ts +3 -0
  102. package/driver/magento/transforms/inputs/shipping-method.service.d.ts +3 -0
  103. package/driver/magento/transforms/outputs/billing-address.service.d.ts +3 -0
  104. package/driver/magento/transforms/outputs/cart-address.service.d.ts +3 -0
  105. package/driver/magento/transforms/outputs/cart-coupon-response.service.d.ts +3 -0
  106. package/driver/magento/transforms/outputs/cart-payment.service.d.ts +3 -0
  107. package/driver/magento/transforms/outputs/cart-shipping-information.service.d.ts +3 -0
  108. package/driver/magento/transforms/outputs/cart-shipping-rate.service.d.ts +3 -0
  109. package/driver/magento/transforms/outputs/cart.service.d.ts +3 -0
  110. package/driver/magento/transforms/outputs/shipping-address.service.d.ts +3 -0
  111. package/driver/package.json +5 -6
  112. package/driver/testing/daffodil-cart-driver-testing.d.ts +1 -0
  113. package/driver/testing/drivers/cart/cart.service.d.ts +5 -1
  114. package/driver/testing/drivers/cart-address/cart-address.service.d.ts +3 -0
  115. package/driver/testing/drivers/cart-billing-address/cart-billing-address.service.d.ts +3 -0
  116. package/driver/testing/drivers/cart-coupon/cart-coupon.service.d.ts +3 -0
  117. package/driver/testing/drivers/cart-driver.module.d.ts +5 -0
  118. package/driver/testing/drivers/cart-item/cart-item.service.d.ts +3 -0
  119. package/driver/testing/drivers/cart-order/cart-order.service.d.ts +3 -0
  120. package/driver/testing/drivers/cart-payment/cart-payment.service.d.ts +3 -0
  121. package/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +3 -0
  122. package/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +3 -0
  123. package/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +3 -0
  124. package/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -0
  125. package/driver/testing/package.json +5 -6
  126. package/errors/map.d.ts +0 -1
  127. package/esm2020/daffodil-cart.mjs +5 -0
  128. package/{esm2015/driver/daffodil-cart-driver.js → esm2020/driver/daffodil-cart-driver.mjs} +0 -0
  129. package/{esm2015/driver/errors/cart-not-found.js → esm2020/driver/errors/cart-not-found.mjs} +0 -0
  130. package/{esm2015/driver/errors/codes.enum.js → esm2020/driver/errors/codes.enum.mjs} +0 -0
  131. package/{esm2015/driver/errors/expired-payment-token.js → esm2020/driver/errors/expired-payment-token.mjs} +0 -0
  132. package/{esm2015/driver/errors/invalid-api-response.js → esm2020/driver/errors/invalid-api-response.mjs} +0 -0
  133. package/{esm2015/driver/errors/invalid-country.js → esm2020/driver/errors/invalid-country.mjs} +0 -0
  134. package/{esm2015/driver/errors/invalid-coupon-code.js → esm2020/driver/errors/invalid-coupon-code.mjs} +0 -0
  135. package/{esm2015/driver/errors/invalid-email.js → esm2020/driver/errors/invalid-email.mjs} +0 -0
  136. package/{esm2015/driver/errors/invalid-region.js → esm2020/driver/errors/invalid-region.mjs} +0 -0
  137. package/{esm2015/driver/errors/item-exceeds-max-qty.js → esm2020/driver/errors/item-exceeds-max-qty.mjs} +0 -0
  138. package/{esm2015/driver/errors/map.js → esm2020/driver/errors/map.mjs} +0 -0
  139. package/{esm2015/driver/errors/product-not-found.js → esm2020/driver/errors/product-not-found.mjs} +0 -0
  140. package/{esm2015/driver/errors/product-out-of-stock.js → esm2020/driver/errors/product-out-of-stock.mjs} +0 -0
  141. package/{esm2015/driver/errors/public_api.js → esm2020/driver/errors/public_api.mjs} +0 -0
  142. package/esm2020/driver/in-memory/backend/cart/cart.service.mjs +81 -0
  143. package/esm2020/driver/in-memory/backend/cart-address/cart-address.service.mjs +43 -0
  144. package/esm2020/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.mjs +51 -0
  145. package/esm2020/driver/in-memory/backend/cart-coupon/cart-coupon.service.mjs +89 -0
  146. package/{esm2015/driver/in-memory/backend/cart-items/cart-items.service.js → esm2020/driver/in-memory/backend/cart-items/cart-items.service.mjs} +45 -20
  147. package/esm2020/driver/in-memory/backend/cart-order/cart-order.service.mjs +30 -0
  148. package/esm2020/driver/in-memory/backend/cart-payment/cart-payment.service.mjs +68 -0
  149. package/esm2020/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.mjs +29 -0
  150. package/{esm2015/driver/in-memory/backend/cart-root.service.js → esm2020/driver/in-memory/backend/cart-root.service.mjs} +9 -21
  151. package/esm2020/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.mjs +51 -0
  152. package/esm2020/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +65 -0
  153. package/esm2020/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.mjs +43 -0
  154. package/{esm2015/driver/in-memory/backend/public_api.js → esm2020/driver/in-memory/backend/public_api.mjs} +0 -0
  155. package/esm2020/driver/in-memory/daffodil-cart-driver-in-memory.mjs +5 -0
  156. package/esm2020/driver/in-memory/drivers/cart/cart.service.mjs +43 -0
  157. package/esm2020/driver/in-memory/drivers/cart-address/cart-address.service.mjs +28 -0
  158. package/esm2020/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.mjs +31 -0
  159. package/esm2020/driver/in-memory/drivers/cart-coupon/cart-coupon.service.mjs +37 -0
  160. package/esm2020/driver/in-memory/drivers/cart-driver.module.mjs +82 -0
  161. package/esm2020/driver/in-memory/drivers/cart-item/cart-item.service.mjs +40 -0
  162. package/esm2020/driver/in-memory/drivers/cart-order/cart-order.service.mjs +28 -0
  163. package/esm2020/driver/in-memory/drivers/cart-payment/cart-payment.service.mjs +37 -0
  164. package/esm2020/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.mjs +28 -0
  165. package/esm2020/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.mjs +31 -0
  166. package/esm2020/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.mjs +34 -0
  167. package/esm2020/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +28 -0
  168. package/{esm2015/driver/in-memory/drivers/public_api.js → esm2020/driver/in-memory/drivers/public_api.mjs} +0 -0
  169. package/{esm2015/driver/in-memory/index.js → esm2020/driver/in-memory/index.mjs} +0 -0
  170. package/{esm2015/driver/in-memory/injection-tokens/extra-attributes-hook.token.js → esm2020/driver/in-memory/injection-tokens/extra-attributes-hook.token.mjs} +0 -0
  171. package/{esm2015/driver/in-memory/injection-tokens/public_api.js → esm2020/driver/in-memory/injection-tokens/public_api.mjs} +0 -0
  172. package/{esm2015/driver/in-memory/public_api.js → esm2020/driver/in-memory/public_api.mjs} +0 -0
  173. package/{esm2015/driver/index.js → esm2020/driver/index.mjs} +0 -0
  174. package/{esm2015/driver/interfaces/cart-address-service.interface.js → esm2020/driver/interfaces/cart-address-service.interface.mjs} +0 -0
  175. package/{esm2015/driver/interfaces/cart-billing-address-service.interface.js → esm2020/driver/interfaces/cart-billing-address-service.interface.mjs} +0 -0
  176. package/{esm2015/driver/interfaces/cart-coupon-service.interface.js → esm2020/driver/interfaces/cart-coupon-service.interface.mjs} +0 -0
  177. package/{esm2015/driver/interfaces/cart-item-service.interface.js → esm2020/driver/interfaces/cart-item-service.interface.mjs} +0 -0
  178. package/{esm2015/driver/interfaces/cart-order-service.interface.js → esm2020/driver/interfaces/cart-order-service.interface.mjs} +0 -0
  179. package/{esm2015/driver/interfaces/cart-payment-methods-service.interface.js → esm2020/driver/interfaces/cart-payment-methods-service.interface.mjs} +0 -0
  180. package/{esm2015/driver/interfaces/cart-payment-service.interface.js → esm2020/driver/interfaces/cart-payment-service.interface.mjs} +0 -0
  181. package/esm2020/driver/interfaces/cart-service.interface.mjs +3 -0
  182. package/{esm2015/driver/interfaces/cart-shipping-address-service.interface.js → esm2020/driver/interfaces/cart-shipping-address-service.interface.mjs} +0 -0
  183. package/{esm2015/driver/interfaces/cart-shipping-information-service.interface.js → esm2020/driver/interfaces/cart-shipping-information-service.interface.mjs} +0 -0
  184. package/{esm2015/driver/interfaces/cart-shipping-methods-service.interface.js → esm2020/driver/interfaces/cart-shipping-methods-service.interface.mjs} +0 -0
  185. package/{esm2015/driver/interfaces/public_api.js → esm2020/driver/interfaces/public_api.mjs} +0 -0
  186. package/esm2020/driver/magento/cart-address.service.mjs +64 -0
  187. package/esm2020/driver/magento/cart-billing-address.service.mjs +84 -0
  188. package/esm2020/driver/magento/cart-coupon.service.mjs +68 -0
  189. package/esm2020/driver/magento/cart-driver.module.mjs +112 -0
  190. package/esm2020/driver/magento/cart-item.service.mjs +111 -0
  191. package/esm2020/driver/magento/cart-order.service.mjs +43 -0
  192. package/esm2020/driver/magento/cart-payment-methods.service.mjs +39 -0
  193. package/esm2020/driver/magento/cart-payment.service.mjs +101 -0
  194. package/esm2020/driver/magento/cart-shipping-address.service.mjs +84 -0
  195. package/esm2020/driver/magento/cart-shipping-information.service.mjs +86 -0
  196. package/esm2020/driver/magento/cart-shipping-methods.service.mjs +39 -0
  197. package/esm2020/driver/magento/cart.service.mjs +75 -0
  198. package/esm2020/driver/magento/daffodil-cart-driver-magento.mjs +5 -0
  199. package/{esm2015/driver/magento/errors/codes.js → esm2020/driver/magento/errors/codes.mjs} +0 -0
  200. package/{esm2015/driver/magento/errors/map.js → esm2020/driver/magento/errors/map.mjs} +0 -0
  201. package/esm2020/driver/magento/errors/transform.mjs +37 -0
  202. package/{esm2015/driver/magento/index.js → esm2020/driver/magento/index.mjs} +0 -0
  203. package/{esm2015/driver/magento/injection-tokens/cart-mutation-queue.token.js → esm2020/driver/magento/injection-tokens/cart-mutation-queue.token.mjs} +2 -2
  204. package/{esm2015/driver/magento/injection-tokens/fragments/cart.js → esm2020/driver/magento/injection-tokens/fragments/cart.mjs} +0 -0
  205. package/{esm2015/driver/magento/injection-tokens/public_api.js → esm2020/driver/magento/injection-tokens/public_api.mjs} +0 -0
  206. package/{esm2015/driver/magento/injection-tokens/transforms/cart-item/token.js → esm2020/driver/magento/injection-tokens/transforms/cart-item/token.mjs} +0 -0
  207. package/{esm2015/driver/magento/interfaces/cart-item-transform.type.js → esm2020/driver/magento/interfaces/cart-item-transform.type.mjs} +0 -0
  208. package/{esm2015/driver/magento/interfaces/public_api.js → esm2020/driver/magento/interfaces/public_api.mjs} +0 -0
  209. package/{esm2015/driver/magento/models/public_api.js → esm2020/driver/magento/models/public_api.mjs} +0 -0
  210. package/{esm2015/driver/magento/models/requests/billing-address.js → esm2020/driver/magento/models/requests/billing-address.mjs} +0 -0
  211. package/{esm2015/driver/magento/models/requests/cart-address.js → esm2020/driver/magento/models/requests/cart-address.mjs} +0 -0
  212. package/{esm2015/driver/magento/models/requests/cart-item-update.js → esm2020/driver/magento/models/requests/cart-item-update.mjs} +0 -0
  213. package/{esm2015/driver/magento/models/requests/cart-item.js → esm2020/driver/magento/models/requests/cart-item.mjs} +0 -0
  214. package/{esm2015/driver/magento/models/requests/payment-method.js → esm2020/driver/magento/models/requests/payment-method.mjs} +0 -0
  215. package/{esm2015/driver/magento/models/requests/public_api.js → esm2020/driver/magento/models/requests/public_api.mjs} +0 -0
  216. package/{esm2015/driver/magento/models/requests/shipping-address.js → esm2020/driver/magento/models/requests/shipping-address.mjs} +0 -0
  217. package/{esm2015/driver/magento/models/requests/shipping-method.js → esm2020/driver/magento/models/requests/shipping-method.mjs} +0 -0
  218. package/{esm2015/driver/magento/models/responses/cart-address.js → esm2020/driver/magento/models/responses/cart-address.mjs} +0 -0
  219. package/{esm2015/driver/magento/models/responses/cart-coupon.js → esm2020/driver/magento/models/responses/cart-coupon.mjs} +0 -0
  220. package/{esm2015/driver/magento/models/responses/cart-item.js → esm2020/driver/magento/models/responses/cart-item.mjs} +0 -0
  221. package/{esm2015/driver/magento/models/responses/cart-payment-method.js → esm2020/driver/magento/models/responses/cart-payment-method.mjs} +0 -0
  222. package/{esm2015/driver/magento/models/responses/cart-shipping-method.js → esm2020/driver/magento/models/responses/cart-shipping-method.mjs} +0 -0
  223. package/{esm2015/driver/magento/models/responses/cart.js → esm2020/driver/magento/models/responses/cart.mjs} +0 -0
  224. package/{esm2015/driver/magento/models/responses/public_api.js → esm2020/driver/magento/models/responses/public_api.mjs} +0 -0
  225. package/{esm2015/driver/magento/models/responses/shipping-address.js → esm2020/driver/magento/models/responses/shipping-address.mjs} +0 -0
  226. package/{esm2015/driver/magento/public_api.js → esm2020/driver/magento/public_api.mjs} +0 -0
  227. package/{esm2015/driver/magento/queries/add-cart-item.js → esm2020/driver/magento/queries/add-cart-item.mjs} +2 -2
  228. package/{esm2015/driver/magento/queries/apply-coupon.js → esm2020/driver/magento/queries/apply-coupon.mjs} +2 -2
  229. package/esm2020/driver/magento/queries/create-cart.mjs +7 -0
  230. package/{esm2015/driver/magento/queries/fragments/available-payment-method.js → esm2020/driver/magento/queries/fragments/available-payment-method.mjs} +2 -2
  231. package/{esm2015/driver/magento/queries/fragments/available-shipping-method.js → esm2020/driver/magento/queries/fragments/available-shipping-method.mjs} +2 -2
  232. package/{esm2015/driver/magento/queries/fragments/cart-address.js → esm2020/driver/magento/queries/fragments/cart-address.mjs} +2 -2
  233. package/{esm2015/driver/magento/queries/fragments/cart-coupon.js → esm2020/driver/magento/queries/fragments/cart-coupon.mjs} +2 -2
  234. package/esm2020/driver/magento/queries/fragments/cart-item.mjs +62 -0
  235. package/{esm2015/driver/magento/queries/fragments/cart-totals.js → esm2020/driver/magento/queries/fragments/cart-totals.mjs} +2 -2
  236. package/{esm2015/driver/magento/queries/fragments/cart.js → esm2020/driver/magento/queries/fragments/cart.mjs} +2 -2
  237. package/{esm2015/driver/magento/queries/fragments/money.js → esm2020/driver/magento/queries/fragments/money.mjs} +2 -2
  238. package/esm2020/driver/magento/queries/fragments/prices.mjs +32 -0
  239. package/{esm2015/driver/magento/queries/fragments/public_api.js → esm2020/driver/magento/queries/fragments/public_api.mjs} +0 -0
  240. package/{esm2015/driver/magento/queries/fragments/selected-payment-method.js → esm2020/driver/magento/queries/fragments/selected-payment-method.mjs} +2 -2
  241. package/{esm2015/driver/magento/queries/fragments/selected-shipping-method.js → esm2020/driver/magento/queries/fragments/selected-shipping-method.mjs} +2 -2
  242. package/{esm2015/driver/magento/queries/get-billing-address.js → esm2020/driver/magento/queries/get-billing-address.mjs} +2 -2
  243. package/{esm2015/driver/magento/queries/get-cart.js → esm2020/driver/magento/queries/get-cart.mjs} +2 -2
  244. package/{esm2015/driver/magento/queries/get-selected-payment-method.js → esm2020/driver/magento/queries/get-selected-payment-method.mjs} +2 -2
  245. package/{esm2015/driver/magento/queries/get-selected-shipping-method.js → esm2020/driver/magento/queries/get-selected-shipping-method.mjs} +2 -2
  246. package/{esm2015/driver/magento/queries/get-shipping-address.js → esm2020/driver/magento/queries/get-shipping-address.mjs} +2 -2
  247. package/{esm2015/driver/magento/queries/list-cart-coupons.js → esm2020/driver/magento/queries/list-cart-coupons.mjs} +2 -2
  248. package/{esm2015/driver/magento/queries/list-cart-items.js → esm2020/driver/magento/queries/list-cart-items.mjs} +2 -2
  249. package/{esm2015/driver/magento/queries/list-payment-methods.js → esm2020/driver/magento/queries/list-payment-methods.mjs} +2 -2
  250. package/{esm2015/driver/magento/queries/list-shipping-methods.js → esm2020/driver/magento/queries/list-shipping-methods.mjs} +2 -2
  251. package/esm2020/driver/magento/queries/place-order.mjs +15 -0
  252. package/{esm2015/driver/magento/queries/public_api.js → esm2020/driver/magento/queries/public_api.mjs} +0 -0
  253. package/{esm2015/driver/magento/queries/remove-all-coupons.js → esm2020/driver/magento/queries/remove-all-coupons.mjs} +2 -2
  254. package/esm2020/driver/magento/queries/remove-cart-item.mjs +19 -0
  255. package/{esm2015/driver/magento/queries/responses/add-cart-item.js → esm2020/driver/magento/queries/responses/add-cart-item.mjs} +0 -0
  256. package/{esm2015/driver/magento/queries/responses/apply-coupon.js → esm2020/driver/magento/queries/responses/apply-coupon.mjs} +0 -0
  257. package/{esm2015/driver/magento/queries/responses/create-cart.js → esm2020/driver/magento/queries/responses/create-cart.mjs} +0 -0
  258. package/{esm2015/driver/magento/queries/responses/get-billing-address.js → esm2020/driver/magento/queries/responses/get-billing-address.mjs} +0 -0
  259. package/{esm2015/driver/magento/queries/responses/get-cart.js → esm2020/driver/magento/queries/responses/get-cart.mjs} +0 -0
  260. package/{esm2015/driver/magento/queries/responses/get-selected-payment-method.js → esm2020/driver/magento/queries/responses/get-selected-payment-method.mjs} +0 -0
  261. package/{esm2015/driver/magento/queries/responses/get-selected-shipping-method.js → esm2020/driver/magento/queries/responses/get-selected-shipping-method.mjs} +0 -0
  262. package/{esm2015/driver/magento/queries/responses/get-shipping-address.js → esm2020/driver/magento/queries/responses/get-shipping-address.mjs} +0 -0
  263. package/{esm2015/driver/magento/queries/responses/list-cart-coupons.js → esm2020/driver/magento/queries/responses/list-cart-coupons.mjs} +0 -0
  264. package/{esm2015/driver/magento/queries/responses/list-cart-items.js → esm2020/driver/magento/queries/responses/list-cart-items.mjs} +0 -0
  265. package/{esm2015/driver/magento/queries/responses/list-payment-methods.js → esm2020/driver/magento/queries/responses/list-payment-methods.mjs} +0 -0
  266. package/{esm2015/driver/magento/queries/responses/list-shipping-methods.js → esm2020/driver/magento/queries/responses/list-shipping-methods.mjs} +0 -0
  267. package/{esm2015/driver/magento/queries/responses/place-order.js → esm2020/driver/magento/queries/responses/place-order.mjs} +0 -0
  268. package/{esm2015/driver/magento/queries/responses/public_api.js → esm2020/driver/magento/queries/responses/public_api.mjs} +0 -0
  269. package/{esm2015/driver/magento/queries/responses/remove-all-coupons.js → esm2020/driver/magento/queries/responses/remove-all-coupons.mjs} +0 -0
  270. package/{esm2015/driver/magento/queries/responses/remove-cart-item.js → esm2020/driver/magento/queries/responses/remove-cart-item.mjs} +0 -0
  271. package/{esm2015/driver/magento/queries/responses/set-guest-email.js → esm2020/driver/magento/queries/responses/set-guest-email.mjs} +0 -0
  272. package/{esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.js → esm2020/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.mjs} +0 -0
  273. package/{esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing.js → esm2020/driver/magento/queries/responses/set-selected-payment-method-with-billing.mjs} +0 -0
  274. package/{esm2015/driver/magento/queries/responses/set-selected-payment-method.js → esm2020/driver/magento/queries/responses/set-selected-payment-method.mjs} +0 -0
  275. package/{esm2015/driver/magento/queries/responses/set-selected-shipping-method.js → esm2020/driver/magento/queries/responses/set-selected-shipping-method.mjs} +0 -0
  276. package/{esm2015/driver/magento/queries/responses/update-address-with-email.js → esm2020/driver/magento/queries/responses/update-address-with-email.mjs} +0 -0
  277. package/{esm2015/driver/magento/queries/responses/update-address.js → esm2020/driver/magento/queries/responses/update-address.mjs} +0 -0
  278. package/{esm2015/driver/magento/queries/responses/update-billing-address-with-email.js → esm2020/driver/magento/queries/responses/update-billing-address-with-email.mjs} +0 -0
  279. package/{esm2015/driver/magento/queries/responses/update-billing-address.js → esm2020/driver/magento/queries/responses/update-billing-address.mjs} +0 -0
  280. package/{esm2015/driver/magento/queries/responses/update-cart-item.js → esm2020/driver/magento/queries/responses/update-cart-item.mjs} +0 -0
  281. package/{esm2015/driver/magento/queries/responses/update-shipping-address-with-email.js → esm2020/driver/magento/queries/responses/update-shipping-address-with-email.mjs} +0 -0
  282. package/{esm2015/driver/magento/queries/responses/update-shipping-address.js → esm2020/driver/magento/queries/responses/update-shipping-address.mjs} +0 -0
  283. package/{esm2015/driver/magento/queries/set-selected-payment-method-with-billing-and-email.js → esm2020/driver/magento/queries/set-selected-payment-method-with-billing-and-email.mjs} +2 -2
  284. package/{esm2015/driver/magento/queries/set-selected-payment-method-with-billing.js → esm2020/driver/magento/queries/set-selected-payment-method-with-billing.mjs} +2 -2
  285. package/{esm2015/driver/magento/queries/set-selected-payment-method.js → esm2020/driver/magento/queries/set-selected-payment-method.mjs} +2 -2
  286. package/{esm2015/driver/magento/queries/set-selected-shipping-method.js → esm2020/driver/magento/queries/set-selected-shipping-method.mjs} +2 -2
  287. package/esm2020/driver/magento/queries/update-address-with-email.mjs +46 -0
  288. package/esm2020/driver/magento/queries/update-address.mjs +38 -0
  289. package/esm2020/driver/magento/queries/update-billing-address-with-email.mjs +31 -0
  290. package/{esm2015/driver/magento/queries/update-billing-address.js → esm2020/driver/magento/queries/update-billing-address.mjs} +2 -2
  291. package/esm2020/driver/magento/queries/update-cart-item.mjs +19 -0
  292. package/esm2020/driver/magento/queries/update-shipping-address-with-email.mjs +31 -0
  293. package/{esm2015/driver/magento/queries/update-shipping-address.js → esm2020/driver/magento/queries/update-shipping-address.mjs} +2 -2
  294. package/{esm2015/driver/magento/testing/daffodil-cart-driver-magento-testing.js → esm2020/driver/magento/testing/daffodil-cart-driver-magento-testing.mjs} +0 -0
  295. package/{esm2015/driver/magento/testing/factories/cart-address-input.factory.js → esm2020/driver/magento/testing/factories/cart-address-input.factory.mjs} +9 -9
  296. package/{esm2015/driver/magento/testing/factories/cart-address.factory.js → esm2020/driver/magento/testing/factories/cart-address.factory.mjs} +9 -9
  297. package/esm2020/driver/magento/testing/factories/cart-coupon.factory.mjs +24 -0
  298. package/{esm2015/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.js → esm2020/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.mjs} +9 -9
  299. package/{esm2015/driver/magento/testing/factories/cart-item/cart-item.factory.js → esm2020/driver/magento/testing/factories/cart-item/cart-item.factory.mjs} +9 -9
  300. package/esm2020/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.mjs +35 -0
  301. package/esm2020/driver/magento/testing/factories/cart-payment-method.factory.mjs +25 -0
  302. package/esm2020/driver/magento/testing/factories/cart-shipping-method.factory.mjs +31 -0
  303. package/{esm2015/driver/magento/testing/factories/cart.factory.js → esm2020/driver/magento/testing/factories/cart.factory.mjs} +9 -9
  304. package/{esm2015/driver/magento/testing/factories/public_api.js → esm2020/driver/magento/testing/factories/public_api.mjs} +0 -0
  305. package/esm2020/driver/magento/testing/factories/shipping-address.factory.mjs +26 -0
  306. package/{esm2015/driver/magento/testing/index.js → esm2020/driver/magento/testing/index.mjs} +0 -0
  307. package/{esm2015/driver/magento/testing/public_api.js → esm2020/driver/magento/testing/public_api.mjs} +0 -0
  308. package/esm2020/driver/magento/transforms/inputs/billing-address.service.mjs +29 -0
  309. package/esm2020/driver/magento/transforms/inputs/cart-address.service.mjs +26 -0
  310. package/esm2020/driver/magento/transforms/inputs/cart-item-input-transformers.mjs +20 -0
  311. package/esm2020/driver/magento/transforms/inputs/cart-item-update.service.mjs +19 -0
  312. package/esm2020/driver/magento/transforms/inputs/payment-method.service.mjs +18 -0
  313. package/esm2020/driver/magento/transforms/inputs/shipping-address.service.mjs +29 -0
  314. package/esm2020/driver/magento/transforms/inputs/shipping-method.service.mjs +19 -0
  315. package/esm2020/driver/magento/transforms/outputs/billing-address.service.mjs +32 -0
  316. package/esm2020/driver/magento/transforms/outputs/cart-address.service.mjs +43 -0
  317. package/esm2020/driver/magento/transforms/outputs/cart-coupon-response.service.mjs +59 -0
  318. package/{esm2015/driver/magento/transforms/outputs/cart-coupon.js → esm2020/driver/magento/transforms/outputs/cart-coupon.mjs} +0 -0
  319. package/esm2020/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.mjs +23 -0
  320. package/{esm2015/driver/magento/transforms/outputs/cart-item/cart-item-transformer.js → esm2020/driver/magento/transforms/outputs/cart-item/cart-item-transformer.mjs} +0 -0
  321. package/esm2020/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.mjs +21 -0
  322. package/esm2020/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.mjs +35 -0
  323. package/esm2020/driver/magento/transforms/outputs/cart-payment.service.mjs +26 -0
  324. package/esm2020/driver/magento/transforms/outputs/cart-shipping-information.service.mjs +33 -0
  325. package/esm2020/driver/magento/transforms/outputs/cart-shipping-rate.service.mjs +33 -0
  326. package/{esm2015/driver/magento/transforms/outputs/cart-totals-transformer.js → esm2020/driver/magento/transforms/outputs/cart-totals-transformer.mjs} +2 -3
  327. package/esm2020/driver/magento/transforms/outputs/cart.service.mjs +125 -0
  328. package/esm2020/driver/magento/transforms/outputs/shipping-address.service.mjs +32 -0
  329. package/{esm2015/driver/magento/transforms/public_api.js → esm2020/driver/magento/transforms/public_api.mjs} +0 -0
  330. package/{esm2015/driver/public_api.js → esm2020/driver/public_api.mjs} +0 -0
  331. package/{esm2015/driver/testing/daffodil-cart-driver-testing.js → esm2020/driver/testing/daffodil-cart-driver-testing.mjs} +0 -0
  332. package/esm2020/driver/testing/drivers/cart/cart.service.mjs +39 -0
  333. package/esm2020/driver/testing/drivers/cart-address/cart-address.service.mjs +26 -0
  334. package/esm2020/driver/testing/drivers/cart-billing-address/cart-billing-address.service.mjs +29 -0
  335. package/esm2020/driver/testing/drivers/cart-coupon/cart-coupon.service.mjs +35 -0
  336. package/esm2020/driver/testing/drivers/cart-driver.module.mjs +82 -0
  337. package/esm2020/driver/testing/drivers/cart-item/cart-item.service.mjs +38 -0
  338. package/esm2020/driver/testing/drivers/cart-order/cart-order.service.mjs +25 -0
  339. package/esm2020/driver/testing/drivers/cart-payment/cart-payment.service.mjs +35 -0
  340. package/esm2020/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.mjs +25 -0
  341. package/esm2020/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.mjs +29 -0
  342. package/esm2020/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.mjs +32 -0
  343. package/esm2020/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +25 -0
  344. package/{esm2015/driver/testing/drivers/public_api.js → esm2020/driver/testing/drivers/public_api.mjs} +0 -0
  345. package/{esm2015/driver/testing/index.js → esm2020/driver/testing/index.mjs} +0 -0
  346. package/{esm2015/driver/testing/public_api.js → esm2020/driver/testing/public_api.mjs} +0 -0
  347. package/{esm2015/errors/codes.enum.js → esm2020/errors/codes.enum.mjs} +0 -0
  348. package/{esm2015/errors/map.js → esm2020/errors/map.mjs} +0 -0
  349. package/{esm2015/errors/public_api.js → esm2020/errors/public_api.mjs} +0 -0
  350. package/{esm2015/errors/resolution/cart-not-found-or-created-resolution.js → esm2020/errors/resolution/cart-not-found-or-created-resolution.mjs} +0 -0
  351. package/{esm2015/errors/resolution/cart-resolution.js → esm2020/errors/resolution/cart-resolution.mjs} +0 -0
  352. package/{esm2015/errors/resolution/cart-server-side-resolution.js → esm2020/errors/resolution/cart-server-side-resolution.mjs} +0 -0
  353. package/{esm2015/errors/resolution/cart-storage-resolution.js → esm2020/errors/resolution/cart-storage-resolution.mjs} +0 -0
  354. package/{esm2015/errors/resolution/public_api.js → esm2020/errors/resolution/public_api.mjs} +0 -0
  355. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  356. package/{esm2015/injection-tokens/error-matcher.token.js → esm2020/injection-tokens/error-matcher.token.mjs} +0 -0
  357. package/{esm2015/injection-tokens/payment-method-map.js → esm2020/injection-tokens/payment-method-map.mjs} +0 -0
  358. package/{esm2015/injection-tokens/public_api.js → esm2020/injection-tokens/public_api.mjs} +0 -0
  359. package/{esm2015/models/cart-address.js → esm2020/models/cart-address.mjs} +0 -0
  360. package/{esm2015/models/cart-coupon.js → esm2020/models/cart-coupon.mjs} +0 -0
  361. package/{esm2015/models/cart-item-input.js → esm2020/models/cart-item-input.mjs} +0 -0
  362. package/{esm2015/models/cart-item.js → esm2020/models/cart-item.mjs} +0 -0
  363. package/{esm2015/models/cart-order-result.js → esm2020/models/cart-order-result.mjs} +0 -0
  364. package/{esm2015/models/cart-payment.js → esm2020/models/cart-payment.mjs} +0 -0
  365. package/{esm2015/models/cart-shipping-info.js → esm2020/models/cart-shipping-info.mjs} +0 -0
  366. package/{esm2015/models/cart-shipping-rate.js → esm2020/models/cart-shipping-rate.mjs} +0 -0
  367. package/{esm2015/models/cart-total.js → esm2020/models/cart-total.mjs} +0 -0
  368. package/{esm2015/models/cart.js → esm2020/models/cart.mjs} +0 -0
  369. package/{esm2015/models/composite-cart-item.js → esm2020/models/composite-cart-item.mjs} +0 -0
  370. package/{esm2015/models/configurable-cart-item.js → esm2020/models/configurable-cart-item.mjs} +0 -0
  371. package/{esm2015/models/public_api.js → esm2020/models/public_api.mjs} +0 -0
  372. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  373. package/esm2020/routing/cart-routing.module.mjs +49 -0
  374. package/esm2020/routing/config/config.mjs +19 -0
  375. package/{esm2015/routing/config/resolution/config.js → esm2020/routing/config/resolution/config.mjs} +0 -0
  376. package/{esm2015/routing/daffodil-cart-routing.js → esm2020/routing/daffodil-cart-routing.mjs} +0 -0
  377. package/{esm2015/routing/guards/billing-address/billing-address-guard-redirect.token.js → esm2020/routing/guards/billing-address/billing-address-guard-redirect.token.mjs} +0 -0
  378. package/esm2020/routing/guards/billing-address/billing-address.guard.mjs +40 -0
  379. package/{esm2015/routing/guards/cart-items/cart-items-guard-redirect.token.js → esm2020/routing/guards/cart-items/cart-items-guard-redirect.token.mjs} +0 -0
  380. package/esm2020/routing/guards/cart-items/cart-items.guard.mjs +41 -0
  381. package/{esm2015/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.js → esm2020/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.mjs} +0 -0
  382. package/esm2020/routing/guards/in-stock-items/in-stock-items.guard.mjs +41 -0
  383. package/{esm2015/routing/guards/order-result/order-result-guard-redirect.token.js → esm2020/routing/guards/order-result/order-result-guard-redirect.token.mjs} +0 -0
  384. package/esm2020/routing/guards/order-result/order-result.guard.mjs +38 -0
  385. package/{esm2015/routing/guards/payment-method/payment-method-guard-redirect.token.js → esm2020/routing/guards/payment-method/payment-method-guard-redirect.token.mjs} +0 -0
  386. package/esm2020/routing/guards/payment-method/payment-method.guard.mjs +40 -0
  387. package/{esm2015/routing/guards/public_api.js → esm2020/routing/guards/public_api.mjs} +0 -0
  388. package/esm2020/routing/guards/resolved-cart/resolved-cart.guard.mjs +42 -0
  389. package/{esm2015/routing/guards/shipping-address/shipping-address-guard-redirect.token.js → esm2020/routing/guards/shipping-address/shipping-address-guard-redirect.token.mjs} +0 -0
  390. package/esm2020/routing/guards/shipping-address/shipping-address.guard.mjs +40 -0
  391. package/{esm2015/routing/guards/shipping-method/shipping-method-guard-redirect.token.js → esm2020/routing/guards/shipping-method/shipping-method-guard-redirect.token.mjs} +0 -0
  392. package/esm2020/routing/guards/shipping-method/shipping-method.guard.mjs +40 -0
  393. package/{esm2015/routing/index.js → esm2020/routing/index.mjs} +0 -0
  394. package/{esm2015/routing/public_api.js → esm2020/routing/public_api.mjs} +0 -0
  395. package/esm2020/routing/resolvers/cart-resolver.service.mjs +45 -0
  396. package/esm2020/routing/resolvers/empty-cart-resolver.service.mjs +42 -0
  397. package/{esm2015/routing/resolvers/public_api.js → esm2020/routing/resolvers/public_api.mjs} +0 -0
  398. package/{esm2015/routing/resolvers/tokens/cart-resolver-redirect.token.js → esm2020/routing/resolvers/tokens/cart-resolver-redirect.token.mjs} +0 -0
  399. package/{esm2015/routing/resolvers/tokens/empty-cart-resolver-redirect.token.js → esm2020/routing/resolvers/tokens/empty-cart-resolver-redirect.token.mjs} +0 -0
  400. package/{esm2015/state/actions/cart-address.actions.js → esm2020/state/actions/cart-address.actions.mjs} +0 -0
  401. package/{esm2015/state/actions/cart-billing-address.actions.js → esm2020/state/actions/cart-billing-address.actions.mjs} +0 -0
  402. package/{esm2015/state/actions/cart-coupon.actions.js → esm2020/state/actions/cart-coupon.actions.mjs} +0 -0
  403. package/esm2020/state/actions/cart-item.actions.mjs +199 -0
  404. package/{esm2015/state/actions/cart-order.actions.js → esm2020/state/actions/cart-order.actions.mjs} +0 -0
  405. package/{esm2015/state/actions/cart-payment-methods.actions.js → esm2020/state/actions/cart-payment-methods.actions.mjs} +0 -0
  406. package/{esm2015/state/actions/cart-payment.actions.js → esm2020/state/actions/cart-payment.actions.mjs} +0 -0
  407. package/{esm2015/state/actions/cart-shipping-address.actions.js → esm2020/state/actions/cart-shipping-address.actions.mjs} +0 -0
  408. package/{esm2015/state/actions/cart-shipping-information.actions.js → esm2020/state/actions/cart-shipping-information.actions.mjs} +0 -0
  409. package/{esm2015/state/actions/cart-shipping-methods.actions.js → esm2020/state/actions/cart-shipping-methods.actions.mjs} +0 -0
  410. package/esm2020/state/actions/cart.actions.mjs +197 -0
  411. package/{esm2015/state/actions/public_api.js → esm2020/state/actions/public_api.mjs} +0 -0
  412. package/esm2020/state/cart-state.module.mjs +70 -0
  413. package/esm2020/state/daffodil-cart-state.mjs +5 -0
  414. package/esm2020/state/effects/cart-address.effects.mjs +34 -0
  415. package/esm2020/state/effects/cart-billing-address.effects.mjs +32 -0
  416. package/esm2020/state/effects/cart-coupon.effects.mjs +43 -0
  417. package/esm2020/state/effects/cart-item.effects.mjs +52 -0
  418. package/esm2020/state/effects/cart-order.effects.mjs +35 -0
  419. package/esm2020/state/effects/cart-payment-methods.effects.mjs +31 -0
  420. package/esm2020/state/effects/cart-payment.effects.mjs +34 -0
  421. package/esm2020/state/effects/cart-resolver.effects.mjs +69 -0
  422. package/esm2020/state/effects/cart-shipping-address.effects.mjs +32 -0
  423. package/esm2020/state/effects/cart-shipping-information.effects.mjs +33 -0
  424. package/esm2020/state/effects/cart-shipping-methods.effects.mjs +31 -0
  425. package/esm2020/state/effects/cart.effects.mjs +51 -0
  426. package/{esm2015/state/facades/cart/cart-facade.interface.js → esm2020/state/facades/cart/cart-facade.interface.mjs} +0 -0
  427. package/{esm2015/state/facades/cart/cart.facade.js → esm2020/state/facades/cart/cart.facade.mjs} +12 -13
  428. package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
  429. package/{esm2015/state/injection-tokens/cart-item-state-debounce-time.js → esm2020/state/injection-tokens/cart-item-state-debounce-time.mjs} +0 -0
  430. package/{esm2015/state/injection-tokens/public_api.js → esm2020/state/injection-tokens/public_api.mjs} +0 -0
  431. package/{esm2015/state/models/public_api.js → esm2020/state/models/public_api.mjs} +0 -0
  432. package/{esm2015/state/models/stateful-cart-item.js → esm2020/state/models/stateful-cart-item.mjs} +0 -0
  433. package/{esm2015/state/models/stateful-composite-cart-item.js → esm2020/state/models/stateful-composite-cart-item.mjs} +0 -0
  434. package/{esm2015/state/models/stateful-configurable-cart-item.js → esm2020/state/models/stateful-configurable-cart-item.mjs} +0 -0
  435. package/{esm2015/state/public_api.js → esm2020/state/public_api.mjs} +0 -0
  436. package/{esm2015/state/reducers/action-types.type.js → esm2020/state/reducers/action-types.type.mjs} +0 -0
  437. package/esm2020/state/reducers/cart/cart.reducer.mjs +78 -0
  438. package/esm2020/state/reducers/cart-billing-address/cart-billing-address.reducer.mjs +55 -0
  439. package/esm2020/state/reducers/cart-coupon/cart-coupon.reducer.mjs +63 -0
  440. package/{esm2015/state/reducers/cart-initial-state.js → esm2020/state/reducers/cart-initial-state.mjs} +0 -0
  441. package/esm2020/state/reducers/cart-item/cart-item.reducer.mjs +94 -0
  442. package/esm2020/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.mjs +9 -0
  443. package/esm2020/state/reducers/cart-item-entities/cart-item-entities.reducer.mjs +87 -0
  444. package/{esm2015/state/reducers/cart-operation-type.enum.js → esm2020/state/reducers/cart-operation-type.enum.mjs} +0 -0
  445. package/{esm2015/state/reducers/cart-order/cart-order-initial-state.js → esm2020/state/reducers/cart-order/cart-order-initial-state.mjs} +0 -0
  446. package/{esm2015/state/reducers/cart-order/cart-order-state.interface.js → esm2020/state/reducers/cart-order/cart-order-state.interface.mjs} +0 -0
  447. package/esm2020/state/reducers/cart-order/cart-order.reducer.mjs +30 -0
  448. package/esm2020/state/reducers/cart-payment/cart-payment.reducer.mjs +83 -0
  449. package/esm2020/state/reducers/cart-payment-methods/cart-payment-methods.reducer.mjs +36 -0
  450. package/{esm2015/state/reducers/cart-reducers-state.interface.js → esm2020/state/reducers/cart-reducers-state.interface.mjs} +0 -0
  451. package/{esm2015/state/reducers/cart-reducers.js → esm2020/state/reducers/cart-reducers.mjs} +0 -0
  452. package/{esm2015/state/reducers/cart-resolve/cart-resolve-state.enum.js → esm2020/state/reducers/cart-resolve/cart-resolve-state.enum.mjs} +0 -0
  453. package/esm2020/state/reducers/cart-resolve/cart-resolve.reducer.mjs +30 -0
  454. package/esm2020/state/reducers/cart-shipping-address/cart-shipping-address.reducer.mjs +55 -0
  455. package/esm2020/state/reducers/cart-shipping-information/cart-shipping-information.reducer.mjs +58 -0
  456. package/esm2020/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.mjs +36 -0
  457. package/{esm2015/state/reducers/cart-state.interface.js → esm2020/state/reducers/cart-state.interface.mjs} +0 -0
  458. package/{esm2015/state/reducers/cart-store-feature-key.js → esm2020/state/reducers/cart-store-feature-key.mjs} +0 -0
  459. package/{esm2015/state/reducers/cart.reducer.js → esm2020/state/reducers/cart.reducer.mjs} +0 -0
  460. package/{esm2015/state/reducers/errors/cart-errors.type.js → esm2020/state/reducers/errors/cart-errors.type.mjs} +0 -0
  461. package/esm2020/state/reducers/errors/error-state-helpers.mjs +13 -0
  462. package/esm2020/state/reducers/loading/cart-loading.type.mjs +8 -0
  463. package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
  464. package/{esm2015/state/reducers/token/extra.token.js → esm2020/state/reducers/token/extra.token.mjs} +0 -0
  465. package/{esm2015/state/reducers/token/public_api.js → esm2020/state/reducers/token/public_api.mjs} +0 -0
  466. package/{esm2015/state/reducers/token/reducers.token.js → esm2020/state/reducers/token/reducers.token.mjs} +0 -0
  467. package/esm2020/state/selectors/cart/cart.selector.mjs +219 -0
  468. package/{esm2015/state/selectors/cart-feature.selector.js → esm2020/state/selectors/cart-feature.selector.mjs} +3 -5
  469. package/esm2020/state/selectors/cart-item-entities/cart-item-entities.selectors.mjs +95 -0
  470. package/esm2020/state/selectors/cart-order/cart-order.selector.mjs +30 -0
  471. package/esm2020/state/selectors/cart.selector.mjs +17 -0
  472. package/{esm2015/state/selectors/public_api.js → esm2020/state/selectors/public_api.mjs} +0 -0
  473. package/esm2020/state/testing/cart-testing.module.mjs +20 -0
  474. package/{esm2015/state/testing/daffodil-cart-state-testing.js → esm2020/state/testing/daffodil-cart-state-testing.mjs} +0 -0
  475. package/esm2020/state/testing/factories/stateful-cart-item.factory.mjs +26 -0
  476. package/esm2020/state/testing/factories/stateful-composite-cart-item.factory.mjs +24 -0
  477. package/esm2020/state/testing/factories/stateful-configurable-cart-item.factory.mjs +24 -0
  478. package/{esm2015/state/testing/index.js → esm2020/state/testing/index.mjs} +0 -0
  479. package/{esm2015/state/testing/mock-cart-facade.js → esm2020/state/testing/mock-cart-facade.mjs} +7 -5
  480. package/{esm2015/state/testing/public_api.js → esm2020/state/testing/public_api.mjs} +0 -0
  481. package/esm2020/storage/cart-storage.service.mjs +49 -0
  482. package/{esm2015/testing/daffodil-cart-testing.js → esm2020/testing/daffodil-cart-testing.mjs} +0 -0
  483. package/{esm2015/testing/factories/cart-address.factory.js → esm2020/testing/factories/cart-address.factory.mjs} +9 -9
  484. package/esm2020/testing/factories/cart-coupon.factory.mjs +27 -0
  485. package/{esm2015/testing/factories/cart-item/cart-item.factory.js → esm2020/testing/factories/cart-item/cart-item.factory.mjs} +9 -9
  486. package/{esm2015/testing/factories/cart-item/composite-cart-item.factory.js → esm2020/testing/factories/cart-item/composite-cart-item.factory.mjs} +9 -9
  487. package/esm2020/testing/factories/cart-item/configurable-cart-item.factory.mjs +35 -0
  488. package/esm2020/testing/factories/cart-payment.factory.mjs +22 -0
  489. package/esm2020/testing/factories/cart-shipping-rate.factory.mjs +29 -0
  490. package/{esm2015/testing/factories/cart.factory.js → esm2020/testing/factories/cart.factory.mjs} +9 -9
  491. package/{esm2015/testing/factories/public_api.js → esm2020/testing/factories/public_api.mjs} +0 -0
  492. package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
  493. package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
  494. package/fesm2015/{daffodil-cart-driver-in-memory.js → daffodil-cart-driver-in-memory.mjs} +422 -422
  495. package/fesm2015/daffodil-cart-driver-in-memory.mjs.map +1 -0
  496. package/fesm2015/daffodil-cart-driver-magento-testing.mjs +331 -0
  497. package/fesm2015/daffodil-cart-driver-magento-testing.mjs.map +1 -0
  498. package/fesm2015/{daffodil-cart-driver-magento.js → daffodil-cart-driver-magento.mjs} +455 -396
  499. package/fesm2015/daffodil-cart-driver-magento.mjs.map +1 -0
  500. package/fesm2015/daffodil-cart-driver-testing.mjs +365 -0
  501. package/fesm2015/daffodil-cart-driver-testing.mjs.map +1 -0
  502. package/fesm2015/{daffodil-cart-driver.js → daffodil-cart-driver.mjs} +1 -1
  503. package/fesm2015/daffodil-cart-driver.mjs.map +1 -0
  504. package/fesm2015/daffodil-cart-routing.mjs +449 -0
  505. package/fesm2015/daffodil-cart-routing.mjs.map +1 -0
  506. package/fesm2015/{daffodil-cart-state-testing.js → daffodil-cart-state-testing.mjs} +46 -37
  507. package/fesm2015/daffodil-cart-state-testing.mjs.map +1 -0
  508. package/fesm2015/{daffodil-cart-state.js → daffodil-cart-state.mjs} +489 -466
  509. package/fesm2015/daffodil-cart-state.mjs.map +1 -0
  510. package/fesm2015/daffodil-cart-testing.mjs +292 -0
  511. package/fesm2015/daffodil-cart-testing.mjs.map +1 -0
  512. package/fesm2015/{daffodil-cart.js → daffodil-cart.mjs} +18 -19
  513. package/fesm2015/daffodil-cart.mjs.map +1 -0
  514. package/fesm2020/daffodil-cart-driver-in-memory.mjs +1168 -0
  515. package/fesm2020/daffodil-cart-driver-in-memory.mjs.map +1 -0
  516. package/fesm2020/daffodil-cart-driver-magento-testing.mjs +331 -0
  517. package/fesm2020/daffodil-cart-driver-magento-testing.mjs.map +1 -0
  518. package/fesm2020/daffodil-cart-driver-magento.mjs +2219 -0
  519. package/fesm2020/daffodil-cart-driver-magento.mjs.map +1 -0
  520. package/fesm2020/daffodil-cart-driver-testing.mjs +365 -0
  521. package/fesm2020/daffodil-cart-driver-testing.mjs.map +1 -0
  522. package/fesm2020/daffodil-cart-driver.mjs +176 -0
  523. package/fesm2020/daffodil-cart-driver.mjs.map +1 -0
  524. package/fesm2020/daffodil-cart-routing.mjs +434 -0
  525. package/fesm2020/daffodil-cart-routing.mjs.map +1 -0
  526. package/fesm2020/daffodil-cart-state-testing.mjs +218 -0
  527. package/fesm2020/daffodil-cart-state-testing.mjs.map +1 -0
  528. package/fesm2020/daffodil-cart-state.mjs +2803 -0
  529. package/fesm2020/daffodil-cart-state.mjs.map +1 -0
  530. package/fesm2020/daffodil-cart-testing.mjs +292 -0
  531. package/fesm2020/daffodil-cart-testing.mjs.map +1 -0
  532. package/fesm2020/daffodil-cart.mjs +174 -0
  533. package/fesm2020/daffodil-cart.mjs.map +1 -0
  534. package/package.json +103 -19
  535. package/routing/cart-routing.module.d.ts +4 -0
  536. package/routing/daffodil-cart-routing.d.ts +1 -0
  537. package/routing/guards/billing-address/billing-address.guard.d.ts +3 -0
  538. package/routing/guards/cart-items/cart-items.guard.d.ts +3 -0
  539. package/routing/guards/in-stock-items/in-stock-items.guard.d.ts +3 -0
  540. package/routing/guards/order-result/order-result.guard.d.ts +3 -0
  541. package/routing/guards/payment-method/payment-method.guard.d.ts +3 -0
  542. package/routing/guards/resolved-cart/resolved-cart.guard.d.ts +3 -0
  543. package/routing/guards/shipping-address/shipping-address.guard.d.ts +3 -0
  544. package/routing/guards/shipping-method/shipping-method.guard.d.ts +3 -0
  545. package/routing/package.json +5 -6
  546. package/routing/resolvers/cart-resolver.service.d.ts +3 -0
  547. package/routing/resolvers/empty-cart-resolver.service.d.ts +3 -0
  548. package/state/actions/cart-item.actions.d.ts +26 -1
  549. package/state/actions/cart.actions.d.ts +31 -5
  550. package/state/cart-state.module.d.ts +6 -0
  551. package/state/daffodil-cart-state.d.ts +1 -24
  552. package/state/effects/cart-address.effects.d.ts +11 -8
  553. package/state/effects/cart-billing-address.effects.d.ts +12 -9
  554. package/state/effects/cart-coupon.effects.d.ts +7 -4
  555. package/state/effects/cart-item.effects.d.ts +41 -35
  556. package/state/effects/cart-order.effects.d.ts +5 -2
  557. package/state/effects/cart-payment-methods.effects.d.ts +4 -1
  558. package/state/effects/cart-payment.effects.d.ts +12 -9
  559. package/state/effects/cart-resolver.effects.d.ts +4 -1
  560. package/state/effects/cart-shipping-address.effects.d.ts +12 -9
  561. package/state/effects/cart-shipping-information.effects.d.ts +22 -19
  562. package/state/effects/cart-shipping-methods.effects.d.ts +4 -1
  563. package/state/effects/cart.effects.d.ts +18 -15
  564. package/state/facades/cart/cart.facade.d.ts +3 -0
  565. package/state/package.json +5 -6
  566. package/state/reducers/errors/error-state-helpers.d.ts +1 -1
  567. package/state/reducers/token/reducers.token.d.ts +1 -1
  568. package/state/testing/cart-testing.module.d.ts +4 -0
  569. package/state/testing/daffodil-cart-state-testing.d.ts +1 -0
  570. package/state/testing/factories/stateful-cart-item.factory.d.ts +3 -0
  571. package/state/testing/factories/stateful-composite-cart-item.factory.d.ts +3 -0
  572. package/state/testing/factories/stateful-configurable-cart-item.factory.d.ts +3 -0
  573. package/state/testing/mock-cart-facade.d.ts +3 -0
  574. package/state/testing/package.json +5 -6
  575. package/storage/cart-storage.service.d.ts +3 -0
  576. package/testing/daffodil-cart-testing.d.ts +1 -0
  577. package/testing/factories/cart-address.factory.d.ts +3 -0
  578. package/testing/factories/cart-coupon.factory.d.ts +3 -0
  579. package/testing/factories/cart-item/cart-item.factory.d.ts +3 -0
  580. package/testing/factories/cart-item/composite-cart-item.factory.d.ts +3 -0
  581. package/testing/factories/cart-item/configurable-cart-item.factory.d.ts +3 -0
  582. package/testing/factories/cart-payment.factory.d.ts +3 -0
  583. package/testing/factories/cart-shipping-rate.factory.d.ts +3 -0
  584. package/testing/factories/cart.factory.d.ts +3 -0
  585. package/testing/package.json +5 -6
  586. package/bundles/daffodil-cart-driver-in-memory.umd.js +0 -1527
  587. package/bundles/daffodil-cart-driver-in-memory.umd.js.map +0 -1
  588. package/bundles/daffodil-cart-driver-in-memory.umd.min.js +0 -2
  589. package/bundles/daffodil-cart-driver-in-memory.umd.min.js.map +0 -1
  590. package/bundles/daffodil-cart-driver-magento-testing.umd.js +0 -707
  591. package/bundles/daffodil-cart-driver-magento-testing.umd.js.map +0 -1
  592. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js +0 -16
  593. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js.map +0 -1
  594. package/bundles/daffodil-cart-driver-magento.umd.js +0 -2051
  595. package/bundles/daffodil-cart-driver-magento.umd.js.map +0 -1
  596. package/bundles/daffodil-cart-driver-magento.umd.min.js +0 -2
  597. package/bundles/daffodil-cart-driver-magento.umd.min.js.map +0 -1
  598. package/bundles/daffodil-cart-driver-testing.umd.js +0 -410
  599. package/bundles/daffodil-cart-driver-testing.umd.js.map +0 -1
  600. package/bundles/daffodil-cart-driver-testing.umd.min.js +0 -2
  601. package/bundles/daffodil-cart-driver-testing.umd.min.js.map +0 -1
  602. package/bundles/daffodil-cart-driver.umd.js +0 -552
  603. package/bundles/daffodil-cart-driver.umd.js.map +0 -1
  604. package/bundles/daffodil-cart-driver.umd.min.js +0 -17
  605. package/bundles/daffodil-cart-driver.umd.min.js.map +0 -1
  606. package/bundles/daffodil-cart-routing.umd.js +0 -473
  607. package/bundles/daffodil-cart-routing.umd.js.map +0 -1
  608. package/bundles/daffodil-cart-routing.umd.min.js +0 -2
  609. package/bundles/daffodil-cart-routing.umd.min.js.map +0 -1
  610. package/bundles/daffodil-cart-state-testing.umd.js +0 -557
  611. package/bundles/daffodil-cart-state-testing.umd.js.map +0 -1
  612. package/bundles/daffodil-cart-state-testing.umd.min.js +0 -17
  613. package/bundles/daffodil-cart-state-testing.umd.min.js.map +0 -1
  614. package/bundles/daffodil-cart-state.umd.js +0 -3069
  615. package/bundles/daffodil-cart-state.umd.js.map +0 -1
  616. package/bundles/daffodil-cart-state.umd.min.js +0 -2
  617. package/bundles/daffodil-cart-state.umd.min.js.map +0 -1
  618. package/bundles/daffodil-cart-testing.umd.js +0 -653
  619. package/bundles/daffodil-cart-testing.umd.js.map +0 -1
  620. package/bundles/daffodil-cart-testing.umd.min.js +0 -16
  621. package/bundles/daffodil-cart-testing.umd.min.js.map +0 -1
  622. package/bundles/daffodil-cart.umd.js +0 -516
  623. package/bundles/daffodil-cart.umd.js.map +0 -1
  624. package/bundles/daffodil-cart.umd.min.js +0 -17
  625. package/bundles/daffodil-cart.umd.min.js.map +0 -1
  626. package/daffodil-cart.metadata.json +0 -1
  627. package/driver/daffodil-cart-driver.metadata.json +0 -1
  628. package/driver/in-memory/daffodil-cart-driver-in-memory.metadata.json +0 -1
  629. package/driver/magento/daffodil-cart-driver-magento.metadata.json +0 -1
  630. package/driver/magento/testing/daffodil-cart-driver-magento-testing.metadata.json +0 -1
  631. package/driver/testing/daffodil-cart-driver-testing.metadata.json +0 -1
  632. package/esm2015/daffodil-cart.js +0 -6
  633. package/esm2015/driver/in-memory/backend/cart/cart.service.js +0 -76
  634. package/esm2015/driver/in-memory/backend/cart-address/cart-address.service.js +0 -40
  635. package/esm2015/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.js +0 -48
  636. package/esm2015/driver/in-memory/backend/cart-coupon/cart-coupon.service.js +0 -80
  637. package/esm2015/driver/in-memory/backend/cart-order/cart-order.service.js +0 -28
  638. package/esm2015/driver/in-memory/backend/cart-payment/cart-payment.service.js +0 -62
  639. package/esm2015/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.js +0 -27
  640. package/esm2015/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.js +0 -48
  641. package/esm2015/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.js +0 -59
  642. package/esm2015/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.js +0 -46
  643. package/esm2015/driver/in-memory/daffodil-cart-driver-in-memory.js +0 -6
  644. package/esm2015/driver/in-memory/drivers/cart/cart.service.js +0 -42
  645. package/esm2015/driver/in-memory/drivers/cart-address/cart-address.service.js +0 -30
  646. package/esm2015/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.js +0 -33
  647. package/esm2015/driver/in-memory/drivers/cart-coupon/cart-coupon.service.js +0 -39
  648. package/esm2015/driver/in-memory/drivers/cart-driver.module.js +0 -75
  649. package/esm2015/driver/in-memory/drivers/cart-item/cart-item.service.js +0 -42
  650. package/esm2015/driver/in-memory/drivers/cart-order/cart-order.service.js +0 -30
  651. package/esm2015/driver/in-memory/drivers/cart-payment/cart-payment.service.js +0 -39
  652. package/esm2015/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.js +0 -30
  653. package/esm2015/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.js +0 -33
  654. package/esm2015/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.js +0 -36
  655. package/esm2015/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.js +0 -30
  656. package/esm2015/driver/interfaces/cart-service.interface.js +0 -3
  657. package/esm2015/driver/magento/cart-address.service.js +0 -64
  658. package/esm2015/driver/magento/cart-billing-address.service.js +0 -80
  659. package/esm2015/driver/magento/cart-coupon.service.js +0 -67
  660. package/esm2015/driver/magento/cart-driver.module.js +0 -105
  661. package/esm2015/driver/magento/cart-item.service.js +0 -108
  662. package/esm2015/driver/magento/cart-order.service.js +0 -42
  663. package/esm2015/driver/magento/cart-payment-methods.service.js +0 -41
  664. package/esm2015/driver/magento/cart-payment.service.js +0 -104
  665. package/esm2015/driver/magento/cart-shipping-address.service.js +0 -80
  666. package/esm2015/driver/magento/cart-shipping-information.service.js +0 -85
  667. package/esm2015/driver/magento/cart-shipping-methods.service.js +0 -41
  668. package/esm2015/driver/magento/cart.service.js +0 -61
  669. package/esm2015/driver/magento/daffodil-cart-driver-magento.js +0 -10
  670. package/esm2015/driver/magento/errors/transform.js +0 -30
  671. package/esm2015/driver/magento/queries/create-cart.js +0 -7
  672. package/esm2015/driver/magento/queries/fragments/cart-item.js +0 -62
  673. package/esm2015/driver/magento/queries/fragments/prices.js +0 -32
  674. package/esm2015/driver/magento/queries/place-order.js +0 -15
  675. package/esm2015/driver/magento/queries/remove-cart-item.js +0 -19
  676. package/esm2015/driver/magento/queries/update-address-with-email.js +0 -46
  677. package/esm2015/driver/magento/queries/update-address.js +0 -38
  678. package/esm2015/driver/magento/queries/update-billing-address-with-email.js +0 -31
  679. package/esm2015/driver/magento/queries/update-cart-item.js +0 -19
  680. package/esm2015/driver/magento/queries/update-shipping-address-with-email.js +0 -31
  681. package/esm2015/driver/magento/testing/factories/cart-coupon.factory.js +0 -24
  682. package/esm2015/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.js +0 -35
  683. package/esm2015/driver/magento/testing/factories/cart-payment-method.factory.js +0 -25
  684. package/esm2015/driver/magento/testing/factories/cart-shipping-method.factory.js +0 -31
  685. package/esm2015/driver/magento/testing/factories/shipping-address.factory.js +0 -26
  686. package/esm2015/driver/magento/transforms/inputs/billing-address.service.js +0 -31
  687. package/esm2015/driver/magento/transforms/inputs/cart-address.service.js +0 -24
  688. package/esm2015/driver/magento/transforms/inputs/cart-item-input-transformers.js +0 -18
  689. package/esm2015/driver/magento/transforms/inputs/cart-item-update.service.js +0 -17
  690. package/esm2015/driver/magento/transforms/inputs/payment-method.service.js +0 -14
  691. package/esm2015/driver/magento/transforms/inputs/shipping-address.service.js +0 -31
  692. package/esm2015/driver/magento/transforms/inputs/shipping-method.service.js +0 -17
  693. package/esm2015/driver/magento/transforms/outputs/billing-address.service.js +0 -31
  694. package/esm2015/driver/magento/transforms/outputs/cart-address.service.js +0 -41
  695. package/esm2015/driver/magento/transforms/outputs/cart-coupon-response.service.js +0 -53
  696. package/esm2015/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.js +0 -19
  697. package/esm2015/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.js +0 -17
  698. package/esm2015/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.js +0 -39
  699. package/esm2015/driver/magento/transforms/outputs/cart-payment.service.js +0 -24
  700. package/esm2015/driver/magento/transforms/outputs/cart-shipping-information.service.js +0 -33
  701. package/esm2015/driver/magento/transforms/outputs/cart-shipping-rate.service.js +0 -31
  702. package/esm2015/driver/magento/transforms/outputs/cart.service.js +0 -111
  703. package/esm2015/driver/magento/transforms/outputs/shipping-address.service.js +0 -31
  704. package/esm2015/driver/testing/drivers/cart/cart.service.js +0 -38
  705. package/esm2015/driver/testing/drivers/cart-address/cart-address.service.js +0 -29
  706. package/esm2015/driver/testing/drivers/cart-billing-address/cart-billing-address.service.js +0 -32
  707. package/esm2015/driver/testing/drivers/cart-coupon/cart-coupon.service.js +0 -38
  708. package/esm2015/driver/testing/drivers/cart-driver.module.js +0 -75
  709. package/esm2015/driver/testing/drivers/cart-item/cart-item.service.js +0 -41
  710. package/esm2015/driver/testing/drivers/cart-order/cart-order.service.js +0 -23
  711. package/esm2015/driver/testing/drivers/cart-payment/cart-payment.service.js +0 -38
  712. package/esm2015/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.js +0 -27
  713. package/esm2015/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.js +0 -32
  714. package/esm2015/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.js +0 -35
  715. package/esm2015/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.js +0 -27
  716. package/esm2015/routing/cart-routing.module.js +0 -32
  717. package/esm2015/routing/config/config.js +0 -17
  718. package/esm2015/routing/guards/billing-address/billing-address.guard.js +0 -42
  719. package/esm2015/routing/guards/cart-items/cart-items.guard.js +0 -43
  720. package/esm2015/routing/guards/in-stock-items/in-stock-items.guard.js +0 -43
  721. package/esm2015/routing/guards/order-result/order-result.guard.js +0 -40
  722. package/esm2015/routing/guards/payment-method/payment-method.guard.js +0 -42
  723. package/esm2015/routing/guards/resolved-cart/resolved-cart.guard.js +0 -44
  724. package/esm2015/routing/guards/shipping-address/shipping-address.guard.js +0 -42
  725. package/esm2015/routing/guards/shipping-method/shipping-method.guard.js +0 -42
  726. package/esm2015/routing/resolvers/cart-resolver.service.js +0 -48
  727. package/esm2015/routing/resolvers/empty-cart-resolver.service.js +0 -44
  728. package/esm2015/state/actions/cart-item.actions.js +0 -170
  729. package/esm2015/state/actions/cart.actions.js +0 -169
  730. package/esm2015/state/cart-state.module.js +0 -45
  731. package/esm2015/state/daffodil-cart-state.js +0 -29
  732. package/esm2015/state/effects/cart-address.effects.js +0 -35
  733. package/esm2015/state/effects/cart-billing-address.effects.js +0 -37
  734. package/esm2015/state/effects/cart-coupon.effects.js +0 -56
  735. package/esm2015/state/effects/cart-item.effects.js +0 -64
  736. package/esm2015/state/effects/cart-order.effects.js +0 -40
  737. package/esm2015/state/effects/cart-payment-methods.effects.js +0 -32
  738. package/esm2015/state/effects/cart-payment.effects.js +0 -47
  739. package/esm2015/state/effects/cart-resolver.effects.js +0 -57
  740. package/esm2015/state/effects/cart-shipping-address.effects.js +0 -37
  741. package/esm2015/state/effects/cart-shipping-information.effects.js +0 -42
  742. package/esm2015/state/effects/cart-shipping-methods.effects.js +0 -32
  743. package/esm2015/state/effects/cart.effects.js +0 -59
  744. package/esm2015/state/reducers/cart/cart.reducer.js +0 -37
  745. package/esm2015/state/reducers/cart-billing-address/cart-billing-address.reducer.js +0 -29
  746. package/esm2015/state/reducers/cart-coupon/cart-coupon.reducer.js +0 -34
  747. package/esm2015/state/reducers/cart-item/cart-item.reducer.js +0 -38
  748. package/esm2015/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.js +0 -11
  749. package/esm2015/state/reducers/cart-item-entities/cart-item-entities.reducer.js +0 -62
  750. package/esm2015/state/reducers/cart-order/cart-order.reducer.js +0 -18
  751. package/esm2015/state/reducers/cart-payment/cart-payment.reducer.js +0 -41
  752. package/esm2015/state/reducers/cart-payment-methods/cart-payment-methods.reducer.js +0 -21
  753. package/esm2015/state/reducers/cart-resolve/cart-resolve.reducer.js +0 -18
  754. package/esm2015/state/reducers/cart-shipping-address/cart-shipping-address.reducer.js +0 -29
  755. package/esm2015/state/reducers/cart-shipping-information/cart-shipping-information.reducer.js +0 -33
  756. package/esm2015/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.js +0 -21
  757. package/esm2015/state/reducers/errors/error-state-helpers.js +0 -7
  758. package/esm2015/state/reducers/loading/cart-loading.type.js +0 -5
  759. package/esm2015/state/selectors/cart/cart.selector.js +0 -222
  760. package/esm2015/state/selectors/cart-item-entities/cart-item-entities.selectors.js +0 -98
  761. package/esm2015/state/selectors/cart-order/cart-order.selector.js +0 -33
  762. package/esm2015/state/selectors/cart.selector.js +0 -15
  763. package/esm2015/state/testing/cart-testing.module.js +0 -13
  764. package/esm2015/state/testing/factories/stateful-cart-item.factory.js +0 -26
  765. package/esm2015/state/testing/factories/stateful-composite-cart-item.factory.js +0 -24
  766. package/esm2015/state/testing/factories/stateful-configurable-cart-item.factory.js +0 -24
  767. package/esm2015/storage/cart-storage.service.js +0 -52
  768. package/esm2015/testing/factories/cart-coupon.factory.js +0 -27
  769. package/esm2015/testing/factories/cart-item/configurable-cart-item.factory.js +0 -35
  770. package/esm2015/testing/factories/cart-payment.factory.js +0 -22
  771. package/esm2015/testing/factories/cart-shipping-rate.factory.js +0 -29
  772. package/fesm2015/daffodil-cart-driver-in-memory.js.map +0 -1
  773. package/fesm2015/daffodil-cart-driver-magento-testing.js +0 -330
  774. package/fesm2015/daffodil-cart-driver-magento-testing.js.map +0 -1
  775. package/fesm2015/daffodil-cart-driver-magento.js.map +0 -1
  776. package/fesm2015/daffodil-cart-driver-testing.js +0 -380
  777. package/fesm2015/daffodil-cart-driver-testing.js.map +0 -1
  778. package/fesm2015/daffodil-cart-driver.js.map +0 -1
  779. package/fesm2015/daffodil-cart-routing.js +0 -425
  780. package/fesm2015/daffodil-cart-routing.js.map +0 -1
  781. package/fesm2015/daffodil-cart-state-testing.js.map +0 -1
  782. package/fesm2015/daffodil-cart-state.js.map +0 -1
  783. package/fesm2015/daffodil-cart-testing.js +0 -291
  784. package/fesm2015/daffodil-cart-testing.js.map +0 -1
  785. package/fesm2015/daffodil-cart.js.map +0 -1
  786. package/routing/daffodil-cart-routing.metadata.json +0 -1
  787. package/state/daffodil-cart-state.metadata.json +0 -1
  788. package/state/testing/daffodil-cart-state-testing.metadata.json +0 -1
  789. package/testing/daffodil-cart-testing.metadata.json +0 -1
@@ -1,1527 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@daffodil/cart/driver'), require('@angular/common'), require('angular-in-memory-web-api'), require('@daffodil/cart/testing')) :
3
- typeof define === 'function' && define.amd ? define('@daffodil/cart/driver/in-memory', ['exports', '@angular/common/http', '@angular/core', 'rxjs', 'rxjs/operators', '@daffodil/cart/driver', '@angular/common', 'angular-in-memory-web-api', '@daffodil/cart/testing'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.cart = global.daffodil.cart || {}, global.daffodil.cart.driver = global.daffodil.cart.driver || {}, global.daffodil.cart.driver['in-memory'] = {}), global.ng.common.http, global.ng.core, global.rxjs, global.rxjs.operators, global.daffodil.cart.driver, global.ng.common, global.angularInMemoryWebApi, global.daffodil.cart.testing));
5
- }(this, (function (exports, i1, i0, rxjs, operators, driver, common, angularInMemoryWebApi, i1$1) { 'use strict';
6
-
7
- /**
8
- * @inheritdoc
9
- */
10
- var DaffInMemoryCartService = /** @class */ (function () {
11
- function DaffInMemoryCartService(http) {
12
- this.http = http;
13
- /**
14
- * The URL with which the driver makes calls to the backend.
15
- */
16
- this.url = '/api/cart';
17
- }
18
- DaffInMemoryCartService.prototype.get = function (cartId) {
19
- return this.http.get(this.url + "/" + cartId).pipe(operators.catchError(function (error) { return rxjs.throwError(new driver.DaffCartNotFoundError(error.message)); }), operators.map(function (result) { return result; }));
20
- };
21
- DaffInMemoryCartService.prototype.addToCart = function (productId, qty) {
22
- return this.http.post(this.url + '/addToCart', { productId: productId, qty: qty });
23
- };
24
- DaffInMemoryCartService.prototype.clear = function (cartId) {
25
- return this.http.post(this.url + "/" + cartId + "/clear", {});
26
- };
27
- DaffInMemoryCartService.prototype.create = function () {
28
- return this.http.post(this.url, {});
29
- };
30
- return DaffInMemoryCartService;
31
- }());
32
- /** @nocollapse */ DaffInMemoryCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartService_Factory() { return new DaffInMemoryCartService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartService, providedIn: "root" });
33
- DaffInMemoryCartService.decorators = [
34
- { type: i0.Injectable, args: [{
35
- providedIn: 'root',
36
- },] }
37
- ];
38
- /** @nocollapse */
39
- DaffInMemoryCartService.ctorParameters = function () { return [
40
- { type: i1.HttpClient }
41
- ]; };
42
-
43
- /**
44
- * @inheritdoc
45
- */
46
- var DaffInMemoryCartItemService = /** @class */ (function () {
47
- function DaffInMemoryCartItemService(http) {
48
- this.http = http;
49
- /**
50
- * The URL with which the driver makes calls to the backend.
51
- */
52
- this.url = '/api/cart-items';
53
- }
54
- DaffInMemoryCartItemService.prototype.list = function (cartId) {
55
- return this.http.get(this.url + "/" + cartId + "/");
56
- };
57
- DaffInMemoryCartItemService.prototype.get = function (cartId, itemId) {
58
- return this.http.get(this.url + "/" + cartId + "/" + itemId);
59
- };
60
- DaffInMemoryCartItemService.prototype.add = function (cartId, input) {
61
- return this.http.post(this.url + "/" + cartId + "/", input);
62
- };
63
- DaffInMemoryCartItemService.prototype.update = function (cartId, itemId, item) {
64
- return this.http.put(this.url + "/" + cartId + "/" + itemId, item);
65
- };
66
- DaffInMemoryCartItemService.prototype.delete = function (cartId, itemId) {
67
- return this.http.delete(this.url + "/" + cartId + "/" + itemId);
68
- };
69
- return DaffInMemoryCartItemService;
70
- }());
71
- /** @nocollapse */ DaffInMemoryCartItemService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartItemService_Factory() { return new DaffInMemoryCartItemService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartItemService, providedIn: "root" });
72
- DaffInMemoryCartItemService.decorators = [
73
- { type: i0.Injectable, args: [{
74
- providedIn: 'root',
75
- },] }
76
- ];
77
- /** @nocollapse */
78
- DaffInMemoryCartItemService.ctorParameters = function () { return [
79
- { type: i1.HttpClient }
80
- ]; };
81
-
82
- /**
83
- * @inheritdoc
84
- */
85
- var DaffInMemoryCartBillingAddressService = /** @class */ (function () {
86
- function DaffInMemoryCartBillingAddressService(http) {
87
- this.http = http;
88
- /**
89
- * The URL with which the driver makes calls to the backend.
90
- */
91
- this.url = '/api/cart-billing-address';
92
- }
93
- DaffInMemoryCartBillingAddressService.prototype.get = function (cartId) {
94
- return this.http.get(this.url + "/" + cartId);
95
- };
96
- DaffInMemoryCartBillingAddressService.prototype.update = function (cartId, address) {
97
- return this.http.put(this.url + "/" + cartId, address);
98
- };
99
- return DaffInMemoryCartBillingAddressService;
100
- }());
101
- /** @nocollapse */ DaffInMemoryCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartBillingAddressService_Factory() { return new DaffInMemoryCartBillingAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartBillingAddressService, providedIn: "root" });
102
- DaffInMemoryCartBillingAddressService.decorators = [
103
- { type: i0.Injectable, args: [{
104
- providedIn: 'root',
105
- },] }
106
- ];
107
- /** @nocollapse */
108
- DaffInMemoryCartBillingAddressService.ctorParameters = function () { return [
109
- { type: i1.HttpClient }
110
- ]; };
111
-
112
- /**
113
- * @inheritdoc
114
- */
115
- var DaffInMemoryCartPaymentService = /** @class */ (function () {
116
- function DaffInMemoryCartPaymentService(http) {
117
- this.http = http;
118
- /**
119
- * The URL with which the driver makes calls to the backend.
120
- */
121
- this.url = '/api/cart-payment';
122
- }
123
- DaffInMemoryCartPaymentService.prototype.get = function (cartId) {
124
- return this.http.get(this.url + "/" + cartId);
125
- };
126
- DaffInMemoryCartPaymentService.prototype.update = function (cartId, payment) {
127
- return this.http.put(this.url + "/" + cartId, { payment: payment });
128
- };
129
- DaffInMemoryCartPaymentService.prototype.updateWithBilling = function (cartId, payment, address) {
130
- return this.http.put(this.url + "/" + cartId, { payment: payment, address: address });
131
- };
132
- DaffInMemoryCartPaymentService.prototype.remove = function (cartId) {
133
- return this.http.delete(this.url + "/" + cartId);
134
- };
135
- return DaffInMemoryCartPaymentService;
136
- }());
137
- /** @nocollapse */ DaffInMemoryCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartPaymentService_Factory() { return new DaffInMemoryCartPaymentService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartPaymentService, providedIn: "root" });
138
- DaffInMemoryCartPaymentService.decorators = [
139
- { type: i0.Injectable, args: [{
140
- providedIn: 'root',
141
- },] }
142
- ];
143
- /** @nocollapse */
144
- DaffInMemoryCartPaymentService.ctorParameters = function () { return [
145
- { type: i1.HttpClient }
146
- ]; };
147
-
148
- /**
149
- * @inheritdoc
150
- */
151
- var DaffInMemoryCartPaymentMethodsService = /** @class */ (function () {
152
- function DaffInMemoryCartPaymentMethodsService(http) {
153
- this.http = http;
154
- /**
155
- * The URL with which the driver makes calls to the backend.
156
- */
157
- this.url = '/api/cart-payment-methods';
158
- }
159
- DaffInMemoryCartPaymentMethodsService.prototype.list = function (cartId) {
160
- return this.http.get(this.url + "/" + cartId);
161
- };
162
- return DaffInMemoryCartPaymentMethodsService;
163
- }());
164
- /** @nocollapse */ DaffInMemoryCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartPaymentMethodsService_Factory() { return new DaffInMemoryCartPaymentMethodsService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartPaymentMethodsService, providedIn: "root" });
165
- DaffInMemoryCartPaymentMethodsService.decorators = [
166
- { type: i0.Injectable, args: [{
167
- providedIn: 'root',
168
- },] }
169
- ];
170
- /** @nocollapse */
171
- DaffInMemoryCartPaymentMethodsService.ctorParameters = function () { return [
172
- { type: i1.HttpClient }
173
- ]; };
174
-
175
- /**
176
- * @inheritdoc
177
- */
178
- var DaffInMemoryCartShippingAddressService = /** @class */ (function () {
179
- function DaffInMemoryCartShippingAddressService(http) {
180
- this.http = http;
181
- /**
182
- * The URL with which the driver makes calls to the backend.
183
- */
184
- this.url = '/api/cart-shipping-address';
185
- }
186
- DaffInMemoryCartShippingAddressService.prototype.get = function (cartId) {
187
- return this.http.get(this.url + "/" + cartId);
188
- };
189
- DaffInMemoryCartShippingAddressService.prototype.update = function (cartId, address) {
190
- return this.http.put(this.url + "/" + cartId, address);
191
- };
192
- return DaffInMemoryCartShippingAddressService;
193
- }());
194
- /** @nocollapse */ DaffInMemoryCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingAddressService_Factory() { return new DaffInMemoryCartShippingAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingAddressService, providedIn: "root" });
195
- DaffInMemoryCartShippingAddressService.decorators = [
196
- { type: i0.Injectable, args: [{
197
- providedIn: 'root',
198
- },] }
199
- ];
200
- /** @nocollapse */
201
- DaffInMemoryCartShippingAddressService.ctorParameters = function () { return [
202
- { type: i1.HttpClient }
203
- ]; };
204
-
205
- /**
206
- * @inheritdoc
207
- */
208
- var DaffInMemoryCartShippingInformationService = /** @class */ (function () {
209
- function DaffInMemoryCartShippingInformationService(http) {
210
- this.http = http;
211
- /**
212
- * The URL with which the driver makes calls to the backend.
213
- */
214
- this.url = '/api/cart-shipping-information';
215
- }
216
- DaffInMemoryCartShippingInformationService.prototype.get = function (cartId) {
217
- return this.http.get(this.url + "/" + cartId);
218
- };
219
- DaffInMemoryCartShippingInformationService.prototype.update = function (cartId, info) {
220
- return this.http.put(this.url + "/" + cartId, info);
221
- };
222
- DaffInMemoryCartShippingInformationService.prototype.delete = function (cartId) {
223
- return this.http.delete(this.url + "/" + cartId);
224
- };
225
- return DaffInMemoryCartShippingInformationService;
226
- }());
227
- /** @nocollapse */ DaffInMemoryCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingInformationService_Factory() { return new DaffInMemoryCartShippingInformationService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingInformationService, providedIn: "root" });
228
- DaffInMemoryCartShippingInformationService.decorators = [
229
- { type: i0.Injectable, args: [{
230
- providedIn: 'root',
231
- },] }
232
- ];
233
- /** @nocollapse */
234
- DaffInMemoryCartShippingInformationService.ctorParameters = function () { return [
235
- { type: i1.HttpClient }
236
- ]; };
237
-
238
- /**
239
- * @inheritdoc
240
- */
241
- var DaffInMemoryCartShippingMethodsService = /** @class */ (function () {
242
- function DaffInMemoryCartShippingMethodsService(http) {
243
- this.http = http;
244
- /**
245
- * The URL with which the driver makes calls to the backend.
246
- */
247
- this.url = '/api/cart-shipping-methods';
248
- }
249
- DaffInMemoryCartShippingMethodsService.prototype.list = function (cartId) {
250
- return this.http.get(this.url + "/" + cartId);
251
- };
252
- return DaffInMemoryCartShippingMethodsService;
253
- }());
254
- /** @nocollapse */ DaffInMemoryCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartShippingMethodsService_Factory() { return new DaffInMemoryCartShippingMethodsService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartShippingMethodsService, providedIn: "root" });
255
- DaffInMemoryCartShippingMethodsService.decorators = [
256
- { type: i0.Injectable, args: [{
257
- providedIn: 'root',
258
- },] }
259
- ];
260
- /** @nocollapse */
261
- DaffInMemoryCartShippingMethodsService.ctorParameters = function () { return [
262
- { type: i1.HttpClient }
263
- ]; };
264
-
265
- /**
266
- * @inheritdoc
267
- */
268
- var DaffInMemoryCartOrderService = /** @class */ (function () {
269
- function DaffInMemoryCartOrderService(http) {
270
- this.http = http;
271
- /**
272
- * The URL with which the driver makes calls to the backend.
273
- */
274
- this.url = '/api/cart-order';
275
- }
276
- DaffInMemoryCartOrderService.prototype.placeOrder = function (cartId, payment) {
277
- return this.http.post(this.url + "/" + cartId + "/", { payment: payment });
278
- };
279
- return DaffInMemoryCartOrderService;
280
- }());
281
- /** @nocollapse */ DaffInMemoryCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartOrderService_Factory() { return new DaffInMemoryCartOrderService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartOrderService, providedIn: "root" });
282
- DaffInMemoryCartOrderService.decorators = [
283
- { type: i0.Injectable, args: [{
284
- providedIn: 'root',
285
- },] }
286
- ];
287
- /** @nocollapse */
288
- DaffInMemoryCartOrderService.ctorParameters = function () { return [
289
- { type: i1.HttpClient }
290
- ]; };
291
-
292
- /**
293
- * @inheritdoc
294
- */
295
- var DaffInMemoryCartCouponService = /** @class */ (function () {
296
- function DaffInMemoryCartCouponService(http) {
297
- this.http = http;
298
- /**
299
- * The URL with which the driver makes calls to the backend.
300
- */
301
- this.url = '/api/cart-coupon';
302
- }
303
- DaffInMemoryCartCouponService.prototype.list = function (cartId) {
304
- return this.http.get(this.url + "/" + cartId + "/");
305
- };
306
- DaffInMemoryCartCouponService.prototype.apply = function (cartId, coupon) {
307
- return this.http.post(this.url + "/" + cartId + "/", coupon);
308
- };
309
- DaffInMemoryCartCouponService.prototype.remove = function (cartId, coupon) {
310
- return this.http.delete(this.url + "/" + cartId + "/" + coupon.code);
311
- };
312
- DaffInMemoryCartCouponService.prototype.removeAll = function (cartId) {
313
- return this.http.delete(this.url + "/" + cartId + "/");
314
- };
315
- return DaffInMemoryCartCouponService;
316
- }());
317
- /** @nocollapse */ DaffInMemoryCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartCouponService_Factory() { return new DaffInMemoryCartCouponService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartCouponService, providedIn: "root" });
318
- DaffInMemoryCartCouponService.decorators = [
319
- { type: i0.Injectable, args: [{
320
- providedIn: 'root',
321
- },] }
322
- ];
323
- /** @nocollapse */
324
- DaffInMemoryCartCouponService.ctorParameters = function () { return [
325
- { type: i1.HttpClient }
326
- ]; };
327
-
328
- /**
329
- * @inheritdoc
330
- */
331
- var DaffInMemoryCartAddressService = /** @class */ (function () {
332
- function DaffInMemoryCartAddressService(http) {
333
- this.http = http;
334
- /**
335
- * The URL with which the driver makes calls to the backend.
336
- */
337
- this.url = '/api/cart-address';
338
- }
339
- DaffInMemoryCartAddressService.prototype.update = function (cartId, address) {
340
- return this.http.put(this.url + "/" + cartId, address);
341
- };
342
- return DaffInMemoryCartAddressService;
343
- }());
344
- /** @nocollapse */ DaffInMemoryCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryCartAddressService_Factory() { return new DaffInMemoryCartAddressService(i0.ɵɵinject(i1.HttpClient)); }, token: DaffInMemoryCartAddressService, providedIn: "root" });
345
- DaffInMemoryCartAddressService.decorators = [
346
- { type: i0.Injectable, args: [{
347
- providedIn: 'root',
348
- },] }
349
- ];
350
- /** @nocollapse */
351
- DaffInMemoryCartAddressService.ctorParameters = function () { return [
352
- { type: i1.HttpClient }
353
- ]; };
354
-
355
- var DaffCartInMemoryDriverModule = /** @class */ (function () {
356
- function DaffCartInMemoryDriverModule() {
357
- }
358
- DaffCartInMemoryDriverModule.forRoot = function () {
359
- return {
360
- ngModule: DaffCartInMemoryDriverModule,
361
- providers: [
362
- {
363
- provide: driver.DaffCartDriver,
364
- useExisting: DaffInMemoryCartService,
365
- },
366
- {
367
- provide: driver.DaffCartAddressDriver,
368
- useExisting: DaffInMemoryCartAddressService,
369
- },
370
- {
371
- provide: driver.DaffCartBillingAddressDriver,
372
- useExisting: DaffInMemoryCartBillingAddressService,
373
- },
374
- {
375
- provide: driver.DaffCartItemDriver,
376
- useExisting: DaffInMemoryCartItemService,
377
- },
378
- {
379
- provide: driver.DaffCartPaymentDriver,
380
- useExisting: DaffInMemoryCartPaymentService,
381
- },
382
- {
383
- provide: driver.DaffCartPaymentMethodsDriver,
384
- useExisting: DaffInMemoryCartPaymentMethodsService,
385
- },
386
- {
387
- provide: driver.DaffCartShippingAddressDriver,
388
- useExisting: DaffInMemoryCartShippingAddressService,
389
- },
390
- {
391
- provide: driver.DaffCartShippingInformationDriver,
392
- useExisting: DaffInMemoryCartShippingInformationService,
393
- },
394
- {
395
- provide: driver.DaffCartShippingMethodsDriver,
396
- useExisting: DaffInMemoryCartShippingMethodsService,
397
- },
398
- {
399
- provide: driver.DaffCartOrderDriver,
400
- useExisting: DaffInMemoryCartOrderService,
401
- },
402
- {
403
- provide: driver.DaffCartCouponDriver,
404
- useExisting: DaffInMemoryCartCouponService,
405
- },
406
- ],
407
- };
408
- };
409
- return DaffCartInMemoryDriverModule;
410
- }());
411
- DaffCartInMemoryDriverModule.decorators = [
412
- { type: i0.NgModule, args: [{
413
- imports: [
414
- common.CommonModule,
415
- ],
416
- },] }
417
- ];
418
-
419
- /**
420
- * Allows an app dev to generate extra fields in the in-memory backend.
421
- * This enables the in-memory drivers to return responses similar to what the
422
- * frontend would expect from the production platform.
423
- *
424
- * The value returned by the hook function will be set to the returned cart's `extra_attributes` field
425
- * for driver calls that return a cart.
426
- *
427
- * The following example demonstrates adding the `numberOfCartItems` field to `extra_attributes`:
428
- * ```ts
429
- * (reqInfo: RequestInfo, cart: DaffCart) => ({
430
- * numberOfCartItems: cart.items.length
431
- * })
432
- * ```
433
- *
434
- * Note that this and any `extra_attributes` features are for advanced users
435
- * and should be used with care.
436
- */
437
- var DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK = new i0.InjectionToken('DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK', {
438
- factory: function () { return function (reqInfo, cart) { return ({}); }; },
439
- });
440
-
441
- /**
442
- * @inheritdoc
443
- */
444
- var DaffInMemoryBackendCartAddressService = /** @class */ (function () {
445
- function DaffInMemoryBackendCartAddressService(extraFieldsHook) {
446
- this.extraFieldsHook = extraFieldsHook;
447
- }
448
- DaffInMemoryBackendCartAddressService.prototype.put = function (reqInfo) {
449
- var _this = this;
450
- return reqInfo.utils.createResponse$(function () { return ({
451
- body: _this.updateAddress(reqInfo),
452
- status: angularInMemoryWebApi.STATUS.OK,
453
- }); });
454
- };
455
- DaffInMemoryBackendCartAddressService.prototype.getCart = function (reqInfo) {
456
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
457
- };
458
- DaffInMemoryBackendCartAddressService.prototype.updateAddress = function (reqInfo) {
459
- var cart = this.getCart(reqInfo);
460
- var address = reqInfo.utils.getJsonBody(reqInfo.req);
461
- cart.billing_address = address;
462
- cart.shipping_address = address;
463
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
464
- };
465
- return DaffInMemoryBackendCartAddressService;
466
- }());
467
- /** @nocollapse */ DaffInMemoryBackendCartAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartAddressService_Factory() { return new DaffInMemoryBackendCartAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartAddressService, providedIn: "root" });
468
- DaffInMemoryBackendCartAddressService.decorators = [
469
- { type: i0.Injectable, args: [{
470
- providedIn: 'root',
471
- },] }
472
- ];
473
- /** @nocollapse */
474
- DaffInMemoryBackendCartAddressService.ctorParameters = function () { return [
475
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
476
- ]; };
477
-
478
- /**
479
- * @inheritdoc
480
- */
481
- var DaffInMemoryBackendCartBillingAddressService = /** @class */ (function () {
482
- function DaffInMemoryBackendCartBillingAddressService(extraFieldsHook) {
483
- this.extraFieldsHook = extraFieldsHook;
484
- }
485
- DaffInMemoryBackendCartBillingAddressService.prototype.get = function (reqInfo) {
486
- var _this = this;
487
- return reqInfo.utils.createResponse$(function () { return ({
488
- body: _this.getBillingAddress(reqInfo),
489
- status: angularInMemoryWebApi.STATUS.OK,
490
- }); });
491
- };
492
- DaffInMemoryBackendCartBillingAddressService.prototype.put = function (reqInfo) {
493
- var _this = this;
494
- return reqInfo.utils.createResponse$(function () { return ({
495
- body: _this.updateBillingAddress(reqInfo),
496
- status: angularInMemoryWebApi.STATUS.OK,
497
- }); });
498
- };
499
- DaffInMemoryBackendCartBillingAddressService.prototype.getCart = function (reqInfo) {
500
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
501
- };
502
- DaffInMemoryBackendCartBillingAddressService.prototype.getBillingAddress = function (reqInfo) {
503
- return this.getCart(reqInfo).billing_address;
504
- };
505
- DaffInMemoryBackendCartBillingAddressService.prototype.updateBillingAddress = function (reqInfo) {
506
- var cart = this.getCart(reqInfo);
507
- var address = reqInfo.utils.getJsonBody(reqInfo.req);
508
- cart.billing_address = address;
509
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
510
- };
511
- return DaffInMemoryBackendCartBillingAddressService;
512
- }());
513
- /** @nocollapse */ DaffInMemoryBackendCartBillingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartBillingAddressService_Factory() { return new DaffInMemoryBackendCartBillingAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartBillingAddressService, providedIn: "root" });
514
- DaffInMemoryBackendCartBillingAddressService.decorators = [
515
- { type: i0.Injectable, args: [{
516
- providedIn: 'root',
517
- },] }
518
- ];
519
- /** @nocollapse */
520
- DaffInMemoryBackendCartBillingAddressService.ctorParameters = function () { return [
521
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
522
- ]; };
523
-
524
- /**
525
- * @inheritdoc
526
- */
527
- var DaffInMemoryBackendCartCouponService = /** @class */ (function () {
528
- function DaffInMemoryBackendCartCouponService(extraFieldsHook) {
529
- this.extraFieldsHook = extraFieldsHook;
530
- }
531
- DaffInMemoryBackendCartCouponService.prototype.get = function (reqInfo) {
532
- var _this = this;
533
- return reqInfo.utils.createResponse$(function () { return ({
534
- body: _this.listCoupons(reqInfo),
535
- status: angularInMemoryWebApi.STATUS.OK,
536
- }); });
537
- };
538
- DaffInMemoryBackendCartCouponService.prototype.post = function (reqInfo) {
539
- var _this = this;
540
- return reqInfo.utils.createResponse$(function () { return ({
541
- body: _this.applyCoupon(reqInfo),
542
- status: angularInMemoryWebApi.STATUS.OK,
543
- }); });
544
- };
545
- DaffInMemoryBackendCartCouponService.prototype.delete = function (reqInfo) {
546
- var _this = this;
547
- return reqInfo.utils.createResponse$(function () {
548
- var body;
549
- var action = _this.getAction(reqInfo);
550
- if (action) {
551
- body = _this.removeCoupon(reqInfo, action);
552
- }
553
- else {
554
- body = _this.removeAllCoupons(reqInfo);
555
- }
556
- return {
557
- body: body,
558
- status: angularInMemoryWebApi.STATUS.OK,
559
- };
560
- });
561
- };
562
- /**
563
- * Gets whatever follows the cart ID section of the request URL.
564
- */
565
- DaffInMemoryBackendCartCouponService.prototype.getAction = function (reqInfo) {
566
- return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
567
- };
568
- DaffInMemoryBackendCartCouponService.prototype.getCart = function (reqInfo) {
569
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
570
- };
571
- DaffInMemoryBackendCartCouponService.prototype.listCoupons = function (reqInfo) {
572
- return this.getCart(reqInfo).coupons;
573
- };
574
- DaffInMemoryBackendCartCouponService.prototype.applyCoupon = function (reqInfo) {
575
- var cart = this.getCart(reqInfo);
576
- var coupon = reqInfo.utils.getJsonBody(reqInfo.req);
577
- cart.coupons.push(coupon);
578
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
579
- };
580
- DaffInMemoryBackendCartCouponService.prototype.removeCoupon = function (reqInfo, couponCode) {
581
- var cart = this.getCart(reqInfo);
582
- cart.coupons = cart.coupons.filter(function (_a) {
583
- var code = _a.code;
584
- return code !== couponCode;
585
- });
586
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
587
- };
588
- DaffInMemoryBackendCartCouponService.prototype.removeAllCoupons = function (reqInfo) {
589
- var cart = this.getCart(reqInfo);
590
- cart.coupons = [];
591
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
592
- };
593
- return DaffInMemoryBackendCartCouponService;
594
- }());
595
- /** @nocollapse */ DaffInMemoryBackendCartCouponService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartCouponService_Factory() { return new DaffInMemoryBackendCartCouponService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartCouponService, providedIn: "root" });
596
- DaffInMemoryBackendCartCouponService.decorators = [
597
- { type: i0.Injectable, args: [{
598
- providedIn: 'root',
599
- },] }
600
- ];
601
- /** @nocollapse */
602
- DaffInMemoryBackendCartCouponService.ctorParameters = function () { return [
603
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
604
- ]; };
605
-
606
- /*! *****************************************************************************
607
- Copyright (c) Microsoft Corporation.
608
-
609
- Permission to use, copy, modify, and/or distribute this software for any
610
- purpose with or without fee is hereby granted.
611
-
612
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
613
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
614
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
615
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
616
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
617
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
618
- PERFORMANCE OF THIS SOFTWARE.
619
- ***************************************************************************** */
620
- /* global Reflect, Promise */
621
- var extendStatics = function (d, b) {
622
- extendStatics = Object.setPrototypeOf ||
623
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
624
- function (d, b) { for (var p in b)
625
- if (Object.prototype.hasOwnProperty.call(b, p))
626
- d[p] = b[p]; };
627
- return extendStatics(d, b);
628
- };
629
- function __extends(d, b) {
630
- if (typeof b !== "function" && b !== null)
631
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
632
- extendStatics(d, b);
633
- function __() { this.constructor = d; }
634
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
635
- }
636
- var __assign = function () {
637
- __assign = Object.assign || function __assign(t) {
638
- for (var s, i = 1, n = arguments.length; i < n; i++) {
639
- s = arguments[i];
640
- for (var p in s)
641
- if (Object.prototype.hasOwnProperty.call(s, p))
642
- t[p] = s[p];
643
- }
644
- return t;
645
- };
646
- return __assign.apply(this, arguments);
647
- };
648
- function __rest(s, e) {
649
- var t = {};
650
- for (var p in s)
651
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
652
- t[p] = s[p];
653
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
654
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
655
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
656
- t[p[i]] = s[p[i]];
657
- }
658
- return t;
659
- }
660
- function __decorate(decorators, target, key, desc) {
661
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
662
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
663
- r = Reflect.decorate(decorators, target, key, desc);
664
- else
665
- for (var i = decorators.length - 1; i >= 0; i--)
666
- if (d = decorators[i])
667
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
668
- return c > 3 && r && Object.defineProperty(target, key, r), r;
669
- }
670
- function __param(paramIndex, decorator) {
671
- return function (target, key) { decorator(target, key, paramIndex); };
672
- }
673
- function __metadata(metadataKey, metadataValue) {
674
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
675
- return Reflect.metadata(metadataKey, metadataValue);
676
- }
677
- function __awaiter(thisArg, _arguments, P, generator) {
678
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
679
- return new (P || (P = Promise))(function (resolve, reject) {
680
- function fulfilled(value) { try {
681
- step(generator.next(value));
682
- }
683
- catch (e) {
684
- reject(e);
685
- } }
686
- function rejected(value) { try {
687
- step(generator["throw"](value));
688
- }
689
- catch (e) {
690
- reject(e);
691
- } }
692
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
693
- step((generator = generator.apply(thisArg, _arguments || [])).next());
694
- });
695
- }
696
- function __generator(thisArg, body) {
697
- var _ = { label: 0, sent: function () { if (t[0] & 1)
698
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
699
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
700
- function verb(n) { return function (v) { return step([n, v]); }; }
701
- function step(op) {
702
- if (f)
703
- throw new TypeError("Generator is already executing.");
704
- while (_)
705
- try {
706
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
707
- return t;
708
- if (y = 0, t)
709
- op = [op[0] & 2, t.value];
710
- switch (op[0]) {
711
- case 0:
712
- case 1:
713
- t = op;
714
- break;
715
- case 4:
716
- _.label++;
717
- return { value: op[1], done: false };
718
- case 5:
719
- _.label++;
720
- y = op[1];
721
- op = [0];
722
- continue;
723
- case 7:
724
- op = _.ops.pop();
725
- _.trys.pop();
726
- continue;
727
- default:
728
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
729
- _ = 0;
730
- continue;
731
- }
732
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
733
- _.label = op[1];
734
- break;
735
- }
736
- if (op[0] === 6 && _.label < t[1]) {
737
- _.label = t[1];
738
- t = op;
739
- break;
740
- }
741
- if (t && _.label < t[2]) {
742
- _.label = t[2];
743
- _.ops.push(op);
744
- break;
745
- }
746
- if (t[2])
747
- _.ops.pop();
748
- _.trys.pop();
749
- continue;
750
- }
751
- op = body.call(thisArg, _);
752
- }
753
- catch (e) {
754
- op = [6, e];
755
- y = 0;
756
- }
757
- finally {
758
- f = t = 0;
759
- }
760
- if (op[0] & 5)
761
- throw op[1];
762
- return { value: op[0] ? op[1] : void 0, done: true };
763
- }
764
- }
765
- var __createBinding = Object.create ? (function (o, m, k, k2) {
766
- if (k2 === undefined)
767
- k2 = k;
768
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
769
- }) : (function (o, m, k, k2) {
770
- if (k2 === undefined)
771
- k2 = k;
772
- o[k2] = m[k];
773
- });
774
- function __exportStar(m, o) {
775
- for (var p in m)
776
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
777
- __createBinding(o, m, p);
778
- }
779
- function __values(o) {
780
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
781
- if (m)
782
- return m.call(o);
783
- if (o && typeof o.length === "number")
784
- return {
785
- next: function () {
786
- if (o && i >= o.length)
787
- o = void 0;
788
- return { value: o && o[i++], done: !o };
789
- }
790
- };
791
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
792
- }
793
- function __read(o, n) {
794
- var m = typeof Symbol === "function" && o[Symbol.iterator];
795
- if (!m)
796
- return o;
797
- var i = m.call(o), r, ar = [], e;
798
- try {
799
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
800
- ar.push(r.value);
801
- }
802
- catch (error) {
803
- e = { error: error };
804
- }
805
- finally {
806
- try {
807
- if (r && !r.done && (m = i["return"]))
808
- m.call(i);
809
- }
810
- finally {
811
- if (e)
812
- throw e.error;
813
- }
814
- }
815
- return ar;
816
- }
817
- /** @deprecated */
818
- function __spread() {
819
- for (var ar = [], i = 0; i < arguments.length; i++)
820
- ar = ar.concat(__read(arguments[i]));
821
- return ar;
822
- }
823
- /** @deprecated */
824
- function __spreadArrays() {
825
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
826
- s += arguments[i].length;
827
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
828
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
829
- r[k] = a[j];
830
- return r;
831
- }
832
- function __spreadArray(to, from, pack) {
833
- if (pack || arguments.length === 2)
834
- for (var i = 0, l = from.length, ar; i < l; i++) {
835
- if (ar || !(i in from)) {
836
- if (!ar)
837
- ar = Array.prototype.slice.call(from, 0, i);
838
- ar[i] = from[i];
839
- }
840
- }
841
- return to.concat(ar || Array.prototype.slice.call(from));
842
- }
843
- function __await(v) {
844
- return this instanceof __await ? (this.v = v, this) : new __await(v);
845
- }
846
- function __asyncGenerator(thisArg, _arguments, generator) {
847
- if (!Symbol.asyncIterator)
848
- throw new TypeError("Symbol.asyncIterator is not defined.");
849
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
850
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
851
- function verb(n) { if (g[n])
852
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
853
- function resume(n, v) { try {
854
- step(g[n](v));
855
- }
856
- catch (e) {
857
- settle(q[0][3], e);
858
- } }
859
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
860
- function fulfill(value) { resume("next", value); }
861
- function reject(value) { resume("throw", value); }
862
- function settle(f, v) { if (f(v), q.shift(), q.length)
863
- resume(q[0][0], q[0][1]); }
864
- }
865
- function __asyncDelegator(o) {
866
- var i, p;
867
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
868
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
869
- }
870
- function __asyncValues(o) {
871
- if (!Symbol.asyncIterator)
872
- throw new TypeError("Symbol.asyncIterator is not defined.");
873
- var m = o[Symbol.asyncIterator], i;
874
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
875
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
876
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
877
- }
878
- function __makeTemplateObject(cooked, raw) {
879
- if (Object.defineProperty) {
880
- Object.defineProperty(cooked, "raw", { value: raw });
881
- }
882
- else {
883
- cooked.raw = raw;
884
- }
885
- return cooked;
886
- }
887
- ;
888
- var __setModuleDefault = Object.create ? (function (o, v) {
889
- Object.defineProperty(o, "default", { enumerable: true, value: v });
890
- }) : function (o, v) {
891
- o["default"] = v;
892
- };
893
- function __importStar(mod) {
894
- if (mod && mod.__esModule)
895
- return mod;
896
- var result = {};
897
- if (mod != null)
898
- for (var k in mod)
899
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
900
- __createBinding(result, mod, k);
901
- __setModuleDefault(result, mod);
902
- return result;
903
- }
904
- function __importDefault(mod) {
905
- return (mod && mod.__esModule) ? mod : { default: mod };
906
- }
907
- function __classPrivateFieldGet(receiver, state, kind, f) {
908
- if (kind === "a" && !f)
909
- throw new TypeError("Private accessor was defined without a getter");
910
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
911
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
912
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
913
- }
914
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
915
- if (kind === "m")
916
- throw new TypeError("Private method is not writable");
917
- if (kind === "a" && !f)
918
- throw new TypeError("Private accessor was defined without a setter");
919
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
920
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
921
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
922
- }
923
-
924
- /**
925
- * @inheritdoc
926
- */
927
- var DaffInMemoryBackendCartItemsService = /** @class */ (function () {
928
- function DaffInMemoryBackendCartItemsService(cartItemFactory, extraFieldsHook) {
929
- this.cartItemFactory = cartItemFactory;
930
- this.extraFieldsHook = extraFieldsHook;
931
- }
932
- DaffInMemoryBackendCartItemsService.prototype.get = function (reqInfo) {
933
- var _this = this;
934
- return reqInfo.utils.createResponse$(function () {
935
- var body;
936
- var action = _this.getAction(reqInfo);
937
- if (action) {
938
- body = _this.getItem(reqInfo, action);
939
- }
940
- else {
941
- body = _this.listItems(reqInfo);
942
- }
943
- return {
944
- body: body,
945
- status: angularInMemoryWebApi.STATUS.OK,
946
- };
947
- });
948
- };
949
- DaffInMemoryBackendCartItemsService.prototype.put = function (reqInfo) {
950
- var _this = this;
951
- return reqInfo.utils.createResponse$(function () { return ({
952
- body: _this.updateItem(reqInfo, _this.getAction(reqInfo)),
953
- status: angularInMemoryWebApi.STATUS.OK,
954
- }); });
955
- };
956
- DaffInMemoryBackendCartItemsService.prototype.post = function (reqInfo) {
957
- var _this = this;
958
- return reqInfo.utils.createResponse$(function () { return ({
959
- body: _this.addItem(reqInfo),
960
- status: angularInMemoryWebApi.STATUS.OK,
961
- }); });
962
- };
963
- DaffInMemoryBackendCartItemsService.prototype.delete = function (reqInfo) {
964
- var _this = this;
965
- return reqInfo.utils.createResponse$(function () { return ({
966
- body: _this.deleteItem(reqInfo, _this.getAction(reqInfo)),
967
- status: angularInMemoryWebApi.STATUS.OK,
968
- }); });
969
- };
970
- /**
971
- * Gets whatever follows the cart ID section of the request URL.
972
- */
973
- DaffInMemoryBackendCartItemsService.prototype.getAction = function (reqInfo) {
974
- return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
975
- };
976
- DaffInMemoryBackendCartItemsService.prototype.getCart = function (reqInfo) {
977
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
978
- };
979
- DaffInMemoryBackendCartItemsService.prototype.transformItemInput = function (itemInput) {
980
- return Object.assign(Object.assign(Object.assign({}, this.cartItemFactory.create()), itemInput), { product_id: itemInput.productId });
981
- };
982
- DaffInMemoryBackendCartItemsService.prototype.listItems = function (reqInfo) {
983
- return this.getCart(reqInfo).items;
984
- };
985
- DaffInMemoryBackendCartItemsService.prototype.getItem = function (reqInfo, itemId) {
986
- var cart = this.getCart(reqInfo);
987
- return cart.items.find(function (_a) {
988
- var id = _a.id;
989
- return itemId === id;
990
- });
991
- };
992
- DaffInMemoryBackendCartItemsService.prototype.updateItem = function (reqInfo, itemId) {
993
- var cart = this.getCart(reqInfo);
994
- var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
995
- var itemChanges = reqInfo.utils.getJsonBody(reqInfo.req);
996
- var itemIndex = cart.items.findIndex(function (item) { return itemId === item.id; });
997
- reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.map(function (item, index) { return index === itemIndex ? Object.assign(Object.assign({}, cart.items[itemIndex]), itemChanges) : item; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
998
- return reqInfo.collection[cartIndex];
999
- };
1000
- DaffInMemoryBackendCartItemsService.prototype.addItem = function (reqInfo) {
1001
- var cart = this.getCart(reqInfo);
1002
- var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
1003
- var itemInput = reqInfo.utils.getJsonBody(reqInfo.req);
1004
- var existingCartItemIndex = cart.items.findIndex(function (item) { return item.product_id === itemInput.productId; });
1005
- if (existingCartItemIndex > -1) {
1006
- var updatedCartItem_1 = Object.assign(Object.assign({}, cart.items[existingCartItemIndex]), { qty: cart.items[existingCartItemIndex].qty + itemInput.qty });
1007
- reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.map(function (item, index) { return index === existingCartItemIndex ? updatedCartItem_1 : item; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1008
- }
1009
- else {
1010
- reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: __spread(cart.items, [
1011
- this.transformItemInput(itemInput),
1012
- ]), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1013
- }
1014
- return reqInfo.collection[cartIndex];
1015
- };
1016
- DaffInMemoryBackendCartItemsService.prototype.deleteItem = function (reqInfo, itemId) {
1017
- var cart = this.getCart(reqInfo);
1018
- var itemIndex = cart.items.findIndex(function (_a) {
1019
- var id = _a.id;
1020
- return itemId === id;
1021
- });
1022
- var cartIndex = reqInfo.collection.findIndex(function (c) { return c.id === reqInfo.id; });
1023
- reqInfo.collection[cartIndex] = Object.assign(Object.assign({}, cart), { items: cart.items.filter(function (item, index) { return index !== itemIndex; }), extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1024
- return reqInfo.collection[cartIndex];
1025
- };
1026
- return DaffInMemoryBackendCartItemsService;
1027
- }());
1028
- /** @nocollapse */ DaffInMemoryBackendCartItemsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartItemsService_Factory() { return new DaffInMemoryBackendCartItemsService(i0.ɵɵinject(i1$1.DaffCartItemFactory), i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartItemsService, providedIn: "root" });
1029
- DaffInMemoryBackendCartItemsService.decorators = [
1030
- { type: i0.Injectable, args: [{
1031
- providedIn: 'root',
1032
- },] }
1033
- ];
1034
- /** @nocollapse */
1035
- DaffInMemoryBackendCartItemsService.ctorParameters = function () { return [
1036
- { type: i1$1.DaffCartItemFactory },
1037
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
1038
- ]; };
1039
-
1040
- /**
1041
- * @inheritdoc
1042
- */
1043
- var DaffInMemoryBackendCartOrderService = /** @class */ (function () {
1044
- function DaffInMemoryBackendCartOrderService() {
1045
- }
1046
- DaffInMemoryBackendCartOrderService.prototype.post = function (reqInfo) {
1047
- var _this = this;
1048
- return reqInfo.utils.createResponse$(function () { return ({
1049
- body: _this.placeOrder(reqInfo),
1050
- status: angularInMemoryWebApi.STATUS.OK,
1051
- }); });
1052
- };
1053
- DaffInMemoryBackendCartOrderService.prototype.placeOrder = function (reqInfo) {
1054
- return {
1055
- id: '8235422034',
1056
- cartId: '89fdsa8sadf',
1057
- orderId: '8235422034',
1058
- };
1059
- };
1060
- return DaffInMemoryBackendCartOrderService;
1061
- }());
1062
- /** @nocollapse */ DaffInMemoryBackendCartOrderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartOrderService_Factory() { return new DaffInMemoryBackendCartOrderService(); }, token: DaffInMemoryBackendCartOrderService, providedIn: "root" });
1063
- DaffInMemoryBackendCartOrderService.decorators = [
1064
- { type: i0.Injectable, args: [{
1065
- providedIn: 'root',
1066
- },] }
1067
- ];
1068
-
1069
- /**
1070
- * @inheritdoc
1071
- */
1072
- var DaffInMemoryBackendCartPaymentMethodsService = /** @class */ (function () {
1073
- function DaffInMemoryBackendCartPaymentMethodsService() {
1074
- }
1075
- DaffInMemoryBackendCartPaymentMethodsService.prototype.get = function (reqInfo) {
1076
- var _this = this;
1077
- return reqInfo.utils.createResponse$(function () { return ({
1078
- body: _this.listPaymentMethods(reqInfo),
1079
- status: angularInMemoryWebApi.STATUS.OK,
1080
- }); });
1081
- };
1082
- DaffInMemoryBackendCartPaymentMethodsService.prototype.getCart = function (reqInfo) {
1083
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1084
- };
1085
- DaffInMemoryBackendCartPaymentMethodsService.prototype.listPaymentMethods = function (reqInfo) {
1086
- return this.getCart(reqInfo).available_payment_methods;
1087
- };
1088
- return DaffInMemoryBackendCartPaymentMethodsService;
1089
- }());
1090
- /** @nocollapse */ DaffInMemoryBackendCartPaymentMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartPaymentMethodsService_Factory() { return new DaffInMemoryBackendCartPaymentMethodsService(); }, token: DaffInMemoryBackendCartPaymentMethodsService, providedIn: "root" });
1091
- DaffInMemoryBackendCartPaymentMethodsService.decorators = [
1092
- { type: i0.Injectable, args: [{
1093
- providedIn: 'root',
1094
- },] }
1095
- ];
1096
-
1097
- /**
1098
- * @inheritdoc
1099
- */
1100
- var DaffInMemoryBackendCartPaymentService = /** @class */ (function () {
1101
- function DaffInMemoryBackendCartPaymentService(extraFieldsHook) {
1102
- this.extraFieldsHook = extraFieldsHook;
1103
- }
1104
- DaffInMemoryBackendCartPaymentService.prototype.get = function (reqInfo) {
1105
- var _this = this;
1106
- return reqInfo.utils.createResponse$(function () { return ({
1107
- body: _this.getPayment(reqInfo),
1108
- status: angularInMemoryWebApi.STATUS.OK,
1109
- }); });
1110
- };
1111
- DaffInMemoryBackendCartPaymentService.prototype.put = function (reqInfo) {
1112
- var _this = this;
1113
- return reqInfo.utils.createResponse$(function () { return ({
1114
- body: _this.updatePayment(reqInfo),
1115
- status: angularInMemoryWebApi.STATUS.OK,
1116
- }); });
1117
- };
1118
- DaffInMemoryBackendCartPaymentService.prototype.delete = function (reqInfo) {
1119
- var _this = this;
1120
- return reqInfo.utils.createResponse$(function () { return ({
1121
- body: _this.removePayment(reqInfo),
1122
- status: angularInMemoryWebApi.STATUS.OK,
1123
- }); });
1124
- };
1125
- DaffInMemoryBackendCartPaymentService.prototype.getCart = function (reqInfo) {
1126
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1127
- };
1128
- DaffInMemoryBackendCartPaymentService.prototype.getPayment = function (reqInfo) {
1129
- return this.getCart(reqInfo).payment;
1130
- };
1131
- DaffInMemoryBackendCartPaymentService.prototype.updatePayment = function (reqInfo) {
1132
- var cart = this.getCart(reqInfo);
1133
- var _a = reqInfo.utils.getJsonBody(reqInfo.req), payment = _a.payment, address = _a.address;
1134
- cart.payment = payment;
1135
- if (address) {
1136
- cart.billing_address = address;
1137
- }
1138
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1139
- };
1140
- DaffInMemoryBackendCartPaymentService.prototype.removePayment = function (reqInfo) {
1141
- var cart = this.getCart(reqInfo);
1142
- cart.payment = null;
1143
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1144
- };
1145
- return DaffInMemoryBackendCartPaymentService;
1146
- }());
1147
- /** @nocollapse */ DaffInMemoryBackendCartPaymentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartPaymentService_Factory() { return new DaffInMemoryBackendCartPaymentService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartPaymentService, providedIn: "root" });
1148
- DaffInMemoryBackendCartPaymentService.decorators = [
1149
- { type: i0.Injectable, args: [{
1150
- providedIn: 'root',
1151
- },] }
1152
- ];
1153
- /** @nocollapse */
1154
- DaffInMemoryBackendCartPaymentService.ctorParameters = function () { return [
1155
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
1156
- ]; };
1157
-
1158
- /**
1159
- * @inheritdoc
1160
- */
1161
- var DaffInMemoryBackendCartShippingAddressService = /** @class */ (function () {
1162
- function DaffInMemoryBackendCartShippingAddressService(extraFieldsHook) {
1163
- this.extraFieldsHook = extraFieldsHook;
1164
- }
1165
- DaffInMemoryBackendCartShippingAddressService.prototype.get = function (reqInfo) {
1166
- var _this = this;
1167
- return reqInfo.utils.createResponse$(function () { return ({
1168
- body: _this.getShippingAddress(reqInfo),
1169
- status: angularInMemoryWebApi.STATUS.OK,
1170
- }); });
1171
- };
1172
- DaffInMemoryBackendCartShippingAddressService.prototype.put = function (reqInfo) {
1173
- var _this = this;
1174
- return reqInfo.utils.createResponse$(function () { return ({
1175
- body: _this.updateShippingAddress(reqInfo),
1176
- status: angularInMemoryWebApi.STATUS.OK,
1177
- }); });
1178
- };
1179
- DaffInMemoryBackendCartShippingAddressService.prototype.getCart = function (reqInfo) {
1180
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1181
- };
1182
- DaffInMemoryBackendCartShippingAddressService.prototype.getShippingAddress = function (reqInfo) {
1183
- return this.getCart(reqInfo).shipping_address;
1184
- };
1185
- DaffInMemoryBackendCartShippingAddressService.prototype.updateShippingAddress = function (reqInfo) {
1186
- var cart = this.getCart(reqInfo);
1187
- var address = reqInfo.utils.getJsonBody(reqInfo.req);
1188
- cart.shipping_address = address;
1189
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1190
- };
1191
- return DaffInMemoryBackendCartShippingAddressService;
1192
- }());
1193
- /** @nocollapse */ DaffInMemoryBackendCartShippingAddressService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingAddressService_Factory() { return new DaffInMemoryBackendCartShippingAddressService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartShippingAddressService, providedIn: "root" });
1194
- DaffInMemoryBackendCartShippingAddressService.decorators = [
1195
- { type: i0.Injectable, args: [{
1196
- providedIn: 'root',
1197
- },] }
1198
- ];
1199
- /** @nocollapse */
1200
- DaffInMemoryBackendCartShippingAddressService.ctorParameters = function () { return [
1201
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
1202
- ]; };
1203
-
1204
- /**
1205
- * @inheritdoc
1206
- */
1207
- var DaffInMemoryBackendCartShippingInformationService = /** @class */ (function () {
1208
- function DaffInMemoryBackendCartShippingInformationService(extraFieldsHook) {
1209
- this.extraFieldsHook = extraFieldsHook;
1210
- }
1211
- DaffInMemoryBackendCartShippingInformationService.prototype.get = function (reqInfo) {
1212
- var _this = this;
1213
- return reqInfo.utils.createResponse$(function () { return ({
1214
- body: _this.getShippingInformation(reqInfo),
1215
- status: angularInMemoryWebApi.STATUS.OK,
1216
- }); });
1217
- };
1218
- DaffInMemoryBackendCartShippingInformationService.prototype.put = function (reqInfo) {
1219
- var _this = this;
1220
- return reqInfo.utils.createResponse$(function () { return ({
1221
- body: _this.updateShippingInformation(reqInfo),
1222
- status: angularInMemoryWebApi.STATUS.OK,
1223
- }); });
1224
- };
1225
- DaffInMemoryBackendCartShippingInformationService.prototype.delete = function (reqInfo) {
1226
- var _this = this;
1227
- return reqInfo.utils.createResponse$(function () { return ({
1228
- body: _this.removeShippingInformation(reqInfo),
1229
- status: angularInMemoryWebApi.STATUS.OK,
1230
- }); });
1231
- };
1232
- DaffInMemoryBackendCartShippingInformationService.prototype.getCart = function (reqInfo) {
1233
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1234
- };
1235
- DaffInMemoryBackendCartShippingInformationService.prototype.getShippingInformation = function (reqInfo) {
1236
- return this.getCart(reqInfo).shipping_information;
1237
- };
1238
- DaffInMemoryBackendCartShippingInformationService.prototype.updateShippingInformation = function (reqInfo) {
1239
- var cart = this.getCart(reqInfo);
1240
- var shippingInformation = reqInfo.utils.getJsonBody(reqInfo.req);
1241
- cart.shipping_information = shippingInformation;
1242
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1243
- };
1244
- DaffInMemoryBackendCartShippingInformationService.prototype.removeShippingInformation = function (reqInfo) {
1245
- var cart = this.getCart(reqInfo);
1246
- cart.shipping_information = null;
1247
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1248
- };
1249
- return DaffInMemoryBackendCartShippingInformationService;
1250
- }());
1251
- /** @nocollapse */ DaffInMemoryBackendCartShippingInformationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingInformationService_Factory() { return new DaffInMemoryBackendCartShippingInformationService(i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartShippingInformationService, providedIn: "root" });
1252
- DaffInMemoryBackendCartShippingInformationService.decorators = [
1253
- { type: i0.Injectable, args: [{
1254
- providedIn: 'root',
1255
- },] }
1256
- ];
1257
- /** @nocollapse */
1258
- DaffInMemoryBackendCartShippingInformationService.ctorParameters = function () { return [
1259
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
1260
- ]; };
1261
-
1262
- /**
1263
- * @inheritdoc
1264
- */
1265
- var DaffInMemoryBackendCartShippingMethodsService = /** @class */ (function () {
1266
- function DaffInMemoryBackendCartShippingMethodsService(shippingMethodFactory) {
1267
- this.shippingMethodFactory = shippingMethodFactory;
1268
- }
1269
- DaffInMemoryBackendCartShippingMethodsService.prototype.get = function (reqInfo) {
1270
- var _this = this;
1271
- return reqInfo.utils.createResponse$(function () { return ({
1272
- body: _this.listShippingMethods(reqInfo),
1273
- status: angularInMemoryWebApi.STATUS.OK,
1274
- }); });
1275
- };
1276
- DaffInMemoryBackendCartShippingMethodsService.prototype.getCart = function (reqInfo) {
1277
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1278
- };
1279
- DaffInMemoryBackendCartShippingMethodsService.prototype.listShippingMethods = function (reqInfo) {
1280
- var _a;
1281
- var cart = this.getCart(reqInfo);
1282
- if (cart.shipping_address) {
1283
- if (((_a = cart.available_shipping_methods) === null || _a === void 0 ? void 0 : _a.length) === 0) {
1284
- cart.available_shipping_methods = this.shippingMethodFactory.createMany(3);
1285
- }
1286
- }
1287
- else {
1288
- cart.available_shipping_methods = [];
1289
- }
1290
- return cart.available_shipping_methods;
1291
- };
1292
- return DaffInMemoryBackendCartShippingMethodsService;
1293
- }());
1294
- /** @nocollapse */ DaffInMemoryBackendCartShippingMethodsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartShippingMethodsService_Factory() { return new DaffInMemoryBackendCartShippingMethodsService(i0.ɵɵinject(i1$1.DaffCartShippingRateFactory)); }, token: DaffInMemoryBackendCartShippingMethodsService, providedIn: "root" });
1295
- DaffInMemoryBackendCartShippingMethodsService.decorators = [
1296
- { type: i0.Injectable, args: [{
1297
- providedIn: 'root',
1298
- },] }
1299
- ];
1300
- /** @nocollapse */
1301
- DaffInMemoryBackendCartShippingMethodsService.ctorParameters = function () { return [
1302
- { type: i1$1.DaffCartShippingRateFactory }
1303
- ]; };
1304
-
1305
- /**
1306
- * @inheritdoc
1307
- */
1308
- var DaffInMemoryBackendCartService = /** @class */ (function () {
1309
- function DaffInMemoryBackendCartService(cartFactory, extraFieldsHook) {
1310
- this.cartFactory = cartFactory;
1311
- this.extraFieldsHook = extraFieldsHook;
1312
- }
1313
- DaffInMemoryBackendCartService.prototype.get = function (reqInfo) {
1314
- var _this = this;
1315
- var cart = this.getCart(reqInfo);
1316
- return reqInfo.utils.createResponse$(function () { return ({
1317
- body: cart ? Object.assign(Object.assign({}, cart), { extra_attributes: _this.extraFieldsHook(reqInfo, cart) }) : cart,
1318
- status: cart ? angularInMemoryWebApi.STATUS.OK : angularInMemoryWebApi.STATUS.NOT_FOUND,
1319
- }); });
1320
- };
1321
- DaffInMemoryBackendCartService.prototype.post = function (reqInfo) {
1322
- var _this = this;
1323
- return reqInfo.utils.createResponse$(function () {
1324
- var body;
1325
- var action = _this.getAction(reqInfo);
1326
- if (reqInfo.id === 'addToCart') {
1327
- // deprecated
1328
- body = {};
1329
- }
1330
- else if (action === 'clear') {
1331
- body = _this.clear(reqInfo);
1332
- }
1333
- else {
1334
- body = _this.create(reqInfo);
1335
- }
1336
- return {
1337
- body: body,
1338
- status: angularInMemoryWebApi.STATUS.OK,
1339
- };
1340
- });
1341
- };
1342
- /**
1343
- * Gets whatever follows the cart ID section of the request URL.
1344
- */
1345
- DaffInMemoryBackendCartService.prototype.getAction = function (reqInfo) {
1346
- return reqInfo.url.replace("/" + reqInfo.resourceUrl + reqInfo.id + "/", '');
1347
- };
1348
- DaffInMemoryBackendCartService.prototype.clear = function (reqInfo) {
1349
- var cart = this.getCart(reqInfo);
1350
- cart.items = [];
1351
- return Object.assign(Object.assign({}, cart), { extra_attributes: this.extraFieldsHook(reqInfo, cart) });
1352
- };
1353
- DaffInMemoryBackendCartService.prototype.create = function (reqInfo) {
1354
- var cart = this.cartFactory.create();
1355
- reqInfo.collection.push(cart);
1356
- return {
1357
- id: cart.id,
1358
- };
1359
- };
1360
- DaffInMemoryBackendCartService.prototype.getCart = function (reqInfo) {
1361
- return reqInfo.utils.findById(reqInfo.collection, reqInfo.id);
1362
- };
1363
- return DaffInMemoryBackendCartService;
1364
- }());
1365
- /** @nocollapse */ DaffInMemoryBackendCartService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartService_Factory() { return new DaffInMemoryBackendCartService(i0.ɵɵinject(i1$1.DaffCartFactory), i0.ɵɵinject(DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK)); }, token: DaffInMemoryBackendCartService, providedIn: "root" });
1366
- DaffInMemoryBackendCartService.decorators = [
1367
- { type: i0.Injectable, args: [{
1368
- providedIn: 'root',
1369
- },] }
1370
- ];
1371
- /** @nocollapse */
1372
- DaffInMemoryBackendCartService.ctorParameters = function () { return [
1373
- { type: i1$1.DaffCartFactory },
1374
- { type: undefined, decorators: [{ type: i0.Inject, args: [DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK,] }] }
1375
- ]; };
1376
-
1377
- /**
1378
- * The root cart in-memory backend.
1379
- * Creates the database and delegates requests to child backends.
1380
- */
1381
- var DaffInMemoryBackendCartRootService = /** @class */ (function () {
1382
- function DaffInMemoryBackendCartRootService(cartService, cartItemsService, cartOrderService, cartCouponService, cartAddressService, cartShippingAddressService, cartBillingAddressService, cartPaymentMethodsService, cartShippingMethodsService, cartPaymentService, cartShippingInformationService) {
1383
- this.cartService = cartService;
1384
- this.cartItemsService = cartItemsService;
1385
- this.cartOrderService = cartOrderService;
1386
- this.cartCouponService = cartCouponService;
1387
- this.cartAddressService = cartAddressService;
1388
- this.cartShippingAddressService = cartShippingAddressService;
1389
- this.cartBillingAddressService = cartBillingAddressService;
1390
- this.cartPaymentMethodsService = cartPaymentMethodsService;
1391
- this.cartShippingMethodsService = cartShippingMethodsService;
1392
- this.cartPaymentService = cartPaymentService;
1393
- this.cartShippingInformationService = cartShippingInformationService;
1394
- /**
1395
- * The collection of carts in the backend.
1396
- */
1397
- this.carts = [];
1398
- }
1399
- DaffInMemoryBackendCartRootService.prototype.createDb = function (reqInfo) {
1400
- if (reqInfo) {
1401
- var seedData = reqInfo.utils.getJsonBody(reqInfo.req).carts;
1402
- if (seedData) {
1403
- this.carts = seedData;
1404
- }
1405
- }
1406
- return {
1407
- cart: this.carts,
1408
- };
1409
- };
1410
- DaffInMemoryBackendCartRootService.prototype.get = function (reqInfo) {
1411
- return this.delegateRequest(reqInfo);
1412
- };
1413
- DaffInMemoryBackendCartRootService.prototype.post = function (reqInfo) {
1414
- return this.delegateRequest(reqInfo);
1415
- };
1416
- DaffInMemoryBackendCartRootService.prototype.put = function (reqInfo) {
1417
- return this.delegateRequest(reqInfo);
1418
- };
1419
- DaffInMemoryBackendCartRootService.prototype.delete = function (reqInfo) {
1420
- return this.delegateRequest(reqInfo);
1421
- };
1422
- DaffInMemoryBackendCartRootService.prototype.delegateRequest = function (reqInfo) {
1423
- reqInfo.collection = this.carts;
1424
- switch (reqInfo.collectionName) {
1425
- case 'cart':
1426
- return this.cartService[reqInfo.method](reqInfo);
1427
- case 'cart-items':
1428
- return this.cartItemsService[reqInfo.method](reqInfo);
1429
- case 'cart-order':
1430
- return this.cartOrderService[reqInfo.method](reqInfo);
1431
- case 'cart-coupon':
1432
- return this.cartCouponService[reqInfo.method](reqInfo);
1433
- case 'cart-address':
1434
- return this.cartAddressService[reqInfo.method](reqInfo);
1435
- case 'cart-shipping-address':
1436
- return this.cartShippingAddressService[reqInfo.method](reqInfo);
1437
- case 'cart-billing-address':
1438
- return this.cartBillingAddressService[reqInfo.method](reqInfo);
1439
- case 'cart-payment-methods':
1440
- return this.cartPaymentMethodsService[reqInfo.method](reqInfo);
1441
- case 'cart-shipping-methods':
1442
- return this.cartShippingMethodsService[reqInfo.method](reqInfo);
1443
- case 'cart-payment':
1444
- return this.cartPaymentService[reqInfo.method](reqInfo);
1445
- case 'cart-shipping-information':
1446
- return this.cartShippingInformationService[reqInfo.method](reqInfo);
1447
- default:
1448
- return reqInfo.utils.createResponse$(function () { return ({
1449
- body: {},
1450
- status: angularInMemoryWebApi.STATUS.OK,
1451
- }); });
1452
- }
1453
- };
1454
- return DaffInMemoryBackendCartRootService;
1455
- }());
1456
- /**
1457
- * The collections that the root service manages.
1458
- * Useful for a higher-level backend that delegates to this one based on collection name.
1459
- */
1460
- DaffInMemoryBackendCartRootService.COLLECTION_NAMES = [
1461
- 'cart',
1462
- 'cart-items',
1463
- 'cart-order',
1464
- 'cart-coupon',
1465
- 'cart-address',
1466
- 'cart-shipping-address',
1467
- 'cart-billing-address',
1468
- 'cart-payment-methods',
1469
- 'cart-shipping-methods',
1470
- 'cart-payment',
1471
- 'cart-shipping-information',
1472
- ];
1473
- /** @nocollapse */ DaffInMemoryBackendCartRootService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffInMemoryBackendCartRootService_Factory() { return new DaffInMemoryBackendCartRootService(i0.ɵɵinject(DaffInMemoryBackendCartService), i0.ɵɵinject(DaffInMemoryBackendCartItemsService), i0.ɵɵinject(DaffInMemoryBackendCartOrderService), i0.ɵɵinject(DaffInMemoryBackendCartCouponService), i0.ɵɵinject(DaffInMemoryBackendCartAddressService), i0.ɵɵinject(DaffInMemoryBackendCartShippingAddressService), i0.ɵɵinject(DaffInMemoryBackendCartBillingAddressService), i0.ɵɵinject(DaffInMemoryBackendCartPaymentMethodsService), i0.ɵɵinject(DaffInMemoryBackendCartShippingMethodsService), i0.ɵɵinject(DaffInMemoryBackendCartPaymentService), i0.ɵɵinject(DaffInMemoryBackendCartShippingInformationService)); }, token: DaffInMemoryBackendCartRootService, providedIn: "root" });
1474
- DaffInMemoryBackendCartRootService.decorators = [
1475
- { type: i0.Injectable, args: [{
1476
- providedIn: 'root',
1477
- },] }
1478
- ];
1479
- /** @nocollapse */
1480
- DaffInMemoryBackendCartRootService.ctorParameters = function () { return [
1481
- { type: DaffInMemoryBackendCartService },
1482
- { type: DaffInMemoryBackendCartItemsService },
1483
- { type: DaffInMemoryBackendCartOrderService },
1484
- { type: DaffInMemoryBackendCartCouponService },
1485
- { type: DaffInMemoryBackendCartAddressService },
1486
- { type: DaffInMemoryBackendCartShippingAddressService },
1487
- { type: DaffInMemoryBackendCartBillingAddressService },
1488
- { type: DaffInMemoryBackendCartPaymentMethodsService },
1489
- { type: DaffInMemoryBackendCartShippingMethodsService },
1490
- { type: DaffInMemoryBackendCartPaymentService },
1491
- { type: DaffInMemoryBackendCartShippingInformationService }
1492
- ]; };
1493
-
1494
- /**
1495
- * Generated bundle index. Do not edit.
1496
- */
1497
-
1498
- exports.DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK = DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK;
1499
- exports.DaffCartInMemoryDriverModule = DaffCartInMemoryDriverModule;
1500
- exports.DaffInMemoryBackendCartAddressService = DaffInMemoryBackendCartAddressService;
1501
- exports.DaffInMemoryBackendCartBillingAddressService = DaffInMemoryBackendCartBillingAddressService;
1502
- exports.DaffInMemoryBackendCartCouponService = DaffInMemoryBackendCartCouponService;
1503
- exports.DaffInMemoryBackendCartItemsService = DaffInMemoryBackendCartItemsService;
1504
- exports.DaffInMemoryBackendCartOrderService = DaffInMemoryBackendCartOrderService;
1505
- exports.DaffInMemoryBackendCartPaymentMethodsService = DaffInMemoryBackendCartPaymentMethodsService;
1506
- exports.DaffInMemoryBackendCartPaymentService = DaffInMemoryBackendCartPaymentService;
1507
- exports.DaffInMemoryBackendCartRootService = DaffInMemoryBackendCartRootService;
1508
- exports.DaffInMemoryBackendCartService = DaffInMemoryBackendCartService;
1509
- exports.DaffInMemoryBackendCartShippingAddressService = DaffInMemoryBackendCartShippingAddressService;
1510
- exports.DaffInMemoryBackendCartShippingInformationService = DaffInMemoryBackendCartShippingInformationService;
1511
- exports.DaffInMemoryBackendCartShippingMethodsService = DaffInMemoryBackendCartShippingMethodsService;
1512
- exports.DaffInMemoryCartBillingAddressService = DaffInMemoryCartBillingAddressService;
1513
- exports.DaffInMemoryCartCouponService = DaffInMemoryCartCouponService;
1514
- exports.DaffInMemoryCartItemService = DaffInMemoryCartItemService;
1515
- exports.DaffInMemoryCartOrderService = DaffInMemoryCartOrderService;
1516
- exports.DaffInMemoryCartPaymentMethodsService = DaffInMemoryCartPaymentMethodsService;
1517
- exports.DaffInMemoryCartPaymentService = DaffInMemoryCartPaymentService;
1518
- exports.DaffInMemoryCartService = DaffInMemoryCartService;
1519
- exports.DaffInMemoryCartShippingAddressService = DaffInMemoryCartShippingAddressService;
1520
- exports.DaffInMemoryCartShippingInformationService = DaffInMemoryCartShippingInformationService;
1521
- exports.DaffInMemoryCartShippingMethodsService = DaffInMemoryCartShippingMethodsService;
1522
- exports.ɵa = DaffInMemoryCartAddressService;
1523
-
1524
- Object.defineProperty(exports, '__esModule', { value: true });
1525
-
1526
- })));
1527
- //# sourceMappingURL=daffodil-cart-driver-in-memory.umd.js.map