@suiteop/storefront 0.1.1 → 0.3.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 (57) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +74 -0
  3. package/dist/astro-content-model.cjs +17 -0
  4. package/dist/astro-content-model.d.cts +4 -0
  5. package/dist/astro-content-model.d.ts +4 -0
  6. package/dist/astro-content-model.js +10 -0
  7. package/dist/astro.cjs +3 -1
  8. package/dist/astro.d.cts +38 -17
  9. package/dist/astro.d.ts +38 -17
  10. package/dist/astro.js +2 -2
  11. package/dist/checkout.cjs +3 -3
  12. package/dist/checkout.js +2 -2
  13. package/dist/chunk-A43EXKPY.js +3 -0
  14. package/dist/chunk-BFUMJBZV.js +9 -0
  15. package/dist/chunk-EVSAMV5K.cjs +8 -0
  16. package/dist/{chunk-YFTWGF3L.js → chunk-HMLBMNGA.js} +1 -1
  17. package/dist/chunk-IBIDIWTI.js +8 -0
  18. package/dist/chunk-PUY7GWID.cjs +19 -0
  19. package/dist/chunk-PYVUDQSQ.js +3 -0
  20. package/dist/chunk-USOISC2R.cjs +17 -0
  21. package/dist/{chunk-RDREYP27.cjs → chunk-VV2UNVQ2.cjs} +2 -2
  22. package/dist/chunk-W4VKQWXY.cjs +16 -0
  23. package/dist/chunk-WNCQ6YBT.cjs +18 -0
  24. package/dist/chunk-Y6INA5K7.js +5 -0
  25. package/dist/chunk-ZI2PG7LS.js +6 -0
  26. package/dist/chunk-ZLAOY6IF.cjs +9 -0
  27. package/dist/{errors-Bp_jmXbA.d.ts → client-CdsTfFv7.d.ts} +104 -147
  28. package/dist/{errors-y-BiaVAk.d.cts → client-CmoApA__.d.cts} +104 -147
  29. package/dist/components.cjs +2 -1
  30. package/dist/components.d.cts +5 -2
  31. package/dist/components.d.ts +5 -2
  32. package/dist/components.js +2 -1
  33. package/dist/config.cjs +6 -2
  34. package/dist/config.d.cts +33 -1
  35. package/dist/config.d.ts +33 -1
  36. package/dist/config.js +3 -2
  37. package/dist/content.cjs +37 -0
  38. package/dist/content.d.cts +254 -0
  39. package/dist/content.d.ts +254 -0
  40. package/dist/content.js +4 -0
  41. package/dist/errors-Ct7uJn5o.d.ts +151 -0
  42. package/dist/errors-LMVeW29z.d.cts +151 -0
  43. package/dist/index.cjs +38 -20
  44. package/dist/index.d.cts +14 -3
  45. package/dist/index.d.ts +14 -3
  46. package/dist/index.js +5 -3
  47. package/dist/react.cjs +6 -5
  48. package/dist/react.d.cts +2 -1
  49. package/dist/react.d.ts +2 -1
  50. package/dist/react.js +5 -4
  51. package/package.json +22 -2
  52. package/dist/chunk-AIQUVZEI.cjs +0 -8
  53. package/dist/chunk-GIIXCS6X.cjs +0 -18
  54. package/dist/chunk-LIBKUMJV.js +0 -8
  55. package/dist/chunk-SK5TD73J.js +0 -3
  56. package/dist/chunk-UACP7BZ7.js +0 -6
  57. package/dist/chunk-XIAAWHAY.cjs +0 -17
@@ -42,6 +42,11 @@ declare const storefrontBookingSchema: z.ZodObject<{
42
42
  totalMinor: z.ZodNullable<z.ZodNumber>;
43
43
  currency: z.ZodNullable<z.ZodString>;
44
44
  confirmationCode: z.ZodNullable<z.ZodString>;
45
+ lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ title: z.ZodString;
47
+ quantity: z.ZodNumber;
48
+ totalMinor: z.ZodNumber;
49
+ }, z.core.$strip>>>;
45
50
  }, z.core.$strip>;
46
51
  type StorefrontBooking = z.infer<typeof storefrontBookingSchema>;
47
52
 
@@ -53,6 +58,7 @@ declare const storefrontSiteSchema: z.ZodObject<{
53
58
  enableWebChat: z.ZodBoolean;
54
59
  mapEmbedHost: z.ZodNullable<z.ZodString>;
55
60
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ bookingsOpen: z.ZodOptional<z.ZodBoolean>;
56
62
  }, z.core.$strip>;
57
63
  type StorefrontSite = z.infer<typeof storefrontSiteSchema>;
58
64
  declare const storefrontListingSummarySchema: z.ZodObject<{
@@ -72,6 +78,13 @@ declare const storefrontListingSummarySchema: z.ZodObject<{
72
78
  bookable: z.ZodBoolean;
73
79
  }, z.core.$strip>;
74
80
  type StorefrontListingSummary = z.infer<typeof storefrontListingSummarySchema>;
81
+ declare const storefrontImageSchema: z.ZodObject<{
82
+ url: z.ZodString;
83
+ alt: z.ZodNullable<z.ZodString>;
84
+ width: z.ZodNullable<z.ZodNumber>;
85
+ height: z.ZodNullable<z.ZodNumber>;
86
+ }, z.core.$strip>;
87
+ type StorefrontImage = z.infer<typeof storefrontImageSchema>;
75
88
  declare const storefrontListingSchema: z.ZodObject<{
76
89
  id: z.ZodUUID;
77
90
  buildingId: z.ZodUUID;
@@ -92,6 +105,12 @@ declare const storefrontListingSchema: z.ZodObject<{
92
105
  description: z.ZodNullable<z.ZodString>;
93
106
  amenities: z.ZodArray<z.ZodString>;
94
107
  pictures: z.ZodUnknown;
108
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ url: z.ZodString;
110
+ alt: z.ZodNullable<z.ZodString>;
111
+ width: z.ZodNullable<z.ZodNumber>;
112
+ height: z.ZodNullable<z.ZodNumber>;
113
+ }, z.core.$strip>>>;
95
114
  rooms: z.ZodUnknown;
96
115
  houseRules: z.ZodNullable<z.ZodString>;
97
116
  checkInTime: z.ZodNullable<z.ZodString>;
@@ -119,6 +138,18 @@ declare const storefrontBuildingSchema: z.ZodObject<{
119
138
  latitude: z.ZodNullable<z.ZodNumber>;
120
139
  longitude: z.ZodNullable<z.ZodNumber>;
121
140
  address: z.ZodUnknown;
141
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
145
+ url: z.ZodString;
146
+ alt: z.ZodNullable<z.ZodString>;
147
+ width: z.ZodNullable<z.ZodNumber>;
148
+ height: z.ZodNullable<z.ZodNumber>;
149
+ }, z.core.$strip>>>>;
150
+ sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
151
+ listingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
152
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
122
153
  }, z.core.$strip>;
123
154
  type StorefrontBuilding = z.infer<typeof storefrontBuildingSchema>;
124
155
  declare const storefrontLocationSchema: z.ZodObject<{
@@ -132,6 +163,17 @@ declare const storefrontLocationSchema: z.ZodObject<{
132
163
  longitude: z.ZodNullable<z.ZodNumber>;
133
164
  address: z.ZodUnknown;
134
165
  sortOrder: z.ZodNumber;
166
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
170
+ url: z.ZodString;
171
+ alt: z.ZodNullable<z.ZodString>;
172
+ width: z.ZodNullable<z.ZodNumber>;
173
+ height: z.ZodNullable<z.ZodNumber>;
174
+ }, z.core.$strip>>>>;
175
+ buildingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
176
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
135
177
  }, z.core.$strip>;
136
178
  type StorefrontLocation = z.infer<typeof storefrontLocationSchema>;
137
179
  declare const storefrontReviewSchema: z.ZodObject<{
@@ -297,6 +339,14 @@ declare const createCheckoutSessionInputSchema: z.ZodObject<{
297
339
  variant: "a" | "b";
298
340
  } | undefined;
299
341
  } | null>>;
342
+ extras: z.ZodOptional<z.ZodObject<{
343
+ customFields: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
344
+ upsells: z.ZodDefault<z.ZodArray<z.ZodObject<{
345
+ portalUpsellId: z.ZodUUID;
346
+ quantity: z.ZodNumber;
347
+ }, z.core.$strip>>>;
348
+ }, z.core.$strip>>;
349
+ hostSessionId: z.ZodOptional<z.ZodUUID>;
300
350
  }, z.core.$strip>;
301
351
  type CreateCheckoutSessionInput = z.infer<typeof createCheckoutSessionInputSchema>;
302
352
  declare const checkoutSessionSchema: z.ZodObject<{
@@ -348,81 +398,49 @@ declare const checkoutSessionSchema: z.ZodObject<{
348
398
  }, z.core.$loose>]>>;
349
399
  chargedBy: z.ZodOptional<z.ZodLiteral<"host">>;
350
400
  guestSaved: z.ZodOptional<z.ZodLiteral<true>>;
401
+ extras: z.ZodOptional<z.ZodObject<{
402
+ lines: z.ZodArray<z.ZodObject<{
403
+ portalUpsellId: z.ZodNullable<z.ZodUUID>;
404
+ title: z.ZodString;
405
+ quantity: z.ZodNumber;
406
+ totalMinor: z.ZodNumber;
407
+ }, z.core.$strip>>;
408
+ extrasTotalMinor: z.ZodNumber;
409
+ heldTotalMinor: z.ZodNumber;
410
+ }, z.core.$strip>>;
411
+ extrasSessionId: z.ZodOptional<z.ZodUUID>;
351
412
  expiresAt: z.ZodISODateTime;
352
413
  }, z.core.$strip>;
353
414
  type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
354
415
 
355
- declare const storefrontClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
356
- name: z.ZodLiteral<"page_view">;
357
- eventId: z.ZodUUID;
358
- ts: z.ZodNumber;
359
- path: z.ZodString;
360
- referrerHost: z.ZodNullable<z.ZodString>;
361
- }, z.core.$strip>, z.ZodObject<{
362
- name: z.ZodLiteral<"view_search_results">;
363
- checkIn: z.ZodOptional<z.ZodISODate>;
364
- checkOut: z.ZodOptional<z.ZodISODate>;
365
- guests: z.ZodOptional<z.ZodNumber>;
366
- locationId: z.ZodOptional<z.ZodUUID>;
367
- eventId: z.ZodUUID;
368
- ts: z.ZodNumber;
369
- path: z.ZodString;
370
- referrerHost: z.ZodNullable<z.ZodString>;
371
- }, z.core.$strip>, z.ZodObject<{
372
- name: z.ZodLiteral<"view_item_list">;
373
- listName: z.ZodString;
374
- itemCount: z.ZodNumber;
375
- eventId: z.ZodUUID;
376
- ts: z.ZodNumber;
377
- path: z.ZodString;
378
- referrerHost: z.ZodNullable<z.ZodString>;
379
- }, z.core.$strip>, z.ZodObject<{
380
- name: z.ZodLiteral<"view_item">;
381
- listingId: z.ZodUUID;
382
- eventId: z.ZodUUID;
383
- ts: z.ZodNumber;
384
- path: z.ZodString;
385
- referrerHost: z.ZodNullable<z.ZodString>;
386
- }, z.core.$strip>, z.ZodObject<{
387
- name: z.ZodLiteral<"view_quote">;
388
- listingId: z.ZodUUID;
389
- valueMinor: z.ZodNumber;
390
- currency: z.ZodString;
391
- nights: z.ZodNumber;
392
- eventId: z.ZodUUID;
393
- ts: z.ZodNumber;
394
- path: z.ZodString;
395
- referrerHost: z.ZodNullable<z.ZodString>;
396
- }, z.core.$strip>, z.ZodObject<{
397
- name: z.ZodLiteral<"begin_checkout">;
398
- checkoutSessionId: z.ZodUUID;
399
- eventId: z.ZodUUID;
400
- ts: z.ZodNumber;
401
- path: z.ZodString;
402
- referrerHost: z.ZodNullable<z.ZodString>;
403
- }, z.core.$strip>, z.ZodObject<{
404
- name: z.ZodLiteral<"add_payment_info">;
405
- checkoutSessionId: z.ZodUUID;
406
- eventId: z.ZodUUID;
407
- ts: z.ZodNumber;
408
- path: z.ZodString;
409
- referrerHost: z.ZodNullable<z.ZodString>;
410
- }, z.core.$strip>, z.ZodObject<{
411
- name: z.ZodLiteral<"generate_lead">;
412
- formId: z.ZodOptional<z.ZodString>;
413
- eventId: z.ZodUUID;
414
- ts: z.ZodNumber;
415
- path: z.ZodString;
416
- referrerHost: z.ZodNullable<z.ZodString>;
417
- }, z.core.$strip>, z.ZodObject<{
418
- name: z.ZodLiteral<"sign_up">;
419
- method: z.ZodLiteral<"newsletter">;
420
- eventId: z.ZodUUID;
421
- ts: z.ZodNumber;
422
- path: z.ZodString;
423
- referrerHost: z.ZodNullable<z.ZodString>;
424
- }, z.core.$strip>], "name">;
425
- type StorefrontClientEvent = z.infer<typeof storefrontClientEventSchema>;
416
+ declare const storefrontContentRefSchema: z.ZodObject<{
417
+ kind: z.ZodString;
418
+ id: z.ZodUUID;
419
+ slug: z.ZodNullable<z.ZodString>;
420
+ }, z.core.$strip>;
421
+ type StorefrontContentRef = z.infer<typeof storefrontContentRefSchema>;
422
+ declare const storefrontContentItemSchema: z.ZodObject<{
423
+ id: z.ZodUUID;
424
+ type: z.ZodString;
425
+ slug: z.ZodNullable<z.ZodString>;
426
+ publishedAt: z.ZodNullable<z.ZodString>;
427
+ updatedAt: z.ZodString;
428
+ sortOrder: z.ZodNumber;
429
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
430
+ }, z.core.$strip>;
431
+ type StorefrontContentItem = z.infer<typeof storefrontContentItemSchema>;
432
+ declare const storefrontContentModelSchema: z.ZodObject<{
433
+ version: z.ZodNumber;
434
+ types: z.ZodArray<z.ZodObject<{
435
+ key: z.ZodString;
436
+ kind: z.ZodString;
437
+ fields: z.ZodArray<z.ZodObject<{
438
+ key: z.ZodString;
439
+ type: z.ZodString;
440
+ }, z.core.$catchall<z.ZodUnknown>>>;
441
+ }, z.core.$catchall<z.ZodUnknown>>>;
442
+ }, z.core.$strip>;
443
+ type StorefrontContentModel = z.infer<typeof storefrontContentModelSchema>;
426
444
 
427
445
  declare const storefrontRatePlanQuoteSchema: z.ZodObject<{
428
446
  ratePlanId: z.ZodString;
@@ -466,28 +484,6 @@ declare const storefrontQuoteSchema: z.ZodObject<{
466
484
  }, z.core.$strip>;
467
485
  type StorefrontQuote = z.infer<typeof storefrontQuoteSchema>;
468
486
 
469
- type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
470
- type TrackEvent = DistributiveOmit<StorefrontClientEvent, 'eventId' | 'ts' | 'path' | 'referrerHost'>;
471
- type AnalyticsReporter = (err: unknown) => void;
472
- interface AnalyticsOptions {
473
- publishableKey: string;
474
- report?: AnalyticsReporter;
475
- }
476
- interface StorefrontAnalytics {
477
- track(event: TrackEvent): void;
478
- pageView(): void;
479
- flush(opts?: {
480
- beacon?: boolean;
481
- }): void;
482
- dispose(): void;
483
- }
484
- declare function trackPurchasePixel(booking: Pick<BookingResult, 'bookingRequestId'> & {
485
- totalMinor?: number | null;
486
- currency?: string | null;
487
- }): void;
488
- declare function createAnalytics(opts: AnalyticsOptions): StorefrontAnalytics;
489
- declare function analyticsFor(publishableKey: string): StorefrontAnalytics;
490
-
491
487
  declare const STOREFRONT_API_PATH = "/api/storefront/v1";
492
488
  interface StorefrontClientOptions {
493
489
  publishableKey: string;
@@ -502,6 +498,10 @@ interface RequestOptions {
502
498
  interface CreateCheckoutSessionOptions extends RequestOptions {
503
499
  idempotencyKey?: string;
504
500
  }
501
+ interface ContentListQuery {
502
+ limit?: number;
503
+ offset?: number;
504
+ }
505
505
  interface Page<T> {
506
506
  items: T[];
507
507
  total: number;
@@ -529,6 +529,16 @@ interface StorefrontClient {
529
529
  locations: {
530
530
  list(opts?: RequestOptions): Promise<StorefrontLocation[]>;
531
531
  };
532
+ contentModel: {
533
+ get(opts?: RequestOptions): Promise<StorefrontContentModel>;
534
+ };
535
+ collections: {
536
+ list(key: string, query?: ContentListQuery, opts?: RequestOptions): Promise<Page<StorefrontContentItem>>;
537
+ get(key: string, slugOrId: string, opts?: RequestOptions): Promise<StorefrontContentItem | null>;
538
+ };
539
+ sections: {
540
+ get(key: string, opts?: RequestOptions): Promise<StorefrontContentItem>;
541
+ };
532
542
  amenities: {
533
543
  list(opts?: RequestOptions): Promise<string[]>;
534
544
  };
@@ -559,57 +569,4 @@ interface StorefrontClient {
559
569
  }
560
570
  declare function createStorefrontClient(options: StorefrontClientOptions): StorefrontClient;
561
571
 
562
- declare const STOREFRONT_ERROR_CODES: readonly ["wrong_region", "origin_not_allowed", "origin_required", "site_archived", "not_bookable", "quote_invalid", "quote_expired", "price_changed", "currency_unsupported", "payment_declined", "session_expired", "rate_limited", "contact_not_configured", "payment_account_unavailable", "idempotency_key_required", "idempotency_key_reused", "payment_mode_unsupported", "payment_not_authorized", "payment_method_required", "site_not_published", "preview_read_only", "UNAUTHORIZED", "VALIDATION_ERROR", "NOT_FOUND", "site_not_found", "upstream_timeout", "timeout", "network", "invalid_response", "internal_error", "checkout_unavailable"];
563
- type StorefrontErrorCode = (typeof STOREFRONT_ERROR_CODES)[number];
564
- type StorefrontRegion = 'us' | 'eu' | 'apac';
565
- interface StorefrontErrorInit {
566
- status: number;
567
- code: string;
568
- message: string;
569
- type?: string;
570
- requestId?: string | null;
571
- details?: Record<string, unknown>;
572
- cause?: unknown;
573
- }
574
- declare class StorefrontError extends Error {
575
- name: string;
576
- readonly status: number;
577
- readonly type: string;
578
- readonly code: StorefrontErrorCode | (string & {});
579
- readonly requestId: string | null;
580
- readonly details: Record<string, unknown>;
581
- constructor(init: StorefrontErrorInit);
582
- }
583
- declare class PriceChangedError extends StorefrontError {
584
- name: string;
585
- readonly quote: StorefrontQuote | null;
586
- readonly requiresNewSession: boolean;
587
- constructor(init: StorefrontErrorInit);
588
- }
589
- declare class WrongRegionError extends StorefrontError {
590
- name: string;
591
- readonly region: StorefrontRegion | null;
592
- readonly baseUrl: string | null;
593
- constructor(init: StorefrontErrorInit);
594
- }
595
- declare class RateLimitedError extends StorefrontError {
596
- name: string;
597
- readonly retryAfterSec: number | null;
598
- readonly scope: 'key' | 'ip' | 'pms' | null;
599
- constructor(init: StorefrontErrorInit & {
600
- retryAfterSec: number | null;
601
- });
602
- }
603
- declare class StorefrontTimeoutError extends StorefrontError {
604
- name: string;
605
- constructor(timeoutMs: number, requestId?: string | null);
606
- }
607
- declare class StorefrontNetworkError extends StorefrontError {
608
- name: string;
609
- constructor(cause: unknown);
610
- }
611
- declare class StorefrontConfigError extends Error {
612
- name: string;
613
- }
614
-
615
- export { type AnalyticsOptions as A, type BookingResult as B, type CheckoutMountDescriptor as C, StorefrontNetworkError as D, type StorefrontQuote as E, type StorefrontQuoteInput as F, type StorefrontRatePlanQuote as G, type StorefrontReview as H, type StorefrontReviewsQuery as I, type StorefrontSite as J, StorefrontTimeoutError as K, analyticsFor as L, createAnalytics as M, createStorefrontClient as N, trackPurchasePixel as O, type Page as P, RateLimitedError as R, type StorefrontRegion as S, type TrackEvent as T, WrongRegionError as W, type AnalyticsReporter as a, type CheckoutSession as b, type ConfirmCheckoutSessionInput as c, type ConfirmCheckoutSessionRequest as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, PriceChangedError as h, type RequestOptions as i, STOREFRONT_API_PATH as j, STOREFRONT_ERROR_CODES as k, type StorefrontAnalytics as l, type StorefrontBooking as m, type StorefrontBuilding as n, type StorefrontClient as o, type StorefrontClientOptions as p, StorefrontConfigError as q, type StorefrontContactInput as r, StorefrontError as s, type StorefrontErrorCode as t, type StorefrontErrorInit as u, type StorefrontGuestInput as v, type StorefrontListing as w, type StorefrontListingSummary as x, type StorefrontListingsQuery as y, type StorefrontLocation as z };
572
+ export { type StorefrontSite as A, type BookingResult as B, type CheckoutMountDescriptor as C, createStorefrontClient as D, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontImage as q, type StorefrontListing as r, type StorefrontListingSummary as s, type StorefrontListingsQuery as t, type StorefrontLocation as u, type StorefrontQuote as v, type StorefrontQuoteInput as w, type StorefrontRatePlanQuote as x, type StorefrontReview as y, type StorefrontReviewsQuery as z };
@@ -42,6 +42,11 @@ declare const storefrontBookingSchema: z.ZodObject<{
42
42
  totalMinor: z.ZodNullable<z.ZodNumber>;
43
43
  currency: z.ZodNullable<z.ZodString>;
44
44
  confirmationCode: z.ZodNullable<z.ZodString>;
45
+ lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ title: z.ZodString;
47
+ quantity: z.ZodNumber;
48
+ totalMinor: z.ZodNumber;
49
+ }, z.core.$strip>>>;
45
50
  }, z.core.$strip>;
46
51
  type StorefrontBooking = z.infer<typeof storefrontBookingSchema>;
47
52
 
@@ -53,6 +58,7 @@ declare const storefrontSiteSchema: z.ZodObject<{
53
58
  enableWebChat: z.ZodBoolean;
54
59
  mapEmbedHost: z.ZodNullable<z.ZodString>;
55
60
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ bookingsOpen: z.ZodOptional<z.ZodBoolean>;
56
62
  }, z.core.$strip>;
57
63
  type StorefrontSite = z.infer<typeof storefrontSiteSchema>;
58
64
  declare const storefrontListingSummarySchema: z.ZodObject<{
@@ -72,6 +78,13 @@ declare const storefrontListingSummarySchema: z.ZodObject<{
72
78
  bookable: z.ZodBoolean;
73
79
  }, z.core.$strip>;
74
80
  type StorefrontListingSummary = z.infer<typeof storefrontListingSummarySchema>;
81
+ declare const storefrontImageSchema: z.ZodObject<{
82
+ url: z.ZodString;
83
+ alt: z.ZodNullable<z.ZodString>;
84
+ width: z.ZodNullable<z.ZodNumber>;
85
+ height: z.ZodNullable<z.ZodNumber>;
86
+ }, z.core.$strip>;
87
+ type StorefrontImage = z.infer<typeof storefrontImageSchema>;
75
88
  declare const storefrontListingSchema: z.ZodObject<{
76
89
  id: z.ZodUUID;
77
90
  buildingId: z.ZodUUID;
@@ -92,6 +105,12 @@ declare const storefrontListingSchema: z.ZodObject<{
92
105
  description: z.ZodNullable<z.ZodString>;
93
106
  amenities: z.ZodArray<z.ZodString>;
94
107
  pictures: z.ZodUnknown;
108
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ url: z.ZodString;
110
+ alt: z.ZodNullable<z.ZodString>;
111
+ width: z.ZodNullable<z.ZodNumber>;
112
+ height: z.ZodNullable<z.ZodNumber>;
113
+ }, z.core.$strip>>>;
95
114
  rooms: z.ZodUnknown;
96
115
  houseRules: z.ZodNullable<z.ZodString>;
97
116
  checkInTime: z.ZodNullable<z.ZodString>;
@@ -119,6 +138,18 @@ declare const storefrontBuildingSchema: z.ZodObject<{
119
138
  latitude: z.ZodNullable<z.ZodNumber>;
120
139
  longitude: z.ZodNullable<z.ZodNumber>;
121
140
  address: z.ZodUnknown;
141
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
145
+ url: z.ZodString;
146
+ alt: z.ZodNullable<z.ZodString>;
147
+ width: z.ZodNullable<z.ZodNumber>;
148
+ height: z.ZodNullable<z.ZodNumber>;
149
+ }, z.core.$strip>>>>;
150
+ sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
151
+ listingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
152
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
122
153
  }, z.core.$strip>;
123
154
  type StorefrontBuilding = z.infer<typeof storefrontBuildingSchema>;
124
155
  declare const storefrontLocationSchema: z.ZodObject<{
@@ -132,6 +163,17 @@ declare const storefrontLocationSchema: z.ZodObject<{
132
163
  longitude: z.ZodNullable<z.ZodNumber>;
133
164
  address: z.ZodUnknown;
134
165
  sortOrder: z.ZodNumber;
166
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
170
+ url: z.ZodString;
171
+ alt: z.ZodNullable<z.ZodString>;
172
+ width: z.ZodNullable<z.ZodNumber>;
173
+ height: z.ZodNullable<z.ZodNumber>;
174
+ }, z.core.$strip>>>>;
175
+ buildingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
176
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
135
177
  }, z.core.$strip>;
136
178
  type StorefrontLocation = z.infer<typeof storefrontLocationSchema>;
137
179
  declare const storefrontReviewSchema: z.ZodObject<{
@@ -297,6 +339,14 @@ declare const createCheckoutSessionInputSchema: z.ZodObject<{
297
339
  variant: "a" | "b";
298
340
  } | undefined;
299
341
  } | null>>;
342
+ extras: z.ZodOptional<z.ZodObject<{
343
+ customFields: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
344
+ upsells: z.ZodDefault<z.ZodArray<z.ZodObject<{
345
+ portalUpsellId: z.ZodUUID;
346
+ quantity: z.ZodNumber;
347
+ }, z.core.$strip>>>;
348
+ }, z.core.$strip>>;
349
+ hostSessionId: z.ZodOptional<z.ZodUUID>;
300
350
  }, z.core.$strip>;
301
351
  type CreateCheckoutSessionInput = z.infer<typeof createCheckoutSessionInputSchema>;
302
352
  declare const checkoutSessionSchema: z.ZodObject<{
@@ -348,81 +398,49 @@ declare const checkoutSessionSchema: z.ZodObject<{
348
398
  }, z.core.$loose>]>>;
349
399
  chargedBy: z.ZodOptional<z.ZodLiteral<"host">>;
350
400
  guestSaved: z.ZodOptional<z.ZodLiteral<true>>;
401
+ extras: z.ZodOptional<z.ZodObject<{
402
+ lines: z.ZodArray<z.ZodObject<{
403
+ portalUpsellId: z.ZodNullable<z.ZodUUID>;
404
+ title: z.ZodString;
405
+ quantity: z.ZodNumber;
406
+ totalMinor: z.ZodNumber;
407
+ }, z.core.$strip>>;
408
+ extrasTotalMinor: z.ZodNumber;
409
+ heldTotalMinor: z.ZodNumber;
410
+ }, z.core.$strip>>;
411
+ extrasSessionId: z.ZodOptional<z.ZodUUID>;
351
412
  expiresAt: z.ZodISODateTime;
352
413
  }, z.core.$strip>;
353
414
  type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
354
415
 
355
- declare const storefrontClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
356
- name: z.ZodLiteral<"page_view">;
357
- eventId: z.ZodUUID;
358
- ts: z.ZodNumber;
359
- path: z.ZodString;
360
- referrerHost: z.ZodNullable<z.ZodString>;
361
- }, z.core.$strip>, z.ZodObject<{
362
- name: z.ZodLiteral<"view_search_results">;
363
- checkIn: z.ZodOptional<z.ZodISODate>;
364
- checkOut: z.ZodOptional<z.ZodISODate>;
365
- guests: z.ZodOptional<z.ZodNumber>;
366
- locationId: z.ZodOptional<z.ZodUUID>;
367
- eventId: z.ZodUUID;
368
- ts: z.ZodNumber;
369
- path: z.ZodString;
370
- referrerHost: z.ZodNullable<z.ZodString>;
371
- }, z.core.$strip>, z.ZodObject<{
372
- name: z.ZodLiteral<"view_item_list">;
373
- listName: z.ZodString;
374
- itemCount: z.ZodNumber;
375
- eventId: z.ZodUUID;
376
- ts: z.ZodNumber;
377
- path: z.ZodString;
378
- referrerHost: z.ZodNullable<z.ZodString>;
379
- }, z.core.$strip>, z.ZodObject<{
380
- name: z.ZodLiteral<"view_item">;
381
- listingId: z.ZodUUID;
382
- eventId: z.ZodUUID;
383
- ts: z.ZodNumber;
384
- path: z.ZodString;
385
- referrerHost: z.ZodNullable<z.ZodString>;
386
- }, z.core.$strip>, z.ZodObject<{
387
- name: z.ZodLiteral<"view_quote">;
388
- listingId: z.ZodUUID;
389
- valueMinor: z.ZodNumber;
390
- currency: z.ZodString;
391
- nights: z.ZodNumber;
392
- eventId: z.ZodUUID;
393
- ts: z.ZodNumber;
394
- path: z.ZodString;
395
- referrerHost: z.ZodNullable<z.ZodString>;
396
- }, z.core.$strip>, z.ZodObject<{
397
- name: z.ZodLiteral<"begin_checkout">;
398
- checkoutSessionId: z.ZodUUID;
399
- eventId: z.ZodUUID;
400
- ts: z.ZodNumber;
401
- path: z.ZodString;
402
- referrerHost: z.ZodNullable<z.ZodString>;
403
- }, z.core.$strip>, z.ZodObject<{
404
- name: z.ZodLiteral<"add_payment_info">;
405
- checkoutSessionId: z.ZodUUID;
406
- eventId: z.ZodUUID;
407
- ts: z.ZodNumber;
408
- path: z.ZodString;
409
- referrerHost: z.ZodNullable<z.ZodString>;
410
- }, z.core.$strip>, z.ZodObject<{
411
- name: z.ZodLiteral<"generate_lead">;
412
- formId: z.ZodOptional<z.ZodString>;
413
- eventId: z.ZodUUID;
414
- ts: z.ZodNumber;
415
- path: z.ZodString;
416
- referrerHost: z.ZodNullable<z.ZodString>;
417
- }, z.core.$strip>, z.ZodObject<{
418
- name: z.ZodLiteral<"sign_up">;
419
- method: z.ZodLiteral<"newsletter">;
420
- eventId: z.ZodUUID;
421
- ts: z.ZodNumber;
422
- path: z.ZodString;
423
- referrerHost: z.ZodNullable<z.ZodString>;
424
- }, z.core.$strip>], "name">;
425
- type StorefrontClientEvent = z.infer<typeof storefrontClientEventSchema>;
416
+ declare const storefrontContentRefSchema: z.ZodObject<{
417
+ kind: z.ZodString;
418
+ id: z.ZodUUID;
419
+ slug: z.ZodNullable<z.ZodString>;
420
+ }, z.core.$strip>;
421
+ type StorefrontContentRef = z.infer<typeof storefrontContentRefSchema>;
422
+ declare const storefrontContentItemSchema: z.ZodObject<{
423
+ id: z.ZodUUID;
424
+ type: z.ZodString;
425
+ slug: z.ZodNullable<z.ZodString>;
426
+ publishedAt: z.ZodNullable<z.ZodString>;
427
+ updatedAt: z.ZodString;
428
+ sortOrder: z.ZodNumber;
429
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
430
+ }, z.core.$strip>;
431
+ type StorefrontContentItem = z.infer<typeof storefrontContentItemSchema>;
432
+ declare const storefrontContentModelSchema: z.ZodObject<{
433
+ version: z.ZodNumber;
434
+ types: z.ZodArray<z.ZodObject<{
435
+ key: z.ZodString;
436
+ kind: z.ZodString;
437
+ fields: z.ZodArray<z.ZodObject<{
438
+ key: z.ZodString;
439
+ type: z.ZodString;
440
+ }, z.core.$catchall<z.ZodUnknown>>>;
441
+ }, z.core.$catchall<z.ZodUnknown>>>;
442
+ }, z.core.$strip>;
443
+ type StorefrontContentModel = z.infer<typeof storefrontContentModelSchema>;
426
444
 
427
445
  declare const storefrontRatePlanQuoteSchema: z.ZodObject<{
428
446
  ratePlanId: z.ZodString;
@@ -466,28 +484,6 @@ declare const storefrontQuoteSchema: z.ZodObject<{
466
484
  }, z.core.$strip>;
467
485
  type StorefrontQuote = z.infer<typeof storefrontQuoteSchema>;
468
486
 
469
- type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
470
- type TrackEvent = DistributiveOmit<StorefrontClientEvent, 'eventId' | 'ts' | 'path' | 'referrerHost'>;
471
- type AnalyticsReporter = (err: unknown) => void;
472
- interface AnalyticsOptions {
473
- publishableKey: string;
474
- report?: AnalyticsReporter;
475
- }
476
- interface StorefrontAnalytics {
477
- track(event: TrackEvent): void;
478
- pageView(): void;
479
- flush(opts?: {
480
- beacon?: boolean;
481
- }): void;
482
- dispose(): void;
483
- }
484
- declare function trackPurchasePixel(booking: Pick<BookingResult, 'bookingRequestId'> & {
485
- totalMinor?: number | null;
486
- currency?: string | null;
487
- }): void;
488
- declare function createAnalytics(opts: AnalyticsOptions): StorefrontAnalytics;
489
- declare function analyticsFor(publishableKey: string): StorefrontAnalytics;
490
-
491
487
  declare const STOREFRONT_API_PATH = "/api/storefront/v1";
492
488
  interface StorefrontClientOptions {
493
489
  publishableKey: string;
@@ -502,6 +498,10 @@ interface RequestOptions {
502
498
  interface CreateCheckoutSessionOptions extends RequestOptions {
503
499
  idempotencyKey?: string;
504
500
  }
501
+ interface ContentListQuery {
502
+ limit?: number;
503
+ offset?: number;
504
+ }
505
505
  interface Page<T> {
506
506
  items: T[];
507
507
  total: number;
@@ -529,6 +529,16 @@ interface StorefrontClient {
529
529
  locations: {
530
530
  list(opts?: RequestOptions): Promise<StorefrontLocation[]>;
531
531
  };
532
+ contentModel: {
533
+ get(opts?: RequestOptions): Promise<StorefrontContentModel>;
534
+ };
535
+ collections: {
536
+ list(key: string, query?: ContentListQuery, opts?: RequestOptions): Promise<Page<StorefrontContentItem>>;
537
+ get(key: string, slugOrId: string, opts?: RequestOptions): Promise<StorefrontContentItem | null>;
538
+ };
539
+ sections: {
540
+ get(key: string, opts?: RequestOptions): Promise<StorefrontContentItem>;
541
+ };
532
542
  amenities: {
533
543
  list(opts?: RequestOptions): Promise<string[]>;
534
544
  };
@@ -559,57 +569,4 @@ interface StorefrontClient {
559
569
  }
560
570
  declare function createStorefrontClient(options: StorefrontClientOptions): StorefrontClient;
561
571
 
562
- declare const STOREFRONT_ERROR_CODES: readonly ["wrong_region", "origin_not_allowed", "origin_required", "site_archived", "not_bookable", "quote_invalid", "quote_expired", "price_changed", "currency_unsupported", "payment_declined", "session_expired", "rate_limited", "contact_not_configured", "payment_account_unavailable", "idempotency_key_required", "idempotency_key_reused", "payment_mode_unsupported", "payment_not_authorized", "payment_method_required", "site_not_published", "preview_read_only", "UNAUTHORIZED", "VALIDATION_ERROR", "NOT_FOUND", "site_not_found", "upstream_timeout", "timeout", "network", "invalid_response", "internal_error", "checkout_unavailable"];
563
- type StorefrontErrorCode = (typeof STOREFRONT_ERROR_CODES)[number];
564
- type StorefrontRegion = 'us' | 'eu' | 'apac';
565
- interface StorefrontErrorInit {
566
- status: number;
567
- code: string;
568
- message: string;
569
- type?: string;
570
- requestId?: string | null;
571
- details?: Record<string, unknown>;
572
- cause?: unknown;
573
- }
574
- declare class StorefrontError extends Error {
575
- name: string;
576
- readonly status: number;
577
- readonly type: string;
578
- readonly code: StorefrontErrorCode | (string & {});
579
- readonly requestId: string | null;
580
- readonly details: Record<string, unknown>;
581
- constructor(init: StorefrontErrorInit);
582
- }
583
- declare class PriceChangedError extends StorefrontError {
584
- name: string;
585
- readonly quote: StorefrontQuote | null;
586
- readonly requiresNewSession: boolean;
587
- constructor(init: StorefrontErrorInit);
588
- }
589
- declare class WrongRegionError extends StorefrontError {
590
- name: string;
591
- readonly region: StorefrontRegion | null;
592
- readonly baseUrl: string | null;
593
- constructor(init: StorefrontErrorInit);
594
- }
595
- declare class RateLimitedError extends StorefrontError {
596
- name: string;
597
- readonly retryAfterSec: number | null;
598
- readonly scope: 'key' | 'ip' | 'pms' | null;
599
- constructor(init: StorefrontErrorInit & {
600
- retryAfterSec: number | null;
601
- });
602
- }
603
- declare class StorefrontTimeoutError extends StorefrontError {
604
- name: string;
605
- constructor(timeoutMs: number, requestId?: string | null);
606
- }
607
- declare class StorefrontNetworkError extends StorefrontError {
608
- name: string;
609
- constructor(cause: unknown);
610
- }
611
- declare class StorefrontConfigError extends Error {
612
- name: string;
613
- }
614
-
615
- export { type AnalyticsOptions as A, type BookingResult as B, type CheckoutMountDescriptor as C, StorefrontNetworkError as D, type StorefrontQuote as E, type StorefrontQuoteInput as F, type StorefrontRatePlanQuote as G, type StorefrontReview as H, type StorefrontReviewsQuery as I, type StorefrontSite as J, StorefrontTimeoutError as K, analyticsFor as L, createAnalytics as M, createStorefrontClient as N, trackPurchasePixel as O, type Page as P, RateLimitedError as R, type StorefrontRegion as S, type TrackEvent as T, WrongRegionError as W, type AnalyticsReporter as a, type CheckoutSession as b, type ConfirmCheckoutSessionInput as c, type ConfirmCheckoutSessionRequest as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, PriceChangedError as h, type RequestOptions as i, STOREFRONT_API_PATH as j, STOREFRONT_ERROR_CODES as k, type StorefrontAnalytics as l, type StorefrontBooking as m, type StorefrontBuilding as n, type StorefrontClient as o, type StorefrontClientOptions as p, StorefrontConfigError as q, type StorefrontContactInput as r, StorefrontError as s, type StorefrontErrorCode as t, type StorefrontErrorInit as u, type StorefrontGuestInput as v, type StorefrontListing as w, type StorefrontListingSummary as x, type StorefrontListingsQuery as y, type StorefrontLocation as z };
572
+ export { type StorefrontSite as A, type BookingResult as B, type CheckoutMountDescriptor as C, createStorefrontClient as D, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontImage as q, type StorefrontListing as r, type StorefrontListingSummary as s, type StorefrontListingsQuery as t, type StorefrontLocation as u, type StorefrontQuote as v, type StorefrontQuoteInput as w, type StorefrontRatePlanQuote as x, type StorefrontReview as y, type StorefrontReviewsQuery as z };