@daffodil/cart 0.94.1 → 0.95.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/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,168 +1,156 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
constructor(totalFactory: DaffCartTotalFactory, shippingInformationFactory: DaffCartShippingRateFactory);
|
|
61
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartFactory, never>;
|
|
62
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCartFactory>;
|
|
63
|
-
}
|
|
64
|
-
|
|
1
|
+
import { DaffCart, DaffCartAddress, DaffCartCoupon, DaffCartItem, DaffCartItemDiscount, DaffCartItemInputType, DaffCartPaymentMethod, DaffCartShippingRate, DaffCartTotal, DaffCartTotalTypeEnum, DaffCompositeCartItem, DaffConfigurableCartItem } from "@daffodil/cart";
|
|
2
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { DaffProduct, DaffProductImage } from "@daffodil/product";
|
|
5
|
+
export declare class MockCartShippingRate implements DaffCartShippingRate {
|
|
6
|
+
id: string;
|
|
7
|
+
carrier: string;
|
|
8
|
+
carrier_title: string;
|
|
9
|
+
method_code: string;
|
|
10
|
+
method_title: string;
|
|
11
|
+
method_description: string;
|
|
12
|
+
price: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class DaffCartShippingRateFactory extends DaffModelFactory<DaffCartShippingRate> {
|
|
15
|
+
constructor();
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartShippingRateFactory, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
18
|
+
}
|
|
19
|
+
export declare class MockDaffCartTotal implements DaffCartTotal {
|
|
20
|
+
name: DaffCartTotalTypeEnum;
|
|
21
|
+
value: number;
|
|
22
|
+
label: string;
|
|
23
|
+
order: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class DaffCartTotalFactory extends DaffModelFactory<DaffCartTotal> {
|
|
26
|
+
constructor();
|
|
27
|
+
createGrandTotal(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
28
|
+
createSubtotalExcludingTax(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
29
|
+
createSubtotalIncludingTax(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
30
|
+
createSubtotalWithDiscountExcludingTax(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
31
|
+
createSubtotalWithDiscountIncludingTax(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
32
|
+
createTax(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
33
|
+
createDiscount(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
34
|
+
createShipping(partial?: Partial<DaffCartTotal>): DaffCartTotal;
|
|
35
|
+
createAllTotals(): Record<DaffCartTotal['name'], DaffCartTotal>;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartTotalFactory, never>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
38
|
+
}
|
|
39
|
+
export declare class MockCart implements DaffCart {
|
|
40
|
+
protected totalFactory: DaffCartTotalFactory;
|
|
41
|
+
protected shippingInformationFactory: DaffCartShippingRateFactory;
|
|
42
|
+
id: string;
|
|
43
|
+
coupons: any[];
|
|
44
|
+
items: any[];
|
|
45
|
+
billing_address: any;
|
|
46
|
+
shipping_address: any;
|
|
47
|
+
shipping_information: import("@daffodil/cart").DaffCartShippingRate;
|
|
48
|
+
totals: Record<string, import("@daffodil/cart").DaffCartTotal>;
|
|
49
|
+
payment: any;
|
|
50
|
+
available_shipping_methods: any[];
|
|
51
|
+
available_payment_methods: any[];
|
|
52
|
+
extra_attributes: {};
|
|
53
|
+
constructor(totalFactory: DaffCartTotalFactory, shippingInformationFactory: DaffCartShippingRateFactory);
|
|
54
|
+
}
|
|
55
|
+
export declare class DaffCartFactory extends DaffModelFactory<DaffCart> {
|
|
56
|
+
constructor(totalFactory: DaffCartTotalFactory, shippingInformationFactory: DaffCartShippingRateFactory);
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartFactory, never>;
|
|
58
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
59
|
+
}
|
|
65
60
|
/**
|
|
66
61
|
* @role mock
|
|
67
62
|
*/
|
|
68
|
-
declare class DaffMockCartItem implements DaffCartItem {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
declare class DaffCartItemFactory extends DaffModelFactory<DaffCartItem> {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
63
|
+
export declare class DaffMockCartItem implements DaffCartItem {
|
|
64
|
+
id: string;
|
|
65
|
+
type: DaffCartItemInputType;
|
|
66
|
+
product_id: string;
|
|
67
|
+
parent_item_id: string;
|
|
68
|
+
image: DaffProductImage;
|
|
69
|
+
sku: string;
|
|
70
|
+
name: string;
|
|
71
|
+
url: string;
|
|
72
|
+
qty: number;
|
|
73
|
+
price: number;
|
|
74
|
+
row_total: number;
|
|
75
|
+
in_stock: boolean;
|
|
76
|
+
_numberOfDiscounts: number;
|
|
77
|
+
discounts: DaffCartItemDiscount[];
|
|
78
|
+
private _discounts;
|
|
79
|
+
}
|
|
80
|
+
export declare class DaffCartItemFactory extends DaffModelFactory<DaffCartItem> {
|
|
81
|
+
constructor();
|
|
82
|
+
fromProduct(product: DaffProduct): DaffCartItem;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartItemFactory, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
85
|
+
}
|
|
92
86
|
/**
|
|
93
87
|
* @role mock
|
|
94
88
|
*/
|
|
95
|
-
declare class DaffMockConfigurableCartItem extends DaffMockCartItem implements DaffConfigurableCartItem {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
declare class DaffConfigurableCartItemFactory extends DaffModelFactory<DaffConfigurableCartItem> {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
89
|
+
export declare class DaffMockConfigurableCartItem extends DaffMockCartItem implements DaffConfigurableCartItem {
|
|
90
|
+
type: DaffCartItemInputType;
|
|
91
|
+
attributes: {
|
|
92
|
+
attribute_label: string;
|
|
93
|
+
value_label: string;
|
|
94
|
+
}[];
|
|
95
|
+
}
|
|
96
|
+
export declare class DaffConfigurableCartItemFactory extends DaffModelFactory<DaffConfigurableCartItem> {
|
|
97
|
+
constructor();
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffConfigurableCartItemFactory, never>;
|
|
99
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
100
|
+
}
|
|
108
101
|
/**
|
|
109
102
|
* @role mock
|
|
110
103
|
*/
|
|
111
|
-
declare class DaffMockCompositeCartItem extends DaffMockCartItem implements DaffCompositeCartItem {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
id: string;
|
|
115
|
-
option_label: string;
|
|
116
|
-
value_label: string;
|
|
117
|
-
}[];
|
|
118
|
-
}
|
|
119
|
-
declare class DaffCompositeCartItemFactory extends DaffModelFactory<DaffCompositeCartItem> {
|
|
120
|
-
constructor();
|
|
121
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompositeCartItemFactory, never>;
|
|
122
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCompositeCartItemFactory>;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare class MockCartAddress implements DaffCartAddress {
|
|
126
|
-
id: string;
|
|
127
|
-
email: string;
|
|
128
|
-
prefix: string;
|
|
129
|
-
firstname: string;
|
|
130
|
-
middlename: string;
|
|
131
|
-
lastname: string;
|
|
132
|
-
suffix: string;
|
|
133
|
-
company: string;
|
|
134
|
-
street: string;
|
|
135
|
-
city: string;
|
|
136
|
-
state: string;
|
|
137
|
-
region: string;
|
|
138
|
-
postcode: string;
|
|
139
|
-
country_id: string;
|
|
140
|
-
telephone: string;
|
|
141
|
-
}
|
|
142
|
-
declare class DaffCartAddressFactory extends DaffModelFactory<DaffCartAddress> {
|
|
143
|
-
constructor();
|
|
144
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartAddressFactory, never>;
|
|
145
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCartAddressFactory>;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare class MockCartPayment implements DaffCartPaymentMethod {
|
|
149
|
-
method: string;
|
|
150
|
-
}
|
|
151
|
-
declare class DaffCartPaymentFactory extends DaffModelFactory<DaffCartPaymentMethod> {
|
|
152
|
-
constructor();
|
|
153
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartPaymentFactory, never>;
|
|
154
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCartPaymentFactory>;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
declare class MockDaffCartCoupon implements DaffCartCoupon {
|
|
104
|
+
export declare class DaffMockCompositeCartItem extends DaffMockCartItem implements DaffCompositeCartItem {
|
|
105
|
+
type: DaffCartItemInputType;
|
|
106
|
+
options: {
|
|
158
107
|
id: string;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
export
|
|
108
|
+
option_label: string;
|
|
109
|
+
value_label: string;
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
112
|
+
export declare class DaffCompositeCartItemFactory extends DaffModelFactory<DaffCompositeCartItem> {
|
|
113
|
+
constructor();
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompositeCartItemFactory, never>;
|
|
115
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
116
|
+
}
|
|
117
|
+
export declare class MockCartAddress implements DaffCartAddress {
|
|
118
|
+
id: string;
|
|
119
|
+
email: string;
|
|
120
|
+
prefix: string;
|
|
121
|
+
firstname: string;
|
|
122
|
+
middlename: string;
|
|
123
|
+
lastname: string;
|
|
124
|
+
suffix: string;
|
|
125
|
+
company: string;
|
|
126
|
+
street: string;
|
|
127
|
+
city: string;
|
|
128
|
+
state: string;
|
|
129
|
+
region: string;
|
|
130
|
+
postcode: string;
|
|
131
|
+
country_id: string;
|
|
132
|
+
telephone: string;
|
|
133
|
+
}
|
|
134
|
+
export declare class DaffCartAddressFactory extends DaffModelFactory<DaffCartAddress> {
|
|
135
|
+
constructor();
|
|
136
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartAddressFactory, never>;
|
|
137
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
138
|
+
}
|
|
139
|
+
export declare class MockCartPayment implements DaffCartPaymentMethod {
|
|
140
|
+
method: string;
|
|
141
|
+
}
|
|
142
|
+
export declare class DaffCartPaymentFactory extends DaffModelFactory<DaffCartPaymentMethod> {
|
|
143
|
+
constructor();
|
|
144
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartPaymentFactory, never>;
|
|
145
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
146
|
+
}
|
|
147
|
+
export declare class MockDaffCartCoupon implements DaffCartCoupon {
|
|
148
|
+
id: string;
|
|
149
|
+
code: string;
|
|
150
|
+
description: string;
|
|
151
|
+
}
|
|
152
|
+
export declare class DaffCartCouponFactory extends DaffModelFactory<DaffCartCoupon> {
|
|
153
|
+
constructor();
|
|
154
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartCouponFactory, never>;
|
|
155
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
156
|
+
}
|