@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.
Files changed (28) hide show
  1. package/dist/StorefrontProvider.d.ts +20 -0
  2. package/dist/booking-period-time-slots.d.ts +23 -38
  3. package/dist/booking-period.d.ts +20 -0
  4. package/dist/booking.d.ts +18 -0
  5. package/dist/checkoutSubmit.d.ts +36 -0
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-CnBdp3jk.js → booking-engine-configuration-BKlzwJJX.js} +20 -19
  7. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-DYgEGJ5M.js → cart-inputs-ByBK0IVJ.js} +2 -2
  8. package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-C9VB-WhU.js → public-booking-engine-configuration-DKoak4s5.js} +2 -2
  9. package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js +51 -0
  10. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +76 -80
  11. package/dist/index.js +308 -298
  12. package/dist/lib/booking-period-time-slots.d.ts +0 -31
  13. package/dist/lib/booking-period-time-slots.js +122 -221
  14. package/dist/lib/booking-period.d.ts +14 -0
  15. package/dist/lib/booking-period.js +168 -150
  16. package/dist/lib/booking.d.ts +3 -0
  17. package/dist/lib/booking.js +102 -89
  18. package/dist/lib/checkoutSubmit.d.ts +34 -0
  19. package/dist/lib/checkoutSubmit.js +17 -15
  20. package/dist/lib/storefrontTimeSlots.d.ts +43 -0
  21. package/dist/lib/storefrontTimeSlots.js +26 -0
  22. package/dist/storefront.css +1 -1
  23. package/dist/storefrontSchemas.d.ts +8 -0
  24. package/dist/storefrontSchemas.js +4 -4
  25. package/dist/storefrontTimeSlots.d.ts +53 -0
  26. package/dist/whatsapp.d.ts +8 -0
  27. package/package.json +1 -1
  28. package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-B47MMaoD.js +0 -45
@@ -117,6 +117,10 @@ export declare const storefrontConfigurationSchema: z.ZodObject<{
117
117
  end: string;
118
118
  }[];
119
119
  }[] | undefined;
120
+ extraTimeSlots?: {
121
+ minutesAfterClose: number;
122
+ extraAmount: number;
123
+ }[] | undefined;
120
124
  };
121
125
  currency: "EUR" | "USD" | "GBP" | "CHF";
122
126
  checkout: {
@@ -181,6 +185,10 @@ export declare const storefrontConfigurationSchema: z.ZodObject<{
181
185
  end: string;
182
186
  }[];
183
187
  }[] | undefined;
188
+ extraTimeSlots?: {
189
+ minutesAfterClose: number;
190
+ extraAmount: number;
191
+ }[] | undefined;
184
192
  };
185
193
  currency: "EUR" | "USD" | "GBP" | "CHF";
186
194
  checkout: {
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- import "./chunks/pkg/booking-engine/dist/schemas/cart-inputs-DYgEGJ5M.js";
2
+ import "./chunks/pkg/booking-engine/dist/schemas/cart-inputs-ByBK0IVJ.js";
3
3
  import "./chunks/pkg/booking-engine/dist/models/Product.shared-BiDGmurZ.js";
4
4
  import "./chunks/pkg/booking-engine/dist/models/LocalizedString--6q77SPQ.js";
5
5
  import "./chunks/pkg/booking-engine/dist/models/Price-BlFRDHXV.js";
@@ -7,9 +7,9 @@ import "./chunks/pkg/booking-engine/dist/schemas/base-asset-GJ9eIvIL.js";
7
7
  import "./chunks/pkg/booking-engine/dist/schemas/base-booking-D9k8ehGi.js";
8
8
  import "./chunks/pkg/booking-engine/dist/schemas/rich-text-CqXhNDN3.js";
9
9
  import "./chunks/pkg/booking-engine/dist/schemas/money-Dy4b9loa.js";
10
- import { timeOfDaySchema as d } from "./chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-B47MMaoD.js";
11
- import { publicBookingEngineConfigurationSchema as p } from "./chunks/pkg/booking-engine/dist/schemas/public-booking-engine-configuration-C9VB-WhU.js";
12
- import "./chunks/pkg/booking-engine/dist/schemas/booking-engine-configuration-CnBdp3jk.js";
10
+ import { timeOfDaySchema as d } from "./chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js";
11
+ import { publicBookingEngineConfigurationSchema as p } from "./chunks/pkg/booking-engine/dist/schemas/public-booking-engine-configuration-DKoak4s5.js";
12
+ import "./chunks/pkg/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js";
13
13
  const u = /^\+[1-9]\d{1,14}$/, l = e.string().trim().regex(u, {
14
14
  message: "Invalid phone number format (expected E.164, e.g. +33608707197)."
15
15
  }), h = e.object({
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+
3
+ export declare type RequestPayload = z.infer<typeof requestSchema>;
4
+
5
+ export declare const requestSchema: z.ZodObject<{
6
+ storeSlug: z.ZodString;
7
+ date: z.ZodOptional<z.ZodString>;
8
+ journey: z.ZodDefault<z.ZodEnum<{
9
+ start: "start";
10
+ end: "end";
11
+ }>>;
12
+ }, z.core.$strip>;
13
+
14
+ export declare type ResponsePayload = z.infer<typeof responseSchema>;
15
+
16
+ export declare const responseSchema: z.ZodObject<{
17
+ success: z.ZodBoolean;
18
+ message: z.ZodOptional<z.ZodString>;
19
+ timeSlots: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ value: z.ZodString;
21
+ label: z.ZodString;
22
+ startMinutes: z.ZodNumber;
23
+ endMinutes: z.ZodNumber;
24
+ isExtra: z.ZodBoolean;
25
+ extraAmount: z.ZodOptional<z.ZodNumber>;
26
+ isDisabled: z.ZodBoolean;
27
+ disabledReason: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>>>;
29
+ }, z.core.$strip>;
30
+
31
+ export declare const ROUTE = "/api/public/storefront/availability/time-slots";
32
+
33
+ export declare type StorefrontTimeSlot = z.infer<typeof storefrontTimeSlotSchema>;
34
+
35
+ export declare const storefrontTimeSlotSchema: z.ZodObject<{
36
+ value: z.ZodString;
37
+ label: z.ZodString;
38
+ startMinutes: z.ZodNumber;
39
+ endMinutes: z.ZodNumber;
40
+ isExtra: z.ZodBoolean;
41
+ extraAmount: z.ZodOptional<z.ZodNumber>;
42
+ isDisabled: z.ZodBoolean;
43
+ disabledReason: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>;
45
+
46
+ export declare type TimeSlotJourney = z.infer<typeof timeSlotJourneySchema>;
47
+
48
+ export declare const timeSlotJourneySchema: z.ZodEnum<{
49
+ start: "start";
50
+ end: "end";
51
+ }>;
52
+
53
+ export { }
@@ -127,6 +127,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
127
127
  end: string;
128
128
  }[];
129
129
  }[] | undefined;
130
+ extraTimeSlots?: {
131
+ minutesAfterClose: number;
132
+ extraAmount: number;
133
+ }[] | undefined;
130
134
  };
131
135
  currency: "EUR" | "USD" | "GBP" | "CHF";
132
136
  checkout: {
@@ -191,6 +195,10 @@ declare const storefrontConfigurationSchema: z.ZodObject<{
191
195
  end: string;
192
196
  }[];
193
197
  }[] | undefined;
198
+ extraTimeSlots?: {
199
+ minutesAfterClose: number;
200
+ extraAmount: number;
201
+ }[] | undefined;
194
202
  };
195
203
  currency: "EUR" | "USD" | "GBP" | "CHF";
196
204
  checkout: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loczer/storefront-sdk",
3
- "version": "0.150.0",
3
+ "version": "0.152.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,45 +0,0 @@
1
- import { z as e } from "zod";
2
- const n = /^([01]\d|2[0-3]):[0-5]\d$/, o = /^\d{4}-\d{2}-\d{2}$/, t = e.string().regex(n, {
3
- message: "Time value must use 24-hour HH:MM format"
4
- }), a = e.string().regex(o, {
5
- message: "Date must use YYYY-MM-DD format"
6
- }), s = e.object({
7
- start: t,
8
- end: t
9
- }).refine((r) => r.start < r.end, {
10
- message: "End must be after start",
11
- path: ["end"]
12
- }), i = 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: i,
22
- openingSlots: e.array(s)
23
- }), g = e.object({
24
- name: e.string().min(1),
25
- startDate: a,
26
- endDate: a,
27
- openingHours: e.array(m).min(1)
28
- }), l = e.object({
29
- date: a,
30
- openingSlots: e.array(s)
31
- }), d = e.object({
32
- timeZone: e.string().min(1),
33
- openingHours: e.array(g).min(1),
34
- openingHoursOverrides: e.array(l).optional()
35
- });
36
- export {
37
- a as isoDateSchema,
38
- d as shopConfigurationSchema,
39
- i as shopOpeningDayIndexSchema,
40
- m as shopOpeningDaySchema,
41
- l as shopOpeningHoursOverrideSchema,
42
- g as shopOpeningHoursPeriodSchema,
43
- s as shopOpeningSlotSchema,
44
- t as timeOfDaySchema
45
- };