@daffodil/cart 0.94.1 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-cart-driver-in-memory.mjs +1618 -1198
- package/fesm2022/daffodil-cart-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver-magento-2.4.7-testing.mjs +546 -0
- package/fesm2022/daffodil-cart-driver-magento-2.4.7-testing.mjs.map +1 -0
- package/fesm2022/daffodil-cart-driver-magento-2.4.7.mjs +2607 -0
- package/fesm2022/daffodil-cart-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-cart-driver-magento-auto-testing.mjs +7 -0
- package/fesm2022/daffodil-cart-driver-magento-auto-testing.mjs.map +1 -0
- package/fesm2022/daffodil-cart-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-cart-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-cart-driver-testing.mjs +553 -335
- package/fesm2022/daffodil-cart-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-driver.mjs +167 -292
- package/fesm2022/daffodil-cart-driver.mjs.map +1 -1
- package/fesm2022/daffodil-cart-routing.mjs +741 -542
- package/fesm2022/daffodil-cart-routing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-state-testing.mjs +288 -193
- package/fesm2022/daffodil-cart-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart-state.mjs +2571 -2800
- package/fesm2022/daffodil-cart-state.mjs.map +1 -1
- package/fesm2022/daffodil-cart-testing.mjs +542 -357
- package/fesm2022/daffodil-cart-testing.mjs.map +1 -1
- package/fesm2022/daffodil-cart.mjs +131 -200
- package/fesm2022/daffodil-cart.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-cart-driver-in-memory.d.ts +273 -292
- package/types/daffodil-cart-driver-magento-2.4.7-testing.d.ts +176 -0
- package/types/daffodil-cart-driver-magento-2.4.7.d.ts +860 -0
- package/types/daffodil-cart-driver-magento-auto-testing.d.ts +1 -0
- package/types/daffodil-cart-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-cart-driver-testing.d.ts +111 -118
- package/types/daffodil-cart-driver.d.ts +219 -262
- package/types/daffodil-cart-routing.d.ts +130 -149
- package/types/daffodil-cart-state-testing.d.ts +115 -114
- package/types/daffodil-cart-state.d.ts +1126 -1173
- package/types/daffodil-cart-testing.d.ts +146 -158
- package/types/daffodil-cart.d.ts +302 -321
- package/fesm2022/daffodil-cart-driver-magento-testing.mjs +0 -332
- package/fesm2022/daffodil-cart-driver-magento-testing.mjs.map +0 -1
- package/fesm2022/daffodil-cart-driver-magento.mjs +0 -2273
- package/fesm2022/daffodil-cart-driver-magento.mjs.map +0 -1
- package/types/daffodil-cart-driver-magento-testing.d.ts +0 -188
- package/types/daffodil-cart-driver-magento.d.ts +0 -999
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
import { Router, UrlTree } from
|
|
2
|
-
import { Observable } from
|
|
3
|
-
import { DaffCartFacade, DaffCartStateRootSlice } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import { ModuleWithProviders } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { Router, UrlTree } from "@angular/router";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { DaffCartFacade, DaffCartStateRootSlice } from "@daffodil/cart/state";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
6
|
+
import { DaffCart, DaffCartStorageService } from "@daffodil/cart";
|
|
7
|
+
import { ActionsSubject, Store } from "@ngrx/store";
|
|
9
8
|
/**
|
|
10
9
|
* A routing guard that will redirect to a given url if the billing address on the cart is not defined.
|
|
11
10
|
* The url is `/` by default, but can be overridden with the DaffCartBillingAddressGuardRedirectUrl injection token.
|
|
12
11
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
13
12
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
14
13
|
*/
|
|
15
|
-
declare class DaffBillingAddressGuard {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export declare class DaffBillingAddressGuard {
|
|
15
|
+
private facade;
|
|
16
|
+
private router;
|
|
17
|
+
private redirectUrl;
|
|
18
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
19
|
+
canActivate(): Observable<boolean>;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffBillingAddressGuard, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
/**
|
|
26
24
|
* An object that describes the resolution configuration of the cart state package.
|
|
27
25
|
*/
|
|
28
26
|
interface DaffCartRoutingResolutionConfiguration {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
/**
|
|
28
|
+
* When Daffodil fails to resolve a cart, you should navigate your users to
|
|
29
|
+
* a page that is outside the scope of resolution. The `failedResolutionPath` allows you
|
|
30
|
+
* to control where to navigate your users to when resolution fails.
|
|
31
|
+
*/
|
|
32
|
+
failedResolutionPath: string;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
34
|
/**
|
|
38
35
|
* An object that describes the configuration of the`@daffodil/cart/state` package.
|
|
39
36
|
*/
|
|
40
|
-
interface DaffCartRoutingConfiguration {
|
|
41
|
-
|
|
37
|
+
export interface DaffCartRoutingConfiguration {
|
|
38
|
+
resolution: DaffCartRoutingResolutionConfiguration;
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
44
41
|
* The token holding the runtime configuration for the behavior of the
|
|
45
42
|
* `@daffodil/cart/state` package.
|
|
46
43
|
*/
|
|
47
|
-
declare const DAFF_CART_ROUTING_CONFIG:
|
|
48
|
-
|
|
44
|
+
declare const DAFF_CART_ROUTING_CONFIG: import("@angular/core").InjectionToken<DaffCartRoutingConfiguration>, provideDaffCartRoutingConfig: <R extends DaffCartRoutingConfiguration = DaffCartRoutingConfiguration>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
|
|
49
45
|
/**
|
|
50
46
|
* A routing guard that will optionally redirect to a given url if the cart is not properly resolved.
|
|
51
47
|
* It will initiate cart resolution.
|
|
@@ -53,16 +49,15 @@ declare const DAFF_CART_ROUTING_CONFIG: i0.InjectionToken<DaffCartRoutingConfigu
|
|
|
53
49
|
* Specify a redirect path with the {@link DaffResolvedCartGuardRedirectUrl} injection token.
|
|
54
50
|
* The guard will wait until the cart has been resolved before performing the check and emitting.
|
|
55
51
|
*/
|
|
56
|
-
declare class DaffResolvedCartGuard {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
export declare class DaffResolvedCartGuard {
|
|
53
|
+
private facade;
|
|
54
|
+
private router;
|
|
55
|
+
private config;
|
|
56
|
+
constructor(facade: DaffCartFacade, router: Router, config: DaffCartRoutingConfiguration);
|
|
57
|
+
canActivate(): Observable<boolean | UrlTree>;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffResolvedCartGuard, never>;
|
|
59
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
/**
|
|
67
62
|
* A routing guard that will optionally redirect to a given url if the cart is not properly resolved.
|
|
68
63
|
* It will initiate cart resolution.
|
|
@@ -70,17 +65,16 @@ declare class DaffResolvedCartGuard {
|
|
|
70
65
|
* Specify a redirect path with the {@link DaffResolvedCartGuardRedirectUrl} injection token.
|
|
71
66
|
* The guard will wait until the cart has been resolved before performing the check and emitting.
|
|
72
67
|
*/
|
|
73
|
-
declare class DaffResolveCartGuard {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
export declare class DaffResolveCartGuard {
|
|
69
|
+
private facade;
|
|
70
|
+
private router;
|
|
71
|
+
private redirectUrl;
|
|
72
|
+
private storage;
|
|
73
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string, storage: DaffCartStorageService);
|
|
74
|
+
canActivate(): Observable<boolean | UrlTree>;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffResolveCartGuard, never>;
|
|
76
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
82
77
|
}
|
|
83
|
-
|
|
84
78
|
/**
|
|
85
79
|
* A routing guard that will ensure that the cart is not empty before allowing activation of a route.
|
|
86
80
|
* If the cart has items in it, then `canActivate` will emit true. If not, it will emit false and redirect to a specific path.
|
|
@@ -88,16 +82,15 @@ declare class DaffResolveCartGuard {
|
|
|
88
82
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
89
83
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
90
84
|
*/
|
|
91
|
-
declare class DaffCartItemsGuard {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
export declare class DaffCartItemsGuard {
|
|
86
|
+
private facade;
|
|
87
|
+
private router;
|
|
88
|
+
private redirectUrl;
|
|
89
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
90
|
+
canActivate(): Observable<boolean>;
|
|
91
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartItemsGuard, never>;
|
|
92
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
99
93
|
}
|
|
100
|
-
|
|
101
94
|
/**
|
|
102
95
|
* A routing guard that will ensure that the cart has only in-stock items before allowing activation of a route.
|
|
103
96
|
* If the cart has any out of stock items in it, then `canActivate` will emit `false` and redirect to a specific path.
|
|
@@ -105,136 +98,124 @@ declare class DaffCartItemsGuard {
|
|
|
105
98
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
106
99
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
107
100
|
*/
|
|
108
|
-
declare class DaffCartInStockItemsGuard {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
export declare class DaffCartInStockItemsGuard {
|
|
102
|
+
private facade;
|
|
103
|
+
private router;
|
|
104
|
+
private redirectUrl;
|
|
105
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
106
|
+
canActivateChild(): Observable<boolean>;
|
|
107
|
+
canActivate(): Observable<boolean>;
|
|
108
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartInStockItemsGuard, never>;
|
|
109
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
117
110
|
}
|
|
118
|
-
|
|
119
111
|
/**
|
|
120
112
|
* A routing guard that will redirect to a given url if the payment method on the cart is not defined.
|
|
121
113
|
* The url is `/` by default, but can be overridden with the DaffCartPaymentMethodGuardRedirectUrl injection token.
|
|
122
114
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
123
115
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
124
116
|
*/
|
|
125
|
-
declare class DaffPaymentMethodGuard {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
117
|
+
export declare class DaffPaymentMethodGuard {
|
|
118
|
+
private facade;
|
|
119
|
+
private router;
|
|
120
|
+
private redirectUrl;
|
|
121
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
122
|
+
canActivate(): Observable<boolean>;
|
|
123
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffPaymentMethodGuard, never>;
|
|
124
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
133
125
|
}
|
|
134
|
-
|
|
135
126
|
/**
|
|
136
127
|
* A routing guard that will redirect to a given url if the shipping address on the cart is not defined.
|
|
137
128
|
* The url is `/` by default, but can be overridden with the DaffCartShippingAddressGuardRedirectUrl injection token.
|
|
138
129
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
139
130
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
140
131
|
*/
|
|
141
|
-
declare class DaffShippingAddressGuard {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
132
|
+
export declare class DaffShippingAddressGuard {
|
|
133
|
+
private facade;
|
|
134
|
+
private router;
|
|
135
|
+
private redirectUrl;
|
|
136
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
137
|
+
canActivate(): Observable<boolean>;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffShippingAddressGuard, never>;
|
|
139
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
149
140
|
}
|
|
150
|
-
|
|
151
141
|
/**
|
|
152
142
|
* A routing guard that will redirect to a given url if the shipping method on the cart is not defined.
|
|
153
143
|
* The url is `/` by default, but can be overridden with the DaffCartShippingMethodGuardRedirectUrl injection token.
|
|
154
144
|
* The guard will not wait until the cart has been resolved before performing the check and emitting.
|
|
155
145
|
* Ensure that the cart is resolved prior to running this guard with the {@link DaffResolvedCartGuard}.
|
|
156
146
|
*/
|
|
157
|
-
declare class DaffShippingMethodGuard {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
147
|
+
export declare class DaffShippingMethodGuard {
|
|
148
|
+
private facade;
|
|
149
|
+
private router;
|
|
150
|
+
private redirectUrl;
|
|
151
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
152
|
+
canActivate(): Observable<boolean>;
|
|
153
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffShippingMethodGuard, never>;
|
|
154
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
165
155
|
}
|
|
166
|
-
|
|
167
156
|
/**
|
|
168
157
|
* A routing guard that will redirect to a given url if the cart order result is not defined.
|
|
169
158
|
* The url is `/` by default, but can be overridden with the DaffCartOrderResultGuardRedirectUrl injection token.
|
|
170
159
|
*/
|
|
171
|
-
declare class DaffOrderResultGuard {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
160
|
+
export declare class DaffOrderResultGuard {
|
|
161
|
+
private facade;
|
|
162
|
+
private router;
|
|
163
|
+
private redirectUrl;
|
|
164
|
+
constructor(facade: DaffCartFacade, router: Router, redirectUrl: string);
|
|
165
|
+
canActivate(): Observable<boolean>;
|
|
166
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffOrderResultGuard, never>;
|
|
167
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
179
168
|
}
|
|
180
|
-
|
|
181
|
-
declare const
|
|
182
|
-
|
|
183
|
-
declare const
|
|
184
|
-
|
|
185
|
-
declare const
|
|
186
|
-
|
|
187
|
-
declare const
|
|
188
|
-
|
|
189
|
-
declare const DaffCartShippingAddressGuardRedirectUrl: i0.InjectionToken<string>;
|
|
190
|
-
|
|
191
|
-
declare const DaffCartShippingMethodGuardRedirectUrl: i0.InjectionToken<string>;
|
|
192
|
-
|
|
193
|
-
declare const DaffCartOrderResultGuardRedirectUrl: i0.InjectionToken<string>;
|
|
194
|
-
|
|
195
|
-
declare const DaffResolveCartGuardRedirectUrl: i0.InjectionToken<string>;
|
|
196
|
-
|
|
169
|
+
declare const DaffCartBillingAddressGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartBillingAddressGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
170
|
+
declare const DaffCartItemsGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartItemsGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
171
|
+
declare const DaffCartInStockItemsGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartInStockItemsGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
172
|
+
declare const DaffCartPaymentMethodGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartPaymentMethodGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
173
|
+
declare const DaffCartShippingAddressGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartShippingAddressGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
174
|
+
declare const DaffCartShippingMethodGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartShippingMethodGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
175
|
+
declare const DaffCartOrderResultGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartOrderResultGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
176
|
+
declare const DaffResolveCartGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffResolveCartGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
197
177
|
/**
|
|
198
178
|
* Resolves the cart before navigation. Redirects to a given url when a failure occurs during Cart Load.
|
|
199
179
|
* This url is `/` by default but can be overridden with the DaffCartResolverRedirectUrl injection token.
|
|
200
180
|
*/
|
|
201
|
-
declare class DaffCartResolver {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
181
|
+
export declare class DaffCartResolver {
|
|
182
|
+
private store;
|
|
183
|
+
private dispatcher;
|
|
184
|
+
private router;
|
|
185
|
+
private redirectUrl;
|
|
186
|
+
constructor(store: Store<DaffCartStateRootSlice>, dispatcher: ActionsSubject, router: Router, redirectUrl: string);
|
|
187
|
+
resolve(): Observable<DaffCart>;
|
|
188
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartResolver, never>;
|
|
189
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
210
190
|
}
|
|
211
|
-
|
|
212
191
|
/**
|
|
213
192
|
* Resolves the cart before navigation. Redirects to a given url when a failure occurs during Cart Load.
|
|
214
193
|
* This url is `/` by default but can be overridden with the DaffCartResolverRedirectUrl injection token.
|
|
215
194
|
* This resolver also redirects to a different url when the cart is empty after successfully loading.
|
|
216
195
|
* This url is also `/` by default, but can be overridden with the DaffEmptyCartResolverRedirectUrl
|
|
217
196
|
*/
|
|
218
|
-
declare class DaffEmptyCartResolver {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
197
|
+
export declare class DaffEmptyCartResolver {
|
|
198
|
+
private cartResolver;
|
|
199
|
+
private router;
|
|
200
|
+
private redirectUrl;
|
|
201
|
+
constructor(cartResolver: DaffCartResolver, router: Router, redirectUrl: string);
|
|
202
|
+
resolve(): Observable<DaffCart>;
|
|
203
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffEmptyCartResolver, never>;
|
|
204
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
226
205
|
}
|
|
227
|
-
|
|
228
|
-
declare const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
declare class DaffCartRoutingModule {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
206
|
+
declare const DaffCartResolverRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffCartResolverRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
207
|
+
declare const DaffEmptyCartResolverRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffEmptyCartResolverRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
|
|
208
|
+
/**
|
|
209
|
+
* @deprecated in favor of {@link provideDaffCartRouting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
210
|
+
*/
|
|
211
|
+
export declare class DaffCartRoutingModule {
|
|
212
|
+
static forRoot(config?: DaffCartRoutingConfiguration): ModuleWithProviders<DaffCartRoutingModule>;
|
|
213
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartRoutingModule, never>;
|
|
214
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCartRoutingModule, never, never, never>;
|
|
215
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCartRoutingModule>;
|
|
237
216
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Provides the `@daffodil/cart/routing` guard and resolver redirect URLs and configuration.
|
|
219
|
+
*/
|
|
220
|
+
export declare const provideDaffCartRouting: (config?: DaffCartRoutingConfiguration) => EnvironmentProviders;
|
|
221
|
+
export { DAFF_CART_ROUTING_CONFIG, DaffCartBillingAddressGuardRedirectUrl, DaffCartInStockItemsGuardRedirectUrl, DaffCartItemsGuardRedirectUrl, DaffCartOrderResultGuardRedirectUrl, DaffCartPaymentMethodGuardRedirectUrl, DaffCartResolverRedirectUrl, DaffCartShippingAddressGuardRedirectUrl, DaffCartShippingMethodGuardRedirectUrl, DaffEmptyCartResolverRedirectUrl, DaffResolveCartGuardRedirectUrl };
|
|
@@ -1,130 +1,131 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { Dictionary } from "@ngrx/entity";
|
|
4
|
+
import { Action } from "@ngrx/store";
|
|
5
|
+
import { BehaviorSubject } from "rxjs";
|
|
6
|
+
import { DaffCart, DaffCartItem, DaffCartOrderResult, DaffCompositeCartItem, DaffCompositeCartItemOption, DaffConfigurableCartItem, DaffConfigurableCartItemAttribute } from "@daffodil/cart";
|
|
7
|
+
import { DaffCartErrors, DaffCartFacadeInterface, DaffCartLoading, DaffCartOperationType, DaffCartResolveState } from "@daffodil/cart/state";
|
|
8
|
+
import { DaffOperationEntity, DaffState, DaffStateError } from "@daffodil/core/state";
|
|
9
|
+
import { DaffMockCartItem, DaffMockCompositeCartItem, DaffMockConfigurableCartItem } from "@daffodil/cart/testing";
|
|
10
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated in favor of {@link provideDaffCartStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DaffCartStateTestingModule {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartStateTestingModule, never>;
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCartStateTestingModule, never, never, never>;
|
|
17
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCartStateTestingModule>;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Provides {@link MockDaffCartFacade} in place of {@link DaffCartFacade}.
|
|
21
|
+
*/
|
|
22
|
+
export declare const provideDaffCartStateTesting: () => EnvironmentProviders;
|
|
23
|
+
export declare class MockDaffCartFacade implements DaffCartFacadeInterface {
|
|
24
|
+
cart$: BehaviorSubject<DaffCart>;
|
|
25
|
+
resolved$: BehaviorSubject<DaffCartResolveState>;
|
|
26
|
+
loadingObject$: BehaviorSubject<DaffCartLoading>;
|
|
27
|
+
featureLoading$: BehaviorSubject<boolean>;
|
|
28
|
+
featureResolving$: BehaviorSubject<boolean>;
|
|
29
|
+
featureMutating$: BehaviorSubject<boolean>;
|
|
30
|
+
loading$: BehaviorSubject<boolean>;
|
|
31
|
+
resolving$: BehaviorSubject<boolean>;
|
|
32
|
+
mutating$: BehaviorSubject<boolean>;
|
|
33
|
+
billingAddressLoading$: BehaviorSubject<boolean>;
|
|
34
|
+
billingAddressResolving$: BehaviorSubject<boolean>;
|
|
35
|
+
billingAddressMutating$: BehaviorSubject<boolean>;
|
|
36
|
+
shippingAddressLoading$: BehaviorSubject<boolean>;
|
|
37
|
+
shippingAddressResolving$: BehaviorSubject<boolean>;
|
|
38
|
+
shippingAddressMutating$: BehaviorSubject<boolean>;
|
|
39
|
+
shippingInformationLoading$: BehaviorSubject<boolean>;
|
|
40
|
+
shippingInformationResolving$: BehaviorSubject<boolean>;
|
|
41
|
+
shippingInformationMutating$: BehaviorSubject<boolean>;
|
|
42
|
+
shippingMethodsLoading$: BehaviorSubject<boolean>;
|
|
43
|
+
shippingMethodsResolving$: BehaviorSubject<boolean>;
|
|
44
|
+
paymentLoading$: BehaviorSubject<boolean>;
|
|
45
|
+
paymentResolving$: BehaviorSubject<boolean>;
|
|
46
|
+
paymentMutating$: BehaviorSubject<boolean>;
|
|
47
|
+
paymentMethodsLoading$: BehaviorSubject<boolean>;
|
|
48
|
+
paymentMethodsResolving$: BehaviorSubject<boolean>;
|
|
49
|
+
couponLoading$: BehaviorSubject<boolean>;
|
|
50
|
+
couponResolving$: BehaviorSubject<boolean>;
|
|
51
|
+
couponMutating$: BehaviorSubject<boolean>;
|
|
52
|
+
itemLoading$: BehaviorSubject<boolean>;
|
|
53
|
+
itemAdding$: BehaviorSubject<boolean>;
|
|
54
|
+
itemResolving$: BehaviorSubject<boolean>;
|
|
55
|
+
itemMutating$: BehaviorSubject<boolean>;
|
|
56
|
+
errors$: BehaviorSubject<DaffCartErrors>;
|
|
57
|
+
cartErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.Cart]>;
|
|
58
|
+
itemErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.Item]>;
|
|
59
|
+
billingAddressErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.BillingAddress]>;
|
|
60
|
+
shippingAddressErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.ShippingAddress]>;
|
|
61
|
+
shippingInformationErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.ShippingInformation]>;
|
|
62
|
+
shippingMethodsErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.ShippingMethods]>;
|
|
63
|
+
paymentErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.Payment]>;
|
|
64
|
+
paymentMethodsErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.PaymentMethods]>;
|
|
65
|
+
couponErrors$: BehaviorSubject<DaffCartErrors[DaffCartOperationType.Coupon]>;
|
|
66
|
+
itemEntities$: BehaviorSubject<DaffOperationEntity<DaffCartItem>[]>;
|
|
67
|
+
totalItems$: BehaviorSubject<number>;
|
|
68
|
+
hasOutOfStockItems$: BehaviorSubject<boolean>;
|
|
69
|
+
outOfStockItems$: BehaviorSubject<DaffOperationEntity<DaffCartItem>[]>;
|
|
70
|
+
inStockItems$: BehaviorSubject<DaffOperationEntity<DaffCartItem>[]>;
|
|
71
|
+
itemDictionary$: BehaviorSubject<Dictionary<DaffOperationEntity<DaffCartItem>>>;
|
|
72
|
+
paymentId$: BehaviorSubject<any>;
|
|
73
|
+
isCartEmpty$: BehaviorSubject<boolean>;
|
|
74
|
+
isBillingSameAsShipping$: BehaviorSubject<boolean>;
|
|
75
|
+
hasBillingAddress$: BehaviorSubject<boolean>;
|
|
76
|
+
hasShippingAddress$: BehaviorSubject<boolean>;
|
|
77
|
+
hasShippingMethod$: BehaviorSubject<boolean>;
|
|
78
|
+
hasPaymentMethod$: BehaviorSubject<boolean>;
|
|
79
|
+
canPlaceOrder$: BehaviorSubject<boolean>;
|
|
80
|
+
orderResultLoading$: BehaviorSubject<boolean>;
|
|
81
|
+
orderResultErrors$: BehaviorSubject<DaffStateError[]>;
|
|
82
|
+
orderResult$: BehaviorSubject<DaffCartOrderResult>;
|
|
83
|
+
orderResultId$: BehaviorSubject<string>;
|
|
84
|
+
orderResultCartId$: BehaviorSubject<string>;
|
|
85
|
+
hasOrderResult$: BehaviorSubject<boolean>;
|
|
86
|
+
getConfiguredCartItemAttributes(itemId: DaffCartItem['id']): BehaviorSubject<DaffConfigurableCartItemAttribute[]>;
|
|
87
|
+
getCompositeCartItemOptions(itemId: DaffCartItem['id']): BehaviorSubject<DaffCompositeCartItemOption[]>;
|
|
88
|
+
isCartItemOutOfStock(itemId: DaffCartItem['id']): BehaviorSubject<boolean>;
|
|
89
|
+
dispatch(action: Action): void;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffCartFacade, never>;
|
|
91
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
86
92
|
}
|
|
87
|
-
|
|
88
93
|
/**
|
|
89
94
|
* @role mock
|
|
90
95
|
*/
|
|
91
|
-
declare class DaffMockStatefulCartItem extends DaffMockCartItem implements DaffOperationEntity<DaffCartItem> {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
export declare class DaffMockStatefulCartItem extends DaffMockCartItem implements DaffOperationEntity<DaffCartItem> {
|
|
97
|
+
daffState: DaffState;
|
|
98
|
+
daffErrors: any[];
|
|
99
|
+
daffTemp: boolean;
|
|
95
100
|
}
|
|
96
|
-
declare class DaffStatefulCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffCartItem>> {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
export declare class DaffStatefulCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffCartItem>> {
|
|
102
|
+
constructor();
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffStatefulCartItemFactory, never>;
|
|
104
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
100
105
|
}
|
|
101
|
-
|
|
102
106
|
/**
|
|
103
107
|
* @role mock
|
|
104
108
|
*/
|
|
105
|
-
declare class DaffMockStatefulCompositeCartItem extends DaffMockCompositeCartItem implements DaffOperationEntity<DaffCompositeCartItem> {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
export declare class DaffMockStatefulCompositeCartItem extends DaffMockCompositeCartItem implements DaffOperationEntity<DaffCompositeCartItem> {
|
|
110
|
+
daffState: DaffState;
|
|
111
|
+
daffErrors: any[];
|
|
112
|
+
daffTemp: boolean;
|
|
109
113
|
}
|
|
110
|
-
declare class DaffStatefulCompositeCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffCompositeCartItem>> {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
export declare class DaffStatefulCompositeCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffCompositeCartItem>> {
|
|
115
|
+
constructor();
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffStatefulCompositeCartItemFactory, never>;
|
|
117
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
114
118
|
}
|
|
115
|
-
|
|
116
119
|
/**
|
|
117
120
|
* @role mock
|
|
118
121
|
*/
|
|
119
|
-
declare class DaffMockStatefulConfigurableCartItem extends DaffMockConfigurableCartItem implements DaffOperationEntity<DaffConfigurableCartItem> {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
declare class DaffStatefulConfigurableCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffConfigurableCartItem>> {
|
|
125
|
-
constructor();
|
|
126
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffStatefulConfigurableCartItemFactory, never>;
|
|
127
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffStatefulConfigurableCartItemFactory>;
|
|
122
|
+
export declare class DaffMockStatefulConfigurableCartItem extends DaffMockConfigurableCartItem implements DaffOperationEntity<DaffConfigurableCartItem> {
|
|
123
|
+
daffState: DaffState;
|
|
124
|
+
daffErrors: any[];
|
|
125
|
+
daffTemp: boolean;
|
|
128
126
|
}
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
export declare class DaffStatefulConfigurableCartItemFactory extends DaffModelFactory<DaffOperationEntity<DaffConfigurableCartItem>> {
|
|
128
|
+
constructor();
|
|
129
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffStatefulConfigurableCartItemFactory, never>;
|
|
130
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
131
|
+
}
|