@clicktap/state 0.16.2 → 0.16.4
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/__mocks__/nanoid.d.ts +7 -0
- package/auth/AuthProvider.d.ts +133 -0
- package/auth/actions/addError.d.ts +8 -0
- package/auth/actions/clearErrors.d.ts +5 -0
- package/auth/actions/index.d.ts +8 -0
- package/auth/actions/notifyAuthenticated.d.ts +6 -0
- package/auth/actions/setAccessToken.d.ts +9 -0
- package/auth/actions/setIgnoreRefreshToken.d.ts +4 -0
- package/auth/actions/setUserContext.d.ts +9 -0
- package/auth/actions/unsetRefreshToken.d.ts +4 -0
- package/auth/actions/unsetUserContext.d.ts +8 -0
- package/auth/actors/authenticate.d.ts +16 -0
- package/auth/actors/index.d.ts +3 -0
- package/auth/actors/refreshAccessToken.d.ts +18 -0
- package/auth/actors/unauthenticate.d.ts +14 -0
- package/auth/auth.d.ts +54 -0
- package/auth/types.d.ts +50 -0
- package/helpers/request.d.ts +2 -0
- package/index.js +41 -34
- package/index.mjs +1979 -1636
- package/package.json +2 -2
- package/quote/CheckoutProvider.d.ts +159 -0
- package/quote/QuoteProvider.d.ts +242 -0
- package/quote/checkout/actions/changeStep.d.ts +8 -0
- package/quote/checkout/actions/index.d.ts +5 -0
- package/quote/checkout/actions/nextStep.d.ts +8 -0
- package/quote/checkout/actions/resetCheckout.d.ts +104 -0
- package/quote/checkout/actions/updateQuote.d.ts +216 -0
- package/quote/checkout/actions/updateSuccessId.d.ts +8 -0
- package/quote/checkout/actors/index.d.ts +2 -0
- package/quote/checkout/actors/placeOrder.d.ts +20 -0
- package/quote/checkout/actors/submitStepData.d.ts +19 -0
- package/quote/checkout/guards/index.d.ts +1 -0
- package/quote/checkout/guards/quoteExists.d.ts +10 -0
- package/quote/checkout/types.d.ts +55 -0
- package/quote/checkout.d.ts +46 -0
- package/quote/quote/actions/addItems.d.ts +217 -0
- package/quote/quote/actions/index.d.ts +9 -0
- package/quote/quote/actions/notifyAddItems.d.ts +6 -0
- package/quote/quote/actions/notifyRemoveItems.d.ts +6 -0
- package/quote/quote/actions/notifyUpdateItems.d.ts +6 -0
- package/quote/quote/actions/refresh.d.ts +216 -0
- package/quote/quote/actions/removeItems.d.ts +217 -0
- package/quote/quote/actions/reset.d.ts +40 -0
- package/quote/quote/actions/syncAccessToken.d.ts +100 -0
- package/quote/quote/actions/updateItems.d.ts +217 -0
- package/quote/quote/actors/addItems.d.ts +24 -0
- package/quote/quote/actors/index.d.ts +4 -0
- package/quote/quote/actors/refresh.d.ts +22 -0
- package/quote/quote/actors/removeItems.d.ts +24 -0
- package/quote/quote/actors/updateItems.d.ts +24 -0
- package/quote/quote/guards/canRefresh.d.ts +10 -0
- package/quote/quote/guards/hasItems.d.ts +5 -0
- package/quote/quote/guards/index.d.ts +2 -0
- package/quote/quote/types.d.ts +291 -0
- package/quote/quote.d.ts +72 -0
- package/quote/types.d.ts +5 -0
- package/toast/ToastProvider.d.ts +80 -0
- package/toast/timer.d.ts +23 -0
- package/toast/toast.d.ts +69 -0
- package/toast/types.d.ts +58 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
+
export declare function refresh({ context, event, }: {
|
|
3
|
+
context: QuoteMachineContext;
|
|
4
|
+
event: QuoteMachineEvents;
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
quote?: Partial<{
|
|
8
|
+
id: string | null;
|
|
9
|
+
accessToken: string | null;
|
|
10
|
+
locale: string | null;
|
|
11
|
+
checkoutSteps: Array<import('../types').CheckoutStep>;
|
|
12
|
+
baseCurrency: string | null;
|
|
13
|
+
currency: string | null;
|
|
14
|
+
currencyConversionRate: number | null;
|
|
15
|
+
dateCreated: Date | null;
|
|
16
|
+
dateLastUpdated: Date | null;
|
|
17
|
+
items: Array<Record<string, any>> | null;
|
|
18
|
+
promotions: Array<Record<string, any>> | null;
|
|
19
|
+
shippingAddresses: {
|
|
20
|
+
available: Array<import('../types').QuoteAddress>;
|
|
21
|
+
applied: Array<{
|
|
22
|
+
availableAddressId?: string;
|
|
23
|
+
address: import('../types').QuoteAddress;
|
|
24
|
+
itemIds: Array<Record<string, any>>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
paymentMethods: {
|
|
28
|
+
available: Array<import('../types').PaymentMethod>;
|
|
29
|
+
applied: Array<{
|
|
30
|
+
paymentMethod: import('../types').PaymentMethod;
|
|
31
|
+
options: Array<Record<string, any>>;
|
|
32
|
+
amount: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
shipments: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
shippingAddress: {
|
|
38
|
+
id: string;
|
|
39
|
+
address: import('../types').QuoteAddress;
|
|
40
|
+
};
|
|
41
|
+
items: Array<Record<string, any>>;
|
|
42
|
+
shippingMethods: {
|
|
43
|
+
available: Array<{
|
|
44
|
+
shippingMethod: {
|
|
45
|
+
id: string;
|
|
46
|
+
code: string;
|
|
47
|
+
name: string;
|
|
48
|
+
carrier: {
|
|
49
|
+
id: string;
|
|
50
|
+
code: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
estimatedTotal: number;
|
|
55
|
+
earliestShipDate: Date;
|
|
56
|
+
latestShipDate: Date;
|
|
57
|
+
earliestArrivalDate: Date;
|
|
58
|
+
latestArrivalDate: Date;
|
|
59
|
+
}>;
|
|
60
|
+
applied: {
|
|
61
|
+
shippingMethod: {
|
|
62
|
+
id: string;
|
|
63
|
+
code: string;
|
|
64
|
+
name: string;
|
|
65
|
+
carrier: {
|
|
66
|
+
id: string;
|
|
67
|
+
code: string;
|
|
68
|
+
name: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
estimatedTotal: number;
|
|
72
|
+
earliestShipDate: Date;
|
|
73
|
+
latestShipDate: Date;
|
|
74
|
+
earliestArrivalDate: Date;
|
|
75
|
+
latestArrivalDate: Date;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
79
|
+
totals: {
|
|
80
|
+
discount: number;
|
|
81
|
+
taxAmount: number;
|
|
82
|
+
shippingAmount: number;
|
|
83
|
+
shippingTaxAmount: number;
|
|
84
|
+
subtotal: number;
|
|
85
|
+
grandTotal: number;
|
|
86
|
+
} | null;
|
|
87
|
+
appliedPriceRules: Array<Record<string, any>> | null;
|
|
88
|
+
appliedPromotions: Array<Record<string, any>> | null;
|
|
89
|
+
shippingMethods: Array<Record<string, any>> | null;
|
|
90
|
+
storeCredit: Array<Record<string, any>> | null;
|
|
91
|
+
rewards: Array<Record<string, any>> | null;
|
|
92
|
+
giftCards: Array<Record<string, any>> | null;
|
|
93
|
+
user: {
|
|
94
|
+
id: string | null;
|
|
95
|
+
email: string | null;
|
|
96
|
+
firstName: string | null;
|
|
97
|
+
lastName: string | null;
|
|
98
|
+
} | null;
|
|
99
|
+
}> | undefined;
|
|
100
|
+
errors?: string[] | undefined;
|
|
101
|
+
endpoints?: {
|
|
102
|
+
client?: string;
|
|
103
|
+
server?: string;
|
|
104
|
+
} | undefined;
|
|
105
|
+
graphql?: {
|
|
106
|
+
refresh: {
|
|
107
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
108
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
109
|
+
};
|
|
110
|
+
addItems: {
|
|
111
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
112
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
113
|
+
};
|
|
114
|
+
removeItems: {
|
|
115
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
116
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
117
|
+
};
|
|
118
|
+
updateItems: {
|
|
119
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
120
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
121
|
+
};
|
|
122
|
+
} | undefined;
|
|
123
|
+
id?: string | null | undefined;
|
|
124
|
+
accessToken?: string | null | undefined;
|
|
125
|
+
locale?: string | null | undefined;
|
|
126
|
+
checkoutSteps?: import('../types').CheckoutStep[] | undefined;
|
|
127
|
+
baseCurrency?: string | null | undefined;
|
|
128
|
+
currency?: string | null | undefined;
|
|
129
|
+
currencyConversionRate?: number | null | undefined;
|
|
130
|
+
dateCreated?: Date | null | undefined;
|
|
131
|
+
dateLastUpdated?: Date | null | undefined;
|
|
132
|
+
items?: Record<string, any>[] | null | undefined;
|
|
133
|
+
promotions?: Record<string, any>[] | null | undefined;
|
|
134
|
+
shippingAddresses?: {
|
|
135
|
+
available: Array<import('../types').QuoteAddress>;
|
|
136
|
+
applied: Array<{
|
|
137
|
+
availableAddressId?: string;
|
|
138
|
+
address: import('../types').QuoteAddress;
|
|
139
|
+
itemIds: Array<Record<string, any>>;
|
|
140
|
+
}>;
|
|
141
|
+
} | undefined;
|
|
142
|
+
paymentMethods?: {
|
|
143
|
+
available: Array<import('../types').PaymentMethod>;
|
|
144
|
+
applied: Array<{
|
|
145
|
+
paymentMethod: import('../types').PaymentMethod;
|
|
146
|
+
options: Array<Record<string, any>>;
|
|
147
|
+
amount: number;
|
|
148
|
+
}>;
|
|
149
|
+
} | undefined;
|
|
150
|
+
shipments?: {
|
|
151
|
+
id: string;
|
|
152
|
+
shippingAddress: {
|
|
153
|
+
id: string;
|
|
154
|
+
address: import('../types').QuoteAddress;
|
|
155
|
+
};
|
|
156
|
+
items: Array<Record<string, any>>;
|
|
157
|
+
shippingMethods: {
|
|
158
|
+
available: Array<{
|
|
159
|
+
shippingMethod: {
|
|
160
|
+
id: string;
|
|
161
|
+
code: string;
|
|
162
|
+
name: string;
|
|
163
|
+
carrier: {
|
|
164
|
+
id: string;
|
|
165
|
+
code: string;
|
|
166
|
+
name: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
estimatedTotal: number;
|
|
170
|
+
earliestShipDate: Date;
|
|
171
|
+
latestShipDate: Date;
|
|
172
|
+
earliestArrivalDate: Date;
|
|
173
|
+
latestArrivalDate: Date;
|
|
174
|
+
}>;
|
|
175
|
+
applied: {
|
|
176
|
+
shippingMethod: {
|
|
177
|
+
id: string;
|
|
178
|
+
code: string;
|
|
179
|
+
name: string;
|
|
180
|
+
carrier: {
|
|
181
|
+
id: string;
|
|
182
|
+
code: string;
|
|
183
|
+
name: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
estimatedTotal: number;
|
|
187
|
+
earliestShipDate: Date;
|
|
188
|
+
latestShipDate: Date;
|
|
189
|
+
earliestArrivalDate: Date;
|
|
190
|
+
latestArrivalDate: Date;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
totals?: {
|
|
195
|
+
discount: number;
|
|
196
|
+
taxAmount: number;
|
|
197
|
+
shippingAmount: number;
|
|
198
|
+
shippingTaxAmount: number;
|
|
199
|
+
subtotal: number;
|
|
200
|
+
grandTotal: number;
|
|
201
|
+
} | null | undefined;
|
|
202
|
+
appliedPriceRules?: Record<string, any>[] | null | undefined;
|
|
203
|
+
appliedPromotions?: Record<string, any>[] | null | undefined;
|
|
204
|
+
shippingMethods?: Record<string, any>[] | null | undefined;
|
|
205
|
+
storeCredit?: Record<string, any>[] | null | undefined;
|
|
206
|
+
rewards?: Record<string, any>[] | null | undefined;
|
|
207
|
+
giftCards?: Record<string, any>[] | null | undefined;
|
|
208
|
+
user?: {
|
|
209
|
+
id: string | null;
|
|
210
|
+
email: string | null;
|
|
211
|
+
firstName: string | null;
|
|
212
|
+
lastName: string | null;
|
|
213
|
+
} | null | undefined;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
export default refresh;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
+
export declare function removeItems({ context, event, }: {
|
|
3
|
+
context: QuoteMachineContext;
|
|
4
|
+
event: QuoteMachineEvents;
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
quote?: Partial<{
|
|
8
|
+
id: string | null;
|
|
9
|
+
accessToken: string | null;
|
|
10
|
+
locale: string | null;
|
|
11
|
+
checkoutSteps: Array<import('../types').CheckoutStep>;
|
|
12
|
+
baseCurrency: string | null;
|
|
13
|
+
currency: string | null;
|
|
14
|
+
currencyConversionRate: number | null;
|
|
15
|
+
dateCreated: Date | null;
|
|
16
|
+
dateLastUpdated: Date | null;
|
|
17
|
+
items: Array<Record<string, any>> | null;
|
|
18
|
+
promotions: Array<Record<string, any>> | null;
|
|
19
|
+
shippingAddresses: {
|
|
20
|
+
available: Array<import('../types').QuoteAddress>;
|
|
21
|
+
applied: Array<{
|
|
22
|
+
availableAddressId?: string;
|
|
23
|
+
address: import('../types').QuoteAddress;
|
|
24
|
+
itemIds: Array<Record<string, any>>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
paymentMethods: {
|
|
28
|
+
available: Array<import('../types').PaymentMethod>;
|
|
29
|
+
applied: Array<{
|
|
30
|
+
paymentMethod: import('../types').PaymentMethod;
|
|
31
|
+
options: Array<Record<string, any>>;
|
|
32
|
+
amount: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
shipments: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
shippingAddress: {
|
|
38
|
+
id: string;
|
|
39
|
+
address: import('../types').QuoteAddress;
|
|
40
|
+
};
|
|
41
|
+
items: Array<Record<string, any>>;
|
|
42
|
+
shippingMethods: {
|
|
43
|
+
available: Array<{
|
|
44
|
+
shippingMethod: {
|
|
45
|
+
id: string;
|
|
46
|
+
code: string;
|
|
47
|
+
name: string;
|
|
48
|
+
carrier: {
|
|
49
|
+
id: string;
|
|
50
|
+
code: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
estimatedTotal: number;
|
|
55
|
+
earliestShipDate: Date;
|
|
56
|
+
latestShipDate: Date;
|
|
57
|
+
earliestArrivalDate: Date;
|
|
58
|
+
latestArrivalDate: Date;
|
|
59
|
+
}>;
|
|
60
|
+
applied: {
|
|
61
|
+
shippingMethod: {
|
|
62
|
+
id: string;
|
|
63
|
+
code: string;
|
|
64
|
+
name: string;
|
|
65
|
+
carrier: {
|
|
66
|
+
id: string;
|
|
67
|
+
code: string;
|
|
68
|
+
name: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
estimatedTotal: number;
|
|
72
|
+
earliestShipDate: Date;
|
|
73
|
+
latestShipDate: Date;
|
|
74
|
+
earliestArrivalDate: Date;
|
|
75
|
+
latestArrivalDate: Date;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
79
|
+
totals: {
|
|
80
|
+
discount: number;
|
|
81
|
+
taxAmount: number;
|
|
82
|
+
shippingAmount: number;
|
|
83
|
+
shippingTaxAmount: number;
|
|
84
|
+
subtotal: number;
|
|
85
|
+
grandTotal: number;
|
|
86
|
+
} | null;
|
|
87
|
+
appliedPriceRules: Array<Record<string, any>> | null;
|
|
88
|
+
appliedPromotions: Array<Record<string, any>> | null;
|
|
89
|
+
shippingMethods: Array<Record<string, any>> | null;
|
|
90
|
+
storeCredit: Array<Record<string, any>> | null;
|
|
91
|
+
rewards: Array<Record<string, any>> | null;
|
|
92
|
+
giftCards: Array<Record<string, any>> | null;
|
|
93
|
+
user: {
|
|
94
|
+
id: string | null;
|
|
95
|
+
email: string | null;
|
|
96
|
+
firstName: string | null;
|
|
97
|
+
lastName: string | null;
|
|
98
|
+
} | null;
|
|
99
|
+
}> | undefined;
|
|
100
|
+
errors?: string[] | undefined;
|
|
101
|
+
endpoints?: {
|
|
102
|
+
client?: string;
|
|
103
|
+
server?: string;
|
|
104
|
+
} | undefined;
|
|
105
|
+
graphql?: {
|
|
106
|
+
refresh: {
|
|
107
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
108
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
109
|
+
};
|
|
110
|
+
addItems: {
|
|
111
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
112
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
113
|
+
};
|
|
114
|
+
removeItems: {
|
|
115
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
116
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
117
|
+
};
|
|
118
|
+
updateItems: {
|
|
119
|
+
document: import('graphql-request').RequestDocument | import('@graphql-typed-document-node/core').TypedDocumentNode<unknown, object>;
|
|
120
|
+
requestHeaders?: import('graphql-request/build/esm/types').GraphQLClientRequestHeaders | undefined;
|
|
121
|
+
};
|
|
122
|
+
} | undefined;
|
|
123
|
+
id?: string | null | undefined;
|
|
124
|
+
accessToken?: string | null | undefined;
|
|
125
|
+
locale?: string | null | undefined;
|
|
126
|
+
checkoutSteps?: import('../types').CheckoutStep[] | undefined;
|
|
127
|
+
baseCurrency?: string | null | undefined;
|
|
128
|
+
currency?: string | null | undefined;
|
|
129
|
+
currencyConversionRate?: number | null | undefined;
|
|
130
|
+
dateCreated?: Date | null | undefined;
|
|
131
|
+
dateLastUpdated?: Date | null | undefined;
|
|
132
|
+
items?: Record<string, any>[] | null | undefined;
|
|
133
|
+
promotions?: Record<string, any>[] | null | undefined;
|
|
134
|
+
shippingAddresses?: {
|
|
135
|
+
available: Array<import('../types').QuoteAddress>;
|
|
136
|
+
applied: Array<{
|
|
137
|
+
availableAddressId?: string;
|
|
138
|
+
address: import('../types').QuoteAddress;
|
|
139
|
+
itemIds: Array<Record<string, any>>;
|
|
140
|
+
}>;
|
|
141
|
+
} | undefined;
|
|
142
|
+
paymentMethods?: {
|
|
143
|
+
available: Array<import('../types').PaymentMethod>;
|
|
144
|
+
applied: Array<{
|
|
145
|
+
paymentMethod: import('../types').PaymentMethod;
|
|
146
|
+
options: Array<Record<string, any>>;
|
|
147
|
+
amount: number;
|
|
148
|
+
}>;
|
|
149
|
+
} | undefined;
|
|
150
|
+
shipments?: {
|
|
151
|
+
id: string;
|
|
152
|
+
shippingAddress: {
|
|
153
|
+
id: string;
|
|
154
|
+
address: import('../types').QuoteAddress;
|
|
155
|
+
};
|
|
156
|
+
items: Array<Record<string, any>>;
|
|
157
|
+
shippingMethods: {
|
|
158
|
+
available: Array<{
|
|
159
|
+
shippingMethod: {
|
|
160
|
+
id: string;
|
|
161
|
+
code: string;
|
|
162
|
+
name: string;
|
|
163
|
+
carrier: {
|
|
164
|
+
id: string;
|
|
165
|
+
code: string;
|
|
166
|
+
name: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
estimatedTotal: number;
|
|
170
|
+
earliestShipDate: Date;
|
|
171
|
+
latestShipDate: Date;
|
|
172
|
+
earliestArrivalDate: Date;
|
|
173
|
+
latestArrivalDate: Date;
|
|
174
|
+
}>;
|
|
175
|
+
applied: {
|
|
176
|
+
shippingMethod: {
|
|
177
|
+
id: string;
|
|
178
|
+
code: string;
|
|
179
|
+
name: string;
|
|
180
|
+
carrier: {
|
|
181
|
+
id: string;
|
|
182
|
+
code: string;
|
|
183
|
+
name: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
estimatedTotal: number;
|
|
187
|
+
earliestShipDate: Date;
|
|
188
|
+
latestShipDate: Date;
|
|
189
|
+
earliestArrivalDate: Date;
|
|
190
|
+
latestArrivalDate: Date;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
totals?: {
|
|
195
|
+
discount: number;
|
|
196
|
+
taxAmount: number;
|
|
197
|
+
shippingAmount: number;
|
|
198
|
+
shippingTaxAmount: number;
|
|
199
|
+
subtotal: number;
|
|
200
|
+
grandTotal: number;
|
|
201
|
+
} | null | undefined;
|
|
202
|
+
appliedPriceRules?: Record<string, any>[] | null | undefined;
|
|
203
|
+
appliedPromotions?: Record<string, any>[] | null | undefined;
|
|
204
|
+
shippingMethods?: Record<string, any>[] | null | undefined;
|
|
205
|
+
storeCredit?: Record<string, any>[] | null | undefined;
|
|
206
|
+
rewards?: Record<string, any>[] | null | undefined;
|
|
207
|
+
giftCards?: Record<string, any>[] | null | undefined;
|
|
208
|
+
user?: {
|
|
209
|
+
id: string | null;
|
|
210
|
+
email: string | null;
|
|
211
|
+
firstName: string | null;
|
|
212
|
+
lastName: string | null;
|
|
213
|
+
} | null | undefined;
|
|
214
|
+
};
|
|
215
|
+
itemsRemoved: Record<string, any>[] | null | undefined;
|
|
216
|
+
};
|
|
217
|
+
export default removeItems;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
+
export declare function reset({ context, event, }: {
|
|
3
|
+
context: QuoteMachineContext;
|
|
4
|
+
event: QuoteMachineEvents;
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
id: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
baseCurrency: string;
|
|
10
|
+
currencyConversionRate: number;
|
|
11
|
+
dateCreated: null;
|
|
12
|
+
dateLastUpdated: null;
|
|
13
|
+
currency: string;
|
|
14
|
+
items: never[];
|
|
15
|
+
promotions: never[];
|
|
16
|
+
shippingAddresses: {
|
|
17
|
+
available: never[];
|
|
18
|
+
applied: never[];
|
|
19
|
+
};
|
|
20
|
+
paymentMethods: {
|
|
21
|
+
available: never[];
|
|
22
|
+
applied: never[];
|
|
23
|
+
};
|
|
24
|
+
totals: {
|
|
25
|
+
discount: number;
|
|
26
|
+
taxAmount: number;
|
|
27
|
+
shippingAmount: number;
|
|
28
|
+
shippingTaxAmount: number;
|
|
29
|
+
subtotal: number;
|
|
30
|
+
grandTotal: number;
|
|
31
|
+
};
|
|
32
|
+
appliedPriceRules: never[];
|
|
33
|
+
appliedPromotions: never[];
|
|
34
|
+
shippingMethods: never[];
|
|
35
|
+
storeCredit: never[];
|
|
36
|
+
rewards: never[];
|
|
37
|
+
giftCards: never[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default reset;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
+
export declare function syncAccessToken({ context, event, }: {
|
|
3
|
+
context: QuoteMachineContext;
|
|
4
|
+
event: QuoteMachineEvents;
|
|
5
|
+
}): QuoteMachineContext | {
|
|
6
|
+
quote: {
|
|
7
|
+
accessToken: string;
|
|
8
|
+
id?: string | null | undefined;
|
|
9
|
+
locale?: string | null | undefined;
|
|
10
|
+
checkoutSteps?: import('../types').CheckoutStep[] | undefined;
|
|
11
|
+
baseCurrency?: string | null | undefined;
|
|
12
|
+
currency?: string | null | undefined;
|
|
13
|
+
currencyConversionRate?: number | null | undefined;
|
|
14
|
+
dateCreated?: Date | null | undefined;
|
|
15
|
+
dateLastUpdated?: Date | null | undefined;
|
|
16
|
+
items?: Record<string, any>[] | null | undefined;
|
|
17
|
+
promotions?: Record<string, any>[] | null | undefined;
|
|
18
|
+
shippingAddresses?: {
|
|
19
|
+
available: Array<import('../types').QuoteAddress>;
|
|
20
|
+
applied: Array<{
|
|
21
|
+
availableAddressId?: string;
|
|
22
|
+
address: import('../types').QuoteAddress;
|
|
23
|
+
itemIds: Array<Record<string, any>>;
|
|
24
|
+
}>;
|
|
25
|
+
} | undefined;
|
|
26
|
+
paymentMethods?: {
|
|
27
|
+
available: Array<import('../types').PaymentMethod>;
|
|
28
|
+
applied: Array<{
|
|
29
|
+
paymentMethod: import('../types').PaymentMethod;
|
|
30
|
+
options: Array<Record<string, any>>;
|
|
31
|
+
amount: number;
|
|
32
|
+
}>;
|
|
33
|
+
} | undefined;
|
|
34
|
+
shipments?: {
|
|
35
|
+
id: string;
|
|
36
|
+
shippingAddress: {
|
|
37
|
+
id: string;
|
|
38
|
+
address: import('../types').QuoteAddress;
|
|
39
|
+
};
|
|
40
|
+
items: Array<Record<string, any>>;
|
|
41
|
+
shippingMethods: {
|
|
42
|
+
available: Array<{
|
|
43
|
+
shippingMethod: {
|
|
44
|
+
id: string;
|
|
45
|
+
code: string;
|
|
46
|
+
name: string;
|
|
47
|
+
carrier: {
|
|
48
|
+
id: string;
|
|
49
|
+
code: string;
|
|
50
|
+
name: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
estimatedTotal: number;
|
|
54
|
+
earliestShipDate: Date;
|
|
55
|
+
latestShipDate: Date;
|
|
56
|
+
earliestArrivalDate: Date;
|
|
57
|
+
latestArrivalDate: Date;
|
|
58
|
+
}>;
|
|
59
|
+
applied: {
|
|
60
|
+
shippingMethod: {
|
|
61
|
+
id: string;
|
|
62
|
+
code: string;
|
|
63
|
+
name: string;
|
|
64
|
+
carrier: {
|
|
65
|
+
id: string;
|
|
66
|
+
code: string;
|
|
67
|
+
name: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
estimatedTotal: number;
|
|
71
|
+
earliestShipDate: Date;
|
|
72
|
+
latestShipDate: Date;
|
|
73
|
+
earliestArrivalDate: Date;
|
|
74
|
+
latestArrivalDate: Date;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
totals?: {
|
|
79
|
+
discount: number;
|
|
80
|
+
taxAmount: number;
|
|
81
|
+
shippingAmount: number;
|
|
82
|
+
shippingTaxAmount: number;
|
|
83
|
+
subtotal: number;
|
|
84
|
+
grandTotal: number;
|
|
85
|
+
} | null | undefined;
|
|
86
|
+
appliedPriceRules?: Record<string, any>[] | null | undefined;
|
|
87
|
+
appliedPromotions?: Record<string, any>[] | null | undefined;
|
|
88
|
+
shippingMethods?: Record<string, any>[] | null | undefined;
|
|
89
|
+
storeCredit?: Record<string, any>[] | null | undefined;
|
|
90
|
+
rewards?: Record<string, any>[] | null | undefined;
|
|
91
|
+
giftCards?: Record<string, any>[] | null | undefined;
|
|
92
|
+
user?: {
|
|
93
|
+
id: string | null;
|
|
94
|
+
email: string | null;
|
|
95
|
+
firstName: string | null;
|
|
96
|
+
lastName: string | null;
|
|
97
|
+
} | null | undefined;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export default syncAccessToken;
|