@daffodil/cart 0.94.1-rc.0 → 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
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
import { DaffCart, DaffCartAddress, DaffCartItem, DaffCartItemInput, DaffCartPaymentMethod, DaffCartShippingRate } from "@daffodil/cart";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
4
|
+
import { MagentoDiscount, MagentoMoney } from "@daffodil/driver/magento/2.4.7";
|
|
5
|
+
import { MagentoProductStockStatusEnum } from "@daffodil/product/driver/magento/2.4.7";
|
|
6
|
+
import { DocumentNode, GraphQLFormattedError } from "graphql";
|
|
7
|
+
import { DaffError } from "@daffodil/core";
|
|
8
|
+
import { Apollo } from "apollo-angular";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DaffCartAddressServiceInterface, DaffCartBillingAddressServiceInterface, DaffCartItemServiceInterface, DaffCartPaymentMethodsServiceInterface, DaffCartPaymentServiceInterface, DaffCartServiceInterface, DaffCartShippingAddressServiceInterface, DaffCartShippingInformationServiceInterface, DaffCartShippingMethodsServiceInterface, DaffProductOutOfStockError } from "@daffodil/cart/driver";
|
|
11
|
+
import { DaffQueuedApollo } from "@daffodil/core/graphql";
|
|
12
|
+
import { DaffDriverResponse } from "@daffodil/driver";
|
|
13
|
+
import * as i1 from "@angular/common";
|
|
14
|
+
export interface MagentoCartAddress {
|
|
15
|
+
region: {
|
|
16
|
+
code: string;
|
|
17
|
+
region_id: number;
|
|
18
|
+
};
|
|
19
|
+
country: {
|
|
20
|
+
code: string;
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
street: string[];
|
|
24
|
+
company: string;
|
|
25
|
+
telephone: string;
|
|
26
|
+
postcode: string;
|
|
27
|
+
city: string;
|
|
28
|
+
firstname: string;
|
|
29
|
+
lastname: string;
|
|
30
|
+
email: string;
|
|
31
|
+
customer_address_id: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Transforms magento addresses into an object usable by daffodil.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DaffMagentoCartAddressTransformer {
|
|
37
|
+
/**
|
|
38
|
+
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
39
|
+
*
|
|
40
|
+
* @param address the address from a magento cart query.
|
|
41
|
+
*/
|
|
42
|
+
transform(address: MagentoCartAddress): DaffCartAddress;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartAddressTransformer, never>;
|
|
44
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Transforms magento addresses into an object usable by daffodil.
|
|
48
|
+
*/
|
|
49
|
+
export declare class DaffMagentoBillingAddressTransformer {
|
|
50
|
+
private addressTransformer;
|
|
51
|
+
constructor(addressTransformer: DaffMagentoCartAddressTransformer);
|
|
52
|
+
/**
|
|
53
|
+
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
54
|
+
*
|
|
55
|
+
* @param address the address from a magento cart query.
|
|
56
|
+
*/
|
|
57
|
+
transform(address: MagentoCartAddress): DaffCartAddress;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoBillingAddressTransformer, never>;
|
|
59
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
60
|
+
}
|
|
61
|
+
export interface MagentoCartPaymentMethod {
|
|
62
|
+
__typename?: string;
|
|
63
|
+
code: string;
|
|
64
|
+
purchase_order_number?: string;
|
|
65
|
+
title: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Transforms magento carts into an object usable by daffodil.
|
|
69
|
+
*/
|
|
70
|
+
export declare class DaffMagentoCartPaymentTransformer {
|
|
71
|
+
/**
|
|
72
|
+
* Transforms the magento CartPayment from the magento cart query into a DaffCartPaymentMethod.
|
|
73
|
+
*
|
|
74
|
+
* @param responsePayment - the response from a magento cart query.
|
|
75
|
+
*/
|
|
76
|
+
transform(responsePayment: MagentoCartPaymentMethod): DaffCartPaymentMethod;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartPaymentTransformer, never>;
|
|
78
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
79
|
+
}
|
|
80
|
+
export interface MagentoCartShippingMethod {
|
|
81
|
+
carrier_code: string;
|
|
82
|
+
method_code: string;
|
|
83
|
+
carrier_title: string;
|
|
84
|
+
method_title: string;
|
|
85
|
+
amount: MagentoMoney;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Transforms magento cart shipping methods into an object usable by daffodil.
|
|
89
|
+
*/
|
|
90
|
+
export declare class DaffMagentoCartShippingRateTransformer {
|
|
91
|
+
/**
|
|
92
|
+
* Transforms the magento shipping method from the magento cart query into a DaffCartShippingRate.
|
|
93
|
+
*
|
|
94
|
+
* @param shippingMethod the shippingMethod from a magento cart query.
|
|
95
|
+
*/
|
|
96
|
+
transform(shippingMethod: MagentoCartShippingMethod): DaffCartShippingRate;
|
|
97
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartShippingRateTransformer, never>;
|
|
98
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
99
|
+
}
|
|
100
|
+
export interface MagentoShippingAddress extends MagentoCartAddress {
|
|
101
|
+
available_shipping_methods: MagentoCartShippingMethod[];
|
|
102
|
+
selected_shipping_method: MagentoCartShippingMethod;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Transforms magento addresses into an object usable by daffodil.
|
|
106
|
+
*/
|
|
107
|
+
export declare class DaffMagentoShippingAddressTransformer {
|
|
108
|
+
private addressTransformer;
|
|
109
|
+
constructor(addressTransformer: DaffMagentoCartAddressTransformer);
|
|
110
|
+
/**
|
|
111
|
+
* Transforms the magento MagentoCart from the magento cart query into a DaffCartAddress.
|
|
112
|
+
*
|
|
113
|
+
* @param address the address from a magento cart query.
|
|
114
|
+
*/
|
|
115
|
+
transform(address: MagentoShippingAddress): DaffCartAddress;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoShippingAddressTransformer, never>;
|
|
117
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
118
|
+
}
|
|
119
|
+
export interface MagentoCartAddressInput {
|
|
120
|
+
city: string;
|
|
121
|
+
company?: string;
|
|
122
|
+
country_code: string;
|
|
123
|
+
firstname: string;
|
|
124
|
+
lastname: string;
|
|
125
|
+
postcode?: string;
|
|
126
|
+
region_id: number;
|
|
127
|
+
save_in_address_book: boolean;
|
|
128
|
+
street: string[];
|
|
129
|
+
telephone?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface MagentoCartAddressInputBase {
|
|
132
|
+
address?: MagentoCartAddressInput;
|
|
133
|
+
customer_address_id?: number;
|
|
134
|
+
}
|
|
135
|
+
export interface MagentoBillingAddressInput extends MagentoCartAddressInputBase {
|
|
136
|
+
same_as_shipping?: boolean;
|
|
137
|
+
use_for_shipping?: boolean;
|
|
138
|
+
}
|
|
139
|
+
export interface MagentoCartItemInput {
|
|
140
|
+
quantity: number;
|
|
141
|
+
sku: string;
|
|
142
|
+
parent_sku?: string;
|
|
143
|
+
selected_options?: string[];
|
|
144
|
+
entered_options?: MagentoEnteredOptionInput[];
|
|
145
|
+
}
|
|
146
|
+
export interface MagentoEnteredOptionInput {
|
|
147
|
+
uid: string;
|
|
148
|
+
value: string;
|
|
149
|
+
}
|
|
150
|
+
export interface MagentoCartItemUpdateInput {
|
|
151
|
+
cart_item_id: number;
|
|
152
|
+
quantity: number;
|
|
153
|
+
}
|
|
154
|
+
export interface MagentoPaymentMethodInput {
|
|
155
|
+
code: string;
|
|
156
|
+
purchase_order_number?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface MagentoShippingAddressInput extends MagentoCartAddressInputBase {
|
|
159
|
+
customer_notes?: string;
|
|
160
|
+
}
|
|
161
|
+
export interface MagentoShippingMethodInput {
|
|
162
|
+
carrier_code: string;
|
|
163
|
+
method_code: string;
|
|
164
|
+
}
|
|
165
|
+
export declare enum MagentoCartUserInputErrorType {
|
|
166
|
+
PRODUCT_NOT_FOUND = "PRODUCT_NOT_FOUND",
|
|
167
|
+
NOT_SALABLE = "NOT_SALABLE",
|
|
168
|
+
INSUFFICIENT_STOCK = "INSUFFICIENT_STOCK",
|
|
169
|
+
UNDEFINED = "UNDEFINED"
|
|
170
|
+
}
|
|
171
|
+
export interface MagentoCartUserInputError {
|
|
172
|
+
message: string;
|
|
173
|
+
code: MagentoCartUserInputErrorType;
|
|
174
|
+
}
|
|
175
|
+
export interface MagentoCartCoupon {
|
|
176
|
+
__typename?: 'AppliedCoupon';
|
|
177
|
+
code: string;
|
|
178
|
+
}
|
|
179
|
+
export declare enum MagentoCartItemTypeEnum {
|
|
180
|
+
Simple = "SimpleCartItem",
|
|
181
|
+
Bundle = "BundleCartItem",
|
|
182
|
+
Configurable = "ConfigurableCartItem"
|
|
183
|
+
}
|
|
184
|
+
export interface MagentoCartItemProduct {
|
|
185
|
+
__typename: string;
|
|
186
|
+
id: number;
|
|
187
|
+
name: string;
|
|
188
|
+
sku: string;
|
|
189
|
+
url_key: string;
|
|
190
|
+
url_suffix: string;
|
|
191
|
+
thumbnail: {
|
|
192
|
+
__typename: string;
|
|
193
|
+
label: string;
|
|
194
|
+
url: string;
|
|
195
|
+
};
|
|
196
|
+
stock_status: MagentoProductStockStatusEnum;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* An object for defining what the cart service requests and retrieves from a magento backend.
|
|
200
|
+
*/
|
|
201
|
+
export interface MagentoCartItem {
|
|
202
|
+
__typename: MagentoCartItemTypeEnum;
|
|
203
|
+
id: string;
|
|
204
|
+
prices: {
|
|
205
|
+
price: MagentoMoney;
|
|
206
|
+
row_total: MagentoMoney;
|
|
207
|
+
discounts?: MagentoDiscount[];
|
|
208
|
+
};
|
|
209
|
+
product: MagentoCartItemProduct;
|
|
210
|
+
quantity: number;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* An interface for magento bundled cart items.
|
|
214
|
+
*/
|
|
215
|
+
export interface MagentoBundleCartItem extends MagentoCartItem {
|
|
216
|
+
bundle_options: {
|
|
217
|
+
id: number;
|
|
218
|
+
label: string;
|
|
219
|
+
type: string;
|
|
220
|
+
values: {
|
|
221
|
+
id: number;
|
|
222
|
+
label: string;
|
|
223
|
+
price: number;
|
|
224
|
+
quantity: number;
|
|
225
|
+
}[];
|
|
226
|
+
}[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* An interface for magento configurable cart items.
|
|
230
|
+
*/
|
|
231
|
+
export interface MagentoConfigurableCartItem extends MagentoCartItem {
|
|
232
|
+
configurable_options: {
|
|
233
|
+
option_label: string;
|
|
234
|
+
value_label: string;
|
|
235
|
+
}[];
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* An object for defining what the cart service requests and retrieves from a magento backend.
|
|
239
|
+
*/
|
|
240
|
+
export interface MagentoCart {
|
|
241
|
+
id: string;
|
|
242
|
+
email: string;
|
|
243
|
+
billing_address: MagentoCartAddress;
|
|
244
|
+
shipping_addresses: MagentoShippingAddress[];
|
|
245
|
+
items: MagentoCartItem[];
|
|
246
|
+
available_payment_methods: MagentoCartPaymentMethod[];
|
|
247
|
+
selected_payment_method: MagentoCartPaymentMethod;
|
|
248
|
+
applied_coupons: MagentoCartCoupon[];
|
|
249
|
+
prices: {
|
|
250
|
+
grand_total: MagentoMoney;
|
|
251
|
+
subtotal_excluding_tax: MagentoMoney;
|
|
252
|
+
subtotal_including_tax: MagentoMoney;
|
|
253
|
+
subtotal_with_discount_excluding_tax: MagentoMoney;
|
|
254
|
+
applied_taxes: {
|
|
255
|
+
amount: MagentoMoney;
|
|
256
|
+
label: string;
|
|
257
|
+
}[];
|
|
258
|
+
discounts?: {
|
|
259
|
+
amount: MagentoMoney;
|
|
260
|
+
label: string;
|
|
261
|
+
}[];
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export type DaffCartMagentoCartItemTransform<T extends MagentoCartItem = MagentoCartItem, V extends DaffCartItem = DaffCartItem> = (daffCartItem: DaffCartItem, magentoCartItem: T) => V;
|
|
265
|
+
/**
|
|
266
|
+
* A transform for the Magento driver that can add extra fields or otherwise modify the cart driver response.
|
|
267
|
+
*/
|
|
268
|
+
export type DaffCartMagentoCartTransform<T extends MagentoCart = MagentoCart, V extends DaffCart = DaffCart> = (daffCart: DaffCart, magentoCart: T) => V;
|
|
269
|
+
/**
|
|
270
|
+
* Transforms magento carts into an object usable by daffodil.
|
|
271
|
+
*/
|
|
272
|
+
export declare class DaffMagentoCartTransformer<T extends MagentoCart = MagentoCart, V extends DaffCart = DaffCart> {
|
|
273
|
+
private shippingAddressTransformer;
|
|
274
|
+
private billingAddressTransformer;
|
|
275
|
+
private paymentTransformer;
|
|
276
|
+
private shippingRateTransformer;
|
|
277
|
+
private cartItemTransforms;
|
|
278
|
+
private cartTransforms;
|
|
279
|
+
constructor(shippingAddressTransformer: DaffMagentoShippingAddressTransformer, billingAddressTransformer: DaffMagentoBillingAddressTransformer, paymentTransformer: DaffMagentoCartPaymentTransformer, shippingRateTransformer: DaffMagentoCartShippingRateTransformer, cartItemTransforms: DaffCartMagentoCartItemTransform[], cartTransforms: DaffCartMagentoCartTransform<T, V>[]);
|
|
280
|
+
private transformShippingAddress;
|
|
281
|
+
private transformBillingAddress;
|
|
282
|
+
private transformCartItems;
|
|
283
|
+
private transformCoupons;
|
|
284
|
+
private transformPayment;
|
|
285
|
+
private transformShippingInformation;
|
|
286
|
+
private transformShippingMethods;
|
|
287
|
+
private transformPaymentMethods;
|
|
288
|
+
/**
|
|
289
|
+
* Transforms the magento MagentoCart from the magento cart query into a DaffCart.
|
|
290
|
+
*
|
|
291
|
+
* @param cart the cart from a magento cart query.
|
|
292
|
+
*/
|
|
293
|
+
transform(cart: T): V;
|
|
294
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartTransformer<any, any>, never>;
|
|
295
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
296
|
+
}
|
|
297
|
+
export declare class DaffMagentoCartAddressInputTransformer {
|
|
298
|
+
transform(cartAddress: Partial<DaffCartAddress>): MagentoCartAddressInput;
|
|
299
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartAddressInputTransformer, never>;
|
|
300
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
301
|
+
}
|
|
302
|
+
export declare class DaffMagentoShippingAddressInputTransformer {
|
|
303
|
+
private cartAddressTransformer;
|
|
304
|
+
constructor(cartAddressTransformer: DaffMagentoCartAddressInputTransformer);
|
|
305
|
+
transform(cartAddress: Partial<DaffCartAddress>): MagentoShippingAddressInput;
|
|
306
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoShippingAddressInputTransformer, never>;
|
|
307
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
308
|
+
}
|
|
309
|
+
export declare class DaffMagentoBillingAddressInputTransformer {
|
|
310
|
+
private cartAddressTransformer;
|
|
311
|
+
constructor(cartAddressTransformer: DaffMagentoCartAddressInputTransformer);
|
|
312
|
+
transform(cartAddress: Partial<DaffCartAddress>): MagentoBillingAddressInput;
|
|
313
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoBillingAddressInputTransformer, never>;
|
|
314
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
315
|
+
}
|
|
316
|
+
export declare class DaffMagentoCartItemUpdateInputTransformer {
|
|
317
|
+
transform(item: Partial<DaffCartItem>): MagentoCartItemUpdateInput;
|
|
318
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartItemUpdateInputTransformer, never>;
|
|
319
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
320
|
+
}
|
|
321
|
+
export declare class DaffMagentoPaymentMethodInputTransformer {
|
|
322
|
+
transform(payment: Partial<DaffCartPaymentMethod>): MagentoPaymentMethodInput;
|
|
323
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoPaymentMethodInputTransformer, never>;
|
|
324
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
325
|
+
}
|
|
326
|
+
export declare class DaffMagentoShippingMethodInputTransformer {
|
|
327
|
+
transform(method: Partial<DaffCartShippingRate>): MagentoShippingMethodInput;
|
|
328
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoShippingMethodInputTransformer, never>;
|
|
329
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
330
|
+
}
|
|
331
|
+
export declare const DAFF_CART_MAGENTO_EXTRA_CART_FRAGMENTS: import("@angular/core").InjectionToken<DocumentNode[]>, provideDaffCartMagentoExtraCartFragments: <R extends DocumentNode = DocumentNode>(...values: R[]) => Array<import("@angular/core").ValueProvider>, provideDaffCartMagentoExtraCartFragmentFactories: <R extends DocumentNode = DocumentNode>(...factories: (() => R)[]) => Array<import("@angular/core").FactoryProvider>;
|
|
332
|
+
export declare const DAFF_CART_MAGENTO_CART_ITEM_TRANSFORMS: import("@angular/core").InjectionToken<DaffCartMagentoCartItemTransform[]>, provideDaffCartMagentoCartItemTransforms: <R extends DaffCartMagentoCartItemTransform = DaffCartMagentoCartItemTransform>(...values: R[]) => Array<import("@angular/core").ValueProvider>, provideDaffCartMagentoCartItemTransformFactories: <R extends DaffCartMagentoCartItemTransform = DaffCartMagentoCartItemTransform>(...factories: (() => R)[]) => Array<import("@angular/core").FactoryProvider>;
|
|
333
|
+
export declare const DAFF_CART_MAGENTO_CART_TRANSFORMS: import("@angular/core").InjectionToken<DaffCartMagentoCartTransform[]>, provideDaffCartMagentoCartTransforms: <R extends DaffCartMagentoCartTransform = DaffCartMagentoCartTransform>(...values: R[]) => Array<import("@angular/core").ValueProvider>, provideDaffCartMagentoCartTransformFactories: <R extends DaffCartMagentoCartTransform = DaffCartMagentoCartTransform>(...factories: (() => R)[]) => Array<import("@angular/core").FactoryProvider>;
|
|
334
|
+
export declare const cartCouponFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
335
|
+
export declare const cartAddressFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
336
|
+
export declare const cartItemFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
337
|
+
export declare const availablePaymentMethodFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
338
|
+
export declare const selectedPaymentMethodFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
339
|
+
export declare const availableShippingMethodFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
340
|
+
export declare const selectedShippingMethodFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
341
|
+
export declare const cartFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
342
|
+
export declare const pricesFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
343
|
+
export declare const magentoCartUserError: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
344
|
+
export interface MagentoGetCartResponse {
|
|
345
|
+
__typename: string;
|
|
346
|
+
cart: MagentoCart;
|
|
347
|
+
}
|
|
348
|
+
export interface MagentoCartGetQueryVariables {
|
|
349
|
+
cartId: string;
|
|
350
|
+
}
|
|
351
|
+
export declare const getCart: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoGetCartResponse, MagentoCartGetQueryVariables>;
|
|
352
|
+
interface Response extends MagentoGetCartResponse {
|
|
353
|
+
user_errors: MagentoCartUserInputError[];
|
|
354
|
+
}
|
|
355
|
+
export interface MagentoAddCartItemResponse {
|
|
356
|
+
addProductsToCart: Response;
|
|
357
|
+
}
|
|
358
|
+
export interface MagentoCartAddItemQueryVariables {
|
|
359
|
+
cartId: string;
|
|
360
|
+
input: MagentoCartItemInput;
|
|
361
|
+
}
|
|
362
|
+
export declare const addCartItem: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoAddCartItemResponse, MagentoCartAddItemQueryVariables>;
|
|
363
|
+
export interface MagentoApplyCouponResponse {
|
|
364
|
+
applyCouponToCart: {
|
|
365
|
+
cart: MagentoCart;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
export interface MagentoCartApplyCouponQueryVariables {
|
|
369
|
+
cartId: string;
|
|
370
|
+
couponCode: string;
|
|
371
|
+
}
|
|
372
|
+
export declare const applyCoupon: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoApplyCouponResponse, MagentoCartApplyCouponQueryVariables>;
|
|
373
|
+
export declare const createCart: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
374
|
+
export interface MagentoCartCreateCartQueryVariables {}
|
|
375
|
+
export interface MagentoCreateCartResponse {
|
|
376
|
+
createEmptyCart: MagentoCart['id'];
|
|
377
|
+
}
|
|
378
|
+
export interface MagentoGetBillingAddressResponse {
|
|
379
|
+
cart: {
|
|
380
|
+
__typename: string;
|
|
381
|
+
billing_address: MagentoCartAddress;
|
|
382
|
+
email: string;
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
export interface MagentoCartGetBillingAddressQueryVariables {
|
|
386
|
+
cartId: string;
|
|
387
|
+
}
|
|
388
|
+
export declare const getBillingAddress: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoGetBillingAddressResponse, MagentoCartGetBillingAddressQueryVariables>;
|
|
389
|
+
export interface MagentoGetSelectedPaymentMethodResponse {
|
|
390
|
+
cart: {
|
|
391
|
+
__typename: string;
|
|
392
|
+
selected_payment_method: MagentoCartPaymentMethod;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
export interface MagentoCartGetSelectedPaymentMethodQueryVariables {
|
|
396
|
+
cartId: string;
|
|
397
|
+
}
|
|
398
|
+
export declare const getSelectedPaymentMethod: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoGetSelectedPaymentMethodResponse, MagentoCartGetSelectedPaymentMethodQueryVariables>;
|
|
399
|
+
export interface MagentoGetSelectedShippingMethodResponse {
|
|
400
|
+
cart: {
|
|
401
|
+
__typename: string;
|
|
402
|
+
shipping_addresses: {
|
|
403
|
+
__typename: string;
|
|
404
|
+
selected_shipping_method: MagentoCartShippingMethod;
|
|
405
|
+
}[];
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
export interface MagentoCartGetSelectedShippingMethodQueryVariables {
|
|
409
|
+
cartId: string;
|
|
410
|
+
}
|
|
411
|
+
export declare const getSelectedShippingMethod: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoGetSelectedShippingMethodResponse, MagentoCartGetSelectedShippingMethodQueryVariables>;
|
|
412
|
+
export interface MagentoGetShippingAddressResponse {
|
|
413
|
+
cart: {
|
|
414
|
+
__typename: string;
|
|
415
|
+
shipping_addresses: MagentoShippingAddress[];
|
|
416
|
+
email: string;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
export interface MagentoCartGetShippingAddressQueryVariables {
|
|
420
|
+
cartId: string;
|
|
421
|
+
}
|
|
422
|
+
export declare const getShippingAddress: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoGetShippingAddressResponse, MagentoCartGetShippingAddressQueryVariables>;
|
|
423
|
+
export interface MagentoListCartCouponsResponse {
|
|
424
|
+
cart: {
|
|
425
|
+
applied_coupons: MagentoCart['applied_coupons'];
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
export interface MagentoCartListCouponsQueryVariables {
|
|
429
|
+
cartId: string;
|
|
430
|
+
}
|
|
431
|
+
export declare const listCartCoupons: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoListCartCouponsResponse, MagentoCartListCouponsQueryVariables>;
|
|
432
|
+
export interface MagentoListCartItemsResponse {
|
|
433
|
+
cart: {
|
|
434
|
+
__typename: string;
|
|
435
|
+
items: MagentoCartItem[];
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
export interface MagentoCartListItemsQueryVariables {
|
|
439
|
+
cartId: string;
|
|
440
|
+
}
|
|
441
|
+
export declare const listCartItems: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoListCartItemsResponse, MagentoCartListItemsQueryVariables>;
|
|
442
|
+
export interface MagentoListPaymentMethodsResponse {
|
|
443
|
+
cart: {
|
|
444
|
+
__typename: string;
|
|
445
|
+
available_payment_methods: MagentoCartPaymentMethod[];
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
export interface MagentoCartListPaymentMethodsQueryVariables {
|
|
449
|
+
cartId: string;
|
|
450
|
+
}
|
|
451
|
+
export declare const listPaymentMethods: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoListPaymentMethodsResponse, MagentoCartListPaymentMethodsQueryVariables>;
|
|
452
|
+
export declare const listShippingMethods: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoListShippingMethodsResponse, MagentoCartListShippingMethodsQueryVariables>;
|
|
453
|
+
export interface MagentoCartListShippingMethodsQueryVariables {
|
|
454
|
+
cartId: string;
|
|
455
|
+
}
|
|
456
|
+
export interface MagentoPlaceOrderResponse {
|
|
457
|
+
placeOrder: {
|
|
458
|
+
order: {
|
|
459
|
+
order_number: string;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
export interface MagentoMergeCartsResponse {
|
|
464
|
+
mergeCarts: MagentoCart;
|
|
465
|
+
}
|
|
466
|
+
export interface MagentoCartMergeCartsQueryVariables {
|
|
467
|
+
source: string;
|
|
468
|
+
destination?: string;
|
|
469
|
+
}
|
|
470
|
+
export declare const magentoMergeCartsMutation: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoMergeCartsResponse, MagentoCartMergeCartsQueryVariables>;
|
|
471
|
+
export declare const placeOrder: import("apollo-angular").TypedDocumentNode<MagentoPlaceOrderResponse, MagentoCartPlaceOrderQueryVariables>;
|
|
472
|
+
export interface MagentoCartPlaceOrderQueryVariables {
|
|
473
|
+
cartId: string;
|
|
474
|
+
}
|
|
475
|
+
export interface MagentoListShippingMethodsResponse {
|
|
476
|
+
cart: {
|
|
477
|
+
__typename: string;
|
|
478
|
+
id: MagentoCart['id'];
|
|
479
|
+
shipping_addresses: {
|
|
480
|
+
__typename: string;
|
|
481
|
+
available_shipping_methods: MagentoCartShippingMethod[];
|
|
482
|
+
}[];
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export interface MagentoRemoveAllCouponsResponse {
|
|
486
|
+
removeCouponFromCart: {
|
|
487
|
+
cart: MagentoCart;
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
export interface MagentoCartRemoveAllCouponsQueryVariables {
|
|
491
|
+
cartId: string;
|
|
492
|
+
}
|
|
493
|
+
export declare const removeAllCoupons: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoRemoveAllCouponsResponse, MagentoCartRemoveAllCouponsQueryVariables>;
|
|
494
|
+
export interface MagentoRemoveCartItemResponse {
|
|
495
|
+
removeItemFromCart: MagentoGetCartResponse;
|
|
496
|
+
}
|
|
497
|
+
export interface MagentoCartRemoveItemQueryVariables {
|
|
498
|
+
cartId: string;
|
|
499
|
+
itemId: number;
|
|
500
|
+
}
|
|
501
|
+
export declare const removeCartItem: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoRemoveCartItemResponse, MagentoCartRemoveItemQueryVariables>;
|
|
502
|
+
export interface MagentoSetSelectedPaymentMethodWithBillingAndEmailResponse {
|
|
503
|
+
setPaymentMethodOnCart: {
|
|
504
|
+
__typename: string;
|
|
505
|
+
cart: {
|
|
506
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
setBillingAddressOnCart: {
|
|
510
|
+
__typename: string;
|
|
511
|
+
cart: {
|
|
512
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
setGuestEmailOnCart: MagentoGetCartResponse;
|
|
516
|
+
}
|
|
517
|
+
export interface MagentoCartSetSelectedPaymentMethodWithBillingAndEmailQueryVariables {
|
|
518
|
+
cartId: string;
|
|
519
|
+
payment: MagentoPaymentMethodInput;
|
|
520
|
+
address: MagentoBillingAddressInput;
|
|
521
|
+
email: string;
|
|
522
|
+
}
|
|
523
|
+
export declare const setSelectedPaymentMethodWithBillingAndEmail: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoSetSelectedPaymentMethodWithBillingAndEmailResponse, MagentoCartSetSelectedPaymentMethodWithBillingAndEmailQueryVariables>;
|
|
524
|
+
export interface MagentoSetSelectedPaymentMethodWithBillingResponse {
|
|
525
|
+
setBillingAddressOnCart: {
|
|
526
|
+
__typename: string;
|
|
527
|
+
cart: {
|
|
528
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
setPaymentMethodOnCart: MagentoGetCartResponse;
|
|
532
|
+
}
|
|
533
|
+
export interface MagentoCartSetSelectedPaymentMethodWithBillingQueryVariables {
|
|
534
|
+
cartId: string;
|
|
535
|
+
payment: MagentoPaymentMethodInput;
|
|
536
|
+
address: MagentoBillingAddressInput;
|
|
537
|
+
}
|
|
538
|
+
export declare const setSelectedPaymentMethodWithBilling: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoSetSelectedPaymentMethodWithBillingResponse, MagentoCartSetSelectedPaymentMethodWithBillingQueryVariables>;
|
|
539
|
+
export interface MagentoSetSelectedPaymentMethodResponse {
|
|
540
|
+
setPaymentMethodOnCart: MagentoGetCartResponse;
|
|
541
|
+
}
|
|
542
|
+
export interface MagentoCartSetSelectedPaymentMethodQueryVariables {
|
|
543
|
+
cartId: string;
|
|
544
|
+
payment: MagentoPaymentMethodInput;
|
|
545
|
+
}
|
|
546
|
+
export declare const setSelectedPaymentMethod: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoSetSelectedPaymentMethodResponse, MagentoCartSetSelectedPaymentMethodQueryVariables>;
|
|
547
|
+
export interface MagentoSetSelectedShippingMethodResponse {
|
|
548
|
+
setShippingMethodsOnCart: MagentoGetCartResponse;
|
|
549
|
+
}
|
|
550
|
+
export interface MagentoCartSetSelectedShippingMethodQueryVariables {
|
|
551
|
+
cartId: string;
|
|
552
|
+
method: MagentoShippingMethodInput;
|
|
553
|
+
}
|
|
554
|
+
export declare const setSelectedShippingMethod: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoSetSelectedShippingMethodResponse, MagentoCartSetSelectedShippingMethodQueryVariables>;
|
|
555
|
+
export interface MagentoUpdateAddressWithEmailResponse {
|
|
556
|
+
setBillingAddressOnCart: {
|
|
557
|
+
__typename?: string;
|
|
558
|
+
cart: {
|
|
559
|
+
__typename?: string;
|
|
560
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
setShippingAddressesOnCart: {
|
|
564
|
+
__typename?: string;
|
|
565
|
+
cart: {
|
|
566
|
+
__typename?: string;
|
|
567
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
setGuestEmailOnCart: MagentoGetCartResponse;
|
|
571
|
+
}
|
|
572
|
+
export interface MagentoCartUpdateAddressWithEmailQueryVariables {
|
|
573
|
+
cartId: string;
|
|
574
|
+
email: string;
|
|
575
|
+
address?: MagentoCartAddressInput;
|
|
576
|
+
addressId?: number;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Update the shipping and billing address of the cart.
|
|
580
|
+
* At the time of writing, Magento 2 processes compound queries in the order they are defined.
|
|
581
|
+
* We rely on this fact and only use the return of the last query.
|
|
582
|
+
* This helps us keep query complexity down and save some server CPU cycles.
|
|
583
|
+
* Driver behavior is not guaranteed if Magento no longer processes compound queries in the order they are defined.
|
|
584
|
+
*/
|
|
585
|
+
export declare const updateAddressWithEmail: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateAddressWithEmailResponse, MagentoCartUpdateAddressWithEmailQueryVariables>;
|
|
586
|
+
export interface MagentoUpdateAddressResponse {
|
|
587
|
+
setBillingAddressOnCart: {
|
|
588
|
+
__typename?: string;
|
|
589
|
+
cart: {
|
|
590
|
+
__typename?: string;
|
|
591
|
+
id: MagentoGetCartResponse['cart']['id'];
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
setShippingAddressesOnCart: MagentoGetCartResponse;
|
|
595
|
+
}
|
|
596
|
+
export interface MagentoCartUpdateAddressQueryVariables {
|
|
597
|
+
cartId: string;
|
|
598
|
+
address?: MagentoCartAddressInput;
|
|
599
|
+
addressId?: number;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Update the shipping and billing address of the cart.
|
|
603
|
+
* At the time of writing, Magento 2 processes compound queries in the order they are defined.
|
|
604
|
+
* We rely on this fact and only use the return of the last query.
|
|
605
|
+
* This helps us keep query complexity down and save some server CPU cycles.
|
|
606
|
+
* Driver behavior is not guaranteed if Magento no longer processes compound queries in the order they are defined.
|
|
607
|
+
*/
|
|
608
|
+
export declare const updateAddress: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateAddressResponse, MagentoCartUpdateAddressQueryVariables>;
|
|
609
|
+
export interface MagentoUpdateBillingAddressWithEmailResponse {
|
|
610
|
+
setBillingAddressOnCart: MagentoGetCartResponse;
|
|
611
|
+
setGuestEmailOnCart: {
|
|
612
|
+
__typename?: string;
|
|
613
|
+
cart: {
|
|
614
|
+
__typename?: string;
|
|
615
|
+
email: MagentoGetCartResponse['cart']['email'];
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
export interface MagentoCartUpdateBillingAddressWithEmailQueryVariables {
|
|
620
|
+
cartId: string;
|
|
621
|
+
email: string;
|
|
622
|
+
address: MagentoBillingAddressInput;
|
|
623
|
+
}
|
|
624
|
+
export declare const updateBillingAddressWithEmail: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateBillingAddressWithEmailResponse, MagentoCartUpdateBillingAddressWithEmailQueryVariables>;
|
|
625
|
+
export interface MagentoUpdateBillingAddressResponse {
|
|
626
|
+
setBillingAddressOnCart: MagentoGetCartResponse;
|
|
627
|
+
}
|
|
628
|
+
export interface MagentoCartUpdateBillingAddressQueryVariables {
|
|
629
|
+
cartId: string;
|
|
630
|
+
address: MagentoBillingAddressInput;
|
|
631
|
+
}
|
|
632
|
+
export declare const updateBillingAddress: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateBillingAddressResponse, MagentoCartUpdateBillingAddressQueryVariables>;
|
|
633
|
+
export interface MagentoUpdateCartItemResponse {
|
|
634
|
+
updateCartItems: MagentoGetCartResponse;
|
|
635
|
+
}
|
|
636
|
+
export interface MagentoCartUpdateItemQueryVariables {
|
|
637
|
+
cartId: string;
|
|
638
|
+
input: MagentoCartItemUpdateInput;
|
|
639
|
+
}
|
|
640
|
+
export declare const updateCartItem: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateCartItemResponse, MagentoCartUpdateItemQueryVariables>;
|
|
641
|
+
export interface MagentoUpdateShippingAddressWithEmailResponse {
|
|
642
|
+
setShippingAddressesOnCart: MagentoGetCartResponse;
|
|
643
|
+
setGuestEmailOnCart: {
|
|
644
|
+
__typename?: string;
|
|
645
|
+
cart: {
|
|
646
|
+
__typename?: string;
|
|
647
|
+
email: MagentoGetCartResponse['cart']['email'];
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
export interface MagentoCartUpdateShippingAddressWithEmailQueryVariables {
|
|
652
|
+
cartId: string;
|
|
653
|
+
email: string;
|
|
654
|
+
address: MagentoShippingAddressInput;
|
|
655
|
+
}
|
|
656
|
+
export declare const updateShippingAddressWithEmail: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateShippingAddressWithEmailResponse, MagentoCartUpdateShippingAddressWithEmailQueryVariables>;
|
|
657
|
+
export interface MagentoUpdateShippingAddressResponse {
|
|
658
|
+
setShippingAddressesOnCart: MagentoGetCartResponse;
|
|
659
|
+
}
|
|
660
|
+
export interface MagentoCartUpdateShippingAddressQueryVariables {
|
|
661
|
+
cartId: string;
|
|
662
|
+
address: MagentoShippingAddressInput;
|
|
663
|
+
}
|
|
664
|
+
export declare const updateShippingAddress: (extraCartFragments?: DocumentNode[]) => import("apollo-angular").TypedDocumentNode<MagentoUpdateShippingAddressResponse, MagentoCartUpdateShippingAddressQueryVariables>;
|
|
665
|
+
/**
|
|
666
|
+
* Transforms a single GraphQL error.
|
|
667
|
+
* Optionally accepts a request payload which can be used in certain cases
|
|
668
|
+
* to add supplemental info to the error.
|
|
669
|
+
*/
|
|
670
|
+
export declare function transformMagentoCartGraphQlError(error: GraphQLFormattedError, requestPayload?: unknown): DaffError;
|
|
671
|
+
export declare const DAFF_MAGENTO_GET_RECOVERABLE_ERRORS: (typeof DaffProductOutOfStockError)[];
|
|
672
|
+
/**
|
|
673
|
+
* A service for making Magento GraphQL queries for carts.
|
|
674
|
+
*
|
|
675
|
+
* @inheritdoc
|
|
676
|
+
*/
|
|
677
|
+
export declare class DaffMagentoCartService implements DaffCartServiceInterface<DaffCart> {
|
|
678
|
+
private apollo;
|
|
679
|
+
private mutationQueue;
|
|
680
|
+
private cartTransformer;
|
|
681
|
+
private cartItemDriver;
|
|
682
|
+
private extraCartFragments;
|
|
683
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, cartTransformer: DaffMagentoCartTransformer, cartItemDriver: DaffCartItemServiceInterface, extraCartFragments: DocumentNode[]);
|
|
684
|
+
get(cartId: DaffCart['id']): Observable<DaffDriverResponse<DaffCart>>;
|
|
685
|
+
create(): Observable<{
|
|
686
|
+
id: DaffCart['id'];
|
|
687
|
+
}>;
|
|
688
|
+
addToCart(productId: string, qty: number): Observable<DaffCart>;
|
|
689
|
+
clear(cartId: DaffCart['id']): Observable<Partial<DaffCart>>;
|
|
690
|
+
merge(guestCart: DaffCart['id'], customerCart?: DaffCart['id']): Observable<DaffDriverResponse<DaffCart>>;
|
|
691
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartService, never>;
|
|
692
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* A service for making Magento GraphQL queries for carts.
|
|
696
|
+
*
|
|
697
|
+
* @inheritdoc
|
|
698
|
+
*/
|
|
699
|
+
export declare class DaffMagentoCartItemService implements DaffCartItemServiceInterface {
|
|
700
|
+
private apollo;
|
|
701
|
+
private mutationQueue;
|
|
702
|
+
private extraCartFragments;
|
|
703
|
+
private cartItemTransforms;
|
|
704
|
+
private cartTransformer;
|
|
705
|
+
private cartItemUpdateInputTransformer;
|
|
706
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, extraCartFragments: DocumentNode[], cartItemTransforms: DaffCartMagentoCartItemTransform[], cartTransformer: DaffMagentoCartTransformer, cartItemUpdateInputTransformer: DaffMagentoCartItemUpdateInputTransformer);
|
|
707
|
+
list(cartId: DaffCart['id']): Observable<DaffCartItem[]>;
|
|
708
|
+
get(cartId: DaffCart['id'], itemId: DaffCartItem['id']): Observable<DaffCartItem>;
|
|
709
|
+
add(cartId: DaffCart['id'], cartItemInput: DaffCartItemInput): Observable<Partial<DaffCart>>;
|
|
710
|
+
update(cartId: DaffCart['id'], itemId: DaffCartItem['id'], changes: Partial<DaffCartItem>): Observable<Partial<DaffCart>>;
|
|
711
|
+
delete(cartId: DaffCart['id'], itemId: DaffCartItem['id']): Observable<Partial<DaffCart>>;
|
|
712
|
+
private addBundledProduct;
|
|
713
|
+
private addConfigurableProduct;
|
|
714
|
+
private addSimpleProduct;
|
|
715
|
+
private addCartItemRequest;
|
|
716
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartItemService, never>;
|
|
717
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* A service for making Magento GraphQL queries for carts.
|
|
721
|
+
*
|
|
722
|
+
* @inheritdoc
|
|
723
|
+
*/
|
|
724
|
+
export declare class DaffMagentoCartPaymentService implements DaffCartPaymentServiceInterface {
|
|
725
|
+
private apollo;
|
|
726
|
+
private mutationQueue;
|
|
727
|
+
private cartTransformer;
|
|
728
|
+
private paymentTransformer;
|
|
729
|
+
private paymentInputTransformer;
|
|
730
|
+
private cartAddressInputTransformer;
|
|
731
|
+
private extraCartFragments;
|
|
732
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, cartTransformer: DaffMagentoCartTransformer, paymentTransformer: DaffMagentoCartPaymentTransformer, paymentInputTransformer: DaffMagentoPaymentMethodInputTransformer, cartAddressInputTransformer: DaffMagentoBillingAddressInputTransformer, extraCartFragments: DocumentNode[]);
|
|
733
|
+
get(cartId: DaffCart['id']): Observable<DaffCartPaymentMethod>;
|
|
734
|
+
update(cartId: DaffCart['id'], payment: Partial<DaffCartPaymentMethod>, billingAddress?: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
|
|
735
|
+
updateWithBilling(cartId: DaffCart['id'], payment: Partial<DaffCartPaymentMethod>, address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
|
|
736
|
+
remove(cartId: DaffCart['id']): Observable<void>;
|
|
737
|
+
private updateWithBillingAddress;
|
|
738
|
+
private updateWithBillingAddressAndEmail;
|
|
739
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartPaymentService, never>;
|
|
740
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* A service for making Magento GraphQL queries for carts.
|
|
744
|
+
*
|
|
745
|
+
* @inheritdoc
|
|
746
|
+
*/
|
|
747
|
+
export declare class DaffMagentoCartPaymentMethodsService implements DaffCartPaymentMethodsServiceInterface {
|
|
748
|
+
private apollo;
|
|
749
|
+
private extraCartFragments;
|
|
750
|
+
private paymentTransformer;
|
|
751
|
+
constructor(apollo: Apollo, extraCartFragments: DocumentNode[], paymentTransformer: DaffMagentoCartPaymentTransformer);
|
|
752
|
+
list(cartId: DaffCart['id']): Observable<DaffCartPaymentMethod[]>;
|
|
753
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartPaymentMethodsService, never>;
|
|
754
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* A service for making Magento GraphQL queries for carts.
|
|
758
|
+
*
|
|
759
|
+
* @inheritdoc
|
|
760
|
+
*/
|
|
761
|
+
export declare class DaffMagentoCartAddressService implements DaffCartAddressServiceInterface {
|
|
762
|
+
private mutationQueue;
|
|
763
|
+
private extraCartFragments;
|
|
764
|
+
private cartTransformer;
|
|
765
|
+
private cartAddressInputTransformer;
|
|
766
|
+
constructor(mutationQueue: DaffQueuedApollo, extraCartFragments: DocumentNode[], cartTransformer: DaffMagentoCartTransformer, cartAddressInputTransformer: DaffMagentoCartAddressInputTransformer);
|
|
767
|
+
update(cartId: DaffCart['id'], address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
|
|
768
|
+
private getAddressInput;
|
|
769
|
+
private updateAddress;
|
|
770
|
+
private updateAddressWithEmail;
|
|
771
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartAddressService, never>;
|
|
772
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* A service for making Magento GraphQL queries for carts.
|
|
776
|
+
*
|
|
777
|
+
* @inheritdoc
|
|
778
|
+
*/
|
|
779
|
+
export declare class DaffMagentoCartBillingAddressService implements DaffCartBillingAddressServiceInterface {
|
|
780
|
+
private apollo;
|
|
781
|
+
private mutationQueue;
|
|
782
|
+
private extraCartFragments;
|
|
783
|
+
private cartTransformer;
|
|
784
|
+
private billingAddressTransformer;
|
|
785
|
+
private billingAddressInputTransformer;
|
|
786
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, extraCartFragments: DocumentNode[], cartTransformer: DaffMagentoCartTransformer, billingAddressTransformer: DaffMagentoBillingAddressTransformer, billingAddressInputTransformer: DaffMagentoBillingAddressInputTransformer);
|
|
787
|
+
get(cartId: DaffCart['id']): Observable<DaffCartAddress>;
|
|
788
|
+
update(cartId: DaffCart['id'], address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
|
|
789
|
+
private updateAddress;
|
|
790
|
+
private updateAddressWithEmail;
|
|
791
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartBillingAddressService, never>;
|
|
792
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* A service for making Magento GraphQL queries for a cart's shipping address.
|
|
796
|
+
*
|
|
797
|
+
* @inheritdoc
|
|
798
|
+
*/
|
|
799
|
+
export declare class DaffMagentoCartShippingAddressService implements DaffCartShippingAddressServiceInterface {
|
|
800
|
+
private apollo;
|
|
801
|
+
private mutationQueue;
|
|
802
|
+
private extraCartFragments;
|
|
803
|
+
private cartTransformer;
|
|
804
|
+
private shippingAddressTransformer;
|
|
805
|
+
private shippingAddressInputTransformer;
|
|
806
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, extraCartFragments: DocumentNode[], cartTransformer: DaffMagentoCartTransformer, shippingAddressTransformer: DaffMagentoShippingAddressTransformer, shippingAddressInputTransformer: DaffMagentoShippingAddressInputTransformer);
|
|
807
|
+
get(cartId: DaffCart['id']): Observable<DaffCartAddress>;
|
|
808
|
+
update(cartId: DaffCart['id'], address: Partial<DaffCartAddress>): Observable<Partial<DaffCart>>;
|
|
809
|
+
private updateAddress;
|
|
810
|
+
private updateAddressWithEmail;
|
|
811
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartShippingAddressService, never>;
|
|
812
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* A service for making Magento GraphQL queries for carts' shipping methods.
|
|
816
|
+
*
|
|
817
|
+
* @inheritdoc
|
|
818
|
+
*/
|
|
819
|
+
export declare class DaffMagentoCartShippingMethodsService implements DaffCartShippingMethodsServiceInterface {
|
|
820
|
+
private apollo;
|
|
821
|
+
private extraCartFragments;
|
|
822
|
+
private shippingRateTransformer;
|
|
823
|
+
constructor(apollo: Apollo, extraCartFragments: DocumentNode[], shippingRateTransformer: DaffMagentoCartShippingRateTransformer);
|
|
824
|
+
list(cartId: DaffCart['id']): Observable<DaffCartShippingRate[]>;
|
|
825
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartShippingMethodsService, never>;
|
|
826
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* A service for making Magento GraphQL queries for carts.
|
|
830
|
+
*
|
|
831
|
+
* @inheritdoc
|
|
832
|
+
*/
|
|
833
|
+
export declare class DaffMagentoCartShippingInformationService implements DaffCartShippingInformationServiceInterface {
|
|
834
|
+
private apollo;
|
|
835
|
+
private mutationQueue;
|
|
836
|
+
private extraCartFragments;
|
|
837
|
+
private cartTransformer;
|
|
838
|
+
private shippingRateTransformer;
|
|
839
|
+
private shippingMethodInputTransformer;
|
|
840
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo, extraCartFragments: DocumentNode[], cartTransformer: DaffMagentoCartTransformer, shippingRateTransformer: DaffMagentoCartShippingRateTransformer, shippingMethodInputTransformer: DaffMagentoShippingMethodInputTransformer);
|
|
841
|
+
get(cartId: DaffCart['id']): Observable<DaffCartShippingRate>;
|
|
842
|
+
update(cartId: DaffCart['id'], shippingInfo: Partial<DaffCartShippingRate>): Observable<Partial<DaffCart>>;
|
|
843
|
+
delete(cartId: DaffCart['id'], id?: DaffCartShippingRate['id']): Observable<Partial<DaffCart>>;
|
|
844
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoCartShippingInformationService, never>;
|
|
845
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* @deprecated in favor of {@link provideDaffCartMagentoDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
849
|
+
*/
|
|
850
|
+
export declare class DaffCartMagentoDriverModule {
|
|
851
|
+
static forRoot(): ModuleWithProviders<DaffCartMagentoDriverModule>;
|
|
852
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCartMagentoDriverModule, never>;
|
|
853
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCartMagentoDriverModule, never, [typeof i1.CommonModule], never>;
|
|
854
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCartMagentoDriverModule>;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Provides the Magento implementations of the `@daffodil/cart/driver` interfaces.
|
|
858
|
+
*/
|
|
859
|
+
export declare const provideDaffCartMagentoDriver: () => EnvironmentProviders;
|
|
860
|
+
export {};
|