@daffodil/cart 0.77.0 → 0.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/driver/errors/product-not-found.d.ts +1 -1
  2. package/driver/in-memory/backend/cart/cart.service.d.ts +3 -2
  3. package/driver/in-memory/backend/cart-address/cart-address.service.d.ts +3 -2
  4. package/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.d.ts +3 -2
  5. package/driver/in-memory/backend/cart-coupon/cart-coupon.service.d.ts +3 -2
  6. package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +3 -2
  7. package/driver/in-memory/backend/cart-order/cart-order.service.d.ts +3 -2
  8. package/driver/in-memory/backend/cart-payment/cart-payment.service.d.ts +3 -2
  9. package/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.d.ts +3 -2
  10. package/driver/in-memory/backend/cart-root.service.d.ts +7 -25
  11. package/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.d.ts +3 -2
  12. package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +3 -2
  13. package/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.d.ts +3 -2
  14. package/driver/in-memory/collection-names.d.ts +11 -0
  15. package/driver/in-memory/drivers/cart/cart.service.d.ts +4 -6
  16. package/driver/in-memory/drivers/cart-address/cart-address.service.d.ts +4 -6
  17. package/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.d.ts +4 -6
  18. package/driver/in-memory/drivers/cart-coupon/cart-coupon.service.d.ts +4 -6
  19. package/driver/in-memory/drivers/cart-item/cart-item.service.d.ts +4 -6
  20. package/driver/in-memory/drivers/cart-order/cart-order.service.d.ts +4 -6
  21. package/driver/in-memory/drivers/cart-payment/cart-payment.service.d.ts +4 -6
  22. package/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.d.ts +4 -6
  23. package/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.d.ts +4 -6
  24. package/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.d.ts +4 -6
  25. package/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.d.ts +4 -6
  26. package/driver/in-memory/injection-tokens/extra-attributes-hook.token.d.ts +1 -20
  27. package/driver/in-memory/public_api.d.ts +1 -0
  28. package/driver/injection-tokens/free-payment-method.d.ts +1 -10
  29. package/driver/injection-tokens/public_api.d.ts +1 -1
  30. package/driver/interfaces/cart-address-service.interface.d.ts +1 -2
  31. package/driver/interfaces/cart-billing-address-service.interface.d.ts +1 -2
  32. package/driver/interfaces/cart-coupon-service.interface.d.ts +1 -2
  33. package/driver/interfaces/cart-item-service.interface.d.ts +1 -2
  34. package/driver/interfaces/cart-order-service.interface.d.ts +1 -2
  35. package/driver/interfaces/cart-payment-methods-service.interface.d.ts +1 -2
  36. package/driver/interfaces/cart-payment-service.interface.d.ts +2 -3
  37. package/driver/interfaces/cart-service.interface.d.ts +2 -3
  38. package/driver/interfaces/cart-shipping-address-service.interface.d.ts +1 -2
  39. package/driver/interfaces/cart-shipping-information-service.interface.d.ts +1 -2
  40. package/driver/interfaces/cart-shipping-methods-service.interface.d.ts +1 -2
  41. package/driver/interfaces/public_api.d.ts +11 -11
  42. package/driver/magento/injection-tokens/cart-mutation-queue.token.d.ts +1 -2
  43. package/driver/magento/injection-tokens/fragments/cart.d.ts +1 -14
  44. package/driver/magento/injection-tokens/public_api.d.ts +3 -3
  45. package/driver/magento/injection-tokens/transforms/cart/token.d.ts +2 -20
  46. package/driver/magento/injection-tokens/transforms/cart-item/token.d.ts +1 -20
  47. package/esm2022/driver/errors/product-not-found.mjs +2 -2
  48. package/esm2022/driver/in-memory/backend/cart/cart.service.mjs +3 -1
  49. package/esm2022/driver/in-memory/backend/cart-address/cart-address.service.mjs +3 -1
  50. package/esm2022/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.mjs +3 -1
  51. package/esm2022/driver/in-memory/backend/cart-coupon/cart-coupon.service.mjs +3 -1
  52. package/esm2022/driver/in-memory/backend/cart-items/cart-items.service.mjs +3 -1
  53. package/esm2022/driver/in-memory/backend/cart-order/cart-order.service.mjs +5 -1
  54. package/esm2022/driver/in-memory/backend/cart-payment/cart-payment.service.mjs +3 -1
  55. package/esm2022/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.mjs +5 -1
  56. package/esm2022/driver/in-memory/backend/cart-root.service.mjs +45 -77
  57. package/esm2022/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.mjs +3 -1
  58. package/esm2022/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +3 -1
  59. package/esm2022/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.mjs +3 -1
  60. package/esm2022/driver/in-memory/collection-names.mjs +12 -0
  61. package/esm2022/driver/in-memory/drivers/cart/cart.service.mjs +10 -9
  62. package/esm2022/driver/in-memory/drivers/cart-address/cart-address.service.mjs +10 -9
  63. package/esm2022/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.mjs +10 -9
  64. package/esm2022/driver/in-memory/drivers/cart-coupon/cart-coupon.service.mjs +10 -9
  65. package/esm2022/driver/in-memory/drivers/cart-driver.module.mjs +16 -46
  66. package/esm2022/driver/in-memory/drivers/cart-item/cart-item.service.mjs +10 -9
  67. package/esm2022/driver/in-memory/drivers/cart-order/cart-order.service.mjs +10 -9
  68. package/esm2022/driver/in-memory/drivers/cart-payment/cart-payment.service.mjs +10 -9
  69. package/esm2022/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.mjs +10 -9
  70. package/esm2022/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.mjs +10 -9
  71. package/esm2022/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.mjs +10 -9
  72. package/esm2022/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.mjs +10 -9
  73. package/esm2022/driver/in-memory/injection-tokens/extra-attributes-hook.token.mjs +8 -5
  74. package/esm2022/driver/in-memory/public_api.mjs +2 -1
  75. package/esm2022/driver/injection-tokens/free-payment-method.mjs +5 -11
  76. package/esm2022/driver/injection-tokens/public_api.mjs +2 -2
  77. package/esm2022/driver/interfaces/cart-address-service.interface.mjs +7 -3
  78. package/esm2022/driver/interfaces/cart-billing-address-service.interface.mjs +7 -3
  79. package/esm2022/driver/interfaces/cart-coupon-service.interface.mjs +7 -3
  80. package/esm2022/driver/interfaces/cart-item-service.interface.mjs +7 -3
  81. package/esm2022/driver/interfaces/cart-order-service.interface.mjs +7 -3
  82. package/esm2022/driver/interfaces/cart-payment-methods-service.interface.mjs +7 -3
  83. package/esm2022/driver/interfaces/cart-payment-service.interface.mjs +7 -3
  84. package/esm2022/driver/interfaces/cart-service.interface.mjs +7 -3
  85. package/esm2022/driver/interfaces/cart-shipping-address-service.interface.mjs +7 -3
  86. package/esm2022/driver/interfaces/cart-shipping-information-service.interface.mjs +7 -3
  87. package/esm2022/driver/interfaces/cart-shipping-methods-service.interface.mjs +7 -3
  88. package/esm2022/driver/interfaces/public_api.mjs +12 -12
  89. package/esm2022/driver/magento/cart-driver.module.mjs +13 -46
  90. package/esm2022/driver/magento/injection-tokens/cart-mutation-queue.token.mjs +8 -3
  91. package/esm2022/driver/magento/injection-tokens/fragments/cart.mjs +8 -3
  92. package/esm2022/driver/magento/injection-tokens/public_api.mjs +4 -4
  93. package/esm2022/driver/magento/injection-tokens/transforms/cart/token.mjs +6 -11
  94. package/esm2022/driver/magento/injection-tokens/transforms/cart-item/token.mjs +6 -11
  95. package/esm2022/driver/testing/drivers/cart-driver.module.mjs +13 -46
  96. package/esm2022/injection-tokens/payment-method-map.mjs +8 -5
  97. package/esm2022/models/cart-coupon.mjs +1 -1
  98. package/esm2022/models/cart-item.mjs +1 -1
  99. package/esm2022/models/cart-order-result.mjs +1 -1
  100. package/esm2022/models/cart.mjs +1 -1
  101. package/esm2022/models/composite-cart-item.mjs +1 -1
  102. package/esm2022/routing/cart-routing.module.mjs +3 -9
  103. package/esm2022/routing/config/config.mjs +7 -6
  104. package/esm2022/routing/guards/billing-address/billing-address-guard-redirect.token.mjs +7 -3
  105. package/esm2022/routing/guards/cart-items/cart-items-guard-redirect.token.mjs +8 -3
  106. package/esm2022/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.mjs +8 -3
  107. package/esm2022/routing/guards/order-result/order-result-guard-redirect.token.mjs +7 -3
  108. package/esm2022/routing/guards/payment-method/payment-method-guard-redirect.token.mjs +7 -3
  109. package/esm2022/routing/guards/resolve-cart/redirect.token.mjs +7 -3
  110. package/esm2022/routing/guards/shipping-address/shipping-address-guard-redirect.token.mjs +7 -3
  111. package/esm2022/routing/guards/shipping-method/shipping-method-guard-redirect.token.mjs +7 -3
  112. package/esm2022/routing/resolvers/tokens/cart-resolver-redirect.token.mjs +7 -3
  113. package/esm2022/routing/resolvers/tokens/empty-cart-resolver-redirect.token.mjs +7 -3
  114. package/esm2022/state/cart-retrieval/token.mjs +5 -8
  115. package/esm2022/state/cart-state.module.mjs +4 -4
  116. package/esm2022/state/injection-tokens/cart-item-state-debounce-time.mjs +8 -3
  117. package/esm2022/state/injection-tokens/error-matcher.token.mjs +8 -3
  118. package/esm2022/state/injection-tokens/public_api.mjs +3 -3
  119. package/esm2022/state/reducers/token/config.token.mjs +8 -3
  120. package/esm2022/state/reducers/token/extra.token.mjs +5 -10
  121. package/esm2022/state/reducers/token/meta.token.mjs +5 -10
  122. package/esm2022/state/reducers/token/reducers.token.mjs +9 -3
  123. package/fesm2022/daffodil-cart-driver-in-memory.mjs +178 -244
  124. package/fesm2022/daffodil-cart-driver-in-memory.mjs.map +1 -1
  125. package/fesm2022/daffodil-cart-driver-magento.mjs +34 -68
  126. package/fesm2022/daffodil-cart-driver-magento.mjs.map +1 -1
  127. package/fesm2022/daffodil-cart-driver-testing.mjs +12 -45
  128. package/fesm2022/daffodil-cart-driver-testing.mjs.map +1 -1
  129. package/fesm2022/daffodil-cart-driver.mjs +62 -24
  130. package/fesm2022/daffodil-cart-driver.mjs.map +1 -1
  131. package/fesm2022/daffodil-cart-routing.mjs +60 -22
  132. package/fesm2022/daffodil-cart-routing.mjs.map +1 -1
  133. package/fesm2022/daffodil-cart-state.mjs +37 -31
  134. package/fesm2022/daffodil-cart-state.mjs.map +1 -1
  135. package/fesm2022/daffodil-cart.mjs +9 -6
  136. package/fesm2022/daffodil-cart.mjs.map +1 -1
  137. package/injection-tokens/payment-method-map.d.ts +6 -9
  138. package/models/cart-coupon.d.ts +1 -1
  139. package/models/cart-item.d.ts +1 -1
  140. package/models/cart-order-result.d.ts +1 -1
  141. package/models/cart.d.ts +2 -2
  142. package/models/composite-cart-item.d.ts +1 -1
  143. package/package.json +1 -1
  144. package/routing/config/config.d.ts +1 -2
  145. package/routing/guards/billing-address/billing-address-guard-redirect.token.d.ts +1 -2
  146. package/routing/guards/cart-items/cart-items-guard-redirect.token.d.ts +1 -5
  147. package/routing/guards/in-stock-items/in-stock-items-guard-redirect.token.d.ts +1 -5
  148. package/routing/guards/order-result/order-result-guard-redirect.token.d.ts +1 -2
  149. package/routing/guards/payment-method/payment-method-guard-redirect.token.d.ts +1 -2
  150. package/routing/guards/resolve-cart/redirect.token.d.ts +1 -2
  151. package/routing/guards/shipping-address/shipping-address-guard-redirect.token.d.ts +1 -2
  152. package/routing/guards/shipping-method/shipping-method-guard-redirect.token.d.ts +1 -2
  153. package/routing/resolvers/tokens/cart-resolver-redirect.token.d.ts +1 -2
  154. package/routing/resolvers/tokens/empty-cart-resolver-redirect.token.d.ts +1 -2
  155. package/state/cart-retrieval/token.d.ts +1 -9
  156. package/state/injection-tokens/cart-item-state-debounce-time.d.ts +1 -8
  157. package/state/injection-tokens/error-matcher.token.d.ts +1 -6
  158. package/state/injection-tokens/public_api.d.ts +2 -2
  159. package/state/reducers/token/config.token.d.ts +1 -2
  160. package/state/reducers/token/extra.token.d.ts +1 -21
  161. package/state/reducers/token/meta.token.d.ts +1 -20
  162. package/state/reducers/token/reducers.token.d.ts +1 -8
@@ -3,7 +3,7 @@ import { DaffError, DaffInheritableError } from '@daffodil/core';
3
3
  * An error thrown when an add to cart request is sent
4
4
  * for a product that cannot be found.
5
5
  *
6
- * @deprecated Use the `DaffProductNotFoundError` from `@daffodil/product/driver` instead.
6
+ * @deprecated Use the `DaffProductNotFoundError` from `@daffodil/product/driver` instead. Deprecated in version 0.78.0. Will be removed in version 0.81.0.
7
7
  */
8
8
  export declare class DaffProductNotFoundError extends DaffInheritableError implements DaffError {
9
9
  readonly code: string;
@@ -1,16 +1,17 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
2
  import { DaffCartFactory } from '@daffodil/cart/testing';
3
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
3
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
4
4
  import { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';
5
5
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * @inheritdoc
9
9
  */
10
- export declare class DaffInMemoryBackendCartService implements DaffInMemoryDataServiceInterface {
10
+ export declare class DaffInMemoryBackendCartService implements DaffInMemorySingleRouteableBackend {
11
11
  private cartFactory;
12
12
  private extraFieldsHook;
13
13
  private productBackend;
14
+ readonly collectionName = "cart";
14
15
  constructor(cartFactory: DaffCartFactory, extraFieldsHook: DaffCartInMemoryExtraAttributesHook, productBackend: DaffInMemoryBackendProductService);
15
16
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
16
17
  post(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartAddressService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartAddressService implements DaffInMemorySingleRouteableBackend {
9
9
  private extraFieldsHook;
10
+ readonly collectionName = "cart-address";
10
11
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook);
11
12
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  private getCart;
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartBillingAddressService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartBillingAddressService implements DaffInMemorySingleRouteableBackend {
9
9
  private extraFieldsHook;
10
+ readonly collectionName = "cart-billing-address";
10
11
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook);
11
12
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartCouponService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartCouponService implements DaffInMemorySingleRouteableBackend {
9
9
  private extraFieldsHook;
10
+ readonly collectionName = "cart-coupon";
10
11
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook);
11
12
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  post(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,16 +1,17 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
2
  import { DaffCartItemFactory } from '@daffodil/cart/testing';
3
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
3
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
4
4
  import { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';
5
5
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * @inheritdoc
9
9
  */
10
- export declare class DaffInMemoryBackendCartItemsService implements DaffInMemoryDataServiceInterface {
10
+ export declare class DaffInMemoryBackendCartItemsService implements DaffInMemorySingleRouteableBackend {
11
11
  private cartItemFactory;
12
12
  private extraFieldsHook;
13
13
  private productBackend;
14
+ readonly collectionName = "cart-items";
14
15
  constructor(cartItemFactory: DaffCartItemFactory, extraFieldsHook: DaffCartInMemoryExtraAttributesHook, productBackend: DaffInMemoryBackendProductService);
15
16
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
16
17
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,10 +1,11 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * @inheritdoc
6
6
  */
7
- export declare class DaffInMemoryBackendCartOrderService implements DaffInMemoryDataServiceInterface {
7
+ export declare class DaffInMemoryBackendCartOrderService implements DaffInMemorySingleRouteableBackend {
8
+ readonly collectionName = "cart-order";
8
9
  post(reqInfo: RequestInfo): import("rxjs").Observable<any>;
9
10
  private placeOrder;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendCartOrderService, never>;
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartPaymentService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartPaymentService implements DaffInMemorySingleRouteableBackend {
9
9
  private extraFieldsHook;
10
+ readonly collectionName = "cart-payment";
10
11
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook);
11
12
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,10 +1,11 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * @inheritdoc
6
6
  */
7
- export declare class DaffInMemoryBackendCartPaymentMethodsService implements DaffInMemoryDataServiceInterface {
7
+ export declare class DaffInMemoryBackendCartPaymentMethodsService implements DaffInMemorySingleRouteableBackend {
8
+ readonly collectionName = "cart-payment-methods";
8
9
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
9
10
  private getCart;
10
11
  private listPaymentMethods;
@@ -1,6 +1,7 @@
1
1
  import { InMemoryDbService, RequestInfo } from 'angular-in-memory-web-api';
2
+ import { Observable } from 'rxjs';
2
3
  import { DaffCart } from '@daffodil/cart';
3
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
4
+ import { DaffInMemoryBackendDelegate, DaffInMemoryMultiRouteableBackend } from '@daffodil/driver/in-memory';
4
5
  import { DaffInMemoryBackendCartService } from './cart/cart.service';
5
6
  import { DaffInMemoryBackendCartAddressService } from './cart-address/cart-address.service';
6
7
  import { DaffInMemoryBackendCartBillingAddressService } from './cart-billing-address/cart-billing-address.service';
@@ -17,36 +18,17 @@ import * as i0 from "@angular/core";
17
18
  * The root cart in-memory backend.
18
19
  * Creates the database and delegates requests to child backends.
19
20
  */
20
- export declare class DaffInMemoryBackendCartRootService implements InMemoryDbService, DaffInMemoryDataServiceInterface {
21
- private cartService;
22
- private cartItemsService;
23
- private cartOrderService;
24
- private cartCouponService;
25
- private cartAddressService;
26
- private cartShippingAddressService;
27
- private cartBillingAddressService;
28
- private cartPaymentMethodsService;
29
- private cartShippingMethodsService;
30
- private cartPaymentService;
31
- private cartShippingInformationService;
32
- /**
33
- * The collections that the root service manages.
34
- * Useful for a higher-level backend that delegates to this one based on collection name.
35
- */
36
- static readonly COLLECTION_NAMES: string[];
21
+ export declare class DaffInMemoryBackendCartRootService extends DaffInMemoryBackendDelegate implements InMemoryDbService, DaffInMemoryMultiRouteableBackend {
37
22
  /**
38
23
  * The collection of carts in the backend.
39
24
  */
40
25
  carts: DaffCart[];
41
26
  constructor(cartService: DaffInMemoryBackendCartService, cartItemsService: DaffInMemoryBackendCartItemsService, cartOrderService: DaffInMemoryBackendCartOrderService, cartCouponService: DaffInMemoryBackendCartCouponService, cartAddressService: DaffInMemoryBackendCartAddressService, cartShippingAddressService: DaffInMemoryBackendCartShippingAddressService, cartBillingAddressService: DaffInMemoryBackendCartBillingAddressService, cartPaymentMethodsService: DaffInMemoryBackendCartPaymentMethodsService, cartShippingMethodsService: DaffInMemoryBackendCartShippingMethodsService, cartPaymentService: DaffInMemoryBackendCartPaymentService, cartShippingInformationService: DaffInMemoryBackendCartShippingInformationService);
42
- createDb(reqInfo: RequestInfo): {
27
+ protected delegateRequest(reqInfo: RequestInfo, method: any): Observable<any>;
28
+ canHandle(collectionName: string): boolean;
29
+ createDb(reqInfo: RequestInfo): Observable<{
43
30
  cart: DaffCart[];
44
- };
45
- get(reqInfo: RequestInfo): any;
46
- post(reqInfo: RequestInfo): any;
47
- put(reqInfo: RequestInfo): any;
48
- delete(reqInfo: RequestInfo): any;
49
- private delegateRequest;
31
+ }>;
50
32
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendCartRootService, never>;
51
33
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryBackendCartRootService>;
52
34
  }
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartShippingAddressService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartShippingAddressService implements DaffInMemorySingleRouteableBackend {
9
9
  private extraFieldsHook;
10
+ readonly collectionName = "cart-shipping-address";
10
11
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook);
11
12
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,14 +1,15 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
2
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
3
3
  import { DaffInMemoryBackendProductService } from '@daffodil/product/driver/in-memory';
4
4
  import { DaffCartInMemoryExtraAttributesHook } from '../../injection-tokens/public_api';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * @inheritdoc
8
8
  */
9
- export declare class DaffInMemoryBackendCartShippingInformationService implements DaffInMemoryDataServiceInterface {
9
+ export declare class DaffInMemoryBackendCartShippingInformationService implements DaffInMemorySingleRouteableBackend {
10
10
  private extraFieldsHook;
11
11
  private productBackend;
12
+ readonly collectionName = "cart-shipping-information";
12
13
  constructor(extraFieldsHook: DaffCartInMemoryExtraAttributesHook, productBackend: DaffInMemoryBackendProductService);
13
14
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
14
15
  put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
@@ -1,12 +1,13 @@
1
1
  import { RequestInfo } from 'angular-in-memory-web-api';
2
2
  import { DaffCartShippingRateFactory } from '@daffodil/cart/testing';
3
- import { DaffInMemoryDataServiceInterface } from '@daffodil/core/testing';
3
+ import { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * @inheritdoc
7
7
  */
8
- export declare class DaffInMemoryBackendCartShippingMethodsService implements DaffInMemoryDataServiceInterface {
8
+ export declare class DaffInMemoryBackendCartShippingMethodsService implements DaffInMemorySingleRouteableBackend {
9
9
  private shippingMethodFactory;
10
+ readonly collectionName = "cart-shipping-methods";
10
11
  constructor(shippingMethodFactory: DaffCartShippingRateFactory);
11
12
  get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
12
13
  private getCart;
@@ -0,0 +1,11 @@
1
+ export declare const DAFF_CART_IN_MEMORY_CART_COLLECTION_NAME = "cart";
2
+ export declare const DAFF_CART_IN_MEMORY_CART_ITEMS_COLLECTION_NAME = "cart-items";
3
+ export declare const DAFF_CART_IN_MEMORY_CART_ORDER_COLLECTION_NAME = "cart-order";
4
+ export declare const DAFF_CART_IN_MEMORY_CART_COUPON_COLLECTION_NAME = "cart-coupon";
5
+ export declare const DAFF_CART_IN_MEMORY_CART_ADDRESS_COLLECTION_NAME = "cart-address";
6
+ export declare const DAFF_CART_IN_MEMORY_CART_SHIPPING_ADDRESS_COLLECTION_NAME = "cart-shipping-address";
7
+ export declare const DAFF_CART_IN_MEMORY_CART_BILLING_ADDRESS_COLLECTION_NAME = "cart-billing-address";
8
+ export declare const DAFF_CART_IN_MEMORY_CART_PAYMENT_METHODS_COLLECTION_NAME = "cart-payment-methods";
9
+ export declare const DAFF_CART_IN_MEMORY_CART_SHIPPING_METHODS_COLLECTION_NAME = "cart-shipping-methods";
10
+ export declare const DAFF_CART_IN_MEMORY_CART_PAYMENT_COLLECTION_NAME = "cart-payment";
11
+ export declare const DAFF_CART_IN_MEMORY_CART_SHIPPING_COLLECTION_NAME = "cart-shipping-information";
@@ -1,19 +1,17 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartServiceInterface } from '@daffodil/cart/driver';
5
6
  import { DaffDriverResponse } from '@daffodil/driver';
7
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
6
8
  import * as i0 from "@angular/core";
7
9
  /**
8
10
  * @inheritdoc
9
11
  */
10
- export declare class DaffInMemoryCartService implements DaffCartServiceInterface {
12
+ export declare class DaffInMemoryCartService extends DaffInMemoryDriverBase implements DaffCartServiceInterface {
11
13
  private http;
12
- /**
13
- * The URL with which the driver makes calls to the backend.
14
- */
15
- readonly url = "/api/cart";
16
- constructor(http: HttpClient);
14
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
17
15
  get(cartId: DaffCart['id']): Observable<DaffDriverResponse<DaffCart>>;
18
16
  addToCart(productId: string, qty: number): Observable<DaffCart>;
19
17
  clear(cartId: DaffCart['id']): Observable<Partial<DaffCart>>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCart, DaffCartAddress } from '@daffodil/cart';
4
5
  import { DaffCartAddressServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartAddressService implements DaffCartAddressServiceInterface {
11
+ export declare class DaffInMemoryCartAddressService extends DaffInMemoryDriverBase implements DaffCartAddressServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-address";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  update(cartId: DaffCart['id'], address: DaffCartAddress): Observable<Partial<DaffCart>>;
17
15
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartAddressService, never>;
18
16
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryCartAddressService>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartAddress, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartBillingAddressServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartBillingAddressService implements DaffCartBillingAddressServiceInterface {
11
+ export declare class DaffInMemoryCartBillingAddressService extends DaffInMemoryDriverBase implements DaffCartBillingAddressServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-billing-address";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  get(cartId: DaffCart['id']): Observable<DaffCartAddress>;
17
15
  update(cartId: DaffCart['id'], address: DaffCartAddress): Observable<Partial<DaffCart>>;
18
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartBillingAddressService, never>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCart, DaffCartCoupon } from '@daffodil/cart';
4
5
  import { DaffCartCouponServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartCouponService implements DaffCartCouponServiceInterface {
11
+ export declare class DaffInMemoryCartCouponService extends DaffInMemoryDriverBase implements DaffCartCouponServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-coupon";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  list(cartId: DaffCart['id']): Observable<DaffCartCoupon[]>;
17
15
  apply(cartId: DaffCart['id'], coupon: DaffCartCoupon): Observable<Partial<DaffCart>>;
18
16
  remove(cartId: DaffCart['id'], coupon: DaffCartCoupon): Observable<Partial<DaffCart>>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartItem, DaffCartItemInput, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartItemServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartItemService implements DaffCartItemServiceInterface {
11
+ export declare class DaffInMemoryCartItemService extends DaffInMemoryDriverBase implements DaffCartItemServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-items";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  list(cartId: DaffCart['id']): Observable<DaffCartItem[]>;
17
15
  get(cartId: DaffCart['id'], itemId: DaffCartItem['id']): Observable<DaffCartItem>;
18
16
  add(cartId: DaffCart['id'], input: DaffCartItemInput): Observable<Partial<DaffCart>>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCart, DaffCartPaymentMethod, DaffCartOrderResult } from '@daffodil/cart';
4
5
  import { DaffCartOrderServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartOrderService implements DaffCartOrderServiceInterface {
11
+ export declare class DaffInMemoryCartOrderService extends DaffInMemoryDriverBase implements DaffCartOrderServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-order";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  placeOrder(cartId: DaffCart['id'], payment?: DaffCartPaymentMethod): Observable<DaffCartOrderResult>;
17
15
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartOrderService, never>;
18
16
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryCartOrderService>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCart, DaffCartPaymentMethod, DaffCartAddress } from '@daffodil/cart';
4
5
  import { DaffCartPaymentServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartPaymentService implements DaffCartPaymentServiceInterface {
11
+ export declare class DaffInMemoryCartPaymentService extends DaffInMemoryDriverBase implements DaffCartPaymentServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-payment";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  get(cartId: DaffCart['id']): Observable<DaffCartPaymentMethod>;
17
15
  update(cartId: DaffCart['id'], payment: Partial<DaffCartPaymentMethod>): Observable<Partial<DaffCart>>;
18
16
  updateWithBilling(cartId: DaffCart['id'], payment: Partial<DaffCartPaymentMethod>, address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartPaymentMethod, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartPaymentMethodsServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartPaymentMethodsService implements DaffCartPaymentMethodsServiceInterface<DaffCartPaymentMethod> {
11
+ export declare class DaffInMemoryCartPaymentMethodsService extends DaffInMemoryDriverBase implements DaffCartPaymentMethodsServiceInterface<DaffCartPaymentMethod> {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-payment-methods";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  list(cartId: DaffCart['id']): Observable<DaffCartPaymentMethod[]>;
17
15
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartPaymentMethodsService, never>;
18
16
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryCartPaymentMethodsService>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartAddress, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartShippingAddressServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartShippingAddressService implements DaffCartShippingAddressServiceInterface {
11
+ export declare class DaffInMemoryCartShippingAddressService extends DaffInMemoryDriverBase implements DaffCartShippingAddressServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-shipping-address";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  get(cartId: DaffCart['id']): Observable<DaffCartAddress>;
17
15
  update(cartId: DaffCart['id'], address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
18
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartShippingAddressService, never>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartShippingRate, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartShippingInformationServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartShippingInformationService implements DaffCartShippingInformationServiceInterface {
11
+ export declare class DaffInMemoryCartShippingInformationService extends DaffInMemoryDriverBase implements DaffCartShippingInformationServiceInterface {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-shipping-information";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  get(cartId: DaffCart['id']): Observable<DaffCartShippingRate>;
17
15
  update(cartId: DaffCart['id'], info: Partial<DaffCartShippingRate>): Observable<Partial<DaffCart>>;
18
16
  delete(cartId: DaffCart['id']): Observable<Partial<DaffCart>>;
@@ -1,18 +1,16 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { InMemoryBackendConfig } from 'angular-in-memory-web-api';
2
3
  import { Observable } from 'rxjs';
3
4
  import { DaffCartShippingRate, DaffCart } from '@daffodil/cart';
4
5
  import { DaffCartShippingMethodsServiceInterface } from '@daffodil/cart/driver';
6
+ import { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';
5
7
  import * as i0 from "@angular/core";
6
8
  /**
7
9
  * @inheritdoc
8
10
  */
9
- export declare class DaffInMemoryCartShippingMethodsService implements DaffCartShippingMethodsServiceInterface<DaffCartShippingRate> {
11
+ export declare class DaffInMemoryCartShippingMethodsService extends DaffInMemoryDriverBase implements DaffCartShippingMethodsServiceInterface<DaffCartShippingRate> {
10
12
  private http;
11
- /**
12
- * The URL with which the driver makes calls to the backend.
13
- */
14
- readonly url = "/api/cart-shipping-methods";
15
- constructor(http: HttpClient);
13
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
16
14
  list(cartId: DaffCart['id']): Observable<DaffCartShippingRate[]>;
17
15
  static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryCartShippingMethodsService, never>;
18
16
  static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryCartShippingMethodsService>;
@@ -1,23 +1,4 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  import { RequestInfo } from 'angular-in-memory-web-api';
3
2
  import { DaffCart } from '@daffodil/cart';
4
3
  export type DaffCartInMemoryExtraAttributesHook = (reqInfo: RequestInfo, cart: DaffCart) => Record<string, any>;
5
- /**
6
- * Allows an app dev to generate extra fields in the in-memory backend.
7
- * This enables the in-memory drivers to return responses similar to what the
8
- * frontend would expect from the production platform.
9
- *
10
- * The value returned by the hook function will be set to the returned cart's `extra_attributes` field
11
- * for driver calls that return a cart.
12
- *
13
- * The following example demonstrates adding the `numberOfCartItems` field to `extra_attributes`:
14
- * ```ts
15
- * (reqInfo: RequestInfo, cart: DaffCart) => ({
16
- * numberOfCartItems: cart.items.length
17
- * })
18
- * ```
19
- *
20
- * Note that this and any `extra_attributes` features are for advanced users
21
- * and should be used with care.
22
- */
23
- export declare const DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK: InjectionToken<DaffCartInMemoryExtraAttributesHook>;
4
+ export declare const DAFF_CART_IN_MEMORY_EXTRA_ATTRIBUTES_HOOK: import("@angular/core").InjectionToken<DaffCartInMemoryExtraAttributesHook>, provideDaffCartInMemoryExtraAttributesHook: <R extends DaffCartInMemoryExtraAttributesHook = DaffCartInMemoryExtraAttributesHook>(value: R) => import("@angular/core").ValueProvider;
@@ -1,3 +1,4 @@
1
1
  export * from './drivers/public_api';
2
2
  export * from './backend/public_api';
3
3
  export * from './injection-tokens/public_api';
4
+ export * from './collection-names';
@@ -1,11 +1,2 @@
1
- import { InjectionToken, ValueProvider } from '@angular/core';
2
1
  import { DaffCartPaymentMethod } from '@daffodil/cart';
3
- /**
4
- * The payment method payload that correspondes to the free payment method.
5
- * This will be different per-platform and can be passed into the update driver call.
6
- */
7
- export declare const DAFF_CART_DRIVER_FREE_PAYMENT_METHOD: InjectionToken<Partial<DaffCartPaymentMethod>>;
8
- /**
9
- * Provides the {@link DAFF_CART_DRIVER_FREE_PAYMENT_METHOD} injection token.
10
- */
11
- export declare function daffCartDriverProvideFreePaymentMethod(method: Partial<DaffCartPaymentMethod>): ValueProvider;
2
+ export declare const DAFF_CART_DRIVER_FREE_PAYMENT_METHOD: import("@angular/core").InjectionToken<Partial<DaffCartPaymentMethod>>, daffCartDriverProvideFreePaymentMethod: <R extends Partial<DaffCartPaymentMethod> = Partial<DaffCartPaymentMethod>>(value: R) => import("@angular/core").ValueProvider;
@@ -1 +1 @@
1
- export { daffCartDriverProvideFreePaymentMethod, DAFF_CART_DRIVER_FREE_PAYMENT_METHOD, } from './free-payment-method';
1
+ export * from './free-payment-method';
@@ -1,4 +1,3 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  import { Observable } from 'rxjs';
3
2
  import { DaffCart } from '@daffodil/cart';
4
3
  /**
@@ -10,4 +9,4 @@ export interface DaffCartAddressServiceInterface<T extends DaffCart = DaffCart>
10
9
  */
11
10
  update(cartId: T['id'], address: Partial<T['shipping_address'] | T['billing_address']>): Observable<Partial<T>>;
12
11
  }
13
- export declare const DaffCartAddressDriver: InjectionToken<DaffCartAddressServiceInterface<DaffCart>>;
12
+ export declare const DaffCartAddressDriver: import("@angular/core").InjectionToken<DaffCartAddressServiceInterface<DaffCart>>, provideDaffCartAddressDriver: <R extends DaffCartAddressServiceInterface<DaffCart> = DaffCartAddressServiceInterface<DaffCart>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
@@ -1,4 +1,3 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  import { Observable } from 'rxjs';
3
2
  import { DaffCart } from '@daffodil/cart';
4
3
  /**
@@ -14,4 +13,4 @@ export interface DaffCartBillingAddressServiceInterface<T extends DaffCart = Daf
14
13
  */
15
14
  update(cartId: T['id'], address: Partial<T['billing_address']>): Observable<Partial<T>>;
16
15
  }
17
- export declare const DaffCartBillingAddressDriver: InjectionToken<DaffCartBillingAddressServiceInterface<DaffCart>>;
16
+ export declare const DaffCartBillingAddressDriver: import("@angular/core").InjectionToken<DaffCartBillingAddressServiceInterface<DaffCart>>, provideDaffCartBillingAddressDriver: <R extends DaffCartBillingAddressServiceInterface<DaffCart> = DaffCartBillingAddressServiceInterface<DaffCart>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
@@ -1,4 +1,3 @@
1
- import { InjectionToken } from '@angular/core';
2
1
  import { Observable } from 'rxjs';
3
2
  import { DaffCart } from '@daffodil/cart';
4
3
  /**
@@ -22,4 +21,4 @@ export interface DaffCartCouponServiceInterface<T extends DaffCart = DaffCart> {
22
21
  */
23
22
  removeAll(cartId: T['id']): Observable<Partial<T>>;
24
23
  }
25
- export declare const DaffCartCouponDriver: InjectionToken<DaffCartCouponServiceInterface<DaffCart>>;
24
+ export declare const DaffCartCouponDriver: import("@angular/core").InjectionToken<DaffCartCouponServiceInterface<DaffCart>>, provideDaffCartCouponDriver: <R extends DaffCartCouponServiceInterface<DaffCart> = DaffCartCouponServiceInterface<DaffCart>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;