@voyant-travel/charters 0.118.1 → 0.119.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/routes-public.d.ts
CHANGED
|
@@ -509,6 +509,7 @@ export declare const chartersPublicRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
509
509
|
externalRefs: {
|
|
510
510
|
[x: string]: string;
|
|
511
511
|
} | null;
|
|
512
|
+
maxGuests: number | null;
|
|
512
513
|
images: string[] | null;
|
|
513
514
|
appointmentOnly: boolean;
|
|
514
515
|
lastSyncedAt: string | null;
|
|
@@ -517,7 +518,6 @@ export declare const chartersPublicRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
517
518
|
suiteCategory: "signature" | "standard" | "deluxe" | "suite" | "penthouse" | "owners" | null;
|
|
518
519
|
squareFeet: string | null;
|
|
519
520
|
floorplanImages: string[] | null;
|
|
520
|
-
maxGuests: number | null;
|
|
521
521
|
pricesByCurrency: {
|
|
522
522
|
[x: string]: string;
|
|
523
523
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAYjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;KACvB,CAAA;CACF,CAAA;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAyM7B,CAAA;AAEJ,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA"}
|
package/dist/routes-public.js
CHANGED
|
@@ -7,6 +7,10 @@ import { chartersService } from "./service.js";
|
|
|
7
7
|
import { composePerSuiteQuote, composeWholeYachtQuote, pricingService } from "./service-pricing.js";
|
|
8
8
|
import { productListQuerySchema, voyageListQuerySchema } from "./validation-core.js";
|
|
9
9
|
import { currencyCodeSchema } from "./validation-shared.js";
|
|
10
|
+
const PUBLIC_CACHE_CONTROL = "public, s-maxage=60, stale-while-revalidate=300";
|
|
11
|
+
function cachePublicRead(c) {
|
|
12
|
+
c.header("Cache-Control", PUBLIC_CACHE_CONTROL);
|
|
13
|
+
}
|
|
10
14
|
const perSuiteQuotePayload = z.object({
|
|
11
15
|
suiteId: z.string(),
|
|
12
16
|
currency: currencyCodeSchema,
|
|
@@ -55,6 +59,7 @@ export const chartersPublicRoutes = new Hono()
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
}
|
|
62
|
+
cachePublicRead(c);
|
|
58
63
|
return c.json({
|
|
59
64
|
data: [...localItems, ...adapterItems],
|
|
60
65
|
total: local.total + adapterItems.length,
|
|
@@ -75,6 +80,7 @@ export const chartersPublicRoutes = new Hono()
|
|
|
75
80
|
const yacht = product.defaultYachtRef
|
|
76
81
|
? await adapter.fetchYacht(product.defaultYachtRef)
|
|
77
82
|
: null;
|
|
83
|
+
cachePublicRead(c);
|
|
78
84
|
return c.json({
|
|
79
85
|
data: {
|
|
80
86
|
source: "external",
|
|
@@ -93,6 +99,7 @@ export const chartersPublicRoutes = new Hono()
|
|
|
93
99
|
});
|
|
94
100
|
if (!detail || detail.status !== "live")
|
|
95
101
|
return c.json({ error: "not_found" }, 404);
|
|
102
|
+
cachePublicRead(c);
|
|
96
103
|
return c.json({ data: detail });
|
|
97
104
|
}
|
|
98
105
|
// parsed.kind === "invalid": treat the raw param as a slug lookup
|
|
@@ -110,11 +117,13 @@ export const chartersPublicRoutes = new Hono()
|
|
|
110
117
|
});
|
|
111
118
|
if (!detail || detail.status !== "live")
|
|
112
119
|
return c.json({ error: "not_found" }, 404);
|
|
120
|
+
cachePublicRead(c);
|
|
113
121
|
return c.json({ data: detail });
|
|
114
122
|
})
|
|
115
123
|
.get("/voyages", async (c) => {
|
|
116
124
|
const query = parseQuery(c, voyageListQuerySchema);
|
|
117
125
|
const result = await chartersService.listVoyages(c.get("db"), query);
|
|
126
|
+
cachePublicRead(c);
|
|
118
127
|
return c.json(result);
|
|
119
128
|
})
|
|
120
129
|
.get("/voyages/:key", async (c) => {
|
|
@@ -133,6 +142,7 @@ export const chartersPublicRoutes = new Hono()
|
|
|
133
142
|
adapter.fetchVoyageSuites(ref),
|
|
134
143
|
adapter.fetchVoyageSchedule(ref),
|
|
135
144
|
]);
|
|
145
|
+
cachePublicRead(c);
|
|
136
146
|
return c.json({
|
|
137
147
|
data: {
|
|
138
148
|
source: "external",
|
|
@@ -150,6 +160,7 @@ export const chartersPublicRoutes = new Hono()
|
|
|
150
160
|
});
|
|
151
161
|
if (!row)
|
|
152
162
|
return c.json({ error: "not_found" }, 404);
|
|
163
|
+
cachePublicRead(c);
|
|
153
164
|
return c.json({ data: row });
|
|
154
165
|
})
|
|
155
166
|
.post("/voyages/:key/quote/per-suite", async (c) => {
|
|
@@ -225,10 +236,12 @@ export const chartersPublicRoutes = new Hono()
|
|
|
225
236
|
const yacht = await adapter.fetchYacht({ externalId: parsed.ref });
|
|
226
237
|
if (!yacht)
|
|
227
238
|
return c.json({ error: "not_found" }, 404);
|
|
239
|
+
cachePublicRead(c);
|
|
228
240
|
return c.json({ data: yacht });
|
|
229
241
|
}
|
|
230
242
|
const row = await chartersService.getYachtById(c.get("db"), parsed.id);
|
|
231
243
|
if (!row)
|
|
232
244
|
return c.json({ error: "not_found" }, 404);
|
|
245
|
+
cachePublicRead(c);
|
|
233
246
|
return c.json({ data: row });
|
|
234
247
|
});
|
package/dist/routes.d.ts
CHANGED
|
@@ -785,6 +785,7 @@ export declare const chartersAdminRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
785
785
|
externalRefs: {
|
|
786
786
|
[x: string]: string;
|
|
787
787
|
} | null;
|
|
788
|
+
maxGuests: number | null;
|
|
788
789
|
images: string[] | null;
|
|
789
790
|
appointmentOnly: boolean;
|
|
790
791
|
lastSyncedAt: string | null;
|
|
@@ -793,7 +794,6 @@ export declare const chartersAdminRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
793
794
|
suiteCategory: "signature" | "standard" | "deluxe" | "suite" | "penthouse" | "owners" | null;
|
|
794
795
|
squareFeet: string | null;
|
|
795
796
|
floorplanImages: string[] | null;
|
|
796
|
-
maxGuests: number | null;
|
|
797
797
|
pricesByCurrency: {
|
|
798
798
|
[x: string]: string;
|
|
799
799
|
};
|
|
@@ -949,6 +949,7 @@ export declare const chartersAdminRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
949
949
|
externalRefs: {
|
|
950
950
|
[x: string]: string;
|
|
951
951
|
} | null;
|
|
952
|
+
maxGuests: number | null;
|
|
952
953
|
images: string[] | null;
|
|
953
954
|
appointmentOnly: boolean;
|
|
954
955
|
lastSyncedAt: string | null;
|
|
@@ -957,7 +958,6 @@ export declare const chartersAdminRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
957
958
|
suiteCategory: "signature" | "standard" | "deluxe" | "suite" | "penthouse" | "owners" | null;
|
|
958
959
|
squareFeet: string | null;
|
|
959
960
|
floorplanImages: string[] | null;
|
|
960
|
-
maxGuests: number | null;
|
|
961
961
|
pricesByCurrency: {
|
|
962
962
|
[x: string]: string;
|
|
963
963
|
};
|
|
@@ -76,6 +76,7 @@ export declare const replaceVoyageSuitesSchema: z.ZodObject<{
|
|
|
76
76
|
limited: "limited";
|
|
77
77
|
}>>;
|
|
78
78
|
externalRefs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
79
|
+
maxGuests: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
79
80
|
images: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
80
81
|
appointmentOnly: z.ZodDefault<z.ZodBoolean>;
|
|
81
82
|
suiteCode: z.ZodString;
|
|
@@ -90,7 +91,6 @@ export declare const replaceVoyageSuitesSchema: z.ZodObject<{
|
|
|
90
91
|
}>>>;
|
|
91
92
|
squareFeet: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
92
93
|
floorplanImages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
93
|
-
maxGuests: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
94
94
|
pricesByCurrency: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
95
95
|
portFeesByCurrency: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
96
96
|
unitsAvailable: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/charters",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.119.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"drizzle-orm": "^0.45.2",
|
|
75
75
|
"hono": "^4.12.10",
|
|
76
76
|
"zod": "^4.3.6",
|
|
77
|
-
"@voyant-travel/bookings": "^0.
|
|
77
|
+
"@voyant-travel/bookings": "^0.121.0",
|
|
78
78
|
"@voyant-travel/charters-contracts": "^0.104.1",
|
|
79
79
|
"@voyant-travel/core": "^0.109.0",
|
|
80
80
|
"@voyant-travel/db": "^0.108.1",
|
|
81
|
-
"@voyant-travel/hono": "^0.
|
|
82
|
-
"@voyant-travel/catalog": "^0.
|
|
81
|
+
"@voyant-travel/hono": "^0.111.0",
|
|
82
|
+
"@voyant-travel/catalog": "^0.119.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"typescript": "^6.0.2",
|