@voyant-travel/inventory 0.1.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 (311) hide show
  1. package/LICENSE +201 -0
  2. package/dist/action-ledger-drift.d.ts +29 -0
  3. package/dist/action-ledger-drift.d.ts.map +1 -0
  4. package/dist/action-ledger-drift.js +338 -0
  5. package/dist/action-ledger.d.ts +104 -0
  6. package/dist/action-ledger.d.ts.map +1 -0
  7. package/dist/action-ledger.js +100 -0
  8. package/dist/authoring/builder.d.ts +37 -0
  9. package/dist/authoring/builder.d.ts.map +1 -0
  10. package/dist/authoring/builder.js +248 -0
  11. package/dist/authoring/clone-content.d.ts +38 -0
  12. package/dist/authoring/clone-content.d.ts.map +1 -0
  13. package/dist/authoring/clone-content.js +367 -0
  14. package/dist/authoring/clone-pricing.d.ts +9 -0
  15. package/dist/authoring/clone-pricing.d.ts.map +1 -0
  16. package/dist/authoring/clone-pricing.js +242 -0
  17. package/dist/authoring/clone.d.ts +45 -0
  18. package/dist/authoring/clone.d.ts.map +1 -0
  19. package/dist/authoring/clone.js +142 -0
  20. package/dist/authoring/errors.d.ts +21 -0
  21. package/dist/authoring/errors.d.ts.map +1 -0
  22. package/dist/authoring/errors.js +13 -0
  23. package/dist/authoring/extension.d.ts +248 -0
  24. package/dist/authoring/extension.d.ts.map +1 -0
  25. package/dist/authoring/extension.js +116 -0
  26. package/dist/authoring/index.d.ts +12 -0
  27. package/dist/authoring/index.d.ts.map +1 -0
  28. package/dist/authoring/index.js +11 -0
  29. package/dist/authoring/schema.d.ts +85 -0
  30. package/dist/authoring/schema.d.ts.map +1 -0
  31. package/dist/authoring/schema.js +16 -0
  32. package/dist/authoring/service.d.ts +28 -0
  33. package/dist/authoring/service.d.ts.map +1 -0
  34. package/dist/authoring/service.js +66 -0
  35. package/dist/authoring/spec.d.ts +524 -0
  36. package/dist/authoring/spec.d.ts.map +1 -0
  37. package/dist/authoring/spec.js +167 -0
  38. package/dist/authoring/validate.d.ts +17 -0
  39. package/dist/authoring/validate.d.ts.map +1 -0
  40. package/dist/authoring/validate.js +83 -0
  41. package/dist/authoring.d.ts +2 -0
  42. package/dist/authoring.d.ts.map +1 -0
  43. package/dist/authoring.js +1 -0
  44. package/dist/booking-engine/handler-support.d.ts +91 -0
  45. package/dist/booking-engine/handler-support.d.ts.map +1 -0
  46. package/dist/booking-engine/handler-support.js +355 -0
  47. package/dist/booking-engine/handler.d.ts +404 -0
  48. package/dist/booking-engine/handler.d.ts.map +1 -0
  49. package/dist/booking-engine/handler.js +398 -0
  50. package/dist/booking-engine/index.d.ts +8 -0
  51. package/dist/booking-engine/index.d.ts.map +1 -0
  52. package/dist/booking-engine/index.js +7 -0
  53. package/dist/booking-engine.d.ts +2 -0
  54. package/dist/booking-engine.d.ts.map +1 -0
  55. package/dist/booking-engine.js +1 -0
  56. package/dist/booking-extension.d.ts +278 -0
  57. package/dist/booking-extension.d.ts.map +1 -0
  58. package/dist/booking-extension.js +161 -0
  59. package/dist/catalog-policy-departures.d.ts +52 -0
  60. package/dist/catalog-policy-departures.d.ts.map +1 -0
  61. package/dist/catalog-policy-departures.js +169 -0
  62. package/dist/catalog-policy-destinations.d.ts +43 -0
  63. package/dist/catalog-policy-destinations.d.ts.map +1 -0
  64. package/dist/catalog-policy-destinations.js +165 -0
  65. package/dist/catalog-policy-pricing.d.ts +55 -0
  66. package/dist/catalog-policy-pricing.d.ts.map +1 -0
  67. package/dist/catalog-policy-pricing.js +109 -0
  68. package/dist/catalog-policy-promotions.d.ts +52 -0
  69. package/dist/catalog-policy-promotions.d.ts.map +1 -0
  70. package/dist/catalog-policy-promotions.js +270 -0
  71. package/dist/catalog-policy-taxonomy.d.ts +51 -0
  72. package/dist/catalog-policy-taxonomy.d.ts.map +1 -0
  73. package/dist/catalog-policy-taxonomy.js +191 -0
  74. package/dist/catalog-policy.d.ts +33 -0
  75. package/dist/catalog-policy.d.ts.map +1 -0
  76. package/dist/catalog-policy.js +733 -0
  77. package/dist/content-shape.d.ts +15 -0
  78. package/dist/content-shape.d.ts.map +1 -0
  79. package/dist/content-shape.js +28 -0
  80. package/dist/draft-shape.d.ts +43 -0
  81. package/dist/draft-shape.d.ts.map +1 -0
  82. package/dist/draft-shape.js +48 -0
  83. package/dist/events.d.ts +37 -0
  84. package/dist/events.d.ts.map +1 -0
  85. package/dist/events.js +32 -0
  86. package/dist/extras/catalog-policy.d.ts +30 -0
  87. package/dist/extras/catalog-policy.d.ts.map +1 -0
  88. package/dist/extras/catalog-policy.js +319 -0
  89. package/dist/extras/content-shape.d.ts +5 -0
  90. package/dist/extras/content-shape.d.ts.map +1 -0
  91. package/dist/extras/content-shape.js +13 -0
  92. package/dist/extras/draft-shape.d.ts +34 -0
  93. package/dist/extras/draft-shape.d.ts.map +1 -0
  94. package/dist/extras/draft-shape.js +69 -0
  95. package/dist/extras/routes.d.ts +380 -0
  96. package/dist/extras/routes.d.ts.map +1 -0
  97. package/dist/extras/routes.js +59 -0
  98. package/dist/extras/schema-sourced-content.d.ts +254 -0
  99. package/dist/extras/schema-sourced-content.d.ts.map +1 -0
  100. package/dist/extras/schema-sourced-content.js +45 -0
  101. package/dist/extras/schema.d.ts +628 -0
  102. package/dist/extras/schema.d.ts.map +1 -0
  103. package/dist/extras/schema.js +87 -0
  104. package/dist/extras/service-catalog-plane.d.ts +77 -0
  105. package/dist/extras/service-catalog-plane.d.ts.map +1 -0
  106. package/dist/extras/service-catalog-plane.js +219 -0
  107. package/dist/extras/service-content-synthesizer.d.ts +41 -0
  108. package/dist/extras/service-content-synthesizer.d.ts.map +1 -0
  109. package/dist/extras/service-content-synthesizer.js +138 -0
  110. package/dist/extras/service-content.d.ts +48 -0
  111. package/dist/extras/service-content.d.ts.map +1 -0
  112. package/dist/extras/service-content.js +253 -0
  113. package/dist/extras/service.d.ts +185 -0
  114. package/dist/extras/service.d.ts.map +1 -0
  115. package/dist/extras/service.js +96 -0
  116. package/dist/extras/validation.d.ts +437 -0
  117. package/dist/extras/validation.d.ts.map +1 -0
  118. package/dist/extras/validation.js +149 -0
  119. package/dist/extras.d.ts +267 -0
  120. package/dist/extras.d.ts.map +1 -0
  121. package/dist/extras.js +19 -0
  122. package/dist/index.d.ts +22 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +32 -0
  125. package/dist/interface.d.ts +5869 -0
  126. package/dist/interface.d.ts.map +1 -0
  127. package/dist/interface.js +54 -0
  128. package/dist/public-routes.d.ts +2 -0
  129. package/dist/public-routes.d.ts.map +1 -0
  130. package/dist/public-routes.js +1 -0
  131. package/dist/public-validation.d.ts +2 -0
  132. package/dist/public-validation.d.ts.map +1 -0
  133. package/dist/public-validation.js +1 -0
  134. package/dist/read-model.d.ts +25 -0
  135. package/dist/read-model.d.ts.map +1 -0
  136. package/dist/read-model.js +99 -0
  137. package/dist/route-env.d.ts +22 -0
  138. package/dist/route-env.d.ts.map +1 -0
  139. package/dist/route-env.js +1 -0
  140. package/dist/routes-associations.d.ts +164 -0
  141. package/dist/routes-associations.d.ts.map +1 -0
  142. package/dist/routes-associations.js +100 -0
  143. package/dist/routes-catalog.d.ts +436 -0
  144. package/dist/routes-catalog.d.ts.map +1 -0
  145. package/dist/routes-catalog.js +104 -0
  146. package/dist/routes-configuration.d.ts +773 -0
  147. package/dist/routes-configuration.d.ts.map +1 -0
  148. package/dist/routes-configuration.js +364 -0
  149. package/dist/routes-content.d.ts +74 -0
  150. package/dist/routes-content.d.ts.map +1 -0
  151. package/dist/routes-content.js +117 -0
  152. package/dist/routes-core.d.ts +331 -0
  153. package/dist/routes-core.d.ts.map +1 -0
  154. package/dist/routes-core.js +95 -0
  155. package/dist/routes-itinerary.d.ts +759 -0
  156. package/dist/routes-itinerary.d.ts.map +1 -0
  157. package/dist/routes-itinerary.js +387 -0
  158. package/dist/routes-maintenance.d.ts +32 -0
  159. package/dist/routes-maintenance.d.ts.map +1 -0
  160. package/dist/routes-maintenance.js +14 -0
  161. package/dist/routes-media.d.ts +634 -0
  162. package/dist/routes-media.d.ts.map +1 -0
  163. package/dist/routes-media.js +245 -0
  164. package/dist/routes-merchandising.d.ts +1120 -0
  165. package/dist/routes-merchandising.d.ts.map +1 -0
  166. package/dist/routes-merchandising.js +377 -0
  167. package/dist/routes-options.d.ts +363 -0
  168. package/dist/routes-options.d.ts.map +1 -0
  169. package/dist/routes-options.js +173 -0
  170. package/dist/routes-public.d.ts +776 -0
  171. package/dist/routes-public.d.ts.map +1 -0
  172. package/dist/routes-public.js +119 -0
  173. package/dist/routes-translations.d.ts +489 -0
  174. package/dist/routes-translations.d.ts.map +1 -0
  175. package/dist/routes-translations.js +258 -0
  176. package/dist/routes.d.ts +5097 -0
  177. package/dist/routes.d.ts.map +1 -0
  178. package/dist/routes.js +64 -0
  179. package/dist/schema-core.d.ts +1238 -0
  180. package/dist/schema-core.d.ts.map +1 -0
  181. package/dist/schema-core.js +157 -0
  182. package/dist/schema-itinerary.d.ts +1169 -0
  183. package/dist/schema-itinerary.d.ts.map +1 -0
  184. package/dist/schema-itinerary.js +130 -0
  185. package/dist/schema-relations.d.ts +117 -0
  186. package/dist/schema-relations.d.ts.map +1 -0
  187. package/dist/schema-relations.js +192 -0
  188. package/dist/schema-settings.d.ts +1800 -0
  189. package/dist/schema-settings.d.ts.map +1 -0
  190. package/dist/schema-settings.js +220 -0
  191. package/dist/schema-shared.d.ts +15 -0
  192. package/dist/schema-shared.d.ts.map +1 -0
  193. package/dist/schema-shared.js +91 -0
  194. package/dist/schema-sourced-content.d.ts +262 -0
  195. package/dist/schema-sourced-content.d.ts.map +1 -0
  196. package/dist/schema-sourced-content.js +69 -0
  197. package/dist/schema-taxonomy.d.ts +1363 -0
  198. package/dist/schema-taxonomy.d.ts.map +1 -0
  199. package/dist/schema-taxonomy.js +203 -0
  200. package/dist/schema.d.ts +10 -0
  201. package/dist/schema.d.ts.map +1 -0
  202. package/dist/schema.js +9 -0
  203. package/dist/service-aggregates.d.ts +29 -0
  204. package/dist/service-aggregates.d.ts.map +1 -0
  205. package/dist/service-aggregates.js +56 -0
  206. package/dist/service-catalog-plane-destinations.d.ts +30 -0
  207. package/dist/service-catalog-plane-destinations.d.ts.map +1 -0
  208. package/dist/service-catalog-plane-destinations.js +143 -0
  209. package/dist/service-catalog-plane-taxonomy.d.ts +73 -0
  210. package/dist/service-catalog-plane-taxonomy.d.ts.map +1 -0
  211. package/dist/service-catalog-plane-taxonomy.js +242 -0
  212. package/dist/service-catalog-plane.d.ts +179 -0
  213. package/dist/service-catalog-plane.d.ts.map +1 -0
  214. package/dist/service-catalog-plane.js +431 -0
  215. package/dist/service-catalog.d.ts +251 -0
  216. package/dist/service-catalog.d.ts.map +1 -0
  217. package/dist/service-catalog.js +517 -0
  218. package/dist/service-configuration.d.ts +261 -0
  219. package/dist/service-configuration.d.ts.map +1 -0
  220. package/dist/service-configuration.js +343 -0
  221. package/dist/service-content-owned.d.ts +68 -0
  222. package/dist/service-content-owned.d.ts.map +1 -0
  223. package/dist/service-content-owned.js +329 -0
  224. package/dist/service-content-synthesizer.d.ts +90 -0
  225. package/dist/service-content-synthesizer.d.ts.map +1 -0
  226. package/dist/service-content-synthesizer.js +178 -0
  227. package/dist/service-content.d.ts +106 -0
  228. package/dist/service-content.d.ts.map +1 -0
  229. package/dist/service-content.js +388 -0
  230. package/dist/service-core.d.ts +194 -0
  231. package/dist/service-core.d.ts.map +1 -0
  232. package/dist/service-core.js +213 -0
  233. package/dist/service-delivery-formats.d.ts +58 -0
  234. package/dist/service-delivery-formats.d.ts.map +1 -0
  235. package/dist/service-delivery-formats.js +107 -0
  236. package/dist/service-destinations.d.ts +223 -0
  237. package/dist/service-destinations.d.ts.map +1 -0
  238. package/dist/service-destinations.js +310 -0
  239. package/dist/service-itinerary-history.d.ts +457 -0
  240. package/dist/service-itinerary-history.d.ts.map +1 -0
  241. package/dist/service-itinerary-history.js +135 -0
  242. package/dist/service-itinerary.d.ts +1149 -0
  243. package/dist/service-itinerary.d.ts.map +1 -0
  244. package/dist/service-itinerary.js +419 -0
  245. package/dist/service-media.d.ts +272 -0
  246. package/dist/service-media.d.ts.map +1 -0
  247. package/dist/service-media.js +320 -0
  248. package/dist/service-merchandising.d.ts +184 -0
  249. package/dist/service-merchandising.d.ts.map +1 -0
  250. package/dist/service-merchandising.js +181 -0
  251. package/dist/service-option-translations.d.ts +268 -0
  252. package/dist/service-option-translations.d.ts.map +1 -0
  253. package/dist/service-option-translations.js +300 -0
  254. package/dist/service-options.d.ts +181 -0
  255. package/dist/service-options.d.ts.map +1 -0
  256. package/dist/service-options.js +179 -0
  257. package/dist/service-product-destinations.d.ts +37 -0
  258. package/dist/service-product-destinations.d.ts.map +1 -0
  259. package/dist/service-product-destinations.js +94 -0
  260. package/dist/service-public.d.ts +664 -0
  261. package/dist/service-public.d.ts.map +1 -0
  262. package/dist/service-public.js +374 -0
  263. package/dist/service-taxonomy.d.ts +197 -0
  264. package/dist/service-taxonomy.d.ts.map +1 -0
  265. package/dist/service-taxonomy.js +221 -0
  266. package/dist/service.d.ts +3929 -0
  267. package/dist/service.d.ts.map +1 -0
  268. package/dist/service.js +28 -0
  269. package/dist/tasks/brochure-printers.d.ts +31 -0
  270. package/dist/tasks/brochure-printers.d.ts.map +1 -0
  271. package/dist/tasks/brochure-printers.js +149 -0
  272. package/dist/tasks/brochure-templates.d.ts +36 -0
  273. package/dist/tasks/brochure-templates.d.ts.map +1 -0
  274. package/dist/tasks/brochure-templates.js +110 -0
  275. package/dist/tasks/brochures.d.ts +43 -0
  276. package/dist/tasks/brochures.d.ts.map +1 -0
  277. package/dist/tasks/brochures.js +72 -0
  278. package/dist/tasks/generate-pdf.d.ts +8 -0
  279. package/dist/tasks/generate-pdf.d.ts.map +1 -0
  280. package/dist/tasks/generate-pdf.js +106 -0
  281. package/dist/tasks/index.d.ts +5 -0
  282. package/dist/tasks/index.d.ts.map +1 -0
  283. package/dist/tasks/index.js +4 -0
  284. package/dist/tasks/pdf-text.d.ts +2 -0
  285. package/dist/tasks/pdf-text.d.ts.map +1 -0
  286. package/dist/tasks/pdf-text.js +40 -0
  287. package/dist/tasks.d.ts +2 -0
  288. package/dist/tasks.d.ts.map +1 -0
  289. package/dist/tasks.js +1 -0
  290. package/dist/validation-catalog.d.ts +2 -0
  291. package/dist/validation-catalog.d.ts.map +1 -0
  292. package/dist/validation-catalog.js +3 -0
  293. package/dist/validation-config.d.ts +2 -0
  294. package/dist/validation-config.d.ts.map +1 -0
  295. package/dist/validation-config.js +3 -0
  296. package/dist/validation-content.d.ts +2 -0
  297. package/dist/validation-content.d.ts.map +1 -0
  298. package/dist/validation-content.js +3 -0
  299. package/dist/validation-core.d.ts +2 -0
  300. package/dist/validation-core.d.ts.map +1 -0
  301. package/dist/validation-core.js +3 -0
  302. package/dist/validation-public.d.ts +2 -0
  303. package/dist/validation-public.d.ts.map +1 -0
  304. package/dist/validation-public.js +3 -0
  305. package/dist/validation-shared.d.ts +2 -0
  306. package/dist/validation-shared.d.ts.map +1 -0
  307. package/dist/validation-shared.js +3 -0
  308. package/dist/validation.d.ts +2 -0
  309. package/dist/validation.d.ts.map +1 -0
  310. package/dist/validation.js +3 -0
  311. package/package.json +204 -0
@@ -0,0 +1,331 @@
1
+ import type { Env } from "./route-env.js";
2
+ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
3
+ "/aggregates": {
4
+ $get: {
5
+ input: {};
6
+ output: {
7
+ data: {
8
+ total: number;
9
+ countsByStatus: {
10
+ status: "draft" | "active" | "archived";
11
+ count: number;
12
+ }[];
13
+ active: number;
14
+ publicActive: number;
15
+ monthlyCreatedCounts: {
16
+ yearMonth: string;
17
+ count: number;
18
+ }[];
19
+ };
20
+ };
21
+ outputFormat: "json";
22
+ status: import("hono/utils/http-status").ContentfulStatusCode;
23
+ };
24
+ };
25
+ } & {
26
+ "/": {
27
+ $get: {
28
+ input: {};
29
+ output: {
30
+ data: {
31
+ id: string;
32
+ name: string;
33
+ status: "draft" | "active" | "archived";
34
+ description: string | null;
35
+ inclusionsHtml: string | null;
36
+ exclusionsHtml: string | null;
37
+ termsHtml: string | null;
38
+ termsShowOnContract: boolean;
39
+ bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary" | "other";
40
+ capacityMode: "free_sale" | "limited" | "on_request";
41
+ timezone: string | null;
42
+ defaultLanguageTag: string | null;
43
+ visibility: "public" | "private" | "hidden";
44
+ activated: boolean;
45
+ reservationTimeoutMinutes: number | null;
46
+ sellCurrency: string;
47
+ sellAmountCents: number | null;
48
+ costAmountCents: number | null;
49
+ marginPercent: number | null;
50
+ facilityId: string | null;
51
+ supplierId: string | null;
52
+ startDate: string | null;
53
+ endDate: string | null;
54
+ pax: number | null;
55
+ productTypeId: string | null;
56
+ contractTemplateId: string | null;
57
+ taxClassId: string | null;
58
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
59
+ tags: string[] | null;
60
+ createdAt: string;
61
+ updatedAt: string;
62
+ }[];
63
+ total: number;
64
+ limit: number;
65
+ offset: number;
66
+ };
67
+ outputFormat: "json";
68
+ status: import("hono/utils/http-status").ContentfulStatusCode;
69
+ };
70
+ };
71
+ } & {
72
+ "/": {
73
+ $post: {
74
+ input: {};
75
+ output: {
76
+ data: {
77
+ id: string;
78
+ name: string;
79
+ status: "draft" | "active" | "archived";
80
+ description: string | null;
81
+ inclusionsHtml: string | null;
82
+ exclusionsHtml: string | null;
83
+ termsHtml: string | null;
84
+ termsShowOnContract: boolean;
85
+ bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary" | "other";
86
+ capacityMode: "free_sale" | "limited" | "on_request";
87
+ timezone: string | null;
88
+ defaultLanguageTag: string | null;
89
+ visibility: "public" | "private" | "hidden";
90
+ activated: boolean;
91
+ reservationTimeoutMinutes: number | null;
92
+ sellCurrency: string;
93
+ sellAmountCents: number | null;
94
+ costAmountCents: number | null;
95
+ marginPercent: number | null;
96
+ facilityId: string | null;
97
+ supplierId: string | null;
98
+ startDate: string | null;
99
+ endDate: string | null;
100
+ pax: number | null;
101
+ productTypeId: string | null;
102
+ contractTemplateId: string | null;
103
+ taxClassId: string | null;
104
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
105
+ tags: string[] | null;
106
+ createdAt: string;
107
+ updatedAt: string;
108
+ };
109
+ };
110
+ outputFormat: "json";
111
+ status: 201;
112
+ };
113
+ };
114
+ } & {
115
+ "/:id": {
116
+ $get: {
117
+ input: {
118
+ param: {
119
+ id: string;
120
+ };
121
+ };
122
+ output: {
123
+ error: string;
124
+ };
125
+ outputFormat: "json";
126
+ status: 404;
127
+ } | {
128
+ input: {
129
+ param: {
130
+ id: string;
131
+ };
132
+ };
133
+ output: {
134
+ data: {
135
+ productType: {
136
+ id: string;
137
+ name: string;
138
+ code: string;
139
+ } | null;
140
+ id: string;
141
+ name: string;
142
+ status: "draft" | "active" | "archived";
143
+ description: string | null;
144
+ inclusionsHtml: string | null;
145
+ exclusionsHtml: string | null;
146
+ termsHtml: string | null;
147
+ termsShowOnContract: boolean;
148
+ bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary" | "other";
149
+ capacityMode: "free_sale" | "limited" | "on_request";
150
+ timezone: string | null;
151
+ defaultLanguageTag: string | null;
152
+ visibility: "public" | "private" | "hidden";
153
+ activated: boolean;
154
+ reservationTimeoutMinutes: number | null;
155
+ sellCurrency: string;
156
+ sellAmountCents: number | null;
157
+ costAmountCents: number | null;
158
+ marginPercent: number | null;
159
+ facilityId: string | null;
160
+ supplierId: string | null;
161
+ startDate: string | null;
162
+ endDate: string | null;
163
+ pax: number | null;
164
+ productTypeId: string | null;
165
+ contractTemplateId: string | null;
166
+ taxClassId: string | null;
167
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
168
+ tags: string[] | null;
169
+ createdAt: string;
170
+ updatedAt: string;
171
+ };
172
+ };
173
+ outputFormat: "json";
174
+ status: import("hono/utils/http-status").ContentfulStatusCode;
175
+ };
176
+ };
177
+ } & {
178
+ "/:id/action-ledger": {
179
+ $get: {
180
+ input: {
181
+ param: {
182
+ id: string;
183
+ };
184
+ };
185
+ output: {
186
+ error: string;
187
+ };
188
+ outputFormat: "json";
189
+ status: 404;
190
+ } | {
191
+ input: {
192
+ param: {
193
+ id: string;
194
+ };
195
+ };
196
+ output: {
197
+ data: {
198
+ principalSubtype: string | null;
199
+ sessionId: string | null;
200
+ apiTokenId: string | null;
201
+ callerType: string | null;
202
+ organizationId: string | null;
203
+ workflowRunId: string | null;
204
+ workflowStepId: string | null;
205
+ id: string;
206
+ status: "requested" | "awaiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "reversed" | "compensated" | "expired" | "cancelled" | "superseded";
207
+ actionName: string;
208
+ actionVersion: string;
209
+ actionKind: "create" | "update" | "delete" | "duplicate" | "read" | "execute" | "approve" | "reject" | "reverse" | "compensate";
210
+ evaluatedRisk: "low" | "medium" | "high" | "critical";
211
+ actorType: string | null;
212
+ principalType: "user" | "api_key" | "agent" | "workflow" | "system";
213
+ principalId: string;
214
+ internalRequest: boolean;
215
+ delegatedByPrincipalType: "user" | "api_key" | "agent" | "workflow" | "system" | null;
216
+ delegatedByPrincipalId: string | null;
217
+ delegationId: string | null;
218
+ routeOrToolName: string | null;
219
+ correlationId: string | null;
220
+ causationActionId: string | null;
221
+ idempotencyScope: string | null;
222
+ idempotencyKey: string | null;
223
+ idempotencyFingerprint: string | null;
224
+ targetType: string;
225
+ targetId: string;
226
+ capabilityId: string | null;
227
+ capabilityVersion: string | null;
228
+ authorizationSource: string | null;
229
+ approvalId: string | null;
230
+ amendsActionId: string | null;
231
+ occurredAt: string;
232
+ createdAt: string;
233
+ mutationSummary: string | null;
234
+ }[];
235
+ pageInfo: {
236
+ nextCursor: {
237
+ occurredAt: string;
238
+ id: string;
239
+ } | null;
240
+ };
241
+ };
242
+ outputFormat: "json";
243
+ status: import("hono/utils/http-status").ContentfulStatusCode;
244
+ };
245
+ };
246
+ } & {
247
+ "/:id": {
248
+ $patch: {
249
+ input: {
250
+ param: {
251
+ id: string;
252
+ };
253
+ };
254
+ output: {
255
+ error: string;
256
+ };
257
+ outputFormat: "json";
258
+ status: 404;
259
+ } | {
260
+ input: {
261
+ param: {
262
+ id: string;
263
+ };
264
+ };
265
+ output: {
266
+ data: {
267
+ id: string;
268
+ name: string;
269
+ status: "draft" | "active" | "archived";
270
+ description: string | null;
271
+ inclusionsHtml: string | null;
272
+ exclusionsHtml: string | null;
273
+ termsHtml: string | null;
274
+ termsShowOnContract: boolean;
275
+ bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary" | "other";
276
+ capacityMode: "free_sale" | "limited" | "on_request";
277
+ timezone: string | null;
278
+ defaultLanguageTag: string | null;
279
+ visibility: "public" | "private" | "hidden";
280
+ activated: boolean;
281
+ reservationTimeoutMinutes: number | null;
282
+ sellCurrency: string;
283
+ sellAmountCents: number | null;
284
+ costAmountCents: number | null;
285
+ marginPercent: number | null;
286
+ facilityId: string | null;
287
+ supplierId: string | null;
288
+ startDate: string | null;
289
+ endDate: string | null;
290
+ pax: number | null;
291
+ productTypeId: string | null;
292
+ contractTemplateId: string | null;
293
+ taxClassId: string | null;
294
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
295
+ tags: string[] | null;
296
+ createdAt: string;
297
+ updatedAt: string;
298
+ };
299
+ };
300
+ outputFormat: "json";
301
+ status: import("hono/utils/http-status").ContentfulStatusCode;
302
+ };
303
+ };
304
+ } & {
305
+ "/:id": {
306
+ $delete: {
307
+ input: {
308
+ param: {
309
+ id: string;
310
+ };
311
+ };
312
+ output: {
313
+ error: string;
314
+ };
315
+ outputFormat: "json";
316
+ status: 404;
317
+ } | {
318
+ input: {
319
+ param: {
320
+ id: string;
321
+ };
322
+ };
323
+ output: {
324
+ success: true;
325
+ };
326
+ outputFormat: "json";
327
+ status: 200;
328
+ };
329
+ };
330
+ }, "/", "/:id">;
331
+ //# sourceMappingURL=routes-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-core.d.ts","sourceRoot":"","sources":["../src/routes-core.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAiBzC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6F1B,CAAA"}
@@ -0,0 +1,95 @@
1
+ import { aggregateSnapshotKey, readThroughAggregateSnapshot, } from "@voyant-travel/db/aggregate-snapshots";
2
+ import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
3
+ import { Hono } from "hono";
4
+ import { appendProductMutationLedgerEntry, changedProductFields, listProductActionLedger, } from "./action-ledger.js";
5
+ import { emitProductContentChanged } from "./events.js";
6
+ import { productsService } from "./service.js";
7
+ import * as validation from "./validation.js";
8
+ const DASHBOARD_AGGREGATES_CACHE_CONTROL = "private, max-age=30";
9
+ /** Server-side snapshot TTL — see readThroughAggregateSnapshot (#1629). */
10
+ const DASHBOARD_AGGREGATES_TTL_SECONDS = 60;
11
+ function cacheDashboardAggregates(c) {
12
+ c.header("Cache-Control", DASHBOARD_AGGREGATES_CACHE_CONTROL);
13
+ c.header("Vary", "Authorization", { append: true });
14
+ c.header("Vary", "Cookie", { append: true });
15
+ }
16
+ export const productCoreRoutes = new Hono()
17
+ // GET /aggregates — dashboard KPIs (before /:id so the matcher doesn't
18
+ // swallow it). Served from a read-through TTL snapshot (#1629).
19
+ .get("/aggregates", async (c) => {
20
+ const query = parseQuery(c, validation.productAggregatesQuerySchema);
21
+ cacheDashboardAggregates(c);
22
+ const snapshot = await readThroughAggregateSnapshot(c.get("db"), {
23
+ key: aggregateSnapshotKey("products", "aggregates", query),
24
+ ttlSeconds: DASHBOARD_AGGREGATES_TTL_SECONDS,
25
+ compute: () => productsService.getProductAggregates(c.get("db"), query),
26
+ });
27
+ return c.json({ data: snapshot.data });
28
+ })
29
+ // GET / — List products
30
+ .get("/", async (c) => {
31
+ const query = parseQuery(c, validation.productListQuerySchema);
32
+ return c.json(await productsService.listProducts(c.get("db"), query));
33
+ })
34
+ // POST / — Create product
35
+ .post("/", async (c) => {
36
+ const input = await parseJsonBody(c, validation.insertProductSchema);
37
+ const row = await productsService.createProduct(c.get("db"), input);
38
+ await appendProductMutationLedgerEntry(c, {
39
+ action: "create",
40
+ productId: row.id,
41
+ changedFields: changedProductFields(input, null, row),
42
+ });
43
+ await c.get("eventBus")?.emit("product.created", { id: row.id });
44
+ return c.json({ data: row }, 201);
45
+ })
46
+ // GET /:id — Get single product
47
+ .get("/:id", async (c) => {
48
+ const row = await productsService.getProductByIdWithType(c.get("db"), c.req.param("id"));
49
+ if (!row) {
50
+ return c.json({ error: "Product not found" }, 404);
51
+ }
52
+ return c.json({ data: row });
53
+ })
54
+ // GET /:id/action-ledger — Product-scoped action timeline
55
+ .get("/:id/action-ledger", listProductActionLedger)
56
+ // PATCH /:id — Update product
57
+ .patch("/:id", async (c) => {
58
+ const productId = c.req.param("id");
59
+ const before = await productsService.getProductById(c.get("db"), productId);
60
+ if (!before) {
61
+ return c.json({ error: "Product not found" }, 404);
62
+ }
63
+ const input = await parseJsonBody(c, validation.updateProductSchema);
64
+ const row = await productsService.updateProduct(c.get("db"), productId, input);
65
+ if (!row) {
66
+ return c.json({ error: "Product not found" }, 404);
67
+ }
68
+ await appendProductMutationLedgerEntry(c, {
69
+ action: "update",
70
+ productId: row.id,
71
+ changedFields: changedProductFields(input, before, row),
72
+ });
73
+ await c.get("eventBus")?.emit("product.updated", { id: row.id });
74
+ await emitProductContentChanged(c.get("eventBus"), { id: row.id, axis: "product" });
75
+ return c.json({ data: row });
76
+ })
77
+ // DELETE /:id — Delete product
78
+ .delete("/:id", async (c) => {
79
+ const productId = c.req.param("id");
80
+ const before = await productsService.getProductById(c.get("db"), productId);
81
+ if (!before) {
82
+ return c.json({ error: "Product not found" }, 404);
83
+ }
84
+ const row = await productsService.deleteProduct(c.get("db"), productId);
85
+ if (!row) {
86
+ return c.json({ error: "Product not found" }, 404);
87
+ }
88
+ await appendProductMutationLedgerEntry(c, {
89
+ action: "delete",
90
+ productId: row.id,
91
+ changedFields: [],
92
+ });
93
+ await c.get("eventBus")?.emit("product.deleted", { id: row.id });
94
+ return c.json({ success: true }, 200);
95
+ });