@voyant-travel/cruises-react 0.118.2
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/LICENSE +201 -0
- package/README.md +70 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +59 -0
- package/dist/components/cruise-catalog-card.d.ts +13 -0
- package/dist/components/cruise-catalog-card.d.ts.map +1 -0
- package/dist/components/cruise-catalog-card.js +58 -0
- package/dist/components/enrichment-program-list.d.ts +13 -0
- package/dist/components/enrichment-program-list.d.ts.map +1 -0
- package/dist/components/enrichment-program-list.js +45 -0
- package/dist/components/external-badge.d.ts +14 -0
- package/dist/components/external-badge.d.ts.map +1 -0
- package/dist/components/external-badge.js +17 -0
- package/dist/components/pricing-grid.d.ts +21 -0
- package/dist/components/pricing-grid.d.ts.map +1 -0
- package/dist/components/pricing-grid.js +81 -0
- package/dist/components/quote-display.d.ts +14 -0
- package/dist/components/quote-display.d.ts.map +1 -0
- package/dist/components/quote-display.js +61 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/use-cruise-booking.d.ts +205 -0
- package/dist/hooks/use-cruise-booking.d.ts.map +1 -0
- package/dist/hooks/use-cruise-booking.js +56 -0
- package/dist/hooks/use-cruise-mutation.d.ts +144 -0
- package/dist/hooks/use-cruise-mutation.d.ts.map +1 -0
- package/dist/hooks/use-cruise-mutation.js +58 -0
- package/dist/hooks/use-cruise.d.ts +38 -0
- package/dist/hooks/use-cruise.d.ts.map +1 -0
- package/dist/hooks/use-cruise.js +16 -0
- package/dist/hooks/use-cruises.d.ts +61 -0
- package/dist/hooks/use-cruises.d.ts.map +1 -0
- package/dist/hooks/use-cruises.js +16 -0
- package/dist/hooks/use-effective-itinerary.d.ts +27 -0
- package/dist/hooks/use-effective-itinerary.d.ts.map +1 -0
- package/dist/hooks/use-effective-itinerary.js +16 -0
- package/dist/hooks/use-enrichment.d.ts +72 -0
- package/dist/hooks/use-enrichment.d.ts.map +1 -0
- package/dist/hooks/use-enrichment.js +64 -0
- package/dist/hooks/use-external-actions.d.ts +43 -0
- package/dist/hooks/use-external-actions.d.ts.map +1 -0
- package/dist/hooks/use-external-actions.js +45 -0
- package/dist/hooks/use-pricing.d.ts +65 -0
- package/dist/hooks/use-pricing.d.ts.map +1 -0
- package/dist/hooks/use-pricing.js +28 -0
- package/dist/hooks/use-sailing-mutation.d.ts +147 -0
- package/dist/hooks/use-sailing-mutation.d.ts.map +1 -0
- package/dist/hooks/use-sailing-mutation.js +55 -0
- package/dist/hooks/use-sailings.d.ts +49 -0
- package/dist/hooks/use-sailings.d.ts.map +1 -0
- package/dist/hooks/use-sailings.js +20 -0
- package/dist/hooks/use-search-index.d.ts +43 -0
- package/dist/hooks/use-search-index.d.ts.map +1 -0
- package/dist/hooks/use-search-index.js +51 -0
- package/dist/hooks/use-ship-mutation.d.ts +186 -0
- package/dist/hooks/use-ship-mutation.d.ts.map +1 -0
- package/dist/hooks/use-ship-mutation.js +92 -0
- package/dist/hooks/use-ships.d.ts +101 -0
- package/dist/hooks/use-ships.d.ts.map +1 -0
- package/dist/hooks/use-ships.js +43 -0
- package/dist/hooks/use-storefront.d.ts +230 -0
- package/dist/hooks/use-storefront.d.ts.map +1 -0
- package/dist/hooks/use-storefront.js +62 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +79 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +62 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +26 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +3 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +79 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +82 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +39 -0
- package/dist/query-options.d.ts +1272 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +136 -0
- package/dist/schemas.d.ts +1061 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +339 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +5 -0
- package/package.json +121 -0
- package/src/styles.css +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAE3F,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAAsC,CAAA;AAElG,eAAO,MAAM,eAAe;;kBAAgD,CAAA;AAI5E,eAAO,MAAM,gBAAgB;;;;;EAAsD,CAAA;AACnF,eAAO,MAAM,kBAAkB;;;;;EAA2D,CAAA;AAC1F,eAAO,MAAM,kBAAkB;;;EAAgC,CAAA;AAC/D,eAAO,MAAM,cAAc;;;;;;;EAOzB,CAAA;AACF,eAAO,MAAM,mBAAmB;;;;;;;EAO9B,CAAA;AACF,eAAO,MAAM,wBAAwB;;;;;;EAMnC,CAAA;AAC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z } from "zod";
|
|
2
|
+
// ---------- envelope helpers ----------
|
|
3
|
+
export const paginatedEnvelope = (item) => z.object({
|
|
4
|
+
data: z.array(item),
|
|
5
|
+
total: z.number().int(),
|
|
6
|
+
limit: z.number().int(),
|
|
7
|
+
offset: z.number().int(),
|
|
8
|
+
});
|
|
9
|
+
export const singleEnvelope = (item) => z.object({ data: item });
|
|
10
|
+
export const listEnvelope = (item) => z.object({ data: z.array(item) });
|
|
11
|
+
export const successEnvelope = z.object({ success: z.boolean() }).optional();
|
|
12
|
+
// ---------- canonical enum schemas (mirror server) ----------
|
|
13
|
+
export const cruiseTypeSchema = z.enum(["ocean", "river", "expedition", "coastal"]);
|
|
14
|
+
export const cruiseStatusSchema = z.enum(["draft", "awaiting_review", "live", "archived"]);
|
|
15
|
+
export const cruiseSourceSchema = z.enum(["local", "external"]);
|
|
16
|
+
export const shipTypeSchema = z.enum([
|
|
17
|
+
"ocean",
|
|
18
|
+
"river",
|
|
19
|
+
"expedition",
|
|
20
|
+
"yacht",
|
|
21
|
+
"sailing",
|
|
22
|
+
"coastal",
|
|
23
|
+
]);
|
|
24
|
+
export const cabinRoomTypeSchema = z.enum([
|
|
25
|
+
"inside",
|
|
26
|
+
"oceanview",
|
|
27
|
+
"balcony",
|
|
28
|
+
"suite",
|
|
29
|
+
"penthouse",
|
|
30
|
+
"single",
|
|
31
|
+
]);
|
|
32
|
+
export const sailingSalesStatusSchema = z.enum([
|
|
33
|
+
"open",
|
|
34
|
+
"on_request",
|
|
35
|
+
"wait_list",
|
|
36
|
+
"sold_out",
|
|
37
|
+
"closed",
|
|
38
|
+
]);
|
|
39
|
+
export const sailingDirectionSchema = z.enum(["upstream", "downstream", "round_trip", "one_way"]);
|
|
40
|
+
export const priceAvailabilitySchema = z.enum([
|
|
41
|
+
"available",
|
|
42
|
+
"limited",
|
|
43
|
+
"on_request",
|
|
44
|
+
"wait_list",
|
|
45
|
+
"sold_out",
|
|
46
|
+
]);
|
|
47
|
+
export const priceComponentKindSchema = z.enum([
|
|
48
|
+
"gratuity",
|
|
49
|
+
"onboard_credit",
|
|
50
|
+
"port_charge",
|
|
51
|
+
"tax",
|
|
52
|
+
"ncf",
|
|
53
|
+
"airfare",
|
|
54
|
+
"transfer",
|
|
55
|
+
"insurance",
|
|
56
|
+
]);
|
|
57
|
+
export const priceComponentDirectionSchema = z.enum(["addition", "inclusion", "credit"]);
|
|
58
|
+
export const enrichmentKindSchema = z.enum([
|
|
59
|
+
"naturalist",
|
|
60
|
+
"historian",
|
|
61
|
+
"photographer",
|
|
62
|
+
"lecturer",
|
|
63
|
+
"expert",
|
|
64
|
+
"other",
|
|
65
|
+
]);
|
|
66
|
+
export const cruiseBookingModeSchema = z.enum(["inquiry", "reserve"]);
|
|
67
|
+
// ---------- record schemas (browser-facing read shapes) ----------
|
|
68
|
+
const isoDateString = z.string();
|
|
69
|
+
const timestampString = z.string();
|
|
70
|
+
export const cruiseRecordSchema = z.object({
|
|
71
|
+
id: z.string(),
|
|
72
|
+
slug: z.string(),
|
|
73
|
+
name: z.string(),
|
|
74
|
+
cruiseType: cruiseTypeSchema,
|
|
75
|
+
lineSupplierId: z.string().nullable(),
|
|
76
|
+
defaultShipId: z.string().nullable(),
|
|
77
|
+
nights: z.number().int(),
|
|
78
|
+
embarkPortFacilityId: z.string().nullable(),
|
|
79
|
+
disembarkPortFacilityId: z.string().nullable(),
|
|
80
|
+
description: z.string().nullable(),
|
|
81
|
+
shortDescription: z.string().nullable(),
|
|
82
|
+
highlights: z.array(z.string()).nullable(),
|
|
83
|
+
inclusionsHtml: z.string().nullable(),
|
|
84
|
+
exclusionsHtml: z.string().nullable(),
|
|
85
|
+
regions: z.array(z.string()).nullable(),
|
|
86
|
+
themes: z.array(z.string()).nullable(),
|
|
87
|
+
heroImageUrl: z.string().nullable(),
|
|
88
|
+
mapImageUrl: z.string().nullable(),
|
|
89
|
+
status: cruiseStatusSchema,
|
|
90
|
+
lowestPriceCached: z.string().nullable(),
|
|
91
|
+
lowestPriceCurrencyCached: z.string().nullable(),
|
|
92
|
+
earliestDepartureCached: isoDateString.nullable(),
|
|
93
|
+
latestDepartureCached: isoDateString.nullable(),
|
|
94
|
+
externalRefs: z.record(z.string(), z.string()).nullable(),
|
|
95
|
+
createdAt: timestampString,
|
|
96
|
+
updatedAt: timestampString,
|
|
97
|
+
});
|
|
98
|
+
export const sailingRecordSchema = z.object({
|
|
99
|
+
id: z.string(),
|
|
100
|
+
cruiseId: z.string(),
|
|
101
|
+
shipId: z.string(),
|
|
102
|
+
departureDate: isoDateString,
|
|
103
|
+
returnDate: isoDateString,
|
|
104
|
+
embarkPortFacilityId: z.string().nullable(),
|
|
105
|
+
disembarkPortFacilityId: z.string().nullable(),
|
|
106
|
+
direction: sailingDirectionSchema.nullable(),
|
|
107
|
+
availabilityNote: z.string().nullable(),
|
|
108
|
+
isCharter: z.boolean(),
|
|
109
|
+
salesStatus: sailingSalesStatusSchema,
|
|
110
|
+
externalRefs: z.record(z.string(), z.string()).nullable(),
|
|
111
|
+
lastSyncedAt: timestampString.nullable(),
|
|
112
|
+
createdAt: timestampString,
|
|
113
|
+
updatedAt: timestampString,
|
|
114
|
+
});
|
|
115
|
+
export const shipRecordSchema = z.object({
|
|
116
|
+
id: z.string(),
|
|
117
|
+
lineSupplierId: z.string().nullable(),
|
|
118
|
+
name: z.string(),
|
|
119
|
+
slug: z.string(),
|
|
120
|
+
shipType: shipTypeSchema,
|
|
121
|
+
capacityGuests: z.number().int().nullable(),
|
|
122
|
+
capacityCrew: z.number().int().nullable(),
|
|
123
|
+
cabinCount: z.number().int().nullable(),
|
|
124
|
+
deckCount: z.number().int().nullable(),
|
|
125
|
+
lengthMeters: z.string().nullable(),
|
|
126
|
+
cruisingSpeedKnots: z.string().nullable(),
|
|
127
|
+
yearBuilt: z.number().int().nullable(),
|
|
128
|
+
yearRefurbished: z.number().int().nullable(),
|
|
129
|
+
imo: z.string().nullable(),
|
|
130
|
+
description: z.string().nullable(),
|
|
131
|
+
deckPlanUrl: z.string().nullable(),
|
|
132
|
+
gallery: z.array(z.string()).nullable(),
|
|
133
|
+
amenities: z.record(z.string(), z.unknown()).nullable(),
|
|
134
|
+
externalRefs: z.record(z.string(), z.string()).nullable(),
|
|
135
|
+
isActive: z.boolean(),
|
|
136
|
+
createdAt: timestampString,
|
|
137
|
+
updatedAt: timestampString,
|
|
138
|
+
});
|
|
139
|
+
export const cabinCategoryRecordSchema = z.object({
|
|
140
|
+
id: z.string(),
|
|
141
|
+
shipId: z.string(),
|
|
142
|
+
code: z.string(),
|
|
143
|
+
name: z.string(),
|
|
144
|
+
roomType: cabinRoomTypeSchema,
|
|
145
|
+
description: z.string().nullable(),
|
|
146
|
+
minOccupancy: z.number().int(),
|
|
147
|
+
maxOccupancy: z.number().int(),
|
|
148
|
+
squareFeet: z.string().nullable(),
|
|
149
|
+
wheelchairAccessible: z.boolean(),
|
|
150
|
+
amenities: z.array(z.string()).nullable(),
|
|
151
|
+
images: z.array(z.string()).nullable(),
|
|
152
|
+
floorplanImages: z.array(z.string()).nullable(),
|
|
153
|
+
gradeCodes: z.array(z.string()).nullable(),
|
|
154
|
+
externalRefs: z.record(z.string(), z.string()).nullable(),
|
|
155
|
+
createdAt: timestampString,
|
|
156
|
+
updatedAt: timestampString,
|
|
157
|
+
});
|
|
158
|
+
export const deckRecordSchema = z.object({
|
|
159
|
+
id: z.string(),
|
|
160
|
+
shipId: z.string(),
|
|
161
|
+
name: z.string(),
|
|
162
|
+
level: z.number().int().nullable(),
|
|
163
|
+
planImageUrl: z.string().nullable(),
|
|
164
|
+
createdAt: timestampString,
|
|
165
|
+
updatedAt: timestampString,
|
|
166
|
+
});
|
|
167
|
+
export const cabinRecordSchema = z.object({
|
|
168
|
+
id: z.string(),
|
|
169
|
+
categoryId: z.string(),
|
|
170
|
+
cabinNumber: z.string(),
|
|
171
|
+
deckId: z.string().nullable(),
|
|
172
|
+
position: z.string().nullable(),
|
|
173
|
+
connectsTo: z.string().nullable(),
|
|
174
|
+
notes: z.string().nullable(),
|
|
175
|
+
isActive: z.boolean(),
|
|
176
|
+
createdAt: timestampString,
|
|
177
|
+
updatedAt: timestampString,
|
|
178
|
+
});
|
|
179
|
+
export const priceComponentRecordSchema = z.object({
|
|
180
|
+
id: z.string(),
|
|
181
|
+
priceId: z.string(),
|
|
182
|
+
kind: priceComponentKindSchema,
|
|
183
|
+
label: z.string().nullable(),
|
|
184
|
+
amount: z.string(),
|
|
185
|
+
currency: z.string(),
|
|
186
|
+
direction: priceComponentDirectionSchema,
|
|
187
|
+
perPerson: z.boolean(),
|
|
188
|
+
createdAt: timestampString,
|
|
189
|
+
updatedAt: timestampString,
|
|
190
|
+
});
|
|
191
|
+
export const priceRecordSchema = z.object({
|
|
192
|
+
id: z.string(),
|
|
193
|
+
sailingId: z.string(),
|
|
194
|
+
cabinCategoryId: z.string(),
|
|
195
|
+
occupancy: z.number().int(),
|
|
196
|
+
fareCode: z.string().nullable(),
|
|
197
|
+
fareCodeName: z.string().nullable(),
|
|
198
|
+
currency: z.string(),
|
|
199
|
+
pricePerPerson: z.string(),
|
|
200
|
+
secondGuestPricePerPerson: z.string().nullable(),
|
|
201
|
+
singleSupplementPercent: z.string().nullable(),
|
|
202
|
+
availability: priceAvailabilitySchema,
|
|
203
|
+
availabilityCount: z.number().int().nullable(),
|
|
204
|
+
priceCatalogId: z.string().nullable(),
|
|
205
|
+
priceScheduleId: z.string().nullable(),
|
|
206
|
+
bookingDeadline: isoDateString.nullable(),
|
|
207
|
+
requiresRequest: z.boolean(),
|
|
208
|
+
notes: z.string().nullable(),
|
|
209
|
+
externalRefs: z.record(z.string(), z.string()).nullable(),
|
|
210
|
+
lastSyncedAt: timestampString.nullable(),
|
|
211
|
+
createdAt: timestampString,
|
|
212
|
+
updatedAt: timestampString,
|
|
213
|
+
});
|
|
214
|
+
export const enrichmentProgramRecordSchema = z.object({
|
|
215
|
+
id: z.string(),
|
|
216
|
+
cruiseId: z.string(),
|
|
217
|
+
kind: enrichmentKindSchema,
|
|
218
|
+
name: z.string(),
|
|
219
|
+
title: z.string().nullable(),
|
|
220
|
+
description: z.string().nullable(),
|
|
221
|
+
bioImageUrl: z.string().nullable(),
|
|
222
|
+
sortOrder: z.number().int(),
|
|
223
|
+
createdAt: timestampString,
|
|
224
|
+
updatedAt: timestampString,
|
|
225
|
+
});
|
|
226
|
+
export const searchIndexEntrySchema = z.object({
|
|
227
|
+
id: z.string(),
|
|
228
|
+
source: cruiseSourceSchema,
|
|
229
|
+
sourceProvider: z.string().nullable(),
|
|
230
|
+
sourceRef: z.record(z.string(), z.unknown()).nullable(),
|
|
231
|
+
localCruiseId: z.string().nullable(),
|
|
232
|
+
slug: z.string(),
|
|
233
|
+
name: z.string(),
|
|
234
|
+
cruiseType: cruiseTypeSchema,
|
|
235
|
+
lineName: z.string(),
|
|
236
|
+
shipName: z.string(),
|
|
237
|
+
nights: z.number().int(),
|
|
238
|
+
embarkPortName: z.string().nullable(),
|
|
239
|
+
disembarkPortName: z.string().nullable(),
|
|
240
|
+
regions: z.array(z.string()).nullable(),
|
|
241
|
+
themes: z.array(z.string()).nullable(),
|
|
242
|
+
earliestDeparture: isoDateString.nullable(),
|
|
243
|
+
latestDeparture: isoDateString.nullable(),
|
|
244
|
+
departureCount: z.number().int().nullable(),
|
|
245
|
+
lowestPriceCents: z.number().int().nullable(),
|
|
246
|
+
lowestPriceCurrency: z.string().nullable(),
|
|
247
|
+
salesStatus: z.string().nullable(),
|
|
248
|
+
heroImageUrl: z.string().nullable(),
|
|
249
|
+
refreshedAt: timestampString,
|
|
250
|
+
createdAt: timestampString,
|
|
251
|
+
updatedAt: timestampString,
|
|
252
|
+
});
|
|
253
|
+
// ---------- effective itinerary day (computed by the server) ----------
|
|
254
|
+
export const effectiveItineraryDaySchema = z.object({
|
|
255
|
+
dayNumber: z.number().int(),
|
|
256
|
+
title: z.string().nullable(),
|
|
257
|
+
description: z.string().nullable(),
|
|
258
|
+
portFacilityId: z.string().nullable(),
|
|
259
|
+
arrivalTime: z.string().nullable(),
|
|
260
|
+
departureTime: z.string().nullable(),
|
|
261
|
+
isOvernight: z.boolean(),
|
|
262
|
+
isSeaDay: z.boolean(),
|
|
263
|
+
isExpeditionLanding: z.boolean(),
|
|
264
|
+
isSkipped: z.boolean(),
|
|
265
|
+
meals: z
|
|
266
|
+
.object({
|
|
267
|
+
breakfast: z.boolean().optional(),
|
|
268
|
+
lunch: z.boolean().optional(),
|
|
269
|
+
dinner: z.boolean().optional(),
|
|
270
|
+
})
|
|
271
|
+
.optional(),
|
|
272
|
+
hasOverride: z.boolean(),
|
|
273
|
+
});
|
|
274
|
+
// ---------- quote (composed by the server) ----------
|
|
275
|
+
export const quoteComponentSchema = z.object({
|
|
276
|
+
kind: priceComponentKindSchema,
|
|
277
|
+
label: z.string().nullable(),
|
|
278
|
+
amount: z.string(),
|
|
279
|
+
currency: z.string(),
|
|
280
|
+
direction: priceComponentDirectionSchema,
|
|
281
|
+
perPerson: z.boolean(),
|
|
282
|
+
});
|
|
283
|
+
export const quoteSchema = z.object({
|
|
284
|
+
fareCode: z.string().nullable(),
|
|
285
|
+
fareCodeName: z.string().nullable(),
|
|
286
|
+
currency: z.string(),
|
|
287
|
+
occupancy: z.number().int(),
|
|
288
|
+
guestCount: z.number().int(),
|
|
289
|
+
basePerPerson: z.string(),
|
|
290
|
+
components: z.array(quoteComponentSchema),
|
|
291
|
+
totalPerPerson: z.string(),
|
|
292
|
+
totalForCabin: z.string(),
|
|
293
|
+
});
|
|
294
|
+
// ---------- unified-key admin envelopes ----------
|
|
295
|
+
export const adminCruiseListItemSchema = z.union([
|
|
296
|
+
z.object({
|
|
297
|
+
source: z.literal("local"),
|
|
298
|
+
sourceProvider: z.null(),
|
|
299
|
+
sourceRef: z.null(),
|
|
300
|
+
key: z.string(),
|
|
301
|
+
cruise: cruiseRecordSchema,
|
|
302
|
+
}),
|
|
303
|
+
z.object({
|
|
304
|
+
source: z.literal("external"),
|
|
305
|
+
sourceProvider: z.string(),
|
|
306
|
+
sourceRef: z.record(z.string(), z.unknown()),
|
|
307
|
+
key: z.string(),
|
|
308
|
+
cruise: z.unknown(),
|
|
309
|
+
}),
|
|
310
|
+
]);
|
|
311
|
+
export const adminCruiseListResponse = z.object({
|
|
312
|
+
data: z.array(adminCruiseListItemSchema),
|
|
313
|
+
total: z.number().int(),
|
|
314
|
+
localTotal: z.number().int(),
|
|
315
|
+
adapterCount: z.number().int(),
|
|
316
|
+
adapterErrors: z.array(z.object({ adapter: z.string(), error: z.string() })).optional(),
|
|
317
|
+
limit: z.number().int(),
|
|
318
|
+
offset: z.number().int(),
|
|
319
|
+
});
|
|
320
|
+
// ---------- response wrappers ----------
|
|
321
|
+
export const cruiseListResponse = paginatedEnvelope(cruiseRecordSchema);
|
|
322
|
+
export const cruiseSingleResponse = singleEnvelope(cruiseRecordSchema);
|
|
323
|
+
export const sailingListResponse = paginatedEnvelope(sailingRecordSchema);
|
|
324
|
+
export const sailingSingleResponse = singleEnvelope(sailingRecordSchema);
|
|
325
|
+
export const shipListResponse = paginatedEnvelope(shipRecordSchema);
|
|
326
|
+
export const shipSingleResponse = singleEnvelope(shipRecordSchema);
|
|
327
|
+
export const cabinCategoryListResponse = listEnvelope(cabinCategoryRecordSchema);
|
|
328
|
+
export const cabinCategorySingleResponse = singleEnvelope(cabinCategoryRecordSchema);
|
|
329
|
+
export const deckListResponse = listEnvelope(deckRecordSchema);
|
|
330
|
+
export const deckSingleResponse = singleEnvelope(deckRecordSchema);
|
|
331
|
+
export const cabinListResponse = listEnvelope(cabinRecordSchema);
|
|
332
|
+
export const cabinSingleResponse = singleEnvelope(cabinRecordSchema);
|
|
333
|
+
export const priceListResponse = paginatedEnvelope(priceRecordSchema);
|
|
334
|
+
export const priceSingleResponse = singleEnvelope(priceRecordSchema);
|
|
335
|
+
export const enrichmentListResponse = listEnvelope(enrichmentProgramRecordSchema);
|
|
336
|
+
export const enrichmentSingleResponse = singleEnvelope(enrichmentProgramRecordSchema);
|
|
337
|
+
export const effectiveItineraryResponse = listEnvelope(effectiveItineraryDaySchema);
|
|
338
|
+
export const quoteResponse = singleEnvelope(quoteSchema);
|
|
339
|
+
export const searchIndexListResponse = paginatedEnvelope(searchIndexEntrySchema);
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EnrichmentProgramList, type EnrichmentProgramListProps, } from "./components/enrichment-program-list.js";
|
|
2
|
+
export { ExternalCruiseBadge, type ExternalCruiseBadgeProps } from "./components/external-badge.js";
|
|
3
|
+
export { PricingGrid, type PricingGridProps } from "./components/pricing-grid.js";
|
|
4
|
+
export { QuoteDisplay, type QuoteDisplayProps } from "./components/quote-display.js";
|
|
5
|
+
export { type CruisePriceAvailability, type CruiseQuoteComponentKind, type CruisesUiMessageOverrides, type CruisesUiMessages, CruisesUiMessagesProvider, cruisesUiEn, cruisesUiMessageDefinitions, cruisesUiRo, type EnrichmentProgramKind, getCruisesUiI18n, resolveCruisesUiMessages, useCruisesUiI18n, useCruisesUiI18nOrDefault, useCruisesUiMessages, useCruisesUiMessagesOrDefault, } from "./i18n/index.js";
|
|
6
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACnG,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACpF,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,WAAW,EACX,2BAA2B,EAC3B,WAAW,EACX,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAA"}
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EnrichmentProgramList, } from "./components/enrichment-program-list.js";
|
|
2
|
+
export { ExternalCruiseBadge } from "./components/external-badge.js";
|
|
3
|
+
export { PricingGrid } from "./components/pricing-grid.js";
|
|
4
|
+
export { QuoteDisplay } from "./components/quote-display.js";
|
|
5
|
+
export { CruisesUiMessagesProvider, cruisesUiEn, cruisesUiMessageDefinitions, cruisesUiRo, getCruisesUiI18n, resolveCruisesUiMessages, useCruisesUiI18n, useCruisesUiI18nOrDefault, useCruisesUiMessages, useCruisesUiMessagesOrDefault, } from "./i18n/index.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@voyant-travel/cruises-react",
|
|
3
|
+
"version": "0.118.2",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/voyant-travel/voyant.git",
|
|
8
|
+
"directory": "packages/cruises-react"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./provider": {
|
|
19
|
+
"types": "./dist/provider.d.ts",
|
|
20
|
+
"import": "./dist/provider.js",
|
|
21
|
+
"default": "./dist/provider.js"
|
|
22
|
+
},
|
|
23
|
+
"./hooks": {
|
|
24
|
+
"types": "./dist/hooks/index.d.ts",
|
|
25
|
+
"import": "./dist/hooks/index.js",
|
|
26
|
+
"default": "./dist/hooks/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./client": {
|
|
29
|
+
"types": "./dist/client.d.ts",
|
|
30
|
+
"import": "./dist/client.js",
|
|
31
|
+
"default": "./dist/client.js"
|
|
32
|
+
},
|
|
33
|
+
"./query-keys": {
|
|
34
|
+
"types": "./dist/query-keys.d.ts",
|
|
35
|
+
"import": "./dist/query-keys.js",
|
|
36
|
+
"default": "./dist/query-keys.js"
|
|
37
|
+
},
|
|
38
|
+
"./ui": {
|
|
39
|
+
"types": "./dist/ui.d.ts",
|
|
40
|
+
"import": "./dist/ui.js",
|
|
41
|
+
"default": "./dist/ui.js"
|
|
42
|
+
},
|
|
43
|
+
"./styles.css": {
|
|
44
|
+
"default": "./src/styles.css"
|
|
45
|
+
},
|
|
46
|
+
"./i18n": {
|
|
47
|
+
"types": "./dist/i18n/index.d.ts",
|
|
48
|
+
"import": "./dist/i18n/index.js",
|
|
49
|
+
"default": "./dist/i18n/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./i18n/en": {
|
|
52
|
+
"types": "./dist/i18n/en.d.ts",
|
|
53
|
+
"import": "./dist/i18n/en.js",
|
|
54
|
+
"default": "./dist/i18n/en.js"
|
|
55
|
+
},
|
|
56
|
+
"./i18n/ro": {
|
|
57
|
+
"types": "./dist/i18n/ro.d.ts",
|
|
58
|
+
"import": "./dist/i18n/ro.js",
|
|
59
|
+
"default": "./dist/i18n/ro.js"
|
|
60
|
+
},
|
|
61
|
+
"./components/*": {
|
|
62
|
+
"types": "./dist/components/*.d.ts",
|
|
63
|
+
"import": "./dist/components/*.js",
|
|
64
|
+
"default": "./dist/components/*.js"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@tanstack/react-query": "^5.0.0",
|
|
69
|
+
"react": "^19.0.0",
|
|
70
|
+
"react-dom": "^19.0.0",
|
|
71
|
+
"zod": "^4.0.0",
|
|
72
|
+
"@voyant-travel/catalog-react": "^0.117.2",
|
|
73
|
+
"@voyant-travel/ui": "^0.106.1",
|
|
74
|
+
"@voyant-travel/cruises": "^0.118.2"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"@voyant-travel/catalog-react": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"@voyant-travel/ui": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"@voyant-travel/i18n": "^0.106.1",
|
|
86
|
+
"@voyant-travel/react": "^0.104.1"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@tanstack/react-query": "^5.100.11",
|
|
90
|
+
"@types/react": "^19.2.14",
|
|
91
|
+
"@types/react-dom": "^19.2.3",
|
|
92
|
+
"lucide-react": "^0.475.0",
|
|
93
|
+
"react": "^19.2.4",
|
|
94
|
+
"react-dom": "^19.2.4",
|
|
95
|
+
"typescript": "^6.0.2",
|
|
96
|
+
"vitest": "^4.1.2",
|
|
97
|
+
"zod": "^4.3.6",
|
|
98
|
+
"@voyant-travel/catalog-react": "^0.117.2",
|
|
99
|
+
"@voyant-travel/i18n": "^0.106.1",
|
|
100
|
+
"@voyant-travel/react": "^0.104.1",
|
|
101
|
+
"@voyant-travel/voyant-typescript-config": "^0.1.0",
|
|
102
|
+
"@voyant-travel/ui": "^0.106.1",
|
|
103
|
+
"@voyant-travel/cruises": "^0.118.2"
|
|
104
|
+
},
|
|
105
|
+
"files": [
|
|
106
|
+
"dist",
|
|
107
|
+
"src/styles.css"
|
|
108
|
+
],
|
|
109
|
+
"publishConfig": {
|
|
110
|
+
"access": "public"
|
|
111
|
+
},
|
|
112
|
+
"scripts": {
|
|
113
|
+
"build": "tsc -p tsconfig.build.json",
|
|
114
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo",
|
|
115
|
+
"typecheck": "tsc --noEmit",
|
|
116
|
+
"lint": "biome check src/",
|
|
117
|
+
"test": "vitest run --passWithNoTests"
|
|
118
|
+
},
|
|
119
|
+
"main": "./dist/index.js",
|
|
120
|
+
"types": "./dist/index.d.ts"
|
|
121
|
+
}
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Tailwind v4 source-detection helper.
|
|
2
|
+
*
|
|
3
|
+
* Templates that consume this package should `@import` this CSS so Tailwind
|
|
4
|
+
* scans these component files for utility classes:
|
|
5
|
+
*
|
|
6
|
+
* @import "@voyant-travel/<domain>-ui/styles.css";
|
|
7
|
+
*
|
|
8
|
+
* Without it, classes that only appear inside this package (e.g. data-attr
|
|
9
|
+
* variants on primitives) won't be compiled into the final bundle.
|
|
10
|
+
*/
|
|
11
|
+
@source "./components/**/*.{ts,tsx}";
|