@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.
- package/LICENSE +201 -0
- package/dist/action-ledger-drift.d.ts +29 -0
- package/dist/action-ledger-drift.d.ts.map +1 -0
- package/dist/action-ledger-drift.js +338 -0
- package/dist/action-ledger.d.ts +104 -0
- package/dist/action-ledger.d.ts.map +1 -0
- package/dist/action-ledger.js +100 -0
- package/dist/authoring/builder.d.ts +37 -0
- package/dist/authoring/builder.d.ts.map +1 -0
- package/dist/authoring/builder.js +248 -0
- package/dist/authoring/clone-content.d.ts +38 -0
- package/dist/authoring/clone-content.d.ts.map +1 -0
- package/dist/authoring/clone-content.js +367 -0
- package/dist/authoring/clone-pricing.d.ts +9 -0
- package/dist/authoring/clone-pricing.d.ts.map +1 -0
- package/dist/authoring/clone-pricing.js +242 -0
- package/dist/authoring/clone.d.ts +45 -0
- package/dist/authoring/clone.d.ts.map +1 -0
- package/dist/authoring/clone.js +142 -0
- package/dist/authoring/errors.d.ts +21 -0
- package/dist/authoring/errors.d.ts.map +1 -0
- package/dist/authoring/errors.js +13 -0
- package/dist/authoring/extension.d.ts +248 -0
- package/dist/authoring/extension.d.ts.map +1 -0
- package/dist/authoring/extension.js +116 -0
- package/dist/authoring/index.d.ts +12 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +11 -0
- package/dist/authoring/schema.d.ts +85 -0
- package/dist/authoring/schema.d.ts.map +1 -0
- package/dist/authoring/schema.js +16 -0
- package/dist/authoring/service.d.ts +28 -0
- package/dist/authoring/service.d.ts.map +1 -0
- package/dist/authoring/service.js +66 -0
- package/dist/authoring/spec.d.ts +524 -0
- package/dist/authoring/spec.d.ts.map +1 -0
- package/dist/authoring/spec.js +167 -0
- package/dist/authoring/validate.d.ts +17 -0
- package/dist/authoring/validate.d.ts.map +1 -0
- package/dist/authoring/validate.js +83 -0
- package/dist/authoring.d.ts +2 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +1 -0
- package/dist/booking-engine/handler-support.d.ts +91 -0
- package/dist/booking-engine/handler-support.d.ts.map +1 -0
- package/dist/booking-engine/handler-support.js +355 -0
- package/dist/booking-engine/handler.d.ts +404 -0
- package/dist/booking-engine/handler.d.ts.map +1 -0
- package/dist/booking-engine/handler.js +398 -0
- package/dist/booking-engine/index.d.ts +8 -0
- package/dist/booking-engine/index.d.ts.map +1 -0
- package/dist/booking-engine/index.js +7 -0
- package/dist/booking-engine.d.ts +2 -0
- package/dist/booking-engine.d.ts.map +1 -0
- package/dist/booking-engine.js +1 -0
- package/dist/booking-extension.d.ts +278 -0
- package/dist/booking-extension.d.ts.map +1 -0
- package/dist/booking-extension.js +161 -0
- package/dist/catalog-policy-departures.d.ts +52 -0
- package/dist/catalog-policy-departures.d.ts.map +1 -0
- package/dist/catalog-policy-departures.js +169 -0
- package/dist/catalog-policy-destinations.d.ts +43 -0
- package/dist/catalog-policy-destinations.d.ts.map +1 -0
- package/dist/catalog-policy-destinations.js +165 -0
- package/dist/catalog-policy-pricing.d.ts +55 -0
- package/dist/catalog-policy-pricing.d.ts.map +1 -0
- package/dist/catalog-policy-pricing.js +109 -0
- package/dist/catalog-policy-promotions.d.ts +52 -0
- package/dist/catalog-policy-promotions.d.ts.map +1 -0
- package/dist/catalog-policy-promotions.js +270 -0
- package/dist/catalog-policy-taxonomy.d.ts +51 -0
- package/dist/catalog-policy-taxonomy.d.ts.map +1 -0
- package/dist/catalog-policy-taxonomy.js +191 -0
- package/dist/catalog-policy.d.ts +33 -0
- package/dist/catalog-policy.d.ts.map +1 -0
- package/dist/catalog-policy.js +733 -0
- package/dist/content-shape.d.ts +15 -0
- package/dist/content-shape.d.ts.map +1 -0
- package/dist/content-shape.js +28 -0
- package/dist/draft-shape.d.ts +43 -0
- package/dist/draft-shape.d.ts.map +1 -0
- package/dist/draft-shape.js +48 -0
- package/dist/events.d.ts +37 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +32 -0
- package/dist/extras/catalog-policy.d.ts +30 -0
- package/dist/extras/catalog-policy.d.ts.map +1 -0
- package/dist/extras/catalog-policy.js +319 -0
- package/dist/extras/content-shape.d.ts +5 -0
- package/dist/extras/content-shape.d.ts.map +1 -0
- package/dist/extras/content-shape.js +13 -0
- package/dist/extras/draft-shape.d.ts +34 -0
- package/dist/extras/draft-shape.d.ts.map +1 -0
- package/dist/extras/draft-shape.js +69 -0
- package/dist/extras/routes.d.ts +380 -0
- package/dist/extras/routes.d.ts.map +1 -0
- package/dist/extras/routes.js +59 -0
- package/dist/extras/schema-sourced-content.d.ts +254 -0
- package/dist/extras/schema-sourced-content.d.ts.map +1 -0
- package/dist/extras/schema-sourced-content.js +45 -0
- package/dist/extras/schema.d.ts +628 -0
- package/dist/extras/schema.d.ts.map +1 -0
- package/dist/extras/schema.js +87 -0
- package/dist/extras/service-catalog-plane.d.ts +77 -0
- package/dist/extras/service-catalog-plane.d.ts.map +1 -0
- package/dist/extras/service-catalog-plane.js +219 -0
- package/dist/extras/service-content-synthesizer.d.ts +41 -0
- package/dist/extras/service-content-synthesizer.d.ts.map +1 -0
- package/dist/extras/service-content-synthesizer.js +138 -0
- package/dist/extras/service-content.d.ts +48 -0
- package/dist/extras/service-content.d.ts.map +1 -0
- package/dist/extras/service-content.js +253 -0
- package/dist/extras/service.d.ts +185 -0
- package/dist/extras/service.d.ts.map +1 -0
- package/dist/extras/service.js +96 -0
- package/dist/extras/validation.d.ts +437 -0
- package/dist/extras/validation.d.ts.map +1 -0
- package/dist/extras/validation.js +149 -0
- package/dist/extras.d.ts +267 -0
- package/dist/extras.d.ts.map +1 -0
- package/dist/extras.js +19 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/interface.d.ts +5869 -0
- package/dist/interface.d.ts.map +1 -0
- package/dist/interface.js +54 -0
- package/dist/public-routes.d.ts +2 -0
- package/dist/public-routes.d.ts.map +1 -0
- package/dist/public-routes.js +1 -0
- package/dist/public-validation.d.ts +2 -0
- package/dist/public-validation.d.ts.map +1 -0
- package/dist/public-validation.js +1 -0
- package/dist/read-model.d.ts +25 -0
- package/dist/read-model.d.ts.map +1 -0
- package/dist/read-model.js +99 -0
- package/dist/route-env.d.ts +22 -0
- package/dist/route-env.d.ts.map +1 -0
- package/dist/route-env.js +1 -0
- package/dist/routes-associations.d.ts +164 -0
- package/dist/routes-associations.d.ts.map +1 -0
- package/dist/routes-associations.js +100 -0
- package/dist/routes-catalog.d.ts +436 -0
- package/dist/routes-catalog.d.ts.map +1 -0
- package/dist/routes-catalog.js +104 -0
- package/dist/routes-configuration.d.ts +773 -0
- package/dist/routes-configuration.d.ts.map +1 -0
- package/dist/routes-configuration.js +364 -0
- package/dist/routes-content.d.ts +74 -0
- package/dist/routes-content.d.ts.map +1 -0
- package/dist/routes-content.js +117 -0
- package/dist/routes-core.d.ts +331 -0
- package/dist/routes-core.d.ts.map +1 -0
- package/dist/routes-core.js +95 -0
- package/dist/routes-itinerary.d.ts +759 -0
- package/dist/routes-itinerary.d.ts.map +1 -0
- package/dist/routes-itinerary.js +387 -0
- package/dist/routes-maintenance.d.ts +32 -0
- package/dist/routes-maintenance.d.ts.map +1 -0
- package/dist/routes-maintenance.js +14 -0
- package/dist/routes-media.d.ts +634 -0
- package/dist/routes-media.d.ts.map +1 -0
- package/dist/routes-media.js +245 -0
- package/dist/routes-merchandising.d.ts +1120 -0
- package/dist/routes-merchandising.d.ts.map +1 -0
- package/dist/routes-merchandising.js +377 -0
- package/dist/routes-options.d.ts +363 -0
- package/dist/routes-options.d.ts.map +1 -0
- package/dist/routes-options.js +173 -0
- package/dist/routes-public.d.ts +776 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +119 -0
- package/dist/routes-translations.d.ts +489 -0
- package/dist/routes-translations.d.ts.map +1 -0
- package/dist/routes-translations.js +258 -0
- package/dist/routes.d.ts +5097 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +64 -0
- package/dist/schema-core.d.ts +1238 -0
- package/dist/schema-core.d.ts.map +1 -0
- package/dist/schema-core.js +157 -0
- package/dist/schema-itinerary.d.ts +1169 -0
- package/dist/schema-itinerary.d.ts.map +1 -0
- package/dist/schema-itinerary.js +130 -0
- package/dist/schema-relations.d.ts +117 -0
- package/dist/schema-relations.d.ts.map +1 -0
- package/dist/schema-relations.js +192 -0
- package/dist/schema-settings.d.ts +1800 -0
- package/dist/schema-settings.d.ts.map +1 -0
- package/dist/schema-settings.js +220 -0
- package/dist/schema-shared.d.ts +15 -0
- package/dist/schema-shared.d.ts.map +1 -0
- package/dist/schema-shared.js +91 -0
- package/dist/schema-sourced-content.d.ts +262 -0
- package/dist/schema-sourced-content.d.ts.map +1 -0
- package/dist/schema-sourced-content.js +69 -0
- package/dist/schema-taxonomy.d.ts +1363 -0
- package/dist/schema-taxonomy.d.ts.map +1 -0
- package/dist/schema-taxonomy.js +203 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +9 -0
- package/dist/service-aggregates.d.ts +29 -0
- package/dist/service-aggregates.d.ts.map +1 -0
- package/dist/service-aggregates.js +56 -0
- package/dist/service-catalog-plane-destinations.d.ts +30 -0
- package/dist/service-catalog-plane-destinations.d.ts.map +1 -0
- package/dist/service-catalog-plane-destinations.js +143 -0
- package/dist/service-catalog-plane-taxonomy.d.ts +73 -0
- package/dist/service-catalog-plane-taxonomy.d.ts.map +1 -0
- package/dist/service-catalog-plane-taxonomy.js +242 -0
- package/dist/service-catalog-plane.d.ts +179 -0
- package/dist/service-catalog-plane.d.ts.map +1 -0
- package/dist/service-catalog-plane.js +431 -0
- package/dist/service-catalog.d.ts +251 -0
- package/dist/service-catalog.d.ts.map +1 -0
- package/dist/service-catalog.js +517 -0
- package/dist/service-configuration.d.ts +261 -0
- package/dist/service-configuration.d.ts.map +1 -0
- package/dist/service-configuration.js +343 -0
- package/dist/service-content-owned.d.ts +68 -0
- package/dist/service-content-owned.d.ts.map +1 -0
- package/dist/service-content-owned.js +329 -0
- package/dist/service-content-synthesizer.d.ts +90 -0
- package/dist/service-content-synthesizer.d.ts.map +1 -0
- package/dist/service-content-synthesizer.js +178 -0
- package/dist/service-content.d.ts +106 -0
- package/dist/service-content.d.ts.map +1 -0
- package/dist/service-content.js +388 -0
- package/dist/service-core.d.ts +194 -0
- package/dist/service-core.d.ts.map +1 -0
- package/dist/service-core.js +213 -0
- package/dist/service-delivery-formats.d.ts +58 -0
- package/dist/service-delivery-formats.d.ts.map +1 -0
- package/dist/service-delivery-formats.js +107 -0
- package/dist/service-destinations.d.ts +223 -0
- package/dist/service-destinations.d.ts.map +1 -0
- package/dist/service-destinations.js +310 -0
- package/dist/service-itinerary-history.d.ts +457 -0
- package/dist/service-itinerary-history.d.ts.map +1 -0
- package/dist/service-itinerary-history.js +135 -0
- package/dist/service-itinerary.d.ts +1149 -0
- package/dist/service-itinerary.d.ts.map +1 -0
- package/dist/service-itinerary.js +419 -0
- package/dist/service-media.d.ts +272 -0
- package/dist/service-media.d.ts.map +1 -0
- package/dist/service-media.js +320 -0
- package/dist/service-merchandising.d.ts +184 -0
- package/dist/service-merchandising.d.ts.map +1 -0
- package/dist/service-merchandising.js +181 -0
- package/dist/service-option-translations.d.ts +268 -0
- package/dist/service-option-translations.d.ts.map +1 -0
- package/dist/service-option-translations.js +300 -0
- package/dist/service-options.d.ts +181 -0
- package/dist/service-options.d.ts.map +1 -0
- package/dist/service-options.js +179 -0
- package/dist/service-product-destinations.d.ts +37 -0
- package/dist/service-product-destinations.d.ts.map +1 -0
- package/dist/service-product-destinations.js +94 -0
- package/dist/service-public.d.ts +664 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +374 -0
- package/dist/service-taxonomy.d.ts +197 -0
- package/dist/service-taxonomy.d.ts.map +1 -0
- package/dist/service-taxonomy.js +221 -0
- package/dist/service.d.ts +3929 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +28 -0
- package/dist/tasks/brochure-printers.d.ts +31 -0
- package/dist/tasks/brochure-printers.d.ts.map +1 -0
- package/dist/tasks/brochure-printers.js +149 -0
- package/dist/tasks/brochure-templates.d.ts +36 -0
- package/dist/tasks/brochure-templates.d.ts.map +1 -0
- package/dist/tasks/brochure-templates.js +110 -0
- package/dist/tasks/brochures.d.ts +43 -0
- package/dist/tasks/brochures.d.ts.map +1 -0
- package/dist/tasks/brochures.js +72 -0
- package/dist/tasks/generate-pdf.d.ts +8 -0
- package/dist/tasks/generate-pdf.d.ts.map +1 -0
- package/dist/tasks/generate-pdf.js +106 -0
- package/dist/tasks/index.d.ts +5 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +4 -0
- package/dist/tasks/pdf-text.d.ts +2 -0
- package/dist/tasks/pdf-text.d.ts.map +1 -0
- package/dist/tasks/pdf-text.js +40 -0
- package/dist/tasks.d.ts +2 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +1 -0
- package/dist/validation-catalog.d.ts +2 -0
- package/dist/validation-catalog.d.ts.map +1 -0
- package/dist/validation-catalog.js +3 -0
- package/dist/validation-config.d.ts +2 -0
- package/dist/validation-config.d.ts.map +1 -0
- package/dist/validation-config.js +3 -0
- package/dist/validation-content.d.ts +2 -0
- package/dist/validation-content.d.ts.map +1 -0
- package/dist/validation-content.js +3 -0
- package/dist/validation-core.d.ts +2 -0
- package/dist/validation-core.d.ts.map +1 -0
- package/dist/validation-core.js +3 -0
- package/dist/validation-public.d.ts +2 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +3 -0
- package/dist/validation-shared.d.ts +2 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +3 -0
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +3 -0
- 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
|
+
});
|