@voyant-travel/cruises 0.119.1 → 0.119.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/dist/routes-public.d.ts.map +1 -1
- package/dist/routes-public.js +11 -0
- package/package.json +3 -3
|
@@ -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;AAajE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;KACvB,CAAA;CACF,CAAA;AAwFD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAoL3B,CAAA;AAEJ,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA"}
|
package/dist/routes-public.js
CHANGED
|
@@ -7,6 +7,10 @@ import { cruisesService } from "./service.js";
|
|
|
7
7
|
import { composeQuote, pricingService } from "./service-pricing.js";
|
|
8
8
|
import { cruisesSearchService } from "./service-search.js";
|
|
9
9
|
import { searchIndexQuerySchema } from "./validation-search.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 TYPEID_RE = /^[a-z]+_[0-9a-zA-Z]+$/;
|
|
11
15
|
function isTypeId(s) {
|
|
12
16
|
return TYPEID_RE.test(s);
|
|
@@ -81,6 +85,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
81
85
|
.get("/", async (c) => {
|
|
82
86
|
const query = parseQuery(c, searchIndexQuerySchema);
|
|
83
87
|
const result = await cruisesSearchService.query(c.get("db"), query);
|
|
88
|
+
cachePublicRead(c);
|
|
84
89
|
return c.json(result);
|
|
85
90
|
})
|
|
86
91
|
.get("/:slug", async (c) => {
|
|
@@ -95,6 +100,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
95
100
|
});
|
|
96
101
|
if (!detail)
|
|
97
102
|
return c.json({ error: "not_found" }, 404);
|
|
103
|
+
cachePublicRead(c);
|
|
98
104
|
return c.json({
|
|
99
105
|
data: {
|
|
100
106
|
source: "local",
|
|
@@ -122,6 +128,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
122
128
|
if (!cruise)
|
|
123
129
|
return c.json({ error: "not_found" }, 404);
|
|
124
130
|
const sailings = await adapter.listSailingsForCruise(adapterRef);
|
|
131
|
+
cachePublicRead(c);
|
|
125
132
|
return c.json({
|
|
126
133
|
data: {
|
|
127
134
|
source: "external",
|
|
@@ -144,6 +151,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
144
151
|
});
|
|
145
152
|
if (!sailing)
|
|
146
153
|
return c.json({ error: "not_found" }, 404);
|
|
154
|
+
cachePublicRead(c);
|
|
147
155
|
return c.json({ data: { source: "local", sailing } });
|
|
148
156
|
}
|
|
149
157
|
const parsed = resolveExternalKey(key);
|
|
@@ -159,6 +167,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
159
167
|
adapter.fetchSailingPricing(parsed.sourceRef),
|
|
160
168
|
adapter.fetchSailingItinerary(parsed.sourceRef),
|
|
161
169
|
]);
|
|
170
|
+
cachePublicRead(c);
|
|
162
171
|
return c.json({
|
|
163
172
|
data: { source: "external", sourceProvider: adapter.name, sailing, pricing, itinerary },
|
|
164
173
|
});
|
|
@@ -237,6 +246,7 @@ export const cruisePublicRoutes = new Hono()
|
|
|
237
246
|
cruisesService.listShipDecks(c.get("db"), key),
|
|
238
247
|
cruisesService.listShipCabinCategories(c.get("db"), key),
|
|
239
248
|
]);
|
|
249
|
+
cachePublicRead(c);
|
|
240
250
|
return c.json({ data: { ...ship, decks, categories } });
|
|
241
251
|
}
|
|
242
252
|
const parsed = resolveExternalKey(key);
|
|
@@ -248,5 +258,6 @@ export const cruisePublicRoutes = new Hono()
|
|
|
248
258
|
const ship = await adapter.fetchShip(parsed.sourceRef);
|
|
249
259
|
if (!ship)
|
|
250
260
|
return c.json({ error: "not_found" }, 404);
|
|
261
|
+
cachePublicRead(c);
|
|
251
262
|
return c.json({ data: ship });
|
|
252
263
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/cruises",
|
|
3
|
-
"version": "0.119.
|
|
3
|
+
"version": "0.119.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
"drizzle-orm": "^0.45.2",
|
|
105
105
|
"hono": "^4.12.10",
|
|
106
106
|
"zod": "^4.3.6",
|
|
107
|
-
"@voyant-travel/bookings": "^0.120.
|
|
107
|
+
"@voyant-travel/bookings": "^0.120.2",
|
|
108
108
|
"@voyant-travel/core": "^0.109.0",
|
|
109
109
|
"@voyant-travel/db": "^0.108.1",
|
|
110
|
-
"@voyant-travel/hono": "^0.110.
|
|
110
|
+
"@voyant-travel/hono": "^0.110.3",
|
|
111
111
|
"@voyant-travel/catalog": "^0.118.1",
|
|
112
112
|
"@voyant-travel/cruises-contracts": "^0.105.2"
|
|
113
113
|
},
|