@loczer/storefront-sdk 0.242.0 → 0.243.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/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -1
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/lib/checkoutSubmit.d.ts +4 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +16 -8
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +199 -199
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +168 -167
- package/dist/pages/CheckoutSuccessPage.d.ts.map +1 -1
- package/dist/pages/CheckoutSuccessPage.js +37 -25
- package/dist/storefront.css +1 -1
- package/dist/ui/drawer.d.ts +12 -13
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +119 -143
- package/package.json +1 -1
package/dist/i18n/en.d.ts
CHANGED
|
@@ -271,6 +271,7 @@ export declare const storefront: {
|
|
|
271
271
|
checkout_submit: string;
|
|
272
272
|
checkout_success_toast: string;
|
|
273
273
|
checkout_success_title: string;
|
|
274
|
+
checkout_success_booking_number: string;
|
|
274
275
|
checkout_success_description: string;
|
|
275
276
|
checkout_success_back_to_products: string;
|
|
276
277
|
checkout_success_back_home: string;
|
package/dist/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkhBtB,CAAA"}
|
package/dist/i18n/en.js
CHANGED
|
@@ -272,7 +272,8 @@ var e = {
|
|
|
272
272
|
checkout_submit: "Send booking request",
|
|
273
273
|
checkout_success_toast: "Request sent.",
|
|
274
274
|
checkout_success_title: "Request received",
|
|
275
|
-
|
|
275
|
+
checkout_success_booking_number: "Here is your booking number:",
|
|
276
|
+
checkout_success_description: "A confirmation email has been sent to you.",
|
|
276
277
|
checkout_success_back_to_products: "Back to bikes",
|
|
277
278
|
checkout_success_back_home: "Back to home",
|
|
278
279
|
checkout_payment_return_loading: "Checking payment status…",
|
package/dist/i18n/fr.d.ts
CHANGED
|
@@ -272,6 +272,7 @@ export declare const storefront: {
|
|
|
272
272
|
checkout_submit: string;
|
|
273
273
|
checkout_success_toast: string;
|
|
274
274
|
checkout_success_title: string;
|
|
275
|
+
checkout_success_booking_number: string;
|
|
275
276
|
checkout_success_description: string;
|
|
276
277
|
checkout_success_back_to_products: string;
|
|
277
278
|
checkout_success_back_home: string;
|
package/dist/i18n/fr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmhBtB,CAAA"}
|
package/dist/i18n/fr.js
CHANGED
|
@@ -273,7 +273,8 @@ var e = {
|
|
|
273
273
|
checkout_submit: "Envoyer la demande de réservation",
|
|
274
274
|
checkout_success_toast: "Demande envoyée.",
|
|
275
275
|
checkout_success_title: "Demande reçue",
|
|
276
|
-
|
|
276
|
+
checkout_success_booking_number: "Voici votre numéro de réservation :",
|
|
277
|
+
checkout_success_description: "Un e-mail de confirmation vous a été envoyé.",
|
|
277
278
|
checkout_success_back_to_products: "Retour aux vélos",
|
|
278
279
|
checkout_success_back_home: "Retour à l’accueil",
|
|
279
280
|
checkout_payment_return_loading: "Vérification du statut du paiement…",
|
package/dist/index.d.ts
CHANGED
|
@@ -4556,6 +4556,7 @@ export declare const storefrontEn: {
|
|
|
4556
4556
|
checkout_submit: string;
|
|
4557
4557
|
checkout_success_toast: string;
|
|
4558
4558
|
checkout_success_title: string;
|
|
4559
|
+
checkout_success_booking_number: string;
|
|
4559
4560
|
checkout_success_description: string;
|
|
4560
4561
|
checkout_success_back_to_products: string;
|
|
4561
4562
|
checkout_success_back_home: string;
|
|
@@ -5161,6 +5162,7 @@ export declare const storefrontFr: {
|
|
|
5161
5162
|
checkout_submit: string;
|
|
5162
5163
|
checkout_success_toast: string;
|
|
5163
5164
|
checkout_success_title: string;
|
|
5165
|
+
checkout_success_booking_number: string;
|
|
5164
5166
|
checkout_success_description: string;
|
|
5165
5167
|
checkout_success_back_to_products: string;
|
|
5166
5168
|
checkout_success_back_home: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ROUTE = "/api/public/storefront/checkout/submit";
|
|
3
|
+
export declare const CHECKOUT_BOOKING_NUMBER_SEARCH_PARAM = "booking_number";
|
|
4
|
+
export declare const parseCheckoutBookingNumber: (value: unknown) => string;
|
|
5
|
+
export declare const getCheckoutBookingNumberFromSearchParams: (searchParams: URLSearchParams) => string;
|
|
6
|
+
export declare const addCheckoutBookingNumberToPath: (path: string, bookingNumber: unknown) => string;
|
|
3
7
|
export declare const requestCheckoutItemSchema: z.ZodObject<{
|
|
4
8
|
kind: any;
|
|
5
9
|
productId: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"checkoutSubmit.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutSubmit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,KAAK,2CAA2C,CAAA;AAC7D,eAAO,MAAM,oCAAoC,mBAAmB,CAAA;AAEpE,eAAO,MAAM,0BAA0B,GAAI,OAAO,OAAO,KAAG,MAG3D,CAAA;AAED,eAAO,MAAM,wCAAwC,GACnD,cAAc,eAAe,KAC5B,MAIF,CAAA;AAED,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,EACZ,eAAe,OAAO,KACrB,MAeF,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAI3E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqB5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,GACpC,SAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,KAAK,CAAC,CAAC,aAAa,SAWrB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBxB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;iBAazB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -5,12 +5,20 @@ import "../chunks/pkg/booking-engine/dist/schemas-B82mPOxs.js";
|
|
|
5
5
|
import { storefrontFulfillmentModeSchema as i } from "../storefrontSchemas.js";
|
|
6
6
|
import { z as a } from "zod";
|
|
7
7
|
//#region src/lib/checkoutSubmit.ts
|
|
8
|
-
var o = "/api/public/storefront/checkout/submit", s =
|
|
8
|
+
var o = "/api/public/storefront/checkout/submit", s = "booking_number", c = (e) => {
|
|
9
|
+
let n = t.safeParse(e);
|
|
10
|
+
return n.success ? n.data : "";
|
|
11
|
+
}, l = (e) => c(e.get(s)), u = (e, t) => {
|
|
12
|
+
let n = c(t);
|
|
13
|
+
if (!n) return e;
|
|
14
|
+
let r = e.indexOf("#"), i = r >= 0 ? e.slice(0, r) : e, a = r >= 0 ? e.slice(r) : "", o = i.indexOf("?"), l = o >= 0 ? i.slice(0, o) : i, u = new URLSearchParams(o >= 0 ? i.slice(o + 1) : "");
|
|
15
|
+
return u.set(s, n), `${l}?${u.toString()}${a}`;
|
|
16
|
+
}, d = a.object({
|
|
9
17
|
kind: e,
|
|
10
18
|
productId: a.string().trim().min(1),
|
|
11
19
|
productVariantId: a.string().trim().min(1).optional(),
|
|
12
20
|
quantity: a.number().int().positive()
|
|
13
|
-
}),
|
|
21
|
+
}), f = a.object({
|
|
14
22
|
storeSlug: a.string().trim().min(1).toLowerCase(),
|
|
15
23
|
checkoutSessionId: a.string().trim().min(1).max(256).optional(),
|
|
16
24
|
replacesCheckoutSessionId: a.string().trim().min(1).max(256).optional(),
|
|
@@ -27,16 +35,16 @@ var o = "/api/public/storefront/checkout/submit", s = a.object({
|
|
|
27
35
|
phone: a.string().trim().min(6),
|
|
28
36
|
notes: a.string().trim().max(2e3).optional().or(a.literal(""))
|
|
29
37
|
}),
|
|
30
|
-
items: a.array(
|
|
38
|
+
items: a.array(d).min(1),
|
|
31
39
|
nowIso: a.string().datetime({ offset: !0 }).optional()
|
|
32
|
-
}),
|
|
40
|
+
}), p = (e, t) => {
|
|
33
41
|
e.fulfillment === "delivery" && (e.startAddress?.trim() || t.addIssue({
|
|
34
42
|
code: a.ZodIssueCode.custom,
|
|
35
43
|
message: "Delivery start address is required.",
|
|
36
44
|
path: ["startAddress"]
|
|
37
45
|
}));
|
|
38
|
-
},
|
|
39
|
-
|
|
46
|
+
}, m = f.superRefine((e, t) => {
|
|
47
|
+
p(e, t), e.replacesCheckoutSessionId && !e.checkoutSessionId && t.addIssue({
|
|
40
48
|
code: a.ZodIssueCode.custom,
|
|
41
49
|
message: "A replacement checkout session requires a new checkout session id.",
|
|
42
50
|
path: ["checkoutSessionId"]
|
|
@@ -45,7 +53,7 @@ var o = "/api/public/storefront/checkout/submit", s = a.object({
|
|
|
45
53
|
message: "The new and replaced checkout session ids must differ.",
|
|
46
54
|
path: ["replacesCheckoutSessionId"]
|
|
47
55
|
});
|
|
48
|
-
}),
|
|
56
|
+
}), h = a.object({
|
|
49
57
|
success: a.boolean(),
|
|
50
58
|
message: a.string().optional(),
|
|
51
59
|
checkout: a.object({
|
|
@@ -58,4 +66,4 @@ var o = "/api/public/storefront/checkout/submit", s = a.object({
|
|
|
58
66
|
}).optional()
|
|
59
67
|
});
|
|
60
68
|
//#endregion
|
|
61
|
-
export { o as ROUTE, c as requestBaseSchema,
|
|
69
|
+
export { s as CHECKOUT_BOOKING_NUMBER_SEARCH_PARAM, o as ROUTE, u as addCheckoutBookingNumberToPath, l as getCheckoutBookingNumberFromSearchParams, c as parseCheckoutBookingNumber, f as requestBaseSchema, d as requestCheckoutItemSchema, p as requestDeliveryRefinement, m as requestSchema, h as responseSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAuFA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA2rBnC"}
|