@afosto/checkout-ui 0.0.12 → 0.0.14
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/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts +2 -0
- package/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts.map +1 -1
- package/dist/CheckoutAddressFields/CheckoutAddressFields.js +155 -130
- package/dist/CheckoutAddressSection/CheckoutAddressSection.d.ts +6 -2
- package/dist/CheckoutAddressSection/CheckoutAddressSection.d.ts.map +1 -1
- package/dist/CheckoutAddressSection/CheckoutAddressSection.js +82 -71
- package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.d.ts.map +1 -1
- package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.js +32 -29
- package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.d.ts.map +1 -1
- package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.js +21 -21
- package/dist/CheckoutDownPaymentAgreementsSummary/CheckoutDownPaymentAgreementsSummary.d.ts.map +1 -1
- package/dist/CheckoutDownPaymentAgreementsSummary/CheckoutDownPaymentAgreementsSummary.js +38 -35
- package/dist/CheckoutInformationStep/CheckoutInformationStep.d.ts +0 -2
- package/dist/CheckoutInformationStep/CheckoutInformationStep.d.ts.map +1 -1
- package/dist/CheckoutInformationStep/CheckoutInformationStep.js +30 -37
- package/dist/CheckoutPaymentStep/CheckoutPaymentStep.d.ts.map +1 -1
- package/dist/CheckoutPaymentStep/CheckoutPaymentStep.js +15 -15
- package/dist/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.d.ts.map +1 -1
- package/dist/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.js +19 -19
- package/dist/CheckoutSummary/CheckoutSummary.d.ts.map +1 -1
- package/dist/CheckoutSummary/CheckoutSummary.js +23 -23
- package/dist/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.d.ts.map +1 -1
- package/dist/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.js +35 -28
- package/dist/constants/addressDefaultValues.d.ts +1 -0
- package/dist/constants/addressDefaultValues.d.ts.map +1 -1
- package/dist/constants/addressDefaultValues.js +1 -0
- package/dist/constants/addressFields.d.ts.map +1 -1
- package/dist/constants/addressFields.js +6 -5
- package/dist/constants/addressValidationSchema.d.ts +10 -2
- package/dist/constants/addressValidationSchema.d.ts.map +1 -1
- package/dist/constants/addressValidationSchema.js +58 -46
- package/dist/constants/index.js +8 -8
- package/dist/fragments/CoreCartProjectionFields.d.ts +8 -1
- package/dist/fragments/CoreCartProjectionFields.d.ts.map +1 -1
- package/dist/fragments/CoreCartProjectionFields.js +8 -1
- package/dist/fragments/CoreOrderProjectionFields.d.ts +8 -1
- package/dist/fragments/CoreOrderProjectionFields.d.ts.map +1 -1
- package/dist/fragments/CoreOrderProjectionFields.js +8 -1
- package/dist/hooks/useCheckoutAddressOptions.d.ts +3 -1
- package/dist/hooks/useCheckoutAddressOptions.d.ts.map +1 -1
- package/dist/hooks/useCheckoutAddressOptions.js +64 -57
- package/dist/hooks/useCheckoutCart.d.ts.map +1 -1
- package/dist/hooks/useCheckoutForm.d.ts.map +1 -1
- package/dist/hooks/useCheckoutForm.js +45 -41
- package/dist/hooks/useCheckoutOrder.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +426 -428
- package/dist/operations/cartOperations.d.ts.map +1 -1
- package/dist/operations/cartOperations.js +120 -108
- package/dist/operations/orderOperations.d.ts.map +1 -1
- package/dist/operations/orderOperations.js +123 -111
- package/dist/queries/getCartInitialPaymentStepQuery.d.ts +4 -0
- package/dist/queries/getCartInitialPaymentStepQuery.d.ts.map +1 -1
- package/dist/queries/getCartInitialPaymentStepQuery.js +10 -2
- package/dist/queries/getOrderInitialPaymentStepQuery.d.ts +4 -0
- package/dist/queries/getOrderInitialPaymentStepQuery.d.ts.map +1 -1
- package/dist/queries/getOrderInitialPaymentStepQuery.js +11 -3
- package/dist/steps/informationStep.d.ts +0 -1
- package/dist/steps/informationStep.d.ts.map +1 -1
- package/dist/steps/informationStep.js +234 -238
- package/dist/types.d.ts +13 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/createAddressValidationSchema.d.ts +4 -1
- package/dist/utils/createAddressValidationSchema.d.ts.map +1 -1
- package/dist/utils/createAddressValidationSchema.js +8 -8
- package/dist/utils/formatCurrency.d.ts +2 -0
- package/dist/utils/formatCurrency.d.ts.map +1 -0
- package/dist/utils/formatCurrency.js +14 -0
- package/package.json +1 -1
- package/dist/CheckoutSalutationSection/CheckoutSalutationSection.d.ts +0 -13
- package/dist/CheckoutSalutationSection/CheckoutSalutationSection.d.ts.map +0 -1
- package/dist/CheckoutSalutationSection/CheckoutSalutationSection.js +0 -26
- package/dist/CheckoutSalutationSection/index.d.ts +0 -3
- package/dist/CheckoutSalutationSection/index.d.ts.map +0 -1
- package/dist/CheckoutSalutationSection/index.js +0 -4
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { getOrderInitialCheckoutDataQuery as
|
|
2
|
-
import { getOrderInitialPaymentStepQuery as
|
|
3
|
-
import { initialAddCustomerToOrderMutation as
|
|
4
|
-
import { addCouponToOrderMutation as
|
|
5
|
-
import { addCustomerToOrderMutation as
|
|
6
|
-
import { addCustomerCountryCodeToOrderMutation as
|
|
7
|
-
import { addInformationToOrderMutation as
|
|
8
|
-
import { addNoteToOrderMutation as
|
|
9
|
-
import { addPaymentMethodToOrderMutation as
|
|
10
|
-
import { addPickupPointToOrderMutation as
|
|
11
|
-
import { addShippingMethodToOrderMutation as
|
|
12
|
-
import { getOrderPaymentMethodsQuery as
|
|
13
|
-
import { getOrderPickupPointsQuery as
|
|
14
|
-
import { getOrderReviewCheckoutDataQuery as
|
|
15
|
-
import { getOrderShippingMethodsQuery as
|
|
16
|
-
import { getOrderProceedingOptionsQuery as
|
|
17
|
-
import { removeCouponFromOrderMutation as
|
|
18
|
-
import { setAgreementTemplateForOrderMutation as
|
|
19
|
-
import { createAddressValidationSchema as
|
|
20
|
-
import { formatAddressOptionsRules as
|
|
21
|
-
import { isDefined as
|
|
22
|
-
const
|
|
1
|
+
import { getOrderInitialCheckoutDataQuery as w } from "../queries/getOrderInitialCheckoutDataQuery.js";
|
|
2
|
+
import { getOrderInitialPaymentStepQuery as Q } from "../queries/getOrderInitialPaymentStepQuery.js";
|
|
3
|
+
import { initialAddCustomerToOrderMutation as E } from "../mutations/initialAddCustomerToOrder.js";
|
|
4
|
+
import { addCouponToOrderMutation as B } from "../mutations/addCouponToOrder.js";
|
|
5
|
+
import { addCustomerToOrderMutation as N } from "../mutations/addCustomerToOrder.js";
|
|
6
|
+
import { addCustomerCountryCodeToOrderMutation as x } from "../mutations/addCustomerCountryCodeToOrder.js";
|
|
7
|
+
import { addInformationToOrderMutation as G } from "../mutations/addInformationToOrder.js";
|
|
8
|
+
import { addNoteToOrderMutation as U } from "../mutations/addNoteToOrder.js";
|
|
9
|
+
import { addPaymentMethodToOrderMutation as V } from "../mutations/addPaymentMethodToOrder.js";
|
|
10
|
+
import { addPickupPointToOrderMutation as H } from "../mutations/addPickupPointToOrder.js";
|
|
11
|
+
import { addShippingMethodToOrderMutation as j } from "../mutations/addShippingMethodToOrder.js";
|
|
12
|
+
import { getOrderPaymentMethodsQuery as z } from "../queries/getOrderPaymentMethodsQuery.js";
|
|
13
|
+
import { getOrderPickupPointsQuery as J } from "../queries/getOrderPickupPointsQuery.js";
|
|
14
|
+
import { getOrderReviewCheckoutDataQuery as K } from "../queries/getOrderReviewCheckoutDataQuery.js";
|
|
15
|
+
import { getOrderShippingMethodsQuery as L } from "../queries/getOrderShippingMethodsQuery.js";
|
|
16
|
+
import { getOrderProceedingOptionsQuery as W } from "../queries/getOrderProceedingOptionsQuery.js";
|
|
17
|
+
import { removeCouponFromOrderMutation as X } from "../mutations/removeCouponFromOrder.js";
|
|
18
|
+
import { setAgreementTemplateForOrderMutation as Y } from "../mutations/setAgreementTemplateForOrder.js";
|
|
19
|
+
import { createAddressValidationSchema as D } from "../utils/createAddressValidationSchema.js";
|
|
20
|
+
import { formatAddressOptionsRules as F } from "../utils/formatAddressOptionsRules.js";
|
|
21
|
+
import { isDefined as T } from "@afosto/utils";
|
|
22
|
+
const Or = {
|
|
23
23
|
initial: {
|
|
24
24
|
queryFn: async ({ id: e }, r) => {
|
|
25
25
|
const { storefront: t } = r || {};
|
|
26
|
-
return t.query(
|
|
26
|
+
return t.query(w, { id: e });
|
|
27
27
|
},
|
|
28
28
|
formatter: async (e, r) => {
|
|
29
29
|
const {
|
|
@@ -31,52 +31,52 @@ const lr = {
|
|
|
31
31
|
getUser: o,
|
|
32
32
|
isSignedIn: s,
|
|
33
33
|
operations: n,
|
|
34
|
-
settings:
|
|
35
|
-
} = r || {}, { isAccountEnabled: i, isB2bExcluded: O, isSharedOrganisationRequired:
|
|
34
|
+
settings: a
|
|
35
|
+
} = r || {}, { isAccountEnabled: i, isB2bExcluded: O, isSharedOrganisationRequired: f } = a || {}, {
|
|
36
36
|
order: g,
|
|
37
37
|
addressOptions: S,
|
|
38
38
|
...q
|
|
39
39
|
} = e || {};
|
|
40
|
-
let
|
|
41
|
-
const { contact:
|
|
40
|
+
let l = null, c = g, p = !1;
|
|
41
|
+
const { contact: y, organisation: h } = g?.customer || {};
|
|
42
42
|
if (i) {
|
|
43
|
-
const
|
|
44
|
-
if (s &&
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
43
|
+
const d = o();
|
|
44
|
+
if (s && d) {
|
|
45
|
+
let m = h?.id;
|
|
46
|
+
if (d.organisation?.id && d.organisation?.id !== m && (m = d.organisation?.id), d.id !== y?.id || m !== h?.id) {
|
|
47
|
+
const u = await n.initialAddCustomer.queryFn(
|
|
48
48
|
{
|
|
49
|
-
orderId:
|
|
49
|
+
orderId: c.id,
|
|
50
50
|
customer: {
|
|
51
|
-
contactId:
|
|
52
|
-
...
|
|
51
|
+
contactId: d.id,
|
|
52
|
+
...m ? { organisationId: m } : {}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
r
|
|
56
56
|
);
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
c = (await n.initialAddCustomer.formatter(
|
|
58
|
+
u,
|
|
59
59
|
r
|
|
60
|
-
))?.order,
|
|
60
|
+
))?.order, p = !0;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
const [
|
|
64
|
-
|
|
62
|
+
if (l = await t().catch(() => null), !f && !O && !d.organisation?.id && !h?.id) {
|
|
63
|
+
const [u] = l?.organisations || [];
|
|
64
|
+
u && (c.customer.organisation = u);
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
} else !s && (
|
|
66
|
+
f && !d?.organisation?.id && (p = !0);
|
|
67
|
+
} else !s && (f || y && !y.isGuest) && (p = !0);
|
|
68
68
|
}
|
|
69
|
-
const { shipping:
|
|
70
|
-
(
|
|
69
|
+
const { shipping: C } = c?.options || {}, P = C?.countries || [], M = (c?.payments || []).find(
|
|
70
|
+
(d) => !!d.details?.express
|
|
71
71
|
);
|
|
72
72
|
return {
|
|
73
73
|
...q,
|
|
74
|
-
account:
|
|
74
|
+
account: l,
|
|
75
75
|
addressOptions: S,
|
|
76
76
|
availableShippingCountryCodes: P,
|
|
77
|
-
expressPayment:
|
|
78
|
-
order:
|
|
79
|
-
skipCheckCompletedSteps:
|
|
77
|
+
expressPayment: M,
|
|
78
|
+
order: c,
|
|
79
|
+
skipCheckCompletedSteps: p
|
|
80
80
|
};
|
|
81
81
|
},
|
|
82
82
|
success: (e, r) => {
|
|
@@ -85,40 +85,52 @@ const lr = {
|
|
|
85
85
|
getUser: o,
|
|
86
86
|
isSignedIn: s,
|
|
87
87
|
setBillingAddressValidationSchema: n,
|
|
88
|
-
setCurrentOrganisation:
|
|
88
|
+
setCurrentOrganisation: a,
|
|
89
89
|
setHasSharedOrganisations: i,
|
|
90
90
|
setSessionExpired: O,
|
|
91
|
-
setShippingAddressValidationSchema:
|
|
91
|
+
setShippingAddressValidationSchema: f,
|
|
92
92
|
setShowAccountSelection: g,
|
|
93
93
|
setShowSignIn: S,
|
|
94
94
|
setSummary: q,
|
|
95
|
-
settings:
|
|
96
|
-
track:
|
|
97
|
-
} = r || {}, {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
settings: l,
|
|
96
|
+
track: c
|
|
97
|
+
} = r || {}, {
|
|
98
|
+
isAccountEnabled: p,
|
|
99
|
+
isB2bExcluded: y,
|
|
100
|
+
isSharedOrganisationRequired: h,
|
|
101
|
+
isSalutationRequired: C,
|
|
102
|
+
salutation: P
|
|
103
|
+
} = l || {}, M = o(), {
|
|
104
|
+
account: d,
|
|
105
|
+
addressOptions: m,
|
|
106
|
+
order: u,
|
|
107
|
+
...A
|
|
108
|
+
} = e || {}, { contact: R } = u?.customer || {};
|
|
109
|
+
q(t(u || {}));
|
|
104
110
|
try {
|
|
105
|
-
const { options:
|
|
106
|
-
|
|
107
|
-
),
|
|
108
|
-
|
|
111
|
+
const { options: k } = u?.billing?.address || {}, { options: I } = u?.delivery?.address || {}, b = F(
|
|
112
|
+
k ?? m
|
|
113
|
+
), v = F(
|
|
114
|
+
I ?? m
|
|
109
115
|
);
|
|
110
116
|
n(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
D(b, {
|
|
118
|
+
isSalutationRequired: C,
|
|
119
|
+
salutation: P
|
|
120
|
+
})
|
|
121
|
+
), f(
|
|
122
|
+
D(v, {
|
|
123
|
+
isSalutationRequired: C,
|
|
124
|
+
salutation: P
|
|
125
|
+
})
|
|
114
126
|
);
|
|
115
127
|
} catch {
|
|
116
128
|
}
|
|
117
|
-
|
|
118
|
-
...
|
|
119
|
-
...
|
|
120
|
-
account:
|
|
121
|
-
addressOptions:
|
|
129
|
+
y || a(u?.customer?.organisation || null), !y && (d?.sharedOrganisations || []).length > 0 && i(!0), s && h && !M?.organisation?.id && g(!0), p && !s && (h || R && !R?.isGuest) && (O(!!R && !R?.isGuest), S(!0)), c("beginCheckout", {
|
|
130
|
+
...A,
|
|
131
|
+
...u,
|
|
132
|
+
account: d,
|
|
133
|
+
addressOptions: m
|
|
122
134
|
});
|
|
123
135
|
},
|
|
124
136
|
error: () => {
|
|
@@ -127,7 +139,7 @@ const lr = {
|
|
|
127
139
|
initialAddCustomer: {
|
|
128
140
|
queryFn: async ({ orderId: e, customer: r }, t) => {
|
|
129
141
|
const { storefront: o } = t || {};
|
|
130
|
-
return o.query(
|
|
142
|
+
return o.query(E, {
|
|
131
143
|
addCustomerToOrderPayload: {
|
|
132
144
|
orderId: e,
|
|
133
145
|
customer: r
|
|
@@ -149,7 +161,7 @@ const lr = {
|
|
|
149
161
|
initialPaymentStep: {
|
|
150
162
|
queryFn: async ({ id: e }, r) => {
|
|
151
163
|
const { storefront: t } = r || {};
|
|
152
|
-
return t.query(
|
|
164
|
+
return t.query(Q, { id: e });
|
|
153
165
|
},
|
|
154
166
|
formatter: (e) => {
|
|
155
167
|
const { order: r, ...t } = e || {}, o = r?.options?.payment?.agreements || [], s = r?.checkout?.agreement || null, n = r?.options?.payment?.methods || [];
|
|
@@ -169,7 +181,7 @@ const lr = {
|
|
|
169
181
|
addCoupon: {
|
|
170
182
|
queryFn: async ({ orderId: e, coupon: r }, t) => {
|
|
171
183
|
const { storefront: o } = t || {};
|
|
172
|
-
return o.query(
|
|
184
|
+
return o.query(B, {
|
|
173
185
|
couponPayload: {
|
|
174
186
|
orderId: e,
|
|
175
187
|
coupon: r
|
|
@@ -193,7 +205,7 @@ const lr = {
|
|
|
193
205
|
addCustomer: {
|
|
194
206
|
queryFn: async ({ orderId: e, customer: r }, t) => {
|
|
195
207
|
const { storefront: o } = t || {};
|
|
196
|
-
return o.query(
|
|
208
|
+
return o.query(N, {
|
|
197
209
|
addCustomerToOrderPayload: {
|
|
198
210
|
orderId: e,
|
|
199
211
|
customer: r
|
|
@@ -217,7 +229,7 @@ const lr = {
|
|
|
217
229
|
addCustomerCountryCode: {
|
|
218
230
|
queryFn: async ({ orderId: e, countryCode: r }, t) => {
|
|
219
231
|
const { storefront: o } = t || {};
|
|
220
|
-
return o.query(
|
|
232
|
+
return o.query(x, {
|
|
221
233
|
countryCodePayload: {
|
|
222
234
|
orderId: e,
|
|
223
235
|
countryCode: r
|
|
@@ -240,17 +252,17 @@ const lr = {
|
|
|
240
252
|
},
|
|
241
253
|
addInformation: {
|
|
242
254
|
queryFn: async ({ orderId: e, billingAddress: r, customer: t, phoneNumber: o, shippingAddress: s }, n) => {
|
|
243
|
-
const { storefront:
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
addPhoneNumber:
|
|
255
|
+
const { storefront: a } = n || {};
|
|
256
|
+
return a.query(
|
|
257
|
+
G({
|
|
258
|
+
addPhoneNumber: T(o)
|
|
247
259
|
}),
|
|
248
260
|
{
|
|
249
261
|
customerInput: {
|
|
250
262
|
orderId: e,
|
|
251
263
|
customer: t
|
|
252
264
|
},
|
|
253
|
-
...
|
|
265
|
+
...T(o) ? {
|
|
254
266
|
phoneNumberInput: {
|
|
255
267
|
orderId: e,
|
|
256
268
|
phoneNumber: o
|
|
@@ -285,7 +297,7 @@ const lr = {
|
|
|
285
297
|
addNote: {
|
|
286
298
|
queryFn: async ({ orderId: e, note: r }, t) => {
|
|
287
299
|
const { storefront: o } = t || {};
|
|
288
|
-
return o.query(
|
|
300
|
+
return o.query(U, {
|
|
289
301
|
notePayload: {
|
|
290
302
|
orderId: e,
|
|
291
303
|
note: r
|
|
@@ -307,7 +319,7 @@ const lr = {
|
|
|
307
319
|
addPaymentMethod: {
|
|
308
320
|
queryFn: async ({ orderId: e, methodId: r, issuerId: t, terminalId: o }, s) => {
|
|
309
321
|
const { storefront: n } = s || {};
|
|
310
|
-
return n.query(
|
|
322
|
+
return n.query(V, {
|
|
311
323
|
paymentMethodPayload: {
|
|
312
324
|
orderId: e,
|
|
313
325
|
methodId: r,
|
|
@@ -324,9 +336,9 @@ const lr = {
|
|
|
324
336
|
};
|
|
325
337
|
},
|
|
326
338
|
success: (e, r) => {
|
|
327
|
-
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...
|
|
339
|
+
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...a } = e || {}, i = t(e.order || {});
|
|
328
340
|
o(i || {}), s("addPaymentInfo", {
|
|
329
|
-
...
|
|
341
|
+
...a,
|
|
330
342
|
...n
|
|
331
343
|
});
|
|
332
344
|
},
|
|
@@ -336,7 +348,7 @@ const lr = {
|
|
|
336
348
|
addPickupPoint: {
|
|
337
349
|
queryFn: async ({ orderId: e, pickupPointId: r }, t) => {
|
|
338
350
|
const { storefront: o } = t || {};
|
|
339
|
-
return o.query(
|
|
351
|
+
return o.query(H, {
|
|
340
352
|
pickupPointPayload: {
|
|
341
353
|
orderId: e,
|
|
342
354
|
spid: r
|
|
@@ -351,9 +363,9 @@ const lr = {
|
|
|
351
363
|
};
|
|
352
364
|
},
|
|
353
365
|
success: (e, r) => {
|
|
354
|
-
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...
|
|
366
|
+
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...a } = e || {}, i = t(e.order || {});
|
|
355
367
|
o(i || {}), s("addShippingInfo", {
|
|
356
|
-
...
|
|
368
|
+
...a,
|
|
357
369
|
...n
|
|
358
370
|
});
|
|
359
371
|
},
|
|
@@ -363,7 +375,7 @@ const lr = {
|
|
|
363
375
|
addShippingMethod: {
|
|
364
376
|
queryFn: async ({ orderId: e, methodId: r }, t) => {
|
|
365
377
|
const { storefront: o } = t || {};
|
|
366
|
-
return o.query(
|
|
378
|
+
return o.query(j, {
|
|
367
379
|
shippingMethodPayload: {
|
|
368
380
|
orderId: e,
|
|
369
381
|
methodId: r
|
|
@@ -378,9 +390,9 @@ const lr = {
|
|
|
378
390
|
};
|
|
379
391
|
},
|
|
380
392
|
success: (e, r) => {
|
|
381
|
-
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...
|
|
393
|
+
const { createSummary: t, setSummary: o, track: s } = r || {}, { order: n, ...a } = e || {}, i = t(e.order || {});
|
|
382
394
|
o(i || {}), s("addShippingInfo", {
|
|
383
|
-
...
|
|
395
|
+
...a,
|
|
384
396
|
...n
|
|
385
397
|
});
|
|
386
398
|
},
|
|
@@ -390,7 +402,7 @@ const lr = {
|
|
|
390
402
|
checkout: {
|
|
391
403
|
queryFn: async ({ id: e }, r) => {
|
|
392
404
|
const { storefront: t } = r || {};
|
|
393
|
-
return t.query(
|
|
405
|
+
return t.query(W, { id: e });
|
|
394
406
|
},
|
|
395
407
|
formatter: (e) => {
|
|
396
408
|
const { order: r, ...t } = e || {};
|
|
@@ -407,7 +419,7 @@ const lr = {
|
|
|
407
419
|
getPaymentMethods: {
|
|
408
420
|
queryFn: async ({ id: e }, r) => {
|
|
409
421
|
const { storefront: t } = r || {};
|
|
410
|
-
return t.query(
|
|
422
|
+
return t.query(z, { id: e });
|
|
411
423
|
},
|
|
412
424
|
formatter: (e) => {
|
|
413
425
|
const { order: r, ...t } = e || {}, o = r?.billing?.payment?.method || null, s = r?.options?.payment?.methods || [], n = r?.payments || [];
|
|
@@ -427,7 +439,7 @@ const lr = {
|
|
|
427
439
|
getPickupPoints: {
|
|
428
440
|
queryFn: async ({ id: e, countryCode: r, postalCode: t }, o) => {
|
|
429
441
|
const { storefront: s } = o || {};
|
|
430
|
-
return s.query(
|
|
442
|
+
return s.query(J, {
|
|
431
443
|
id: e,
|
|
432
444
|
countryCode: r,
|
|
433
445
|
postalCode: t
|
|
@@ -448,14 +460,14 @@ const lr = {
|
|
|
448
460
|
getReviewCheckoutData: {
|
|
449
461
|
queryFn: async ({ id: e }, r) => {
|
|
450
462
|
const { storefront: t } = r || {};
|
|
451
|
-
return t.query(
|
|
463
|
+
return t.query(K, { id: e });
|
|
452
464
|
},
|
|
453
465
|
formatter: (e) => {
|
|
454
|
-
const { order: r, ...t } = e || {}, { agreements: o = [] } = r?.acceptance || {}, s = r?.checkout?.agreement || null, { contact: n, notes:
|
|
455
|
-
address:
|
|
456
|
-
method:
|
|
457
|
-
pickupPoint:
|
|
458
|
-
} = r?.delivery || {},
|
|
466
|
+
const { order: r, ...t } = e || {}, { agreements: o = [] } = r?.acceptance || {}, s = r?.checkout?.agreement || null, { contact: n, notes: a = "", organisation: i } = r?.customer || {}, { address: O, payment: f } = r?.billing || {}, { issuer: g, method: S } = f || {}, q = r?.phoneNumber || null, {
|
|
467
|
+
address: l,
|
|
468
|
+
method: c,
|
|
469
|
+
pickupPoint: p
|
|
470
|
+
} = r?.delivery || {}, y = r?.currency, h = r?.items || [];
|
|
459
471
|
return {
|
|
460
472
|
...t,
|
|
461
473
|
order: r,
|
|
@@ -464,16 +476,16 @@ const lr = {
|
|
|
464
476
|
amountCovered: 0,
|
|
465
477
|
billingAddress: O,
|
|
466
478
|
contact: n,
|
|
467
|
-
currency:
|
|
479
|
+
currency: y,
|
|
468
480
|
issuer: g,
|
|
469
|
-
items:
|
|
470
|
-
notes:
|
|
481
|
+
items: h,
|
|
482
|
+
notes: a,
|
|
471
483
|
organisation: i,
|
|
472
484
|
paymentMethod: S,
|
|
473
485
|
phoneNumber: q,
|
|
474
|
-
pickupPoint:
|
|
475
|
-
shippingAddress:
|
|
476
|
-
shippingMethod:
|
|
486
|
+
pickupPoint: p,
|
|
487
|
+
shippingAddress: l,
|
|
488
|
+
shippingMethod: c
|
|
477
489
|
};
|
|
478
490
|
},
|
|
479
491
|
success: () => {
|
|
@@ -484,7 +496,7 @@ const lr = {
|
|
|
484
496
|
getShippingMethods: {
|
|
485
497
|
queryFn: async ({ id: e, countryCode: r, postalCode: t }, o) => {
|
|
486
498
|
const { storefront: s } = o || {};
|
|
487
|
-
return s.query(
|
|
499
|
+
return s.query(L, {
|
|
488
500
|
id: e,
|
|
489
501
|
countryCode: r,
|
|
490
502
|
postalCode: t
|
|
@@ -507,7 +519,7 @@ const lr = {
|
|
|
507
519
|
removeCoupon: {
|
|
508
520
|
queryFn: async ({ orderId: e, coupon: r }, t) => {
|
|
509
521
|
const { storefront: o } = t || {};
|
|
510
|
-
return o.query(
|
|
522
|
+
return o.query(X, {
|
|
511
523
|
couponPayload: {
|
|
512
524
|
orderId: e,
|
|
513
525
|
coupon: r
|
|
@@ -531,7 +543,7 @@ const lr = {
|
|
|
531
543
|
setAgreementTemplate: {
|
|
532
544
|
queryFn: async ({ orderId: e, agreementId: r }, t) => {
|
|
533
545
|
const { storefront: o } = t || {};
|
|
534
|
-
return o.query(
|
|
546
|
+
return o.query(Y, {
|
|
535
547
|
input: { orderId: e, agreementId: r }
|
|
536
548
|
});
|
|
537
549
|
},
|
|
@@ -551,5 +563,5 @@ const lr = {
|
|
|
551
563
|
}
|
|
552
564
|
};
|
|
553
565
|
export {
|
|
554
|
-
|
|
566
|
+
Or as orderOperations
|
|
555
567
|
};
|
|
@@ -4,7 +4,11 @@ export interface GetCartInitialPaymentStepParams {
|
|
|
4
4
|
export interface GetCartInitialPaymentStepResponseAgreementCondition {
|
|
5
5
|
type: string;
|
|
6
6
|
amount: number;
|
|
7
|
+
isPercentage: boolean;
|
|
7
8
|
pastDueAfter: number;
|
|
9
|
+
outcome: {
|
|
10
|
+
amount: number;
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
13
|
export interface GetCartInitialPaymentStepResponseAgreement {
|
|
10
14
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCartInitialPaymentStepQuery.d.ts","sourceRoot":"","sources":["../../src/queries/getCartInitialPaymentStepQuery.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mDAAmD;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"getCartInitialPaymentStepQuery.d.ts","sourceRoot":"","sources":["../../src/queries/getCartInitialPaymentStepQuery.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mDAAmD;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,0CAA0C;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,mDAAmD,EAAE,CAAC;CACnE;AAED,MAAM,WAAW,8CAA8C;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,SAAS,EAAE,0CAA0C,CAAC;SACvD,CAAC;QACF,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,UAAU,EAAE,0CAA0C,EAAE,CAAC;gBACzD,OAAO,EAAE,8CAA8C,EAAE,CAAC;aAC3D,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,8BAA8B,QAkD1C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gql as t } from "@afosto/graphql-client";
|
|
2
|
-
const
|
|
2
|
+
const n = t`
|
|
3
3
|
query getCartInitialPaymentStepQuery($id: String!) {
|
|
4
4
|
cart(id: $id) {
|
|
5
5
|
checkout {
|
|
@@ -12,7 +12,11 @@ const i = t`
|
|
|
12
12
|
conditions {
|
|
13
13
|
type
|
|
14
14
|
amount
|
|
15
|
+
is_percentage
|
|
15
16
|
past_due_after
|
|
17
|
+
outcome {
|
|
18
|
+
amount
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
@@ -27,7 +31,11 @@ const i = t`
|
|
|
27
31
|
conditions {
|
|
28
32
|
type
|
|
29
33
|
amount
|
|
34
|
+
is_percentage
|
|
30
35
|
past_due_after
|
|
36
|
+
outcome {
|
|
37
|
+
amount
|
|
38
|
+
}
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
methods {
|
|
@@ -43,5 +51,5 @@ const i = t`
|
|
|
43
51
|
}
|
|
44
52
|
`;
|
|
45
53
|
export {
|
|
46
|
-
|
|
54
|
+
n as getCartInitialPaymentStepQuery
|
|
47
55
|
};
|
|
@@ -4,7 +4,11 @@ export interface GetOrderInitialPaymentStepParams {
|
|
|
4
4
|
export interface GetOrderInitialPaymentStepResponseAgreementCondition {
|
|
5
5
|
type: string;
|
|
6
6
|
amount: number;
|
|
7
|
+
isPercentage: boolean;
|
|
7
8
|
pastDueAfter: number;
|
|
9
|
+
outcome: {
|
|
10
|
+
amount: number;
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
13
|
export interface GetOrderInitialPaymentStepResponseAgreement {
|
|
10
14
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderInitialPaymentStepQuery.d.ts","sourceRoot":"","sources":["../../src/queries/getOrderInitialPaymentStepQuery.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gCAAgC;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oDAAoD;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"getOrderInitialPaymentStepQuery.d.ts","sourceRoot":"","sources":["../../src/queries/getOrderInitialPaymentStepQuery.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gCAAgC;IAC/C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oDAAoD;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,2CAA2C;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,oDAAoD,EAAE,CAAC;CACpE;AAED,MAAM,WAAW,+CAA+C;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,SAAS,EAAE,2CAA2C,CAAC;SACxD,CAAC;QACF,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,UAAU,EAAE,2CAA2C,EAAE,CAAC;gBAC1D,OAAO,EAAE,+CAA+C,EAAE,CAAC;aAC5D,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,+BAA+B,QAkD3C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { gql as
|
|
2
|
-
const
|
|
1
|
+
import { gql as e } from "@afosto/graphql-client";
|
|
2
|
+
const n = e`
|
|
3
3
|
query getOrderInitialPaymentStepQuery($id: String!) {
|
|
4
4
|
order(id: $id) {
|
|
5
5
|
checkout {
|
|
@@ -12,7 +12,11 @@ const i = t`
|
|
|
12
12
|
conditions {
|
|
13
13
|
type
|
|
14
14
|
amount
|
|
15
|
+
is_percentage
|
|
15
16
|
past_due_after
|
|
17
|
+
outcome {
|
|
18
|
+
amount
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
@@ -27,7 +31,11 @@ const i = t`
|
|
|
27
31
|
conditions {
|
|
28
32
|
type
|
|
29
33
|
amount
|
|
34
|
+
is_percentage
|
|
30
35
|
past_due_after
|
|
36
|
+
outcome {
|
|
37
|
+
amount
|
|
38
|
+
}
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
methods {
|
|
@@ -43,5 +51,5 @@ const i = t`
|
|
|
43
51
|
}
|
|
44
52
|
`;
|
|
45
53
|
export {
|
|
46
|
-
|
|
54
|
+
n as getOrderInitialPaymentStepQuery
|
|
47
55
|
};
|
|
@@ -20,7 +20,6 @@ export interface CheckoutInformationStepValues {
|
|
|
20
20
|
phoneNumberCountry: CountryOption | null;
|
|
21
21
|
phoneNumberId: string;
|
|
22
22
|
phoneNumberIsDirty: boolean;
|
|
23
|
-
salutation?: string;
|
|
24
23
|
sameBillingAsShippingAddress: boolean;
|
|
25
24
|
shipping: AddressValues;
|
|
26
25
|
shippingAddressId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"informationStep.d.ts","sourceRoot":"","sources":["../../src/steps/informationStep.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,YAAY,IAAI,gBAAgB,EAEjC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAMjG,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,aAAa,GAAG,IAAI,CAAC;KACxC,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,
|
|
1
|
+
{"version":3,"file":"informationStep.d.ts","sourceRoot":"","sources":["../../src/steps/informationStep.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,YAAY,IAAI,gBAAgB,EAEjC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAMjG,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,aAAa,GAAG,IAAI,CAAC;KACxC,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4BAA4B,EAAE,OAAO,CAAC;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAYD,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,6BAA6B,CAqjCzE,CAAC"}
|