@clicktap/state 0.16.0 → 0.16.2
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/index.js +33 -33
- package/index.mjs +1460 -1535
- package/package.json +3 -3
- package/auth/AuthProvider.d.ts +0 -255
- package/auth/actions/addError.d.ts +0 -8
- package/auth/actions/clearErrors.d.ts +0 -5
- package/auth/actions/index.d.ts +0 -8
- package/auth/actions/notifyAuthenticated.d.ts +0 -6
- package/auth/actions/setAccessToken.d.ts +0 -9
- package/auth/actions/setIgnoreRefreshToken.d.ts +0 -4
- package/auth/actions/setUserContext.d.ts +0 -9
- package/auth/actions/unsetRefreshToken.d.ts +0 -4
- package/auth/actions/unsetUserContext.d.ts +0 -8
- package/auth/actors/authenticate.d.ts +0 -16
- package/auth/actors/index.d.ts +0 -3
- package/auth/actors/refreshAccessToken.d.ts +0 -18
- package/auth/actors/unauthenticate.d.ts +0 -14
- package/auth/auth.d.ts +0 -115
- package/auth/types.d.ts +0 -50
- package/helpers/request.d.ts +0 -2
- package/quote/CheckoutProvider.d.ts +0 -276
- package/quote/QuoteProvider.d.ts +0 -491
- package/quote/checkout/actions/changeStep.d.ts +0 -8
- package/quote/checkout/actions/index.d.ts +0 -5
- package/quote/checkout/actions/nextStep.d.ts +0 -8
- package/quote/checkout/actions/resetCheckout.d.ts +0 -104
- package/quote/checkout/actions/updateQuote.d.ts +0 -216
- package/quote/checkout/actions/updateSuccessId.d.ts +0 -8
- package/quote/checkout/actors/index.d.ts +0 -2
- package/quote/checkout/actors/placeOrder.d.ts +0 -20
- package/quote/checkout/actors/submitStepData.d.ts +0 -19
- package/quote/checkout/guards/index.d.ts +0 -1
- package/quote/checkout/guards/quoteExists.d.ts +0 -10
- package/quote/checkout/types.d.ts +0 -55
- package/quote/checkout.d.ts +0 -85
- package/quote/quote/actions/addItems.d.ts +0 -217
- package/quote/quote/actions/index.d.ts +0 -9
- package/quote/quote/actions/notifyAddItems.d.ts +0 -6
- package/quote/quote/actions/notifyRemoveItems.d.ts +0 -6
- package/quote/quote/actions/notifyUpdateItems.d.ts +0 -6
- package/quote/quote/actions/refresh.d.ts +0 -216
- package/quote/quote/actions/removeItems.d.ts +0 -217
- package/quote/quote/actions/reset.d.ts +0 -40
- package/quote/quote/actions/syncAccessToken.d.ts +0 -100
- package/quote/quote/actions/updateItems.d.ts +0 -217
- package/quote/quote/actors/addItems.d.ts +0 -24
- package/quote/quote/actors/index.d.ts +0 -4
- package/quote/quote/actors/refresh.d.ts +0 -22
- package/quote/quote/actors/removeItems.d.ts +0 -24
- package/quote/quote/actors/updateItems.d.ts +0 -24
- package/quote/quote/guards/canRefresh.d.ts +0 -10
- package/quote/quote/guards/hasItems.d.ts +0 -5
- package/quote/quote/guards/index.d.ts +0 -2
- package/quote/quote/types.d.ts +0 -291
- package/quote/quote.d.ts +0 -155
- package/quote/types.d.ts +0 -5
- package/toast/ToastProvider.d.ts +0 -93
- package/toast/timer.d.ts +0 -22
- package/toast/toast.d.ts +0 -82
- package/toast/types.d.ts +0 -59
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext, CheckoutMachineEvents } from '../types';
|
|
2
|
-
export declare function updateQuote({ context, event, }: {
|
|
3
|
-
context: CheckoutMachineContext;
|
|
4
|
-
event: CheckoutMachineEvents;
|
|
5
|
-
}): CheckoutMachineContext | {
|
|
6
|
-
quote: {
|
|
7
|
-
quote?: Partial<{
|
|
8
|
-
id: string | null;
|
|
9
|
-
accessToken: string | null;
|
|
10
|
-
locale: string | null;
|
|
11
|
-
checkoutSteps: import("../../..").CheckoutStep[];
|
|
12
|
-
baseCurrency: string | null;
|
|
13
|
-
currency: string | null;
|
|
14
|
-
currencyConversionRate: number | null;
|
|
15
|
-
dateCreated: Date | null;
|
|
16
|
-
dateLastUpdated: Date | null;
|
|
17
|
-
items: Record<string, any>[] | null;
|
|
18
|
-
promotions: Record<string, any>[] | null;
|
|
19
|
-
shippingAddresses: {
|
|
20
|
-
available: import("../../..").QuoteAddress[];
|
|
21
|
-
applied: {
|
|
22
|
-
availableAddressId?: string | undefined;
|
|
23
|
-
address: import("../../..").QuoteAddress;
|
|
24
|
-
itemIds: Record<string, any>[];
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
paymentMethods: {
|
|
28
|
-
available: import("../../..").PaymentMethod[];
|
|
29
|
-
applied: {
|
|
30
|
-
paymentMethod: import("../../..").PaymentMethod;
|
|
31
|
-
options: Record<string, any>[];
|
|
32
|
-
amount: number;
|
|
33
|
-
}[];
|
|
34
|
-
};
|
|
35
|
-
shipments: {
|
|
36
|
-
id: string;
|
|
37
|
-
shippingAddress: {
|
|
38
|
-
id: string;
|
|
39
|
-
address: import("../../..").QuoteAddress;
|
|
40
|
-
};
|
|
41
|
-
items: Record<string, any>[];
|
|
42
|
-
shippingMethods: {
|
|
43
|
-
available: {
|
|
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: Record<string, any>[] | null;
|
|
88
|
-
appliedPromotions: Record<string, any>[] | null;
|
|
89
|
-
shippingMethods: Record<string, any>[] | null;
|
|
90
|
-
storeCredit: Record<string, any>[] | null;
|
|
91
|
-
rewards: Record<string, any>[] | null;
|
|
92
|
-
giftCards: 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 | undefined;
|
|
103
|
-
server?: string | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
graphql?: {
|
|
106
|
-
refresh: {
|
|
107
|
-
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
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, {}>;
|
|
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, {}>;
|
|
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, {}>;
|
|
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("../../..").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: import("../../..").QuoteAddress[];
|
|
136
|
-
applied: {
|
|
137
|
-
availableAddressId?: string | undefined;
|
|
138
|
-
address: import("../../..").QuoteAddress;
|
|
139
|
-
itemIds: Record<string, any>[];
|
|
140
|
-
}[];
|
|
141
|
-
} | undefined;
|
|
142
|
-
paymentMethods?: {
|
|
143
|
-
available: import("../../..").PaymentMethod[];
|
|
144
|
-
applied: {
|
|
145
|
-
paymentMethod: import("../../..").PaymentMethod;
|
|
146
|
-
options: Record<string, any>[];
|
|
147
|
-
amount: number;
|
|
148
|
-
}[];
|
|
149
|
-
} | undefined;
|
|
150
|
-
shipments?: {
|
|
151
|
-
id: string;
|
|
152
|
-
shippingAddress: {
|
|
153
|
-
id: string;
|
|
154
|
-
address: import("../../..").QuoteAddress;
|
|
155
|
-
};
|
|
156
|
-
items: Record<string, any>[];
|
|
157
|
-
shippingMethods: {
|
|
158
|
-
available: {
|
|
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 updateQuote;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext, CheckoutMachineEvents } from '../types';
|
|
2
|
-
export declare function updateSuccessId({ context, event, }: {
|
|
3
|
-
context: CheckoutMachineContext;
|
|
4
|
-
event: CheckoutMachineEvents;
|
|
5
|
-
}): CheckoutMachineContext | {
|
|
6
|
-
successId: string;
|
|
7
|
-
};
|
|
8
|
-
export default updateSuccessId;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext, PlaceOrderSuccessEvent } from '../types';
|
|
2
|
-
export type PlaceOrderDataInput = {
|
|
3
|
-
endpoint: CheckoutMachineContext['endpoints']['client'];
|
|
4
|
-
document: CheckoutMachineContext['graphql']['placeOrder']['document'];
|
|
5
|
-
requestHeaders?: CheckoutMachineContext['graphql']['placeOrder']['requestHeaders'];
|
|
6
|
-
};
|
|
7
|
-
export type PlaceOrderDataOutput = Partial<{
|
|
8
|
-
placeOrder: {
|
|
9
|
-
checkoutSuccess: {
|
|
10
|
-
id: string;
|
|
11
|
-
};
|
|
12
|
-
userErrors: Array<{
|
|
13
|
-
code: string;
|
|
14
|
-
field: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}>;
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
19
|
-
export declare const placeOrder: import("xstate").PromiseActorLogic<PlaceOrderSuccessEvent, PlaceOrderDataInput>;
|
|
20
|
-
export default placeOrder;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext, SubmitStepDataEvent, SubmitStepDataSuccessEvent } from '../types';
|
|
2
|
-
export type SubmitStepDataInput = {
|
|
3
|
-
endpoint: CheckoutMachineContext['endpoints']['client'];
|
|
4
|
-
data: SubmitStepDataEvent['data'];
|
|
5
|
-
document: CheckoutMachineContext['graphql']['submitStepData']['document'];
|
|
6
|
-
requestHeaders?: CheckoutMachineContext['graphql']['submitStepData']['requestHeaders'];
|
|
7
|
-
};
|
|
8
|
-
export type SubmitStepDataOutput = Partial<{
|
|
9
|
-
checkoutStep: {
|
|
10
|
-
quote: object;
|
|
11
|
-
userErrors: Array<{
|
|
12
|
-
code: string;
|
|
13
|
-
field: string;
|
|
14
|
-
message: string;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
export declare const submitStepData: import("xstate").PromiseActorLogic<SubmitStepDataSuccessEvent, SubmitStepDataInput>;
|
|
19
|
-
export default submitStepData;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './quoteExists';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Used for initializing quote.
|
|
4
|
-
* Checks whether the quote is an empty object since an initialized quote
|
|
5
|
-
* will never be empty
|
|
6
|
-
*/
|
|
7
|
-
export declare const quoteExists: ({ context }: {
|
|
8
|
-
context: CheckoutMachineContext;
|
|
9
|
-
}) => boolean;
|
|
10
|
-
export default quoteExists;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { RequestDocument } from 'graphql-request';
|
|
2
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
-
import { GraphQLClientRequestHeaders } from 'graphql-request/build/esm/types';
|
|
4
|
-
import { DoneActorEvent } from 'xstate';
|
|
5
|
-
import { QuoteMachineContext, CheckoutStep } from '../quote/types';
|
|
6
|
-
export interface CheckoutMachineContext {
|
|
7
|
-
currentStep: string;
|
|
8
|
-
/** @todo DeepPartial should play nicer with props like steps */
|
|
9
|
-
steps?: Array<CheckoutStep>;
|
|
10
|
-
isLoggedIn: boolean;
|
|
11
|
-
quote: QuoteMachineContext['quote'];
|
|
12
|
-
endpoints: {
|
|
13
|
-
client?: string;
|
|
14
|
-
server?: string;
|
|
15
|
-
};
|
|
16
|
-
successId: string;
|
|
17
|
-
graphql: {
|
|
18
|
-
placeOrder: {
|
|
19
|
-
document: RequestDocument | TypedDocumentNode<unknown, {}>;
|
|
20
|
-
requestHeaders?: GraphQLClientRequestHeaders;
|
|
21
|
-
};
|
|
22
|
-
submitStepData: {
|
|
23
|
-
document: RequestDocument | TypedDocumentNode<unknown, {}>;
|
|
24
|
-
requestHeaders?: GraphQLClientRequestHeaders;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface ChangeStepEvent {
|
|
29
|
-
type: 'CHANGE_STEP';
|
|
30
|
-
step: string;
|
|
31
|
-
}
|
|
32
|
-
export interface PlaceOrderEvent {
|
|
33
|
-
type: 'PLACE_ORDER';
|
|
34
|
-
}
|
|
35
|
-
export interface ResetCheckoutEvent {
|
|
36
|
-
type: 'RESET_CHECKOUT';
|
|
37
|
-
data: {
|
|
38
|
-
currentStep: string;
|
|
39
|
-
steps: Array<CheckoutStep>;
|
|
40
|
-
quote: QuoteMachineContext['quote'];
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export interface SubmitStepDataEvent {
|
|
44
|
-
type: 'SUBMIT_STEP_DATA';
|
|
45
|
-
data: Record<string, any>;
|
|
46
|
-
}
|
|
47
|
-
export interface SubmitStepDataSuccessEvent {
|
|
48
|
-
type: 'SUBMIT_STEP_DATA_SUCCESS';
|
|
49
|
-
quote: Partial<QuoteMachineContext>;
|
|
50
|
-
}
|
|
51
|
-
export interface PlaceOrderSuccessEvent {
|
|
52
|
-
type: 'PLACE_ORDER_SUCCESS';
|
|
53
|
-
successId: string;
|
|
54
|
-
}
|
|
55
|
-
export type CheckoutMachineEvents = ChangeStepEvent | PlaceOrderEvent | ResetCheckoutEvent | SubmitStepDataEvent | DoneActorEvent<PlaceOrderSuccessEvent> | DoneActorEvent<SubmitStepDataSuccessEvent>;
|
package/quote/checkout.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { CheckoutMachineContext } from './checkout/types';
|
|
2
|
-
import { DeepPartial } from './types';
|
|
3
|
-
export declare const checkoutMachine: import("xstate").StateMachine<CheckoutMachineContext, import("./checkout/types").ChangeStepEvent | import("./checkout/types").PlaceOrderEvent | import("./checkout/types").ResetCheckoutEvent | import("./checkout/types").SubmitStepDataEvent | import("xstate").DoneActorEvent<import("./checkout/types").PlaceOrderSuccessEvent> | import("xstate").DoneActorEvent<import("./checkout/types").SubmitStepDataSuccessEvent>, {
|
|
4
|
-
[x: string]: import("xstate").ActorRef<import("xstate").PromiseSnapshot<import("./checkout/types").PlaceOrderSuccessEvent, import("./checkout/actors").PlaceOrderDataInput>, {
|
|
5
|
-
[k: string]: unknown;
|
|
6
|
-
type: string;
|
|
7
|
-
}, import("xstate").EventObject> | import("xstate").ActorRef<import("xstate").PromiseSnapshot<import("./checkout/types").SubmitStepDataSuccessEvent, import("./checkout/actors").SubmitStepDataInput>, {
|
|
8
|
-
[k: string]: unknown;
|
|
9
|
-
type: string;
|
|
10
|
-
}, import("xstate").EventObject> | undefined;
|
|
11
|
-
}, import("xstate").Values<{
|
|
12
|
-
placeOrder: {
|
|
13
|
-
src: "placeOrder";
|
|
14
|
-
logic: import("xstate").PromiseActorLogic<import("./checkout/types").PlaceOrderSuccessEvent, import("./checkout/actors").PlaceOrderDataInput>;
|
|
15
|
-
id: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
submitStepData: {
|
|
18
|
-
src: "submitStepData";
|
|
19
|
-
logic: import("xstate").PromiseActorLogic<import("./checkout/types").SubmitStepDataSuccessEvent, import("./checkout/actors").SubmitStepDataInput>;
|
|
20
|
-
id: string | undefined;
|
|
21
|
-
};
|
|
22
|
-
}>, import("xstate").Values<{
|
|
23
|
-
changeStep: {
|
|
24
|
-
type: "changeStep";
|
|
25
|
-
params: import("xstate").NonReducibleUnknown;
|
|
26
|
-
};
|
|
27
|
-
nextStep: {
|
|
28
|
-
type: "nextStep";
|
|
29
|
-
params: import("xstate").NonReducibleUnknown;
|
|
30
|
-
};
|
|
31
|
-
resetCheckout: {
|
|
32
|
-
type: "resetCheckout";
|
|
33
|
-
params: import("xstate").NonReducibleUnknown;
|
|
34
|
-
};
|
|
35
|
-
updateQuote: {
|
|
36
|
-
type: "updateQuote";
|
|
37
|
-
params: import("xstate").NonReducibleUnknown;
|
|
38
|
-
};
|
|
39
|
-
updateSuccessId: {
|
|
40
|
-
type: "updateSuccessId";
|
|
41
|
-
params: import("xstate").NonReducibleUnknown;
|
|
42
|
-
};
|
|
43
|
-
}>, {
|
|
44
|
-
type: "quoteExists";
|
|
45
|
-
params: unknown;
|
|
46
|
-
}, never, "uninitialized" | "initializing" | "showStep" | "submittingStepData" | "changingStep" | "placingOrder" | "success", string, {
|
|
47
|
-
initialContext: DeepPartial<CheckoutMachineContext>;
|
|
48
|
-
initialState?: string | undefined;
|
|
49
|
-
}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("./checkout/types").ChangeStepEvent | import("./checkout/types").PlaceOrderEvent | import("./checkout/types").ResetCheckoutEvent | import("./checkout/types").SubmitStepDataEvent | import("xstate").DoneActorEvent<import("./checkout/types").PlaceOrderSuccessEvent> | import("xstate").DoneActorEvent<import("./checkout/types").SubmitStepDataSuccessEvent>, import("xstate").Values<{
|
|
50
|
-
placeOrder: {
|
|
51
|
-
src: "placeOrder";
|
|
52
|
-
logic: import("xstate").PromiseActorLogic<import("./checkout/types").PlaceOrderSuccessEvent, import("./checkout/actors").PlaceOrderDataInput>;
|
|
53
|
-
id: string | undefined;
|
|
54
|
-
};
|
|
55
|
-
submitStepData: {
|
|
56
|
-
src: "submitStepData";
|
|
57
|
-
logic: import("xstate").PromiseActorLogic<import("./checkout/types").SubmitStepDataSuccessEvent, import("./checkout/actors").SubmitStepDataInput>;
|
|
58
|
-
id: string | undefined;
|
|
59
|
-
};
|
|
60
|
-
}>, import("xstate").Values<{
|
|
61
|
-
changeStep: {
|
|
62
|
-
type: "changeStep";
|
|
63
|
-
params: import("xstate").NonReducibleUnknown;
|
|
64
|
-
};
|
|
65
|
-
nextStep: {
|
|
66
|
-
type: "nextStep";
|
|
67
|
-
params: import("xstate").NonReducibleUnknown;
|
|
68
|
-
};
|
|
69
|
-
resetCheckout: {
|
|
70
|
-
type: "resetCheckout";
|
|
71
|
-
params: import("xstate").NonReducibleUnknown;
|
|
72
|
-
};
|
|
73
|
-
updateQuote: {
|
|
74
|
-
type: "updateQuote";
|
|
75
|
-
params: import("xstate").NonReducibleUnknown;
|
|
76
|
-
};
|
|
77
|
-
updateSuccessId: {
|
|
78
|
-
type: "updateSuccessId";
|
|
79
|
-
params: import("xstate").NonReducibleUnknown;
|
|
80
|
-
};
|
|
81
|
-
}>, {
|
|
82
|
-
type: "quoteExists";
|
|
83
|
-
params: unknown;
|
|
84
|
-
}, never, string, import("xstate").EventObject>>;
|
|
85
|
-
export default checkoutMachine;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
-
export declare function addItems({ 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: 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: Record<string, any>[] | null;
|
|
18
|
-
promotions: Record<string, any>[] | null;
|
|
19
|
-
shippingAddresses: {
|
|
20
|
-
available: import("../types").QuoteAddress[];
|
|
21
|
-
applied: {
|
|
22
|
-
availableAddressId?: string | undefined;
|
|
23
|
-
address: import("../types").QuoteAddress;
|
|
24
|
-
itemIds: Record<string, any>[];
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
paymentMethods: {
|
|
28
|
-
available: import("../types").PaymentMethod[];
|
|
29
|
-
applied: {
|
|
30
|
-
paymentMethod: import("../types").PaymentMethod;
|
|
31
|
-
options: Record<string, any>[];
|
|
32
|
-
amount: number;
|
|
33
|
-
}[];
|
|
34
|
-
};
|
|
35
|
-
shipments: {
|
|
36
|
-
id: string;
|
|
37
|
-
shippingAddress: {
|
|
38
|
-
id: string;
|
|
39
|
-
address: import("../types").QuoteAddress;
|
|
40
|
-
};
|
|
41
|
-
items: Record<string, any>[];
|
|
42
|
-
shippingMethods: {
|
|
43
|
-
available: {
|
|
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: Record<string, any>[] | null;
|
|
88
|
-
appliedPromotions: Record<string, any>[] | null;
|
|
89
|
-
shippingMethods: Record<string, any>[] | null;
|
|
90
|
-
storeCredit: Record<string, any>[] | null;
|
|
91
|
-
rewards: Record<string, any>[] | null;
|
|
92
|
-
giftCards: 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 | undefined;
|
|
103
|
-
server?: string | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
graphql?: {
|
|
106
|
-
refresh: {
|
|
107
|
-
document: import("graphql-request").RequestDocument | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, {}>;
|
|
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, {}>;
|
|
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, {}>;
|
|
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, {}>;
|
|
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: import("../types").QuoteAddress[];
|
|
136
|
-
applied: {
|
|
137
|
-
availableAddressId?: string | undefined;
|
|
138
|
-
address: import("../types").QuoteAddress;
|
|
139
|
-
itemIds: Record<string, any>[];
|
|
140
|
-
}[];
|
|
141
|
-
} | undefined;
|
|
142
|
-
paymentMethods?: {
|
|
143
|
-
available: import("../types").PaymentMethod[];
|
|
144
|
-
applied: {
|
|
145
|
-
paymentMethod: import("../types").PaymentMethod;
|
|
146
|
-
options: 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: Record<string, any>[];
|
|
157
|
-
shippingMethods: {
|
|
158
|
-
available: {
|
|
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
|
-
itemsAdded: Record<string, any>[] | null | undefined;
|
|
216
|
-
};
|
|
217
|
-
export default addItems;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './addItems';
|
|
2
|
-
export * from './notifyAddItems';
|
|
3
|
-
export * from './notifyRemoveItems';
|
|
4
|
-
export * from './notifyUpdateItems';
|
|
5
|
-
export * from './removeItems';
|
|
6
|
-
export * from './refresh';
|
|
7
|
-
export * from './reset';
|
|
8
|
-
export * from './syncAccessToken';
|
|
9
|
-
export * from './updateItems';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RemoveItemsEmittedEvent, QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
-
export declare function notifyRemoveItems({ event, }: {
|
|
3
|
-
context: QuoteMachineContext;
|
|
4
|
-
event: QuoteMachineEvents;
|
|
5
|
-
}): RemoveItemsEmittedEvent;
|
|
6
|
-
export default notifyRemoveItems;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UpdateItemsEmittedEvent, QuoteMachineContext, QuoteMachineEvents } from '../types';
|
|
2
|
-
export declare function notifyUpdateItems({ event, }: {
|
|
3
|
-
context: QuoteMachineContext;
|
|
4
|
-
event: QuoteMachineEvents;
|
|
5
|
-
}): UpdateItemsEmittedEvent;
|
|
6
|
-
export default notifyUpdateItems;
|