@loczer/storefront-sdk 0.150.0 → 0.152.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 +20 -0
- package/dist/booking-period-time-slots.d.ts +23 -38
- package/dist/booking-period.d.ts +20 -0
- package/dist/booking.d.ts +18 -0
- package/dist/checkoutSubmit.d.ts +36 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-CnBdp3jk.js → booking-engine-configuration-BKlzwJJX.js} +20 -19
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-DYgEGJ5M.js → cart-inputs-ByBK0IVJ.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-C9VB-WhU.js → public-booking-engine-configuration-DKoak4s5.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js +51 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +76 -80
- package/dist/index.js +308 -298
- package/dist/lib/booking-period-time-slots.d.ts +0 -31
- package/dist/lib/booking-period-time-slots.js +122 -221
- package/dist/lib/booking-period.d.ts +14 -0
- package/dist/lib/booking-period.js +168 -150
- package/dist/lib/booking.d.ts +3 -0
- package/dist/lib/booking.js +102 -89
- package/dist/lib/checkoutSubmit.d.ts +34 -0
- package/dist/lib/checkoutSubmit.js +17 -15
- package/dist/lib/storefrontTimeSlots.d.ts +43 -0
- package/dist/lib/storefrontTimeSlots.js +26 -0
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +8 -0
- package/dist/storefrontSchemas.js +4 -4
- package/dist/storefrontTimeSlots.d.ts +53 -0
- package/dist/whatsapp.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-B47MMaoD.js +0 -45
|
@@ -97,6 +97,10 @@ export declare const loader: ({ ctx, params }: LoaderArgs) => Promise<{
|
|
|
97
97
|
end: string;
|
|
98
98
|
}[];
|
|
99
99
|
}[] | undefined;
|
|
100
|
+
extraTimeSlots?: {
|
|
101
|
+
minutesAfterClose: number;
|
|
102
|
+
extraAmount: number;
|
|
103
|
+
}[] | undefined;
|
|
100
104
|
};
|
|
101
105
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
102
106
|
checkout: {
|
|
@@ -339,6 +343,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
339
343
|
end: string;
|
|
340
344
|
}[];
|
|
341
345
|
}[] | undefined;
|
|
346
|
+
extraTimeSlots?: {
|
|
347
|
+
minutesAfterClose: number;
|
|
348
|
+
extraAmount: number;
|
|
349
|
+
}[] | undefined;
|
|
342
350
|
};
|
|
343
351
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
344
352
|
checkout: {
|
|
@@ -403,6 +411,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
403
411
|
end: string;
|
|
404
412
|
}[];
|
|
405
413
|
}[] | undefined;
|
|
414
|
+
extraTimeSlots?: {
|
|
415
|
+
minutesAfterClose: number;
|
|
416
|
+
extraAmount: number;
|
|
417
|
+
}[] | undefined;
|
|
406
418
|
};
|
|
407
419
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
408
420
|
checkout: {
|
|
@@ -768,6 +780,10 @@ export declare function useStorefrontConfig(): {
|
|
|
768
780
|
end: string;
|
|
769
781
|
}[];
|
|
770
782
|
}[] | undefined;
|
|
783
|
+
extraTimeSlots?: {
|
|
784
|
+
minutesAfterClose: number;
|
|
785
|
+
extraAmount: number;
|
|
786
|
+
}[] | undefined;
|
|
771
787
|
};
|
|
772
788
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
773
789
|
checkout: {
|
|
@@ -980,6 +996,10 @@ export declare function useStorefrontConfig(): {
|
|
|
980
996
|
end: string;
|
|
981
997
|
}[];
|
|
982
998
|
}[] | undefined;
|
|
999
|
+
extraTimeSlots?: {
|
|
1000
|
+
minutesAfterClose: number;
|
|
1001
|
+
extraAmount: number;
|
|
1002
|
+
}[] | undefined;
|
|
983
1003
|
};
|
|
984
1004
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
985
1005
|
checkout: {
|
|
@@ -16,14 +16,20 @@ declare namespace bookingPeriod {
|
|
|
16
16
|
NormalizedOpeningHours,
|
|
17
17
|
NormalizeOpeningHoursOptions,
|
|
18
18
|
normalizeOpeningHours,
|
|
19
|
+
BookingPeriodExtraTimeSlotRule,
|
|
19
20
|
BookingPeriodConfig_2 as BookingPeriodConfig,
|
|
20
21
|
BookingPeriodConstants,
|
|
21
22
|
createBookingPeriodConstants,
|
|
23
|
+
instantToBusinessDateTimeParts,
|
|
24
|
+
normalizeBusinessDateString,
|
|
25
|
+
calendarDateToBusinessDateString,
|
|
26
|
+
instantToBusinessDateString,
|
|
22
27
|
DefaultBookingPeriod,
|
|
23
28
|
DefaultBookingPeriodOptions,
|
|
24
29
|
getDefaultBookingPeriod,
|
|
25
30
|
dateToBusinessDateString,
|
|
26
31
|
businessDateStringToDate,
|
|
32
|
+
getWeekdayFromDateString,
|
|
27
33
|
BookingPeriodInput,
|
|
28
34
|
BookingPeriodAdjustmentResult,
|
|
29
35
|
BookingPeriodAdjustmentOptions,
|
|
@@ -54,10 +60,16 @@ declare type BookingPeriodConfig_2 = {
|
|
|
54
60
|
openingHours: StoreOpeningHours;
|
|
55
61
|
openingHoursOverrides: StoreOpeningOverride[];
|
|
56
62
|
timeZone: string;
|
|
63
|
+
extraTimeSlots?: BookingPeriodExtraTimeSlotRule[];
|
|
57
64
|
};
|
|
58
65
|
|
|
59
66
|
declare type BookingPeriodConstants = ReturnType<typeof createBookingPeriodConstants>;
|
|
60
67
|
|
|
68
|
+
declare type BookingPeriodExtraTimeSlotRule = {
|
|
69
|
+
minutesAfterClose: number;
|
|
70
|
+
extraAmount: number;
|
|
71
|
+
};
|
|
72
|
+
|
|
61
73
|
declare interface BookingPeriodInput {
|
|
62
74
|
startDate?: Date | string | null;
|
|
63
75
|
startTime?: string | null;
|
|
@@ -74,6 +86,8 @@ declare type BookingTimingConfig = {
|
|
|
74
86
|
|
|
75
87
|
declare const businessDateStringToDate: (dateString: string) => Date;
|
|
76
88
|
|
|
89
|
+
declare const calendarDateToBusinessDateString: (date: Date | null | undefined) => string | undefined;
|
|
90
|
+
|
|
77
91
|
declare const createBookingPeriodConstants: (config: BookingPeriodConfig_2) => {
|
|
78
92
|
timeZone: string;
|
|
79
93
|
slotIntervalMinutes: number;
|
|
@@ -134,35 +148,6 @@ declare interface DefaultBookingPeriodOptions {
|
|
|
134
148
|
config: BookingPeriodConfig_2;
|
|
135
149
|
}
|
|
136
150
|
|
|
137
|
-
export declare interface DisabledTimeSlotRule {
|
|
138
|
-
startMinutes?: number;
|
|
139
|
-
endMinutes?: number;
|
|
140
|
-
values?: string[];
|
|
141
|
-
reason?: string;
|
|
142
|
-
dates?: string[];
|
|
143
|
-
weekdays?: number[];
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export declare interface DisabledTimeSlotRuleContext {
|
|
147
|
-
date?: string;
|
|
148
|
-
slotInterval: number;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export declare interface ExtraTimeSlotRule {
|
|
152
|
-
startMinutes: number;
|
|
153
|
-
endMinutes?: number;
|
|
154
|
-
extraAmount: number;
|
|
155
|
-
dates?: string[];
|
|
156
|
-
weekdays?: number[];
|
|
157
|
-
journeyTypes?: JourneyType[];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export declare interface ExtraTimeSlotRuleContext {
|
|
161
|
-
date?: string;
|
|
162
|
-
slotInterval: number;
|
|
163
|
-
journeyType?: JourneyType;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
151
|
export declare const getBookingPeriodTimeSlots: (bookingPeriodConfig: BookingPeriodConfig, { date, }?: {
|
|
167
152
|
date?: string;
|
|
168
153
|
}) => Promise<{
|
|
@@ -179,18 +164,22 @@ export declare const getBookingPeriodTimeSlotsSync: (bookingPeriodConfig: Bookin
|
|
|
179
164
|
|
|
180
165
|
declare const getDefaultBookingPeriod: (options: DefaultBookingPeriodOptions) => DefaultBookingPeriod;
|
|
181
166
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
export declare const getDisabledTimeSlotRulesSync: (_context: DisabledTimeSlotRuleContext) => DisabledTimeSlotRule[];
|
|
167
|
+
declare const getWeekdayFromDateString: (dateString: string) => Weekday;
|
|
185
168
|
|
|
186
|
-
|
|
169
|
+
declare const instantToBusinessDateString: (date: Date, timeZone: string) => string | undefined;
|
|
187
170
|
|
|
188
|
-
|
|
171
|
+
declare const instantToBusinessDateTimeParts: (date: Date, timeZone: string) => {
|
|
172
|
+
dateString: string;
|
|
173
|
+
timeString: string;
|
|
174
|
+
minutesFromMidnight: number;
|
|
175
|
+
} | undefined;
|
|
189
176
|
|
|
190
177
|
export declare type JourneyType = "start" | "end";
|
|
191
178
|
|
|
192
179
|
declare const minutesToTimeString: (minutes: number) => string;
|
|
193
180
|
|
|
181
|
+
declare const normalizeBusinessDateString: (dateString: string) => string | undefined;
|
|
182
|
+
|
|
194
183
|
declare type NormalizedOpeningHours = {
|
|
195
184
|
days: NormalizedWorkingDay[];
|
|
196
185
|
defaultOpeningMinutes: number;
|
|
@@ -230,10 +219,6 @@ declare type NormalizeOpeningHoursOptions = {
|
|
|
230
219
|
|
|
231
220
|
declare const parseTimeToMinutes: (time?: string | null) => number | null;
|
|
232
221
|
|
|
233
|
-
export declare const staticDisabledTimeSlotRules: DisabledTimeSlotRule[];
|
|
234
|
-
|
|
235
|
-
export declare const staticExtraTimeSlotRules: ExtraTimeSlotRule[];
|
|
236
|
-
|
|
237
222
|
declare type StoreOpeningDay = {
|
|
238
223
|
day: Weekday;
|
|
239
224
|
openingSlots: StoreOpeningSlot[];
|
package/dist/booking-period.d.ts
CHANGED
|
@@ -21,10 +21,16 @@ export declare type BookingPeriodConfig = {
|
|
|
21
21
|
openingHours: StoreOpeningHours;
|
|
22
22
|
openingHoursOverrides: StoreOpeningOverride[];
|
|
23
23
|
timeZone: string;
|
|
24
|
+
extraTimeSlots?: BookingPeriodExtraTimeSlotRule[];
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export declare type BookingPeriodConstants = ReturnType<typeof createBookingPeriodConstants>;
|
|
27
28
|
|
|
29
|
+
export declare type BookingPeriodExtraTimeSlotRule = {
|
|
30
|
+
minutesAfterClose: number;
|
|
31
|
+
extraAmount: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
28
34
|
export declare interface BookingPeriodInput {
|
|
29
35
|
startDate?: Date | string | null;
|
|
30
36
|
startTime?: string | null;
|
|
@@ -41,6 +47,8 @@ export declare type BookingTimingConfig = {
|
|
|
41
47
|
|
|
42
48
|
export declare const businessDateStringToDate: (dateString: string) => Date;
|
|
43
49
|
|
|
50
|
+
export declare const calendarDateToBusinessDateString: (date: Date | null | undefined) => string | undefined;
|
|
51
|
+
|
|
44
52
|
export declare const createBookingPeriodConstants: (config: BookingPeriodConfig) => {
|
|
45
53
|
timeZone: string;
|
|
46
54
|
slotIntervalMinutes: number;
|
|
@@ -103,8 +111,20 @@ export declare interface DefaultBookingPeriodOptions {
|
|
|
103
111
|
|
|
104
112
|
export declare const getDefaultBookingPeriod: (options: DefaultBookingPeriodOptions) => DefaultBookingPeriod;
|
|
105
113
|
|
|
114
|
+
export declare const getWeekdayFromDateString: (dateString: string) => Weekday;
|
|
115
|
+
|
|
116
|
+
export declare const instantToBusinessDateString: (date: Date, timeZone: string) => string | undefined;
|
|
117
|
+
|
|
118
|
+
export declare const instantToBusinessDateTimeParts: (date: Date, timeZone: string) => {
|
|
119
|
+
dateString: string;
|
|
120
|
+
timeString: string;
|
|
121
|
+
minutesFromMidnight: number;
|
|
122
|
+
} | undefined;
|
|
123
|
+
|
|
106
124
|
export declare const minutesToTimeString: (minutes: number) => string;
|
|
107
125
|
|
|
126
|
+
export declare const normalizeBusinessDateString: (dateString: string) => string | undefined;
|
|
127
|
+
|
|
108
128
|
export declare type NormalizedOpeningHours = {
|
|
109
129
|
days: NormalizedWorkingDay[];
|
|
110
130
|
defaultOpeningMinutes: number;
|
package/dist/booking.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ declare type BookingPeriodConfig = {
|
|
|
11
11
|
openingHours: StoreOpeningHours;
|
|
12
12
|
openingHoursOverrides: StoreOpeningOverride[];
|
|
13
13
|
timeZone: string;
|
|
14
|
+
extraTimeSlots?: BookingPeriodExtraTimeSlotRule[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare type BookingPeriodExtraTimeSlotRule = {
|
|
18
|
+
minutesAfterClose: number;
|
|
19
|
+
extraAmount: number;
|
|
14
20
|
};
|
|
15
21
|
|
|
16
22
|
declare type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
|
|
@@ -22,6 +28,10 @@ declare type BookingTimingConfig = {
|
|
|
22
28
|
minBufferMinutes: number;
|
|
23
29
|
};
|
|
24
30
|
|
|
31
|
+
export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (bookingEngine: StorefrontConfiguration["bookingEngine"], options?: {
|
|
32
|
+
sameDayCutoff?: string;
|
|
33
|
+
}) => BookingPeriodConfig;
|
|
34
|
+
|
|
25
35
|
export declare const createBookingPeriodConfigFromStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration) => BookingPeriodConfig;
|
|
26
36
|
|
|
27
37
|
export declare const getBookingDurationLabel: (booking: StorefrontBookingParams) => {
|
|
@@ -173,6 +183,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
173
183
|
end: string;
|
|
174
184
|
}[];
|
|
175
185
|
}[] | undefined;
|
|
186
|
+
extraTimeSlots?: {
|
|
187
|
+
minutesAfterClose: number;
|
|
188
|
+
extraAmount: number;
|
|
189
|
+
}[] | undefined;
|
|
176
190
|
};
|
|
177
191
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
178
192
|
checkout: {
|
|
@@ -237,6 +251,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
|
|
|
237
251
|
end: string;
|
|
238
252
|
}[];
|
|
239
253
|
}[] | undefined;
|
|
254
|
+
extraTimeSlots?: {
|
|
255
|
+
minutesAfterClose: number;
|
|
256
|
+
extraAmount: number;
|
|
257
|
+
}[] | undefined;
|
|
240
258
|
};
|
|
241
259
|
currency: "EUR" | "USD" | "GBP" | "CHF";
|
|
242
260
|
checkout: {
|
package/dist/checkoutSubmit.d.ts
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
export declare const requestBaseSchema: z.ZodObject<{
|
|
4
|
+
storeSlug: z.ZodString;
|
|
5
|
+
schedule: z.ZodObject<{
|
|
6
|
+
startDate: z.ZodString;
|
|
7
|
+
endDate: z.ZodString;
|
|
8
|
+
startTime: z.ZodString;
|
|
9
|
+
endTime: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
fulfillment: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
pickup: "pickup";
|
|
13
|
+
delivery: "delivery";
|
|
14
|
+
}>>;
|
|
15
|
+
startAddress: z.ZodOptional<z.ZodString>;
|
|
16
|
+
endAddress: z.ZodOptional<z.ZodString>;
|
|
17
|
+
couponCode: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
18
|
+
couponAutoApplied: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
customer: z.ZodObject<{
|
|
20
|
+
fullName: z.ZodString;
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
23
|
+
notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
items: z.ZodArray<z.ZodObject<{
|
|
26
|
+
kind: any;
|
|
27
|
+
productId: z.ZodString;
|
|
28
|
+
productVariantId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
quantity: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
nowIso: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
|
|
3
34
|
export declare type RequestCheckoutItem = z.infer<typeof requestCheckoutItemSchema>;
|
|
4
35
|
|
|
5
36
|
export declare const requestCheckoutItemSchema: z.ZodObject<{
|
|
@@ -9,6 +40,11 @@ export declare const requestCheckoutItemSchema: z.ZodObject<{
|
|
|
9
40
|
quantity: z.ZodNumber;
|
|
10
41
|
}, z.core.$strip>;
|
|
11
42
|
|
|
43
|
+
export declare const requestDeliveryRefinement: (payload: {
|
|
44
|
+
fulfillment?: string;
|
|
45
|
+
startAddress?: string;
|
|
46
|
+
}, ctx: z.RefinementCtx) => void;
|
|
47
|
+
|
|
12
48
|
export declare type RequestPayload = z.infer<typeof requestSchema>;
|
|
13
49
|
|
|
14
50
|
export declare const requestSchema: z.ZodObject<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { localizedStringSchema as s } from "../models/LocalizedString--6q77SPQ.js";
|
|
3
|
-
import { priceUnitSchema as
|
|
3
|
+
import { priceUnitSchema as i } from "../models/Price-BlFRDHXV.js";
|
|
4
4
|
import { currencyCodeSchema as m } from "./money-Dy4b9loa.js";
|
|
5
|
-
import { shopConfigurationSchema as r } from "./shop-opening-hours-
|
|
6
|
-
import { isoDateSchema as
|
|
5
|
+
import { shopConfigurationSchema as r } from "./shop-opening-hours-DqNWstqT.js";
|
|
6
|
+
import { isoDateSchema as x, shopExtraTimeSlotRuleSchema as E, shopOpeningDaySchema as H, shopOpeningHoursOverrideSchema as z, shopOpeningHoursPeriodSchema as I, shopOpeningSlotSchema as L, timeOfDaySchema as $ } from "./shop-opening-hours-DqNWstqT.js";
|
|
7
7
|
const l = [
|
|
8
8
|
"soldOutOnly",
|
|
9
9
|
"soldOutAndFewRemaining",
|
|
@@ -16,30 +16,30 @@ const l = [
|
|
|
16
16
|
"soldOutAndFewRemaining",
|
|
17
17
|
"fewRemaining",
|
|
18
18
|
"fewRemainingCounts"
|
|
19
|
-
]), p = (
|
|
19
|
+
]), p = (a) => c.has(a), h = {
|
|
20
20
|
message: "A defaultFewRemainingThreshold is required for display modes that highlight 'few remaining' states"
|
|
21
|
-
},
|
|
21
|
+
}, d = e.object({
|
|
22
22
|
defaultMode: u,
|
|
23
23
|
defaultFewRemainingThreshold: e.number().int().min(1).optional()
|
|
24
24
|
}).refine(
|
|
25
|
-
(
|
|
26
|
-
|
|
25
|
+
(a) => !p(a.defaultMode) || a.defaultFewRemainingThreshold !== void 0,
|
|
26
|
+
h
|
|
27
27
|
), g = e.object({
|
|
28
28
|
enabled: e.boolean(),
|
|
29
29
|
defaultTtlMinutes: e.number().int().min(1)
|
|
30
30
|
}), b = e.object({
|
|
31
|
-
unit:
|
|
31
|
+
unit: i,
|
|
32
32
|
label: s.optional(),
|
|
33
33
|
durationHours: e.number().positive()
|
|
34
34
|
}), f = e.object({
|
|
35
35
|
enabled: e.boolean(),
|
|
36
36
|
boundaryHour: e.number().int().min(0).max(23)
|
|
37
37
|
}), S = e.object({
|
|
38
|
-
baseUnit:
|
|
38
|
+
baseUnit: i,
|
|
39
39
|
rentalUnits: e.array(b).min(1),
|
|
40
40
|
halfDay: f.optional()
|
|
41
41
|
}).refine(
|
|
42
|
-
(
|
|
42
|
+
(a) => a.rentalUnits.some((t) => t.unit === a.baseUnit),
|
|
43
43
|
{ message: "Rental units must include the configured base unit" }
|
|
44
44
|
), y = e.number().min(0, { message: "Percentage must be greater than or equal to 0" }).max(1, { message: "Percentage must be less than or equal to 1" }), o = e.object({
|
|
45
45
|
enabled: e.boolean(),
|
|
@@ -68,8 +68,8 @@ const l = [
|
|
|
68
68
|
}).catchall(e.unknown()), R = e.object({
|
|
69
69
|
mode: O,
|
|
70
70
|
dynamicOptions: C.optional()
|
|
71
|
-
}), k = m,
|
|
72
|
-
availabilityDisplay:
|
|
71
|
+
}), k = m, M = e.object({
|
|
72
|
+
availabilityDisplay: d,
|
|
73
73
|
holdSettings: g,
|
|
74
74
|
pricing: S,
|
|
75
75
|
bookingDeposit: o,
|
|
@@ -80,25 +80,26 @@ const l = [
|
|
|
80
80
|
});
|
|
81
81
|
export {
|
|
82
82
|
F as DEFAULT_PAYMENT_POLICIES,
|
|
83
|
-
|
|
83
|
+
d as availabilityDisplayConfigurationSchema,
|
|
84
84
|
u as availabilityDisplayModeSchema,
|
|
85
85
|
o as bookingDepositPolicySchema,
|
|
86
|
-
|
|
86
|
+
M as bookingEngineConfigurationSchema,
|
|
87
87
|
R as checkoutConfigurationSchema,
|
|
88
88
|
C as checkoutDynamicOptionsSchema,
|
|
89
89
|
O as checkoutModeSchema,
|
|
90
90
|
k as currencySchema,
|
|
91
91
|
g as holdSettingsSchema,
|
|
92
|
-
|
|
92
|
+
x as isoDateSchema,
|
|
93
93
|
q as paymentPoliciesSchema,
|
|
94
94
|
S as pricingConfigurationSchema,
|
|
95
95
|
f as pricingHalfDaySchema,
|
|
96
96
|
b as pricingUnitOptionSchema,
|
|
97
97
|
n as securityDepositPolicySchema,
|
|
98
98
|
r as shopConfigurationSchema,
|
|
99
|
-
|
|
99
|
+
E as shopExtraTimeSlotRuleSchema,
|
|
100
|
+
H as shopOpeningDaySchema,
|
|
100
101
|
z as shopOpeningHoursOverrideSchema,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
I as shopOpeningHoursPeriodSchema,
|
|
103
|
+
L as shopOpeningSlotSchema,
|
|
104
|
+
$ as timeOfDaySchema
|
|
104
105
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { identifierSchema as i } from "../models/types-DLcvzW5b.js";
|
|
3
3
|
import { moneyMinorSchema as a } from "./money-Dy4b9loa.js";
|
|
4
|
-
import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-
|
|
4
|
+
import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-DKoak4s5.js";
|
|
5
5
|
import { richTextSchema as m } from "./rich-text-CqXhNDN3.js";
|
|
6
|
-
import { timeOfDaySchema as r, isoDateSchema as n } from "./shop-opening-hours-
|
|
6
|
+
import { timeOfDaySchema as r, isoDateSchema as n } from "./shop-opening-hours-DqNWstqT.js";
|
|
7
7
|
const p = e.object({
|
|
8
8
|
startDate: n,
|
|
9
9
|
endDate: n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
|
-
import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-
|
|
3
|
-
import { timeOfDaySchema as e } from "./shop-opening-hours-
|
|
2
|
+
import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-BKlzwJJX.js";
|
|
3
|
+
import { timeOfDaySchema as e } from "./shop-opening-hours-DqNWstqT.js";
|
|
4
4
|
const n = o.enum(["pickup", "delivery"]), t = o.object({
|
|
5
5
|
fulfillmentModes: o.array(n).min(1).optional(),
|
|
6
6
|
sameDayCutoff: e.optional()
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
const o = /^([01]\d|2[0-3]):[0-5]\d$/, i = /^\d{4}-\d{2}-\d{2}$/, r = e.string().regex(o, {
|
|
3
|
+
message: "Time value must use 24-hour HH:MM format"
|
|
4
|
+
}), a = e.string().regex(i, {
|
|
5
|
+
message: "Date must use YYYY-MM-DD format"
|
|
6
|
+
}), s = e.object({
|
|
7
|
+
start: r,
|
|
8
|
+
end: r
|
|
9
|
+
}).refine((t) => t.start < t.end, {
|
|
10
|
+
message: "End must be after start",
|
|
11
|
+
path: ["end"]
|
|
12
|
+
}), n = e.union([
|
|
13
|
+
e.literal(0),
|
|
14
|
+
e.literal(1),
|
|
15
|
+
e.literal(2),
|
|
16
|
+
e.literal(3),
|
|
17
|
+
e.literal(4),
|
|
18
|
+
e.literal(5),
|
|
19
|
+
e.literal(6)
|
|
20
|
+
]), m = e.object({
|
|
21
|
+
day: n,
|
|
22
|
+
openingSlots: e.array(s)
|
|
23
|
+
}), l = e.object({
|
|
24
|
+
name: e.string().min(1),
|
|
25
|
+
startDate: a,
|
|
26
|
+
endDate: a,
|
|
27
|
+
openingHours: e.array(m).min(1)
|
|
28
|
+
}), p = e.object({
|
|
29
|
+
date: a,
|
|
30
|
+
openingSlots: e.array(s)
|
|
31
|
+
}), g = e.object({
|
|
32
|
+
minutesAfterClose: e.number().int().positive().max(240),
|
|
33
|
+
// Surcharge for returning in this tier, in currency minor units.
|
|
34
|
+
extraAmount: e.number().int().positive()
|
|
35
|
+
}), u = e.object({
|
|
36
|
+
timeZone: e.string().min(1),
|
|
37
|
+
openingHours: e.array(l).min(1),
|
|
38
|
+
openingHoursOverrides: e.array(p).optional(),
|
|
39
|
+
extraTimeSlots: e.array(g).optional()
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
a as isoDateSchema,
|
|
43
|
+
u as shopConfigurationSchema,
|
|
44
|
+
g as shopExtraTimeSlotRuleSchema,
|
|
45
|
+
n as shopOpeningDayIndexSchema,
|
|
46
|
+
m as shopOpeningDaySchema,
|
|
47
|
+
p as shopOpeningHoursOverrideSchema,
|
|
48
|
+
l as shopOpeningHoursPeriodSchema,
|
|
49
|
+
s as shopOpeningSlotSchema,
|
|
50
|
+
r as timeOfDaySchema
|
|
51
|
+
};
|