@daffodil/cart 0.64.1 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/in-memory/backend/cart/cart.service.d.ts +3 -1
- package/driver/in-memory/backend/cart-items/cart-items.service.d.ts +3 -1
- package/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.d.ts +3 -1
- package/driver/in-memory/helpers/compute-cart-item-prices.d.ts +3 -0
- package/driver/in-memory/helpers/compute-cart-totals.d.ts +3 -0
- package/driver/magento/models/responses/cart.d.ts +1 -1
- package/esm2020/driver/in-memory/backend/cart/cart.service.mjs +9 -5
- package/esm2020/driver/in-memory/backend/cart-items/cart-items.service.mjs +21 -16
- package/esm2020/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.mjs +10 -6
- package/esm2020/driver/in-memory/helpers/compute-cart-item-prices.mjs +7 -0
- package/esm2020/driver/in-memory/helpers/compute-cart-totals.mjs +46 -0
- package/esm2020/driver/magento/models/responses/cart.mjs +1 -1
- package/esm2020/driver/magento/transforms/outputs/cart-totals-transformer.mjs +23 -18
- package/esm2020/injection-tokens/public_api.mjs +1 -2
- package/esm2020/models/cart-total.mjs +1 -1
- package/esm2020/models/cart.mjs +1 -1
- package/esm2020/state/actions/cart-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-billing-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-coupon.actions.mjs +1 -1
- package/esm2020/state/actions/cart-item.actions.mjs +1 -1
- package/esm2020/state/actions/cart-order.actions.mjs +1 -1
- package/esm2020/state/actions/cart-payment-methods.actions.mjs +1 -1
- package/esm2020/state/actions/cart-payment.actions.mjs +1 -1
- package/esm2020/state/actions/cart-retrieval.mjs +71 -0
- package/esm2020/state/actions/cart-shipping-address.actions.mjs +1 -1
- package/esm2020/state/actions/cart-shipping-information.actions.mjs +1 -1
- package/esm2020/state/actions/cart-shipping-methods.actions.mjs +1 -1
- package/esm2020/state/actions/cart.actions.mjs +1 -1
- package/esm2020/state/actions/public_api.mjs +2 -1
- package/esm2020/state/cart-retrieval/get-response.mjs +12 -0
- package/esm2020/state/cart-retrieval/public_api.mjs +4 -0
- package/esm2020/state/cart-retrieval/token.mjs +14 -0
- package/esm2020/state/cart-retrieval/type.mjs +2 -0
- package/esm2020/state/cart-state.module.mjs +8 -3
- package/esm2020/state/effects/cart-address.effects.mjs +8 -7
- package/esm2020/state/effects/cart-billing-address.effects.mjs +7 -5
- package/esm2020/state/effects/cart-coupon.effects.mjs +17 -16
- package/esm2020/state/effects/cart-item.effects.mjs +12 -10
- package/esm2020/state/effects/cart-order.effects.mjs +8 -7
- package/esm2020/state/effects/cart-payment-methods.effects.mjs +6 -4
- package/esm2020/state/effects/cart-payment-processor.effects.mjs +7 -6
- package/esm2020/state/effects/cart-payment.effects.mjs +9 -7
- package/esm2020/state/effects/cart-resolver.effects.mjs +20 -15
- package/esm2020/state/effects/cart-shipping-address.effects.mjs +7 -5
- package/esm2020/state/effects/cart-shipping-information.effects.mjs +8 -6
- package/esm2020/state/effects/cart-shipping-methods.effects.mjs +6 -4
- package/esm2020/state/effects/cart.effects.mjs +16 -15
- package/esm2020/state/injection-tokens/error-matcher.token.mjs +8 -0
- package/esm2020/state/injection-tokens/public_api.mjs +2 -1
- package/esm2020/state/models/public_api.mjs +2 -1
- package/esm2020/state/models/stateful-cart.mjs +2 -0
- package/esm2020/state/public_api.mjs +2 -1
- package/esm2020/state/reducers/cart/cart.reducer.mjs +3 -16
- package/esm2020/state/reducers/cart/retrieval-actions.reducer.mjs +21 -0
- package/esm2020/state/reducers/cart-billing-address/cart-billing-address.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-coupon/cart-coupon.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-item/cart-item.reducer.mjs +2 -10
- package/esm2020/state/reducers/cart-item-entities/cart-item-entities.reducer.mjs +2 -35
- package/esm2020/state/reducers/cart-item-entities/retrieval-actions.reducer.mjs +20 -0
- package/esm2020/state/reducers/cart-item-entities/set-state.meta-reducer.mjs +46 -0
- package/esm2020/state/reducers/cart-order/cart-order.reducer.mjs +2 -5
- package/esm2020/state/reducers/cart-payment/cart-payment.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-payment/payment.reducer.mjs +2 -2
- package/esm2020/state/reducers/cart-payment-methods/cart-payment-methods.reducer.mjs +2 -2
- package/esm2020/state/reducers/cart-shipping-address/cart-shipping-address.reducer.mjs +2 -6
- package/esm2020/state/reducers/cart-shipping-information/cart-shipping-information.reducer.mjs +2 -8
- package/esm2020/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.mjs +2 -2
- package/esm2020/state/reducers/public_api.mjs +3 -1
- package/esm2020/state/reducers/token/config.token.mjs +18 -0
- package/esm2020/state/reducers/token/meta.token.mjs +27 -0
- package/esm2020/state/reducers/token/public_api.mjs +2 -1
- package/esm2020/state/reducers/token/reducers.token.mjs +20 -6
- package/esm2020/state/selectors/cart/cart.selector.mjs +11 -11
- package/esm2020/state/testing/cart-testing.module.mjs +6 -6
- package/esm2020/state/testing/mock-cart-facade.mjs +2 -2
- package/esm2020/state/testing/public_api.mjs +2 -2
- package/esm2020/testing/factories/cart-shipping-information.factory.mjs +25 -0
- package/esm2020/testing/factories/cart-total.factory.mjs +97 -0
- package/esm2020/testing/factories/cart.factory.mjs +14 -50
- package/esm2020/testing/factories/public_api.mjs +3 -1
- package/fesm2015/daffodil-cart-driver-in-memory.mjs +44 -18
- package/fesm2015/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-cart-driver-magento.mjs +22 -17
- package/fesm2015/daffodil-cart-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-cart-state-testing.mjs +7 -7
- package/fesm2015/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2015/daffodil-cart-state.mjs +326 -141
- package/fesm2015/daffodil-cart-state.mjs.map +1 -1
- package/fesm2015/daffodil-cart-testing.mjs +148 -75
- package/fesm2015/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2015/daffodil-cart.mjs +1 -8
- package/fesm2015/daffodil-cart.mjs.map +1 -1
- package/fesm2020/daffodil-cart-driver-in-memory.mjs +81 -24
- package/fesm2020/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-cart-driver-magento.mjs +22 -17
- package/fesm2020/daffodil-cart-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-cart-state-testing.mjs +7 -7
- package/fesm2020/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2020/daffodil-cart-state.mjs +330 -178
- package/fesm2020/daffodil-cart-state.mjs.map +1 -1
- package/fesm2020/daffodil-cart-testing.mjs +148 -75
- package/fesm2020/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2020/daffodil-cart.mjs +1 -8
- package/fesm2020/daffodil-cart.mjs.map +1 -1
- package/injection-tokens/public_api.d.ts +0 -1
- package/models/cart-total.d.ts +4 -0
- package/models/cart.d.ts +1 -1
- package/package.json +1 -1
- package/state/actions/cart-address.actions.d.ts +6 -5
- package/state/actions/cart-billing-address.actions.d.ts +9 -8
- package/state/actions/cart-coupon.actions.d.ts +17 -16
- package/state/actions/cart-item.actions.d.ts +18 -17
- package/state/actions/cart-order.actions.d.ts +4 -4
- package/state/actions/cart-payment-methods.actions.d.ts +4 -4
- package/state/actions/cart-payment.actions.d.ts +16 -15
- package/state/actions/cart-retrieval.d.ts +5 -0
- package/state/actions/cart-shipping-address.actions.d.ts +9 -8
- package/state/actions/cart-shipping-information.actions.d.ts +13 -12
- package/state/actions/cart-shipping-methods.actions.d.ts +4 -4
- package/state/actions/cart.actions.d.ts +25 -28
- package/state/actions/public_api.d.ts +1 -0
- package/state/cart-retrieval/get-response.d.ts +8 -0
- package/state/cart-retrieval/public_api.d.ts +3 -0
- package/state/cart-retrieval/token.d.ts +10 -0
- package/state/cart-retrieval/type.d.ts +40 -0
- package/state/effects/cart-address.effects.d.ts +2 -16
- package/state/effects/cart-billing-address.effects.d.ts +3 -17
- package/state/effects/cart-coupon.effects.d.ts +5 -5
- package/state/effects/cart-item.effects.d.ts +7 -49
- package/state/effects/cart-order.effects.d.ts +2 -2
- package/state/effects/cart-payment-methods.effects.d.ts +2 -2
- package/state/effects/cart-payment-processor.effects.d.ts +1 -16
- package/state/effects/cart-payment.effects.d.ts +5 -19
- package/state/effects/cart-shipping-address.effects.d.ts +3 -17
- package/state/effects/cart-shipping-information.effects.d.ts +4 -32
- package/state/effects/cart-shipping-methods.effects.d.ts +2 -2
- package/state/effects/cart.effects.d.ts +5 -19
- package/state/injection-tokens/public_api.d.ts +1 -0
- package/state/models/public_api.d.ts +1 -0
- package/state/models/stateful-cart.d.ts +8 -0
- package/state/public_api.d.ts +1 -0
- package/state/reducers/cart/retrieval-actions.reducer.d.ts +9 -0
- package/state/reducers/cart-item-entities/retrieval-actions.reducer.d.ts +10 -0
- package/state/reducers/cart-item-entities/set-state.meta-reducer.d.ts +11 -0
- package/state/reducers/public_api.d.ts +2 -0
- package/state/reducers/token/config.token.d.ts +10 -0
- package/state/reducers/token/meta.token.d.ts +23 -0
- package/state/reducers/token/public_api.d.ts +1 -0
- package/state/selectors/cart/cart.selector.d.ts +1 -0
- package/state/testing/cart-testing.module.d.ts +4 -4
- package/state/testing/public_api.d.ts +1 -1
- package/testing/factories/cart-shipping-information.factory.d.ts +12 -0
- package/testing/factories/cart-total.factory.d.ts +23 -0
- package/testing/factories/cart.factory.d.ts +9 -8
- package/testing/factories/public_api.d.ts +2 -0
- package/esm2020/injection-tokens/error-matcher.token.mjs +0 -8
- /package/{injection-tokens → state/injection-tokens}/error-matcher.token.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartCoupon, DaffCart } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
4
5
|
/**
|
|
5
6
|
* An enum for the cart coupon action types.
|
|
6
7
|
*/
|
|
@@ -30,7 +31,7 @@ export declare class DaffCartCouponApply<T extends DaffCartCoupon = DaffCartCoup
|
|
|
30
31
|
/**
|
|
31
32
|
* Indicates the successful application of a cart coupon.
|
|
32
33
|
*/
|
|
33
|
-
export declare class DaffCartCouponApplySuccess<T extends DaffCart = DaffCart> implements
|
|
34
|
+
export declare class DaffCartCouponApplySuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
34
35
|
payload: Partial<T>;
|
|
35
36
|
readonly type = DaffCartCouponActionTypes.CartCouponApplySuccessAction;
|
|
36
37
|
constructor(payload: Partial<T>);
|
|
@@ -38,10 +39,10 @@ export declare class DaffCartCouponApplySuccess<T extends DaffCart = DaffCart> i
|
|
|
38
39
|
/**
|
|
39
40
|
* Indicates the failed application of a cart coupon.
|
|
40
41
|
*/
|
|
41
|
-
export declare class DaffCartCouponApplyFailure implements
|
|
42
|
-
payload: DaffStateError;
|
|
42
|
+
export declare class DaffCartCouponApplyFailure implements DaffFailureAction {
|
|
43
|
+
payload: DaffStateError[];
|
|
43
44
|
readonly type = DaffCartCouponActionTypes.CartCouponApplyFailureAction;
|
|
44
|
-
constructor(payload: DaffStateError);
|
|
45
|
+
constructor(payload: DaffStateError[]);
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
48
|
* Triggers the load of the cart's coupons.
|
|
@@ -60,10 +61,10 @@ export declare class DaffCartCouponListSuccess<T extends DaffCartCoupon = DaffCa
|
|
|
60
61
|
/**
|
|
61
62
|
* Indicates the failed load of the cart's coupons.
|
|
62
63
|
*/
|
|
63
|
-
export declare class DaffCartCouponListFailure implements
|
|
64
|
-
payload: DaffStateError;
|
|
64
|
+
export declare class DaffCartCouponListFailure implements DaffFailureAction {
|
|
65
|
+
payload: DaffStateError[];
|
|
65
66
|
readonly type = DaffCartCouponActionTypes.CartCouponListFailureAction;
|
|
66
|
-
constructor(payload: DaffStateError);
|
|
67
|
+
constructor(payload: DaffStateError[]);
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Triggers the removal of a cart coupon.
|
|
@@ -76,7 +77,7 @@ export declare class DaffCartCouponRemove<T extends DaffCartCoupon = DaffCartCou
|
|
|
76
77
|
/**
|
|
77
78
|
* Indicates the successful removal of a cart coupon.
|
|
78
79
|
*/
|
|
79
|
-
export declare class DaffCartCouponRemoveSuccess<T extends DaffCart = DaffCart> implements
|
|
80
|
+
export declare class DaffCartCouponRemoveSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
80
81
|
payload: Partial<T>;
|
|
81
82
|
readonly type = DaffCartCouponActionTypes.CartCouponRemoveSuccessAction;
|
|
82
83
|
constructor(payload: Partial<T>);
|
|
@@ -84,10 +85,10 @@ export declare class DaffCartCouponRemoveSuccess<T extends DaffCart = DaffCart>
|
|
|
84
85
|
/**
|
|
85
86
|
* Indicates the failed removal of a cart coupon.
|
|
86
87
|
*/
|
|
87
|
-
export declare class DaffCartCouponRemoveFailure implements
|
|
88
|
-
payload: DaffStateError;
|
|
88
|
+
export declare class DaffCartCouponRemoveFailure implements DaffFailureAction {
|
|
89
|
+
payload: DaffStateError[];
|
|
89
90
|
readonly type = DaffCartCouponActionTypes.CartCouponRemoveFailureAction;
|
|
90
|
-
constructor(payload: DaffStateError);
|
|
91
|
+
constructor(payload: DaffStateError[]);
|
|
91
92
|
}
|
|
92
93
|
/**
|
|
93
94
|
* Triggers the removal of all of the cart's coupons.
|
|
@@ -98,7 +99,7 @@ export declare class DaffCartCouponRemoveAll implements Action {
|
|
|
98
99
|
/**
|
|
99
100
|
* Indicates the successful removal of all of the cart's coupons.
|
|
100
101
|
*/
|
|
101
|
-
export declare class DaffCartCouponRemoveAllSuccess<T extends DaffCart = DaffCart> implements
|
|
102
|
+
export declare class DaffCartCouponRemoveAllSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
102
103
|
payload: Partial<T>;
|
|
103
104
|
readonly type = DaffCartCouponActionTypes.CartCouponRemoveAllSuccessAction;
|
|
104
105
|
constructor(payload: Partial<T>);
|
|
@@ -106,10 +107,10 @@ export declare class DaffCartCouponRemoveAllSuccess<T extends DaffCart = DaffCar
|
|
|
106
107
|
/**
|
|
107
108
|
* Indicates the failed removal of all of the cart's coupons.
|
|
108
109
|
*/
|
|
109
|
-
export declare class DaffCartCouponRemoveAllFailure implements
|
|
110
|
-
payload: DaffStateError;
|
|
110
|
+
export declare class DaffCartCouponRemoveAllFailure implements DaffFailureAction {
|
|
111
|
+
payload: DaffStateError[];
|
|
111
112
|
readonly type = DaffCartCouponActionTypes.CartCouponRemoveAllFailureAction;
|
|
112
|
-
constructor(payload: DaffStateError);
|
|
113
|
+
constructor(payload: DaffStateError[]);
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
116
|
* Removes the errors in cart coupon state.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCart, DaffCartItemInput } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
4
5
|
import { DaffStatefulCartItem } from '../models/public_api';
|
|
5
6
|
/**
|
|
6
7
|
* An enum for the cart item action types.
|
|
@@ -43,10 +44,10 @@ export declare class DaffCartItemListSuccess<T extends DaffStatefulCartItem = Da
|
|
|
43
44
|
/**
|
|
44
45
|
* Indicates the failed load of the cart's items.
|
|
45
46
|
*/
|
|
46
|
-
export declare class DaffCartItemListFailure implements
|
|
47
|
-
payload: DaffStateError;
|
|
47
|
+
export declare class DaffCartItemListFailure implements DaffFailureAction {
|
|
48
|
+
payload: DaffStateError[];
|
|
48
49
|
readonly type = DaffCartItemActionTypes.CartItemListFailureAction;
|
|
49
|
-
constructor(payload: DaffStateError);
|
|
50
|
+
constructor(payload: DaffStateError[]);
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* Triggers the load of a specific cart item.
|
|
@@ -68,10 +69,10 @@ export declare class DaffCartItemLoadSuccess<T extends DaffStatefulCartItem = Da
|
|
|
68
69
|
* Indicates the failed load of a specific cart item.
|
|
69
70
|
*/
|
|
70
71
|
export declare class DaffCartItemLoadFailure<T extends DaffStatefulCartItem = DaffStatefulCartItem> implements Action {
|
|
71
|
-
payload: DaffStateError;
|
|
72
|
+
payload: DaffStateError[];
|
|
72
73
|
itemId: T['id'];
|
|
73
74
|
readonly type = DaffCartItemActionTypes.CartItemLoadFailureAction;
|
|
74
|
-
constructor(payload: DaffStateError, itemId: T['id']);
|
|
75
|
+
constructor(payload: DaffStateError[], itemId: T['id']);
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* Triggers the update of a specific cart item.
|
|
@@ -95,10 +96,10 @@ export declare class DaffCartItemUpdateSuccess<T extends DaffCart = DaffCart, V
|
|
|
95
96
|
* Indicates the failed update of a specific cart item.
|
|
96
97
|
*/
|
|
97
98
|
export declare class DaffCartItemUpdateFailure<T extends DaffStatefulCartItem = DaffStatefulCartItem> implements Action {
|
|
98
|
-
payload: DaffStateError;
|
|
99
|
+
payload: DaffStateError[];
|
|
99
100
|
itemId: T['id'];
|
|
100
101
|
readonly type = DaffCartItemActionTypes.CartItemUpdateFailureAction;
|
|
101
|
-
constructor(payload: DaffStateError, itemId: T['id']);
|
|
102
|
+
constructor(payload: DaffStateError[], itemId: T['id']);
|
|
102
103
|
}
|
|
103
104
|
/**
|
|
104
105
|
* Triggers the addition of a product to the cart.
|
|
@@ -111,7 +112,7 @@ export declare class DaffCartItemAdd<T extends DaffCartItemInput = DaffCartItemI
|
|
|
111
112
|
/**
|
|
112
113
|
* Indicates the successful addition of a product to the cart.
|
|
113
114
|
*/
|
|
114
|
-
export declare class DaffCartItemAddSuccess<T extends DaffCart = DaffCart> implements
|
|
115
|
+
export declare class DaffCartItemAddSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
115
116
|
payload: Partial<T>;
|
|
116
117
|
readonly type = DaffCartItemActionTypes.CartItemAddSuccessAction;
|
|
117
118
|
constructor(payload: Partial<T>);
|
|
@@ -119,10 +120,10 @@ export declare class DaffCartItemAddSuccess<T extends DaffCart = DaffCart> imple
|
|
|
119
120
|
/**
|
|
120
121
|
* Indicates the failed addition of a product to the cart.
|
|
121
122
|
*/
|
|
122
|
-
export declare class DaffCartItemAddFailure implements
|
|
123
|
-
payload: DaffStateError;
|
|
123
|
+
export declare class DaffCartItemAddFailure implements DaffFailureAction {
|
|
124
|
+
payload: DaffStateError[];
|
|
124
125
|
readonly type = DaffCartItemActionTypes.CartItemAddFailureAction;
|
|
125
|
-
constructor(payload: DaffStateError);
|
|
126
|
+
constructor(payload: DaffStateError[]);
|
|
126
127
|
}
|
|
127
128
|
/**
|
|
128
129
|
* Triggers the deletion of a specific cart item.
|
|
@@ -144,10 +145,10 @@ export declare class DaffCartItemDeleteSuccess<T extends DaffCart = DaffCart> im
|
|
|
144
145
|
* Indicates the failed deletion of a specific cart item.
|
|
145
146
|
*/
|
|
146
147
|
export declare class DaffCartItemDeleteFailure<T extends DaffStatefulCartItem = DaffStatefulCartItem> implements Action {
|
|
147
|
-
payload: DaffStateError;
|
|
148
|
+
payload: DaffStateError[];
|
|
148
149
|
itemId: T['id'];
|
|
149
150
|
readonly type = DaffCartItemActionTypes.CartItemDeleteFailureAction;
|
|
150
|
-
constructor(payload: DaffStateError, itemId: T['id']);
|
|
151
|
+
constructor(payload: DaffStateError[], itemId: T['id']);
|
|
151
152
|
}
|
|
152
153
|
/**
|
|
153
154
|
* Triggers the deletion of all out of stock cart items.
|
|
@@ -166,10 +167,10 @@ export declare class DaffCartItemDeleteOutOfStockSuccess<T extends DaffCart = Da
|
|
|
166
167
|
/**
|
|
167
168
|
* Indicates the failed deletion of all out of stock cart items.
|
|
168
169
|
*/
|
|
169
|
-
export declare class DaffCartItemDeleteOutOfStockFailure implements
|
|
170
|
-
payload: DaffStateError;
|
|
170
|
+
export declare class DaffCartItemDeleteOutOfStockFailure implements DaffFailureAction {
|
|
171
|
+
payload: DaffStateError[];
|
|
171
172
|
readonly type = DaffCartItemActionTypes.CartItemDeleteOutOfStockFailureAction;
|
|
172
|
-
constructor(payload: DaffStateError);
|
|
173
|
+
constructor(payload: DaffStateError[]);
|
|
173
174
|
}
|
|
174
175
|
/**
|
|
175
176
|
* Resets cart item "new" or "updated" states to default.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartPaymentMethod, DaffCartOrderResult } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
4
|
/**
|
|
5
5
|
* An enum for the cart order action types.
|
|
6
6
|
*/
|
|
@@ -28,10 +28,10 @@ export declare class DaffCartPlaceOrderSuccess<T extends DaffCartOrderResult = D
|
|
|
28
28
|
/**
|
|
29
29
|
* Indicates the failed order placement for a cart.
|
|
30
30
|
*/
|
|
31
|
-
export declare class DaffCartPlaceOrderFailure implements
|
|
32
|
-
payload: DaffStateError;
|
|
31
|
+
export declare class DaffCartPlaceOrderFailure implements DaffFailureAction {
|
|
32
|
+
payload: DaffStateError[];
|
|
33
33
|
readonly type = DaffCartOrderActionTypes.CartPlaceOrderFailureAction;
|
|
34
|
-
constructor(payload: DaffStateError);
|
|
34
|
+
constructor(payload: DaffStateError[]);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* A union of all the cart order action classes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartPaymentMethod } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
4
|
/**
|
|
5
5
|
* An enum for the cart payment methods action types.
|
|
6
6
|
*/
|
|
@@ -27,10 +27,10 @@ export declare class DaffCartPaymentMethodsLoadSuccess<T extends DaffCartPayment
|
|
|
27
27
|
/**
|
|
28
28
|
* Indicates the failed load of the cart's available payment methods.
|
|
29
29
|
*/
|
|
30
|
-
export declare class DaffCartPaymentMethodsLoadFailure implements
|
|
31
|
-
payload: DaffStateError;
|
|
30
|
+
export declare class DaffCartPaymentMethodsLoadFailure implements DaffFailureAction {
|
|
31
|
+
payload: DaffStateError[];
|
|
32
32
|
readonly type = DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadFailureAction;
|
|
33
|
-
constructor(payload: DaffStateError);
|
|
33
|
+
constructor(payload: DaffStateError[]);
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* A union of all the cart payment methods action classes.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartPaymentMethod, DaffCart, DaffCartAddress } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
4
5
|
/**
|
|
5
6
|
* An enum for the cart payment action types.
|
|
6
7
|
*/
|
|
@@ -36,10 +37,10 @@ export declare class DaffCartPaymentLoadSuccess<T extends DaffCartPaymentMethod
|
|
|
36
37
|
/**
|
|
37
38
|
* Indicates the failed load of the cart's selected payment method.
|
|
38
39
|
*/
|
|
39
|
-
export declare class DaffCartPaymentLoadFailure implements
|
|
40
|
-
payload: DaffStateError;
|
|
40
|
+
export declare class DaffCartPaymentLoadFailure implements DaffFailureAction {
|
|
41
|
+
payload: DaffStateError[];
|
|
41
42
|
readonly type = DaffCartPaymentActionTypes.CartPaymentLoadFailureAction;
|
|
42
|
-
constructor(payload: DaffStateError);
|
|
43
|
+
constructor(payload: DaffStateError[]);
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Triggers the update of the cart's selected payment method.
|
|
@@ -52,7 +53,7 @@ export declare class DaffCartPaymentUpdate<T extends DaffCartPaymentMethod = Daf
|
|
|
52
53
|
/**
|
|
53
54
|
* Indicates the successful update of the cart's selected payment method.
|
|
54
55
|
*/
|
|
55
|
-
export declare class DaffCartPaymentUpdateSuccess<T extends DaffCart = DaffCart> implements
|
|
56
|
+
export declare class DaffCartPaymentUpdateSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
56
57
|
payload: Partial<T>;
|
|
57
58
|
readonly type = DaffCartPaymentActionTypes.CartPaymentUpdateSuccessAction;
|
|
58
59
|
constructor(payload: Partial<T>);
|
|
@@ -60,10 +61,10 @@ export declare class DaffCartPaymentUpdateSuccess<T extends DaffCart = DaffCart>
|
|
|
60
61
|
/**
|
|
61
62
|
* Indicates the failed update of the cart's selected payment method.
|
|
62
63
|
*/
|
|
63
|
-
export declare class DaffCartPaymentUpdateFailure implements
|
|
64
|
-
payload: DaffStateError;
|
|
64
|
+
export declare class DaffCartPaymentUpdateFailure implements DaffFailureAction {
|
|
65
|
+
payload: DaffStateError[];
|
|
65
66
|
readonly type = DaffCartPaymentActionTypes.CartPaymentUpdateFailureAction;
|
|
66
|
-
constructor(payload: DaffStateError);
|
|
67
|
+
constructor(payload: DaffStateError[]);
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Triggers an update of the cart's selected payment method and billing address.
|
|
@@ -82,7 +83,7 @@ export declare class DaffCartPaymentUpdateWithBilling<T extends DaffCartPaymentM
|
|
|
82
83
|
*
|
|
83
84
|
* @param payload The updated cart.
|
|
84
85
|
*/
|
|
85
|
-
export declare class DaffCartPaymentUpdateWithBillingSuccess<T extends DaffCart = DaffCart> implements
|
|
86
|
+
export declare class DaffCartPaymentUpdateWithBillingSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
86
87
|
payload: Partial<T>;
|
|
87
88
|
readonly type = DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction;
|
|
88
89
|
constructor(payload: Partial<T>);
|
|
@@ -92,10 +93,10 @@ export declare class DaffCartPaymentUpdateWithBillingSuccess<T extends DaffCart
|
|
|
92
93
|
*
|
|
93
94
|
* @param payload The error message.
|
|
94
95
|
*/
|
|
95
|
-
export declare class DaffCartPaymentUpdateWithBillingFailure implements
|
|
96
|
-
payload: DaffStateError;
|
|
96
|
+
export declare class DaffCartPaymentUpdateWithBillingFailure implements DaffFailureAction {
|
|
97
|
+
payload: DaffStateError[];
|
|
97
98
|
readonly type = DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction;
|
|
98
|
-
constructor(payload: DaffStateError);
|
|
99
|
+
constructor(payload: DaffStateError[]);
|
|
99
100
|
}
|
|
100
101
|
/**
|
|
101
102
|
* Triggers the removal of the cart's selected payment method.
|
|
@@ -112,10 +113,10 @@ export declare class DaffCartPaymentRemoveSuccess implements Action {
|
|
|
112
113
|
/**
|
|
113
114
|
* Indicates the failed removal of the cart's selected payment method.
|
|
114
115
|
*/
|
|
115
|
-
export declare class DaffCartPaymentRemoveFailure implements
|
|
116
|
-
payload: DaffStateError;
|
|
116
|
+
export declare class DaffCartPaymentRemoveFailure implements DaffFailureAction {
|
|
117
|
+
payload: DaffStateError[];
|
|
117
118
|
readonly type = DaffCartPaymentActionTypes.CartPaymentRemoveFailureAction;
|
|
118
|
-
constructor(payload: DaffStateError);
|
|
119
|
+
constructor(payload: DaffStateError[]);
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
122
|
* This action is temporary until custom reducers can be injected by the @daffodil/paymentSource modules. Right now,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartAddress, DaffCart } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
4
5
|
/**
|
|
5
6
|
* An enum for the cart shipping address action types.
|
|
6
7
|
*/
|
|
@@ -29,10 +30,10 @@ export declare class DaffCartShippingAddressLoadSuccess<T extends DaffCartAddres
|
|
|
29
30
|
/**
|
|
30
31
|
* Indicates the failed load of the cart's shipping address.
|
|
31
32
|
*/
|
|
32
|
-
export declare class DaffCartShippingAddressLoadFailure implements
|
|
33
|
-
payload: DaffStateError;
|
|
33
|
+
export declare class DaffCartShippingAddressLoadFailure implements DaffFailureAction {
|
|
34
|
+
payload: DaffStateError[];
|
|
34
35
|
readonly type = DaffCartShippingAddressActionTypes.CartShippingAddressLoadFailureAction;
|
|
35
|
-
constructor(payload: DaffStateError);
|
|
36
|
+
constructor(payload: DaffStateError[]);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Triggers the update of the cart's shipping address.
|
|
@@ -45,7 +46,7 @@ export declare class DaffCartShippingAddressUpdate<T extends DaffCartAddress = D
|
|
|
45
46
|
/**
|
|
46
47
|
* Indicates the successful update of the cart's shipping address.
|
|
47
48
|
*/
|
|
48
|
-
export declare class DaffCartShippingAddressUpdateSuccess<T extends DaffCart = DaffCart> implements
|
|
49
|
+
export declare class DaffCartShippingAddressUpdateSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
49
50
|
payload: Partial<T>;
|
|
50
51
|
readonly type = DaffCartShippingAddressActionTypes.CartShippingAddressUpdateSuccessAction;
|
|
51
52
|
constructor(payload: Partial<T>);
|
|
@@ -53,10 +54,10 @@ export declare class DaffCartShippingAddressUpdateSuccess<T extends DaffCart = D
|
|
|
53
54
|
/**
|
|
54
55
|
* Indicates the failed update of the cart's shipping address.
|
|
55
56
|
*/
|
|
56
|
-
export declare class DaffCartShippingAddressUpdateFailure implements
|
|
57
|
-
payload: DaffStateError;
|
|
57
|
+
export declare class DaffCartShippingAddressUpdateFailure implements DaffFailureAction {
|
|
58
|
+
payload: DaffStateError[];
|
|
58
59
|
readonly type = DaffCartShippingAddressActionTypes.CartShippingAddressUpdateFailureAction;
|
|
59
|
-
constructor(payload: DaffStateError);
|
|
60
|
+
constructor(payload: DaffStateError[]);
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* A union of all the cart shipping address action classes.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartShippingRate, DaffCart } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
4
5
|
/**
|
|
5
6
|
* An enum for the cart shipping information action types.
|
|
6
7
|
*/
|
|
@@ -32,10 +33,10 @@ export declare class DaffCartShippingInformationLoadSuccess<T extends DaffCartSh
|
|
|
32
33
|
/**
|
|
33
34
|
* Indicates the failed load of the cart's shipping information.
|
|
34
35
|
*/
|
|
35
|
-
export declare class DaffCartShippingInformationLoadFailure implements
|
|
36
|
-
payload: DaffStateError;
|
|
36
|
+
export declare class DaffCartShippingInformationLoadFailure implements DaffFailureAction {
|
|
37
|
+
payload: DaffStateError[];
|
|
37
38
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationLoadFailureAction;
|
|
38
|
-
constructor(payload: DaffStateError);
|
|
39
|
+
constructor(payload: DaffStateError[]);
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Triggers the update of the cart's shipping information.
|
|
@@ -48,7 +49,7 @@ export declare class DaffCartShippingInformationUpdate<T extends DaffCartShippin
|
|
|
48
49
|
/**
|
|
49
50
|
* Indicates the successful update of the cart's shipping information.
|
|
50
51
|
*/
|
|
51
|
-
export declare class DaffCartShippingInformationUpdateSuccess<T extends DaffCart = DaffCart> implements
|
|
52
|
+
export declare class DaffCartShippingInformationUpdateSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
52
53
|
payload: Partial<T>;
|
|
53
54
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationUpdateSuccessAction;
|
|
54
55
|
constructor(payload: Partial<T>);
|
|
@@ -56,10 +57,10 @@ export declare class DaffCartShippingInformationUpdateSuccess<T extends DaffCart
|
|
|
56
57
|
/**
|
|
57
58
|
* Indicates the failed update of the cart's shipping information.
|
|
58
59
|
*/
|
|
59
|
-
export declare class DaffCartShippingInformationUpdateFailure implements
|
|
60
|
-
payload: DaffStateError;
|
|
60
|
+
export declare class DaffCartShippingInformationUpdateFailure implements DaffFailureAction {
|
|
61
|
+
payload: DaffStateError[];
|
|
61
62
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationUpdateFailureAction;
|
|
62
|
-
constructor(payload: DaffStateError);
|
|
63
|
+
constructor(payload: DaffStateError[]);
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* Triggers the deletion of the cart's shipping information.
|
|
@@ -69,15 +70,15 @@ export declare class DaffCartShippingInformationDelete<T extends DaffCartShippin
|
|
|
69
70
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction;
|
|
70
71
|
constructor(id?: T['id']);
|
|
71
72
|
}
|
|
72
|
-
export declare class DaffCartShippingInformationDeleteSuccess<T extends DaffCart = DaffCart> implements
|
|
73
|
+
export declare class DaffCartShippingInformationDeleteSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
73
74
|
payload: Partial<T>;
|
|
74
75
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationDeleteSuccessAction;
|
|
75
76
|
constructor(payload: Partial<T>);
|
|
76
77
|
}
|
|
77
|
-
export declare class DaffCartShippingInformationDeleteFailure implements
|
|
78
|
-
payload: DaffStateError;
|
|
78
|
+
export declare class DaffCartShippingInformationDeleteFailure implements DaffFailureAction {
|
|
79
|
+
payload: DaffStateError[];
|
|
79
80
|
readonly type = DaffCartShippingInformationActionTypes.CartShippingInformationDeleteFailureAction;
|
|
80
|
-
constructor(payload: DaffStateError);
|
|
81
|
+
constructor(payload: DaffStateError[]);
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* A union of all the cart shipping information action classes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCartShippingRate } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
4
|
/**
|
|
5
5
|
* An enum for the cart shipping methods action types.
|
|
6
6
|
*/
|
|
@@ -21,10 +21,10 @@ export declare class DaffCartShippingMethodsLoadSuccess<T extends DaffCartShippi
|
|
|
21
21
|
readonly type = DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadSuccessAction;
|
|
22
22
|
constructor(payload: T[]);
|
|
23
23
|
}
|
|
24
|
-
export declare class DaffCartShippingMethodsLoadFailure implements
|
|
25
|
-
payload: DaffStateError;
|
|
24
|
+
export declare class DaffCartShippingMethodsLoadFailure implements DaffFailureAction {
|
|
25
|
+
payload: DaffStateError[];
|
|
26
26
|
readonly type = DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadFailureAction;
|
|
27
|
-
constructor(payload: DaffStateError);
|
|
27
|
+
constructor(payload: DaffStateError[]);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* A union of all the cart shipping methods action classes.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Action } from '@ngrx/store';
|
|
2
2
|
import { DaffCart } from '@daffodil/cart';
|
|
3
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffFailureAction, DaffStateError } from '@daffodil/core/state';
|
|
4
4
|
import { DaffProduct } from '@daffodil/product';
|
|
5
|
+
import { DaffCartRetrievalAction } from '../cart-retrieval/public_api';
|
|
5
6
|
/**
|
|
6
7
|
* An enum for the cart action types.
|
|
7
8
|
*/
|
|
@@ -29,10 +30,10 @@ export declare enum DaffCartActionTypes {
|
|
|
29
30
|
/**
|
|
30
31
|
* Indicates that an error occured while either reading or writing the cart ID to or from storage.
|
|
31
32
|
*/
|
|
32
|
-
export declare class DaffCartStorageFailure implements
|
|
33
|
-
payload: DaffStateError;
|
|
33
|
+
export declare class DaffCartStorageFailure implements DaffFailureAction {
|
|
34
|
+
payload: DaffStateError[];
|
|
34
35
|
readonly type = DaffCartActionTypes.CartStorageFailureAction;
|
|
35
|
-
constructor(payload: DaffStateError);
|
|
36
|
+
constructor(payload: DaffStateError[]);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Triggers the load of the cart.
|
|
@@ -43,7 +44,7 @@ export declare class DaffCartLoad implements Action {
|
|
|
43
44
|
/**
|
|
44
45
|
* Indicates the successful load of the cart.
|
|
45
46
|
*/
|
|
46
|
-
export declare class DaffCartLoadSuccess<T extends DaffCart = DaffCart> implements
|
|
47
|
+
export declare class DaffCartLoadSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
47
48
|
payload: T;
|
|
48
49
|
readonly type = DaffCartActionTypes.CartLoadSuccessAction;
|
|
49
50
|
constructor(payload: T);
|
|
@@ -54,7 +55,7 @@ export declare class DaffCartLoadSuccess<T extends DaffCart = DaffCart> implemen
|
|
|
54
55
|
* but the user should probably be shown error messages as well.
|
|
55
56
|
* A common example is some cart items being out of stock.
|
|
56
57
|
*/
|
|
57
|
-
export declare class DaffCartLoadPartialSuccess<T extends DaffCart = DaffCart> implements
|
|
58
|
+
export declare class DaffCartLoadPartialSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
58
59
|
payload: T;
|
|
59
60
|
errors: DaffStateError[];
|
|
60
61
|
readonly type = DaffCartActionTypes.CartLoadPartialSuccessAction;
|
|
@@ -63,7 +64,7 @@ export declare class DaffCartLoadPartialSuccess<T extends DaffCart = DaffCart> i
|
|
|
63
64
|
/**
|
|
64
65
|
* Indicates the failed load of the cart.
|
|
65
66
|
*/
|
|
66
|
-
export declare class DaffCartLoadFailure implements
|
|
67
|
+
export declare class DaffCartLoadFailure implements DaffFailureAction {
|
|
67
68
|
payload: DaffStateError[];
|
|
68
69
|
readonly type = DaffCartActionTypes.CartLoadFailureAction;
|
|
69
70
|
constructor(payload: DaffStateError[]);
|
|
@@ -78,21 +79,17 @@ export declare class DaffCartCreate implements Action {
|
|
|
78
79
|
* Indicates the successful creation of a new cart.
|
|
79
80
|
*/
|
|
80
81
|
export declare class DaffCartCreateSuccess<T extends DaffCart = DaffCart> implements Action {
|
|
81
|
-
payload:
|
|
82
|
-
id: T['id'];
|
|
83
|
-
};
|
|
82
|
+
payload: Pick<T, 'id'>;
|
|
84
83
|
readonly type = DaffCartActionTypes.CartCreateSuccessAction;
|
|
85
|
-
constructor(payload:
|
|
86
|
-
id: T['id'];
|
|
87
|
-
});
|
|
84
|
+
constructor(payload: Pick<T, 'id'>);
|
|
88
85
|
}
|
|
89
86
|
/**
|
|
90
87
|
* Indicates the failed creation of a new cart.
|
|
91
88
|
*/
|
|
92
|
-
export declare class DaffCartCreateFailure implements
|
|
93
|
-
payload: DaffStateError;
|
|
89
|
+
export declare class DaffCartCreateFailure implements DaffFailureAction {
|
|
90
|
+
payload: DaffStateError[];
|
|
94
91
|
readonly type = DaffCartActionTypes.CartCreateFailureAction;
|
|
95
|
-
constructor(payload: DaffStateError);
|
|
92
|
+
constructor(payload: DaffStateError[]);
|
|
96
93
|
}
|
|
97
94
|
export declare class DaffAddToCart implements Action {
|
|
98
95
|
payload: {
|
|
@@ -110,10 +107,10 @@ export declare class DaffAddToCartSuccess implements Action {
|
|
|
110
107
|
readonly type = DaffCartActionTypes.AddToCartSuccessAction;
|
|
111
108
|
constructor(payload: DaffCart);
|
|
112
109
|
}
|
|
113
|
-
export declare class DaffAddToCartFailure implements
|
|
114
|
-
payload: DaffStateError;
|
|
110
|
+
export declare class DaffAddToCartFailure implements DaffFailureAction {
|
|
111
|
+
payload: DaffStateError[];
|
|
115
112
|
readonly type = DaffCartActionTypes.AddToCartFailureAction;
|
|
116
|
-
constructor(payload: DaffStateError);
|
|
113
|
+
constructor(payload: DaffStateError[]);
|
|
117
114
|
}
|
|
118
115
|
/**
|
|
119
116
|
* Triggers the removal of all items from the cart.
|
|
@@ -124,7 +121,7 @@ export declare class DaffCartClear implements Action {
|
|
|
124
121
|
/**
|
|
125
122
|
* Indicates the successful removal of all items from the cart.
|
|
126
123
|
*/
|
|
127
|
-
export declare class DaffCartClearSuccess<T extends DaffCart = DaffCart> implements
|
|
124
|
+
export declare class DaffCartClearSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
128
125
|
payload: Partial<T>;
|
|
129
126
|
readonly type = DaffCartActionTypes.CartClearSuccessAction;
|
|
130
127
|
constructor(payload: Partial<T>);
|
|
@@ -132,10 +129,10 @@ export declare class DaffCartClearSuccess<T extends DaffCart = DaffCart> impleme
|
|
|
132
129
|
/**
|
|
133
130
|
* Indicates the failed removal of all items from the cart.
|
|
134
131
|
*/
|
|
135
|
-
export declare class DaffCartClearFailure implements
|
|
136
|
-
payload: DaffStateError;
|
|
132
|
+
export declare class DaffCartClearFailure implements DaffFailureAction {
|
|
133
|
+
payload: DaffStateError[];
|
|
137
134
|
readonly type = DaffCartActionTypes.CartClearFailureAction;
|
|
138
|
-
constructor(payload: DaffStateError);
|
|
135
|
+
constructor(payload: DaffStateError[]);
|
|
139
136
|
}
|
|
140
137
|
/**
|
|
141
138
|
* Triggers cart resolution.
|
|
@@ -147,7 +144,7 @@ export declare class DaffResolveCart implements Action {
|
|
|
147
144
|
/**
|
|
148
145
|
* An action that indicates a user's cart is resolved successfully.
|
|
149
146
|
*/
|
|
150
|
-
export declare class DaffResolveCartSuccess<T extends DaffCart = DaffCart> implements
|
|
147
|
+
export declare class DaffResolveCartSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
151
148
|
payload: T;
|
|
152
149
|
readonly type = DaffCartActionTypes.ResolveCartSuccessAction;
|
|
153
150
|
constructor(payload: T);
|
|
@@ -158,7 +155,7 @@ export declare class DaffResolveCartSuccess<T extends DaffCart = DaffCart> imple
|
|
|
158
155
|
* but the user should probably be shown error messages as well.
|
|
159
156
|
* A common example is some cart items being out of stock.
|
|
160
157
|
*/
|
|
161
|
-
export declare class DaffResolveCartPartialSuccess<T extends DaffCart = DaffCart> implements
|
|
158
|
+
export declare class DaffResolveCartPartialSuccess<T extends DaffCart = DaffCart> implements DaffCartRetrievalAction<T> {
|
|
162
159
|
payload: T;
|
|
163
160
|
errors: DaffStateError[];
|
|
164
161
|
readonly type = DaffCartActionTypes.ResolveCartPartialSuccessAction;
|
|
@@ -167,7 +164,7 @@ export declare class DaffResolveCartPartialSuccess<T extends DaffCart = DaffCart
|
|
|
167
164
|
/**
|
|
168
165
|
* An action that indicates that a cart failed to resolve.
|
|
169
166
|
*/
|
|
170
|
-
export declare class DaffResolveCartFailure implements
|
|
167
|
+
export declare class DaffResolveCartFailure implements DaffFailureAction {
|
|
171
168
|
payload: DaffStateError[];
|
|
172
169
|
readonly type = DaffCartActionTypes.ResolveCartFailureAction;
|
|
173
170
|
constructor(payload: DaffStateError[]);
|
|
@@ -177,9 +174,9 @@ export declare class DaffResolveCartFailure implements Action {
|
|
|
177
174
|
* of an attempted resolution on the server.
|
|
178
175
|
*/
|
|
179
176
|
export declare class DaffResolveCartServerSide implements Action {
|
|
180
|
-
payload: DaffStateError;
|
|
177
|
+
payload: DaffStateError[];
|
|
181
178
|
readonly type = DaffCartActionTypes.ResolveCartServerSideAction;
|
|
182
|
-
constructor(payload: DaffStateError);
|
|
179
|
+
constructor(payload: DaffStateError[]);
|
|
183
180
|
}
|
|
184
181
|
/**
|
|
185
182
|
* A union of all the cart action classes.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { DaffCart } from '@daffodil/cart';
|
|
3
|
+
import { DaffCartRetrievalActionInjection } from './type';
|
|
4
|
+
/**
|
|
5
|
+
* Gets the cart from the passed action if it is a recognized retrieval action and applies the transformation if needed.
|
|
6
|
+
* If the action is not recognized as a retrieval action, returns `null`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function daffCartRetrievalGetResponse<T extends DaffCart = DaffCart>(action: Action, retrievalActions: DaffCartRetrievalActionInjection[]): Partial<T> | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionToken, ValueProvider } from '@angular/core';
|
|
2
|
+
import { DaffCartRetrievalActionInjection } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* A token to hold {@link DaffCartRetrievalActionInjection}s.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DAFF_CART_RETRIEVAL_ACTIONS: InjectionToken<DaffCartRetrievalActionInjection[]>;
|
|
7
|
+
/**
|
|
8
|
+
* A provider function for {@link DAFF_CART_RETRIEVAL_ACTIONS}.
|
|
9
|
+
*/
|
|
10
|
+
export declare const daffCartProvideRetrievalActions: (...actions: DaffCartRetrievalActionInjection[]) => ValueProvider[];
|