@loczer/storefront-sdk 0.163.0 → 0.165.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/StorefrontProvider.d.ts +29 -3
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +68 -58
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
- package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
- package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
- package/dist/components/AboutSection/index.js +1 -1
- package/dist/components/BikeProductCard/index.d.ts +2 -1
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +59 -41
- package/dist/components/BookingBikeVariantDialog/index.js +1 -1
- package/dist/components/BookingFlowSteps/index.js +8 -8
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
- package/dist/components/ContactSection/index.js +4 -4
- package/dist/components/Header/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.js +1 -1
- package/dist/components/ProductWarningNotice/index.js +10 -10
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +13 -13
- package/dist/i18n/en.d.ts +12 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/fr.d.ts +12 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +12 -0
- package/dist/index.d.ts +116 -7
- package/dist/index.js +312 -305
- package/dist/lib/cart.js +1 -1
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +28 -28
- package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +14 -6
- package/dist/lib/checkoutPaymentSession.d.ts +1 -0
- package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentSession.js +12 -11
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +34 -15
- package/dist/lib/products.d.ts +4 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +74 -39
- package/dist/lib/securePaymentLink.d.ts +1 -0
- package/dist/lib/securePaymentLink.d.ts.map +1 -1
- package/dist/lib/securePaymentLink.js +1 -0
- package/dist/lib/storefrontAvailability.d.ts +9 -0
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +28 -18
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +290 -289
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +224 -216
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +92 -92
- package/dist/pages/ContractSaleDocumentPage.js +3 -3
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +167 -161
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +62 -62
- package/dist/pages/PaymentLinkSuccessPage.js +7 -7
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +161 -161
- package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +4 -4
- package/dist/ui/day-picker.js +5 -5
- package/package.json +2 -2
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
package/dist/lib/cart.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as q } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as v, useContext as M, useState as w, useEffect as C, useCallback as I, useMemo as h } from "react";
|
|
3
|
-
const g = v(void 0), V = "loczer.storefront.cart.
|
|
3
|
+
const g = v(void 0), V = "loczer.storefront.cart.v5", b = (r) => {
|
|
4
4
|
const i = r.productVariantId ? `variant:${r.productVariantId}` : "product";
|
|
5
5
|
return `${r.kind}:${r.productId}:${i}`.toLowerCase();
|
|
6
6
|
}, $ = (r) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartSummary.d.ts","sourceRoot":"","sources":["../../src/lib/cartSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAyD,KAAK,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAKtH,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,GAAG;IAC3D,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,oBAAoB,EAAE,OAAO,CAAA;IAC7B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,kBAAkB,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAA;IAC/D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,2BAA2B,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,QAAQ;IACjD,KAAK,EAAE,kBAAkB,EA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M,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,6BAA6B,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,KAAG,qBAoEH,CAAA"}
|
package/dist/lib/cartSummary.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { getProductVariantDisplay as
|
|
2
|
-
import { findStorefrontProduct as V, getStorefrontCheckoutProductId as
|
|
3
|
-
import { calculateDailyPriceForQuantity as
|
|
1
|
+
import { getProductVariantDisplay as M, getProductVariantAttributeValue as D } from "./productVariants.js";
|
|
2
|
+
import { findStorefrontProduct as V, getStorefrontCheckoutProductId as P } from "./products.js";
|
|
3
|
+
import { calculateDailyPriceForQuantity as p } from "./pricing.js";
|
|
4
4
|
import { getLocalizedValue as y } from "../localization.js";
|
|
5
|
-
const
|
|
6
|
-
const a = typeof
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
const r =
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
5
|
+
const h = (i) => {
|
|
6
|
+
const a = typeof i.estimatedDays == "number" && Number.isFinite(i.estimatedDays) && i.estimatedDays > 0 ? Math.max(1, Math.floor(i.estimatedDays)) : void 0, e = i.items.map((o) => {
|
|
7
|
+
const t = V(o.productId, i.products);
|
|
8
|
+
if (!t) return null;
|
|
9
|
+
const r = o.productVariantId ? t.productVariants?.find((v) => v.id === o.productVariantId) : void 0;
|
|
10
|
+
if (o.productVariantId && !r) return null;
|
|
11
|
+
const n = r ? M(r) : void 0, l = t.prices ?? [], u = p(l, 1) ?? 0, d = y(t.name, i.language, i.fallbackLanguage), b = t.storefrontDisplayMode === "variants_as_products" && n?.label ? `${d} ${n.label}`.trim() : d, s = y(t.warning, i.language, i.fallbackLanguage).trim(), m = r ? !!D(r, "size") : !1, f = typeof a == "number" ? p(l, a) ?? u * a : void 0, g = typeof f == "number" ? f * o.quantity : void 0;
|
|
12
12
|
return {
|
|
13
|
-
...
|
|
14
|
-
checkoutProductId:
|
|
15
|
-
productName:
|
|
16
|
-
...
|
|
17
|
-
productVariantLabel:
|
|
18
|
-
productVariantDescription:
|
|
13
|
+
...o,
|
|
14
|
+
checkoutProductId: P(t),
|
|
15
|
+
productName: b,
|
|
16
|
+
...s ? { productWarning: s } : {},
|
|
17
|
+
productVariantLabel: n?.label,
|
|
18
|
+
productVariantDescription: n?.description,
|
|
19
19
|
productVariantIsSize: m,
|
|
20
|
-
unitPriceMinor:
|
|
21
|
-
lineTotalMinor:
|
|
22
|
-
estimatedLineTotalMinor:
|
|
23
|
-
availabilityStatus: "availabilityStatus" in
|
|
20
|
+
unitPriceMinor: u,
|
|
21
|
+
lineTotalMinor: u * o.quantity,
|
|
22
|
+
estimatedLineTotalMinor: g,
|
|
23
|
+
availabilityStatus: "availabilityStatus" in t ? t.availabilityStatus : void 0
|
|
24
24
|
};
|
|
25
|
-
}).filter((
|
|
25
|
+
}).filter((o) => o !== null), c = e.reduce((o, t) => o + t.lineTotalMinor, 0);
|
|
26
26
|
return typeof a == "number" ? {
|
|
27
|
-
lines:
|
|
28
|
-
totalPerDayMinor:
|
|
27
|
+
lines: e,
|
|
28
|
+
totalPerDayMinor: c,
|
|
29
29
|
estimatedDays: a,
|
|
30
|
-
estimatedTotalMinor:
|
|
31
|
-
(
|
|
30
|
+
estimatedTotalMinor: e.reduce(
|
|
31
|
+
(o, t) => o + (t.estimatedLineTotalMinor ?? t.lineTotalMinor * a),
|
|
32
32
|
0
|
|
33
33
|
)
|
|
34
34
|
} : {
|
|
35
|
-
lines:
|
|
36
|
-
totalPerDayMinor:
|
|
35
|
+
lines: e,
|
|
36
|
+
totalPerDayMinor: c
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
h as buildStorefrontCartSummary
|
|
41
41
|
};
|
|
@@ -34,6 +34,14 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
34
34
|
bookingDepositPercentage: z.ZodNumber;
|
|
35
35
|
fullPaymentWindowHours: z.ZodNumber;
|
|
36
36
|
depositRefundableUntilIso: z.ZodOptional<z.ZodString>;
|
|
37
|
+
cancellationQuote: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
policyEnabled: z.ZodBoolean;
|
|
39
|
+
minutesUntilStart: z.ZodNumber;
|
|
40
|
+
refundPercentage: z.ZodNumber;
|
|
41
|
+
refundableAmountMinor: z.ZodNumber;
|
|
42
|
+
nonRefundableAmountMinor: z.ZodNumber;
|
|
43
|
+
matchedUpToHours: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
37
45
|
}, z.core.$strip>>;
|
|
38
46
|
}, z.core.$strip>;
|
|
39
47
|
export type ResponsePayload = z.infer<typeof responseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutPaymentDecision.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutPaymentDecision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,qDAAqD,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;;EAAsC,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,aAAa;;;;;;;;;;iBAYxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"checkoutPaymentDecision.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutPaymentDecision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,qDAAqD,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;;EAAsC,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,aAAa;;;;;;;;;;iBAYxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
const o = "/api/public/storefront/checkout/payment-decision",
|
|
2
|
+
const o = "/api/public/storefront/checkout/payment-decision", n = e.enum(["none", "deposit", "full"]), i = e.object({
|
|
3
3
|
storeSlug: e.string().trim().min(1).toLowerCase(),
|
|
4
4
|
schedule: e.object({
|
|
5
5
|
startDate: e.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
@@ -11,23 +11,31 @@ const o = "/api/public/storefront/checkout/payment-decision", t = e.enum(["none"
|
|
|
11
11
|
// Test-only clock override: the server honors it outside production and
|
|
12
12
|
// always uses its own clock in production.
|
|
13
13
|
nowIso: e.string().datetime({ offset: !0 }).optional()
|
|
14
|
-
}),
|
|
14
|
+
}), r = e.object({
|
|
15
15
|
success: e.boolean(),
|
|
16
16
|
message: e.string().optional(),
|
|
17
17
|
decision: e.object({
|
|
18
18
|
shouldCollectOnlinePayment: e.boolean(),
|
|
19
|
-
paymentMode:
|
|
19
|
+
paymentMode: n,
|
|
20
20
|
calculatedAmountMinor: e.number().int().min(0),
|
|
21
21
|
amountToCollectMinor: e.number().int().min(0),
|
|
22
22
|
currency: e.string().trim().min(1),
|
|
23
23
|
bookingDepositPercentage: e.number().min(0).max(1),
|
|
24
24
|
fullPaymentWindowHours: e.number().int().positive(),
|
|
25
|
-
depositRefundableUntilIso: e.string().datetime({ offset: !0 }).optional()
|
|
25
|
+
depositRefundableUntilIso: e.string().datetime({ offset: !0 }).optional(),
|
|
26
|
+
cancellationQuote: e.object({
|
|
27
|
+
policyEnabled: e.boolean(),
|
|
28
|
+
minutesUntilStart: e.number().int().min(0),
|
|
29
|
+
refundPercentage: e.number().min(0).max(1),
|
|
30
|
+
refundableAmountMinor: e.number().int().min(0),
|
|
31
|
+
nonRefundableAmountMinor: e.number().int().min(0),
|
|
32
|
+
matchedUpToHours: e.number().int().positive().optional()
|
|
33
|
+
}).optional()
|
|
26
34
|
}).optional()
|
|
27
35
|
});
|
|
28
36
|
export {
|
|
29
37
|
o as ROUTE,
|
|
30
|
-
|
|
38
|
+
n as paymentDecisionModeSchema,
|
|
31
39
|
i as requestSchema,
|
|
32
|
-
|
|
40
|
+
r as responseSchema
|
|
33
41
|
};
|
|
@@ -41,6 +41,7 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
41
41
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
42
42
|
clientSecret: z.ZodOptional<z.ZodString>;
|
|
43
43
|
stripeAccountId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
stripePublishableKey: z.ZodOptional<z.ZodString>;
|
|
44
45
|
payment: z.ZodOptional<z.ZodObject<{
|
|
45
46
|
id: z.ZodString;
|
|
46
47
|
amount: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutPaymentSession.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutPaymentSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,oDAAoD,CAAA;AAEtE,eAAO,MAAM,wCAAwC;;;EAGnD,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAA;AAEzG,eAAO,MAAM,kCAAkC;;;;;;EAM7C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,aAAa;;;;;iBAKxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAY1D,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"checkoutPaymentSession.d.ts","sourceRoot":"","sources":["../../src/lib/checkoutPaymentSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,oDAAoD,CAAA;AAEtE,eAAO,MAAM,wCAAwC;;;EAGnD,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAA;AAEzG,eAAO,MAAM,kCAAkC;;;;;;EAM7C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,aAAa;;;;;iBAKxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAY1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAczB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const s = "/api/public/storefront/checkout/payment-session", e = t.enum([
|
|
3
3
|
"stripe_connect_oauth",
|
|
4
4
|
"mollie_connect_oauth"
|
|
5
|
-
]),
|
|
5
|
+
]), o = t.enum([
|
|
6
6
|
"pending",
|
|
7
7
|
"authorized",
|
|
8
8
|
"succeeded",
|
|
9
9
|
"failed",
|
|
10
10
|
"cancelled"
|
|
11
|
-
]),
|
|
11
|
+
]), r = t.object({
|
|
12
12
|
storeSlug: t.string().trim().min(1).toLowerCase(),
|
|
13
13
|
checkoutSessionId: t.string().trim().min(1).max(256),
|
|
14
14
|
returnSearch: t.string().max(2e3).optional(),
|
|
@@ -21,11 +21,11 @@ const r = "/api/public/storefront/checkout/payment-session", o = t.enum([
|
|
|
21
21
|
reference: t.string().optional(),
|
|
22
22
|
description: t.string().optional(),
|
|
23
23
|
livemode: t.boolean()
|
|
24
|
-
}),
|
|
24
|
+
}), a = t.object({
|
|
25
25
|
success: t.boolean(),
|
|
26
26
|
message: t.string(),
|
|
27
|
-
providerType:
|
|
28
|
-
paymentStatus:
|
|
27
|
+
providerType: e.optional(),
|
|
28
|
+
paymentStatus: o.optional(),
|
|
29
29
|
amountMinor: t.number().int().positive().optional(),
|
|
30
30
|
currency: t.string().optional(),
|
|
31
31
|
profileId: t.string().optional(),
|
|
@@ -33,12 +33,13 @@ const r = "/api/public/storefront/checkout/payment-session", o = t.enum([
|
|
|
33
33
|
checkoutUrl: t.string().url().optional(),
|
|
34
34
|
clientSecret: t.string().optional(),
|
|
35
35
|
stripeAccountId: t.string().optional(),
|
|
36
|
+
stripePublishableKey: t.string().optional(),
|
|
36
37
|
payment: n.optional()
|
|
37
38
|
});
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
s as ROUTE,
|
|
41
|
+
e as checkoutPaymentSessionProviderTypeSchema,
|
|
42
|
+
o as checkoutPaymentSessionStatusSchema,
|
|
43
|
+
r as requestSchema,
|
|
44
|
+
a as responseSchema
|
|
44
45
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { bookingScheduleInputSchema as r } from "../chunks/booking-engine/dist/schemas/cart-inputs-
|
|
2
|
+
import { bookingScheduleInputSchema as r } from "../chunks/booking-engine/dist/schemas/cart-inputs-BI_9nAXG.js";
|
|
3
3
|
import { productKindSchema as o } from "../chunks/booking-engine/dist/models/Product.shared-BiDGmurZ.js";
|
|
4
4
|
import "../chunks/booking-engine/dist/models/LocalizedString--6q77SPQ.js";
|
|
5
5
|
import "../chunks/booking-engine/dist/models/Price-BlFRDHXV.js";
|
|
6
6
|
import "../chunks/booking-engine/dist/schemas/base-asset-GJ9eIvIL.js";
|
|
7
|
-
import "../chunks/booking-engine/dist/schemas/base-booking-
|
|
7
|
+
import "../chunks/booking-engine/dist/schemas/base-booking-BMAjsw9r.js";
|
|
8
8
|
import "../chunks/booking-engine/dist/schemas/rich-text-CqXhNDN3.js";
|
|
9
9
|
import "../chunks/booking-engine/dist/schemas/money-Dy4b9loa.js";
|
|
10
10
|
import "../chunks/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js";
|
|
11
|
-
import "../chunks/booking-engine/dist/schemas/public-booking-engine-configuration-
|
|
12
|
-
import "../chunks/booking-engine/dist/schemas/booking-engine-configuration-
|
|
11
|
+
import "../chunks/booking-engine/dist/schemas/public-booking-engine-configuration-CrwffLO4.js";
|
|
12
|
+
import "../chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js";
|
|
13
13
|
import { storefrontFulfillmentModeSchema as s } from "../storefrontSchemas.js";
|
|
14
14
|
const x = "/api/public/storefront/checkout/submit", n = t.object({
|
|
15
15
|
kind: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productVariants.d.ts","sourceRoot":"","sources":["../../src/lib/productVariants.ts"],"names":[],"mappings":"AAKA,KAAK,kBAAkB,GAAG;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;
|
|
1
|
+
{"version":3,"file":"productVariants.d.ts","sourceRoot":"","sources":["../../src/lib/productVariants.ts"],"names":[],"mappings":"AAKA,KAAK,kBAAkB,GAAG;IACxB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAcD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW5G;AAwBD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAY7G;AAED,eAAO,MAAM,kCAAkC,iCAA2B,CAAA"}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const o = (t) => typeof t == "string" ? t.trim() : "", l = /* @__PURE__ */ new Set(["size", "color"]), d = /* @__PURE__ */ new Set(["min_height_cm", "max_height_cm"]);
|
|
2
|
+
function f(t) {
|
|
3
|
+
return o(t).toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
function u(t) {
|
|
3
6
|
return Array.isArray(t.attributes) ? t.attributes : [];
|
|
4
7
|
}
|
|
5
|
-
function
|
|
8
|
+
function y(t, n) {
|
|
6
9
|
const e = n.trim();
|
|
7
10
|
if (e)
|
|
8
|
-
for (const
|
|
9
|
-
if (i
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
11
|
+
for (const i of u(t)) {
|
|
12
|
+
if (o(i?.key) !== e) continue;
|
|
13
|
+
const r = o(i?.value);
|
|
14
|
+
if (r) return r;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function b(t) {
|
|
18
|
+
const n = [], e = [];
|
|
19
|
+
for (const i of u(t)) {
|
|
20
|
+
const r = o(i.value);
|
|
21
|
+
if (!r) continue;
|
|
22
|
+
const a = f(i.key);
|
|
23
|
+
if (!d.has(a)) {
|
|
24
|
+
if (l.has(a)) {
|
|
25
|
+
n.push(r);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
e.push(r);
|
|
12
29
|
}
|
|
30
|
+
}
|
|
31
|
+
return [...n, ...e].join(" · ");
|
|
13
32
|
}
|
|
14
|
-
function
|
|
15
|
-
const n =
|
|
33
|
+
function p(t) {
|
|
34
|
+
const n = o(t.id), e = o(t.computedName), a = [b(t), e, n].find((s) => s.length > 0) ?? n, c = e.length > 0 && e !== a ? e : "";
|
|
16
35
|
return {
|
|
17
|
-
label:
|
|
18
|
-
description:
|
|
36
|
+
label: a || n,
|
|
37
|
+
description: c || void 0
|
|
19
38
|
};
|
|
20
39
|
}
|
|
21
|
-
const
|
|
40
|
+
const m = p;
|
|
22
41
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
42
|
+
y as getProductVariantAttributeValue,
|
|
43
|
+
p as getProductVariantDisplay,
|
|
44
|
+
m as getStorefrontProductVariantDisplay
|
|
26
45
|
};
|
package/dist/lib/products.d.ts
CHANGED
|
@@ -36,11 +36,15 @@ export type StorefrontProductsCollections = {
|
|
|
36
36
|
bikes: BikeProduct[];
|
|
37
37
|
accessories: AccessoryProduct[];
|
|
38
38
|
};
|
|
39
|
+
export type StorefrontBookingProductsCollections = StorefrontProductsCollections;
|
|
39
40
|
export declare const buildStorefrontProductSlug: ({ id, productShortCode, name, }: {
|
|
40
41
|
id: string;
|
|
41
42
|
productShortCode?: string | null;
|
|
42
43
|
name?: LocalizedString;
|
|
43
44
|
}) => string;
|
|
45
|
+
export declare const buildVariantStorefrontProductId: (productId: string, variantId: string) => string;
|
|
46
|
+
export declare const toStorefrontBookingProducts: <T extends StorefrontProduct>(products: T[]) => T[];
|
|
47
|
+
export declare const toStorefrontBookingProductsCollections: (products: StorefrontProductsCollections) => StorefrontBookingProductsCollections;
|
|
44
48
|
export declare function getCatalogProductSortFieldForPriceUnit(unit: CatalogProductSortPriceUnit): CatalogProductSortField;
|
|
45
49
|
export declare function getCatalogProductPaginationSort(priceUnit: CatalogProductSortPriceUnit): CatalogProductPaginationSort;
|
|
46
50
|
export declare function getCatalogProductBaseRateMinor(prices: StorefrontPublicProductPrice[] | undefined, priceUnit?: CatalogProductSortPriceUnit): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/lib/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/lib/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAE7B,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AACjG,MAAM,MAAM,gBAAgB,GAAG,gCAAgC,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAA;AACvF,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAA;AAE9D,eAAO,MAAM,+BAA+B,KAAK,CAAA;AAEjD,MAAM,MAAM,2BAA2B,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAA;AAC9E,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,eAAe,GACf,qBAAqB,GACrB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,sBAAsB,GACtB,YAAY,CAAA;AAEhB,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC;IAC/C,KAAK,EAAE,uBAAuB,CAAA;IAC9B,KAAK,EAAE,KAAK,GAAG,MAAM,CAAA;CACtB,CAAC,CAAA;AAEF,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,4BAA4B,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAA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";
|
|
2
|
+
const m = -1, S = {
|
|
2
3
|
hour: "baseHourlyRateMinor",
|
|
3
4
|
half_day: "baseHalfDayRateMinor",
|
|
4
5
|
day: "baseDailyRateMinor",
|
|
5
6
|
week: "baseWeeklyRateMinor",
|
|
6
7
|
month: "baseMonthlyRateMinor"
|
|
7
|
-
},
|
|
8
|
+
}, g = /[\u0300-\u036f]/g, P = /[^a-z0-9]+/g, y = /^-+|-+$/g, s = (e) => e.normalize("NFKD").replace(g, "").toLowerCase().replace(P, "-").replace(y, ""), R = (e) => {
|
|
8
9
|
const t = e?.en?.value.trim();
|
|
9
10
|
return t || (Object.values(e ?? {}).find((r) => r.value.trim().length > 0)?.value.trim() ?? "");
|
|
10
|
-
},
|
|
11
|
+
}, p = (e, t) => {
|
|
12
|
+
const r = t.trim();
|
|
13
|
+
return r ? Object.fromEntries(
|
|
14
|
+
Object.entries(e).map(([o, n]) => {
|
|
15
|
+
const i = n.value.trim();
|
|
16
|
+
return [
|
|
17
|
+
o,
|
|
18
|
+
{
|
|
19
|
+
...n,
|
|
20
|
+
value: i ? `${i} ${r}`.trim() : n.value
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
})
|
|
24
|
+
) : e;
|
|
25
|
+
}, v = ({
|
|
11
26
|
id: e,
|
|
12
27
|
productShortCode: t,
|
|
13
28
|
name: r
|
|
14
29
|
}) => {
|
|
15
|
-
const o = s(typeof t == "string" ? t.trim() : ""), n = s(
|
|
16
|
-
return `product-${[o, n].filter((
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
return
|
|
30
|
+
const o = s(typeof t == "string" ? t.trim() : ""), n = s(R(r)), i = s(e);
|
|
31
|
+
return `product-${[o, n].filter((a) => a.length > 0).join("-") || i || "item"}`;
|
|
32
|
+
}, I = (e, t) => `${e}__variant__${t}`, _ = (e, t) => {
|
|
33
|
+
const r = e.checkoutProductId?.trim() || e.id, o = t.id.trim(), { label: n } = b(t);
|
|
34
|
+
return {
|
|
35
|
+
...e,
|
|
36
|
+
id: I(r, o),
|
|
37
|
+
checkoutProductId: r,
|
|
38
|
+
representedVariantId: o,
|
|
39
|
+
name: p(e.name, n),
|
|
40
|
+
productVariants: [t]
|
|
41
|
+
};
|
|
42
|
+
}, u = (e) => e.flatMap((t) => {
|
|
43
|
+
if (t.storefrontDisplayMode !== "variants_as_products") return [t];
|
|
44
|
+
const r = t.productVariants ?? [];
|
|
45
|
+
return r.length === 0 ? [t] : r.map((o) => _(t, o));
|
|
46
|
+
}), B = (e) => ({
|
|
47
|
+
bikes: u(e.bikes),
|
|
48
|
+
accessories: u(e.accessories)
|
|
49
|
+
}), l = (e) => e === "e-bike" ? 0 : e === "bike" ? 1 : e === "accessory" ? 2 : 3, f = (e) => e.externalId?.trim() || e.id?.trim() || "";
|
|
50
|
+
function M(e) {
|
|
51
|
+
return S[e];
|
|
20
52
|
}
|
|
21
|
-
function
|
|
53
|
+
function E(e) {
|
|
22
54
|
return [
|
|
23
55
|
{ field: "kind", order: "desc" },
|
|
24
56
|
{ field: "assetRelScore", order: "desc" },
|
|
25
|
-
{ field:
|
|
57
|
+
{ field: M(e), order: "desc" },
|
|
26
58
|
{ field: "externalId", order: "asc" }
|
|
27
59
|
];
|
|
28
60
|
}
|
|
29
61
|
function d(e, t = "day") {
|
|
30
62
|
const r = e?.find((o) => o.unit === t && o.quantity === 1);
|
|
31
|
-
return r ? r.value :
|
|
63
|
+
return r ? r.value : m;
|
|
32
64
|
}
|
|
33
|
-
function
|
|
65
|
+
function T(e) {
|
|
34
66
|
return d(e, "day");
|
|
35
67
|
}
|
|
36
|
-
function
|
|
37
|
-
const o =
|
|
68
|
+
function k(e, t, r = {}) {
|
|
69
|
+
const o = l(e.kind), n = l(t.kind);
|
|
38
70
|
if (o !== n)
|
|
39
71
|
return o - n;
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
return
|
|
72
|
+
const i = (t.assetRelScore ?? 0) - (e.assetRelScore ?? 0);
|
|
73
|
+
if (i !== 0) return i;
|
|
74
|
+
const c = r.priceUnit ?? "day", a = d(t.prices, c) - d(e.prices, c);
|
|
75
|
+
return a !== 0 ? a : f(e).localeCompare(f(t));
|
|
44
76
|
}
|
|
45
77
|
function A(e, t, r = {}) {
|
|
46
|
-
return
|
|
78
|
+
return k(
|
|
47
79
|
{ ...e, kind: e.kind === "e-bike" ? "e-bike" : "bike" },
|
|
48
80
|
{ ...t, kind: t.kind === "e-bike" ? "e-bike" : "bike" },
|
|
49
81
|
r
|
|
50
82
|
);
|
|
51
83
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
84
|
+
function D(e, t, r = {}) {
|
|
85
|
+
return k(
|
|
54
86
|
{ ...e, kind: "accessory" },
|
|
55
87
|
{ ...t, kind: "accessory" },
|
|
56
88
|
r
|
|
57
89
|
);
|
|
58
90
|
}
|
|
59
|
-
const
|
|
91
|
+
const N = (e) => e.map((t) => ({
|
|
60
92
|
...t,
|
|
61
93
|
kind: t.kind === "e-bike" ? "e-bike" : "bike"
|
|
62
|
-
})),
|
|
94
|
+
})), V = (e) => e.map((t) => ({
|
|
63
95
|
...t,
|
|
64
96
|
kind: "accessory"
|
|
65
|
-
})),
|
|
97
|
+
})), h = (e, t) => {
|
|
66
98
|
const r = t.bikes.find((n) => n.id === e);
|
|
67
99
|
return r || (t.accessories.find((n) => n.id === e) ?? null);
|
|
68
|
-
},
|
|
100
|
+
}, L = (e, t) => {
|
|
69
101
|
const r = t.bikes.find((n) => n.slug === e);
|
|
70
102
|
return r || (t.accessories.find((n) => n.slug === e) ?? null);
|
|
71
|
-
},
|
|
103
|
+
}, O = (e) => e.checkoutProductId?.trim() || e.id, U = (e) => {
|
|
72
104
|
const t = e.representedVariantId?.trim();
|
|
73
105
|
return t || void 0;
|
|
74
106
|
};
|
|
75
107
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
108
|
+
m as CATALOG_PRODUCT_BASE_RATE_UNSET,
|
|
109
|
+
v as buildStorefrontProductSlug,
|
|
110
|
+
I as buildVariantStorefrontProductId,
|
|
111
|
+
k as compareCatalogProducts,
|
|
112
|
+
D as compareStorefrontAccessoryProducts,
|
|
80
113
|
A as compareStorefrontBikeProducts,
|
|
81
|
-
|
|
82
|
-
|
|
114
|
+
h as findStorefrontProduct,
|
|
115
|
+
L as findStorefrontProductBySlug,
|
|
83
116
|
d as getCatalogProductBaseRateMinor,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
117
|
+
E as getCatalogProductPaginationSort,
|
|
118
|
+
M as getCatalogProductSortFieldForPriceUnit,
|
|
119
|
+
T as getStorefrontBaseDailyRateMinor,
|
|
120
|
+
O as getStorefrontCheckoutProductId,
|
|
121
|
+
U as getStorefrontRepresentedVariantId,
|
|
122
|
+
V as toStorefrontAccessoryProducts,
|
|
123
|
+
N as toStorefrontBikeProducts,
|
|
124
|
+
u as toStorefrontBookingProducts,
|
|
125
|
+
B as toStorefrontBookingProductsCollections
|
|
91
126
|
};
|
|
@@ -60,6 +60,7 @@ export declare const getStripeSecurePaymentSessionResponseSchema: z.ZodObject<{
|
|
|
60
60
|
message: z.ZodString;
|
|
61
61
|
clientSecret: z.ZodOptional<z.ZodString>;
|
|
62
62
|
stripeAccountId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
stripePublishableKey: z.ZodOptional<z.ZodString>;
|
|
63
64
|
payment: z.ZodOptional<z.ZodObject<{
|
|
64
65
|
id: z.ZodString;
|
|
65
66
|
amount: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securePaymentLink.d.ts","sourceRoot":"","sources":["../../src/lib/securePaymentLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,6BAA6B,mDAAmD,CAAA;AAC7F,eAAO,MAAM,uCAAuC,8DAA8D,CAAA;AAClH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AA6B,CAAC,CAAA;AAEnF,eAAO,MAAM,iCAAiC;;;iBAG5C,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE3F,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB7C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,0CAA0C;;;iBAGrD,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,CAAA;AAE7G,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;iBAiBtD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAA;AAE/G,eAAO,MAAM,0CAA0C;;;;iBAIrD,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,CAAA;AAE7G,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;iBAkBtD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAA"}
|
|
@@ -34,6 +34,7 @@ const o = "/api/public/storefront/secure-payment-link/get", s = "/api/public/sto
|
|
|
34
34
|
message: e.string(),
|
|
35
35
|
clientSecret: e.string().optional(),
|
|
36
36
|
stripeAccountId: e.string().optional(),
|
|
37
|
+
stripePublishableKey: e.string().optional(),
|
|
37
38
|
payment: e.object({
|
|
38
39
|
id: e.string(),
|
|
39
40
|
amount: e.number().int().positive(),
|
|
@@ -7,6 +7,13 @@ export declare const storefrontAvailabilityScheduleSchema: z.ZodObject<{
|
|
|
7
7
|
endTime: z.ZodString;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export type StorefrontAvailabilitySchedule = z.infer<typeof storefrontAvailabilityScheduleSchema>;
|
|
10
|
+
export type StorefrontAvailabilityBookingParams = {
|
|
11
|
+
start_date: string;
|
|
12
|
+
end_date: string;
|
|
13
|
+
start_time: string;
|
|
14
|
+
end_time: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const getValidStorefrontAvailabilitySchedule: (booking: StorefrontAvailabilityBookingParams) => StorefrontAvailabilitySchedule | null;
|
|
10
17
|
export declare const storefrontAvailabilityProductSchema: z.ZodObject<{
|
|
11
18
|
productId: z.ZodString;
|
|
12
19
|
productVariantId: z.ZodOptional<z.ZodString>;
|
|
@@ -48,6 +55,7 @@ export declare const storefrontPublicAvailabilityRecordSchema: z.ZodObject<{
|
|
|
48
55
|
remainingCounts: "remainingCounts";
|
|
49
56
|
}>;
|
|
50
57
|
soldOut: z.ZodBoolean;
|
|
58
|
+
unlimited: z.ZodBoolean;
|
|
51
59
|
insufficientCapacity: z.ZodOptional<z.ZodBoolean>;
|
|
52
60
|
fewRemaining: z.ZodOptional<z.ZodBoolean>;
|
|
53
61
|
remaining: z.ZodOptional<z.ZodNumber>;
|
|
@@ -68,6 +76,7 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
68
76
|
remainingCounts: "remainingCounts";
|
|
69
77
|
}>;
|
|
70
78
|
soldOut: z.ZodBoolean;
|
|
79
|
+
unlimited: z.ZodBoolean;
|
|
71
80
|
insufficientCapacity: z.ZodOptional<z.ZodBoolean>;
|
|
72
81
|
fewRemaining: z.ZodOptional<z.ZodBoolean>;
|
|
73
82
|
remaining: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefrontAvailability.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,8CAA8C,CAAA;AAEhE,eAAO,MAAM,oC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