@voyant-travel/cruises 0.136.0 → 0.136.1

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 (43) hide show
  1. package/dist/booking-extension.d.ts +22 -22
  2. package/dist/routes-booking-payloads.d.ts +4 -4
  3. package/dist/routes-core.d.ts +2 -2
  4. package/dist/routes-core.d.ts.map +1 -1
  5. package/dist/routes-core.js +64 -9
  6. package/dist/routes-detail.d.ts +2 -2
  7. package/dist/routes-detail.d.ts.map +1 -1
  8. package/dist/routes-detail.js +220 -69
  9. package/dist/routes-openapi-schemas.d.ts +419 -0
  10. package/dist/routes-openapi-schemas.d.ts.map +1 -0
  11. package/dist/routes-openapi-schemas.js +345 -0
  12. package/dist/routes-public.d.ts +274 -690
  13. package/dist/routes-public.d.ts.map +1 -1
  14. package/dist/routes-public.js +326 -92
  15. package/dist/routes-sailings-prices.d.ts +2 -2
  16. package/dist/routes-sailings-prices.d.ts.map +1 -1
  17. package/dist/routes-sailings-prices.js +278 -77
  18. package/dist/routes-search-index.d.ts +2 -2
  19. package/dist/routes-search-index.d.ts.map +1 -1
  20. package/dist/routes-search-index.js +52 -15
  21. package/dist/routes-ships.d.ts +2 -2
  22. package/dist/routes-ships.d.ts.map +1 -1
  23. package/dist/routes-ships.js +242 -66
  24. package/dist/routes-voyage-groups.d.ts +2 -2
  25. package/dist/routes-voyage-groups.d.ts.map +1 -1
  26. package/dist/routes-voyage-groups.js +182 -51
  27. package/dist/routes.d.ts +2 -2
  28. package/dist/routes.d.ts.map +1 -1
  29. package/dist/routes.js +9 -2
  30. package/dist/schema-cabins.d.ts +3 -3
  31. package/dist/schema-content.d.ts +1 -1
  32. package/dist/schema-core.d.ts +3 -3
  33. package/dist/schema-pricing.d.ts +1 -1
  34. package/dist/service-core.d.ts +3 -3
  35. package/dist/service-prices.d.ts +1 -1
  36. package/dist/service.d.ts +4 -4
  37. package/dist/validation-cabins.d.ts +13 -13
  38. package/dist/validation-content.d.ts +4 -4
  39. package/dist/validation-core.d.ts +10 -10
  40. package/dist/validation-itinerary.d.ts +4 -4
  41. package/dist/validation-pricing.d.ts +3 -3
  42. package/dist/validation-shared.d.ts +6 -6
  43. package/package.json +7 -6
@@ -226,7 +226,7 @@ export declare const bookingCruiseDetails: import("drizzle-orm/pg-core").PgTable
226
226
  tableName: "booking_cruise_details";
227
227
  dataType: "string";
228
228
  columnType: "PgEnumColumn";
229
- data: "reserve" | "inquiry";
229
+ data: "inquiry" | "reserve";
230
230
  driverParam: string;
231
231
  notNull: true;
232
232
  hasDefault: true;
@@ -747,8 +747,8 @@ declare const cruiseDetailUpsertSchema: z.ZodObject<{
747
747
  air_inclusive: "air_inclusive";
748
748
  }>>;
749
749
  mode: z.ZodDefault<z.ZodEnum<{
750
- reserve: "reserve";
751
750
  inquiry: "inquiry";
751
+ reserve: "reserve";
752
752
  }>>;
753
753
  quotedPricePerPerson: z.ZodString;
754
754
  quotedTotalForCabin: z.ZodString;
@@ -828,24 +828,23 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
828
828
  };
829
829
  output: {
830
830
  data: {
831
- source: "local" | "external";
832
- mode: "reserve" | "inquiry";
831
+ mode: "inquiry" | "reserve";
833
832
  createdAt: string;
834
833
  updatedAt: string;
835
834
  notes: string | null;
836
- bookingId: string;
837
835
  sailingId: string | null;
838
836
  cabinCategoryId: string | null;
839
837
  occupancy: number;
840
838
  fareCode: string | null;
841
839
  fareVariant: "cruise_only" | "air_inclusive";
840
+ bookingId: string;
841
+ source: "local" | "external";
842
842
  sourceProvider: string | null;
843
843
  sourceRef: {
844
844
  [x: string]: import("hono/utils/types").JSONValue;
845
845
  connectionId?: string | undefined;
846
846
  externalId: string;
847
847
  } | null;
848
- airArrangement: "none" | "cruise_line" | "independent" | null;
849
848
  cabinId: string | null;
850
849
  sailingDisplayName: string | null;
851
850
  cabinDisplayName: string | null;
@@ -898,6 +897,7 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
898
897
  } | null;
899
898
  connectorBookingRef: string | null;
900
899
  connectorStatus: string | null;
900
+ airArrangement: "none" | "cruise_line" | "independent" | null;
901
901
  linkedFlightBookingId: string | null;
902
902
  };
903
903
  };
@@ -915,24 +915,23 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
915
915
  };
916
916
  output: {
917
917
  data: {
918
- source: "local" | "external";
919
- mode: "reserve" | "inquiry";
918
+ mode: "inquiry" | "reserve";
920
919
  createdAt: string;
921
920
  updatedAt: string;
922
921
  notes: string | null;
923
- bookingId: string;
924
922
  sailingId: string | null;
925
923
  cabinCategoryId: string | null;
926
924
  occupancy: number;
927
925
  fareCode: string | null;
928
926
  fareVariant: "cruise_only" | "air_inclusive";
927
+ bookingId: string;
928
+ source: "local" | "external";
929
929
  sourceProvider: string | null;
930
930
  sourceRef: {
931
931
  [x: string]: import("hono/utils/types").JSONValue;
932
932
  connectionId?: string | undefined;
933
933
  externalId: string;
934
934
  } | null;
935
- airArrangement: "none" | "cruise_line" | "independent" | null;
936
935
  cabinId: string | null;
937
936
  sailingDisplayName: string | null;
938
937
  cabinDisplayName: string | null;
@@ -985,6 +984,7 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
985
984
  } | null;
986
985
  connectorBookingRef: string | null;
987
986
  connectorStatus: string | null;
987
+ airArrangement: "none" | "cruise_line" | "independent" | null;
988
988
  linkedFlightBookingId: string | null;
989
989
  };
990
990
  };
@@ -1000,20 +1000,20 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
1000
1000
  bookingId: string;
1001
1001
  };
1002
1002
  };
1003
- output: null;
1004
- outputFormat: "body";
1005
- status: 204;
1003
+ output: {
1004
+ error: string;
1005
+ };
1006
+ outputFormat: "json";
1007
+ status: 404;
1006
1008
  } | {
1007
1009
  input: {
1008
1010
  param: {
1009
1011
  bookingId: string;
1010
1012
  };
1011
1013
  };
1012
- output: {
1013
- error: string;
1014
- };
1015
- outputFormat: "json";
1016
- status: 404;
1014
+ output: null;
1015
+ outputFormat: "body";
1016
+ status: 204;
1017
1017
  };
1018
1018
  };
1019
1019
  } & {
@@ -1037,12 +1037,12 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
1037
1037
  };
1038
1038
  output: {
1039
1039
  data: {
1040
- source: "local" | "external";
1040
+ cabinCount: number;
1041
1041
  createdAt: string;
1042
1042
  updatedAt: string;
1043
1043
  notes: string | null;
1044
- cabinCount: number;
1045
1044
  sailingId: string | null;
1045
+ source: "local" | "external";
1046
1046
  sourceProvider: string | null;
1047
1047
  sourceRef: {
1048
1048
  [x: string]: import("hono/utils/types").JSONValue;
@@ -1098,12 +1098,12 @@ export declare const cruisesBookingExtensionRoutes: import("hono/hono-base").Hon
1098
1098
  };
1099
1099
  output: {
1100
1100
  data: {
1101
- source: "local" | "external";
1101
+ cabinCount: number;
1102
1102
  createdAt: string;
1103
1103
  updatedAt: string;
1104
1104
  notes: string | null;
1105
- cabinCount: number;
1106
1105
  sailingId: string | null;
1106
+ source: "local" | "external";
1107
1107
  sourceProvider: string | null;
1108
1108
  sourceRef: {
1109
1109
  [x: string]: import("hono/utils/types").JSONValue;
@@ -19,8 +19,8 @@ export declare const createBookingPayloadSchema: z.ZodObject<{
19
19
  air_inclusive: "air_inclusive";
20
20
  }>>>;
21
21
  mode: z.ZodOptional<z.ZodEnum<{
22
- reserve: "reserve";
23
22
  inquiry: "inquiry";
23
+ reserve: "reserve";
24
24
  }>>;
25
25
  personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
26
26
  organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -42,9 +42,9 @@ export declare const createBookingPayloadSchema: z.ZodObject<{
42
42
  email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
43
43
  phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
44
44
  travelerCategory: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
45
- child: "child";
46
45
  other: "other";
47
46
  adult: "adult";
47
+ child: "child";
48
48
  infant: "infant";
49
49
  senior: "senior";
50
50
  }>>>;
@@ -73,9 +73,9 @@ export declare const createPartyBookingPayloadSchema: z.ZodObject<{
73
73
  email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
74
74
  phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
75
75
  travelerCategory: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
76
- child: "child";
77
76
  other: "other";
78
77
  adult: "adult";
78
+ child: "child";
79
79
  infant: "infant";
80
80
  senior: "senior";
81
81
  }>>>;
@@ -102,8 +102,8 @@ export declare const createPartyBookingPayloadSchema: z.ZodObject<{
102
102
  postalCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
103
103
  }, z.core.$strip>;
104
104
  mode: z.ZodOptional<z.ZodEnum<{
105
- reserve: "reserve";
106
105
  inquiry: "inquiry";
106
+ reserve: "reserve";
107
107
  }>>;
108
108
  label: z.ZodOptional<z.ZodString>;
109
109
  notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -1,4 +1,4 @@
1
- import type { Hono } from "hono";
1
+ import { type OpenAPIHono } from "@hono/zod-openapi";
2
2
  import type { CruiseRoutesEnv as Env } from "./routes-env.js";
3
- export declare function registerCruiseCoreRoutes(app: Hono<Env>): void;
3
+ export declare function registerCruiseCoreRoutes(app: OpenAPIHono<Env>): void;
4
4
  //# sourceMappingURL=routes-core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes-core.d.ts","sourceRoot":"","sources":["../src/routes-core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAIhC,OAAO,KAAK,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAK7D,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAwEtD"}
1
+ {"version":3,"file":"routes-core.d.ts","sourceRoot":"","sources":["../src/routes-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAIpE,OAAO,KAAK,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAgE7D,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,QA0E7D"}
@@ -1,13 +1,67 @@
1
- import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
1
+ import { createRoute, z } from "@hono/zod-openapi";
2
2
  import { listCruiseAdapters } from "./adapters/registry.js";
3
3
  import { makeExternalKey } from "./routes-keying.js";
4
+ import { cruiseRowSchema, dataEnvelope } from "./routes-openapi-schemas.js";
4
5
  import { cruisesService } from "./service.js";
5
6
  import { cruiseListQuerySchema, insertCruiseSchema } from "./validation-core.js";
7
+ /**
8
+ * A single unified list item. `cruise` is the local DB row (for `source:
9
+ * "local"`) or a provider-defined adapter entry (for `source: "external"`), so
10
+ * it is documented as an opaque pass-through (bounded effort per voyant#2114).
11
+ */
12
+ const cruiseListItemSchema = z.object({
13
+ source: z.string(),
14
+ sourceProvider: z.string().nullable(),
15
+ sourceRef: z.unknown().nullable(),
16
+ key: z.string(),
17
+ cruise: z.unknown(),
18
+ });
19
+ /**
20
+ * The unified cruise-list envelope. NOT the canonical `listResponseSchema`:
21
+ * the handler fans out to every registered adapter and reports adapter counts
22
+ * and per-adapter errors alongside the merged local + external rows.
23
+ */
24
+ const cruiseListResponseSchema = z.object({
25
+ data: z.array(cruiseListItemSchema),
26
+ total: z.number().int(),
27
+ localTotal: z.number().int(),
28
+ adapterCount: z.number().int(),
29
+ adapterErrors: z.array(z.object({ adapter: z.string(), error: z.string() })),
30
+ limit: z.number().int(),
31
+ offset: z.number().int(),
32
+ });
33
+ const listCruisesRoute = createRoute({
34
+ method: "get",
35
+ path: "/",
36
+ request: { query: cruiseListQuerySchema },
37
+ responses: {
38
+ 200: {
39
+ description: "Local cruises merged with every registered adapter's entries",
40
+ content: { "application/json": { schema: cruiseListResponseSchema } },
41
+ },
42
+ },
43
+ });
44
+ const createCruiseRoute = createRoute({
45
+ method: "post",
46
+ path: "/",
47
+ request: {
48
+ body: { required: true, content: { "application/json": { schema: insertCruiseSchema } } },
49
+ },
50
+ responses: {
51
+ 201: {
52
+ description: "The created cruise",
53
+ content: { "application/json": { schema: dataEnvelope(cruiseRowSchema) } },
54
+ },
55
+ 400: {
56
+ description: "invalid_request: request body failed validation",
57
+ content: { "application/json": { schema: z.object({ error: z.string() }) } },
58
+ },
59
+ },
60
+ });
6
61
  export function registerCruiseCoreRoutes(app) {
7
- app
8
- // --- list / unified detail ---
9
- .get("/", async (c) => {
10
- const query = parseQuery(c, cruiseListQuerySchema);
62
+ // --- list (local + fan-out to every registered adapter) ---
63
+ app.openapi(listCruisesRoute, async (c) => {
64
+ const query = c.req.valid("query");
11
65
  const local = await cruisesService.listCruises(c.get("db"), query);
12
66
  const localItems = local.data.map((c) => ({
13
67
  source: "local",
@@ -56,10 +110,11 @@ export function registerCruiseCoreRoutes(app) {
56
110
  adapterErrors,
57
111
  limit: local.limit,
58
112
  offset: local.offset,
59
- });
60
- })
61
- .post("/", async (c) => {
62
- const data = await parseJsonBody(c, insertCruiseSchema);
113
+ }, 200);
114
+ });
115
+ // --- create ---
116
+ app.openapi(createCruiseRoute, async (c) => {
117
+ const data = c.req.valid("json");
63
118
  const row = await cruisesService.createCruise(c.get("db"), data, {
64
119
  eventBus: c.get("eventBus"),
65
120
  });
@@ -1,4 +1,4 @@
1
- import type { Hono } from "hono";
1
+ import { type OpenAPIHono } from "@hono/zod-openapi";
2
2
  import type { CruiseRoutesEnv as Env } from "./routes-env.js";
3
- export declare function registerCruiseDetailRoutes(app: Hono<Env>): void;
3
+ export declare function registerCruiseDetailRoutes(app: OpenAPIHono<Env>): void;
4
4
  //# sourceMappingURL=routes-detail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes-detail.d.ts","sourceRoot":"","sources":["../src/routes-detail.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAGhC,OAAO,KAAK,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAoB7D,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QA2PxD"}
1
+ {"version":3,"file":"routes-detail.d.ts","sourceRoot":"","sources":["../src/routes-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAGpE,OAAO,KAAK,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAuN7D,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,QAqP/D"}