@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 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sour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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAagB,CAAA;AAC/D,eAAO,MAAM,yBAAyB,6CAA2B,CAAA;AAEjE,MAAM,MAAM,yBAAyB,GACjC,mBAAmB,GACnB,iBAAiB,GACjB,4BAA4B,GAC5B,6BAA6B,GAC7B,+BAA+B,CAAA;AAEnC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,WAAW,CAAA;IACnB,oBAAoB,EAAE,UAAU,CAAA;IAChC,iBAAiB,EAAE,SAAS,yBAAyB,EAAE,CAAA;IACvD,uBAAuB,EAAE,SAAS;QAChC,YAAY;QACZ,QAAQ;QACR,SAAS;QACT,UAAU;QACV,mBAAmB;KACpB,CAAA;CACF;AAED,eAAO,MAAM,4BAA4B,EAAE,4BAW1C,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { productsBookingExtension } from "./booking-extension.js";
|
|
2
|
+
import { productRoutes } from "./routes.js";
|
|
3
|
+
import { publicProductRoutes } from "./routes-public.js";
|
|
4
|
+
export const inventoryProductLinkable = {
|
|
5
|
+
module: "inventory",
|
|
6
|
+
entity: "product",
|
|
7
|
+
table: "products",
|
|
8
|
+
idPrefix: "prod",
|
|
9
|
+
};
|
|
10
|
+
export const inventoryModule = {
|
|
11
|
+
name: "inventory",
|
|
12
|
+
linkable: {
|
|
13
|
+
product: inventoryProductLinkable,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export const inventoryProductCompatibilityLinkable = {
|
|
17
|
+
module: "products",
|
|
18
|
+
entity: "product",
|
|
19
|
+
table: "products",
|
|
20
|
+
idPrefix: "prod",
|
|
21
|
+
};
|
|
22
|
+
const productsCompatibilityModule = {
|
|
23
|
+
name: "products",
|
|
24
|
+
linkable: {
|
|
25
|
+
product: inventoryProductCompatibilityLinkable,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Compatibility Hono module for the Inventory-owned Product runtime.
|
|
30
|
+
*
|
|
31
|
+
* Routes intentionally keep the existing `products` mount name so deployed
|
|
32
|
+
* `/v1/admin/products` and `/v1/public/products` clients do not break.
|
|
33
|
+
*/
|
|
34
|
+
export const inventoryHonoModule = {
|
|
35
|
+
module: productsCompatibilityModule,
|
|
36
|
+
adminRoutes: productRoutes,
|
|
37
|
+
publicRoutes: publicProductRoutes,
|
|
38
|
+
routes: productRoutes,
|
|
39
|
+
};
|
|
40
|
+
export const inventoryProductRoutes = productRoutes;
|
|
41
|
+
export const publicInventoryProductRoutes = publicProductRoutes;
|
|
42
|
+
export const inventoryBookingExtension = productsBookingExtension;
|
|
43
|
+
export const inventoryInterfaceDescriptor = {
|
|
44
|
+
module: "inventory",
|
|
45
|
+
operatedEntityModule: "products",
|
|
46
|
+
authoringSurfaces: [
|
|
47
|
+
"product-structure",
|
|
48
|
+
"product-version",
|
|
49
|
+
"product-internal-component",
|
|
50
|
+
"owned-publication-lifecycle",
|
|
51
|
+
"operated-extras-configuration",
|
|
52
|
+
],
|
|
53
|
+
catalogResponsibilities: ["projection", "search", "overlay", "snapshot", "source-governance"],
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-routes.d.ts","sourceRoot":"","sources":["../src/public-routes.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./routes-public.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-validation.d.ts","sourceRoot":"","sources":["../src/public-validation.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./validation-public.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { KVStore } from "@voyant-travel/utils/cache";
|
|
2
|
+
export declare function productDocKey(productId: string, variant: string): string;
|
|
3
|
+
export declare function productSlugMapKey(slug: string): string;
|
|
4
|
+
/** Stable variant id from the detail query (currently just the locale). */
|
|
5
|
+
export declare function productDocVariant(query: {
|
|
6
|
+
languageTag?: string | null;
|
|
7
|
+
}): string;
|
|
8
|
+
/**
|
|
9
|
+
* Read-through document fetch. `null` compute results (missing/inactive
|
|
10
|
+
* product) are never cached — a 404 must not mask a product that
|
|
11
|
+
* activates a second later. Cache failures degrade to the live path.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readThroughProductDoc<T>(kv: KVStore | undefined, key: string, compute: () => Promise<T | null>): Promise<{
|
|
14
|
+
data: T | null;
|
|
15
|
+
fromReadModel: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
/** Resolve a slug to a product id through the KV mapping. */
|
|
18
|
+
export declare function readThroughSlugMapping(kv: KVStore | undefined, slug: string, resolve: () => Promise<string | null>): Promise<string | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Drop every cached document variant for a product. Uses KV `list` by
|
|
21
|
+
* prefix (optional on the KVStore contract — silently a no-op without
|
|
22
|
+
* it, where the TTL becomes the only freshness bound).
|
|
23
|
+
*/
|
|
24
|
+
export declare function invalidateProductReadModel(kv: KVStore, productId: string): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=read-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-model.d.ts","sourceRoot":"","sources":["../src/read-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AA2BzD,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,CAEhF;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,EAAE,EAAE,OAAO,GAAG,SAAS,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAC/B,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,CAkBrD;AAED,6DAA6D;AAC7D,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,OAAO,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9F"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KV-backed read model for the public product detail surface (RFC
|
|
3
|
+
* voyant#1687 Phase 2.2 — the "document plane"; browse/search is the
|
|
4
|
+
* Typesense "query plane" and already serves cards without Postgres).
|
|
5
|
+
*
|
|
6
|
+
* Model: read-through with exact invalidation. The first read of a
|
|
7
|
+
* (product, variant) materializes the render-ready document into KV;
|
|
8
|
+
* repeat reads cost one KV get and ZERO Postgres queries. Admin
|
|
9
|
+
* mutations to a product delete its documents (see
|
|
10
|
+
* `productsReadModelInvalidation` in routes.ts), and a generous TTL
|
|
11
|
+
* bounds staleness for anything invalidation misses.
|
|
12
|
+
*
|
|
13
|
+
* Slug lookups resolve through a short-lived slug→id mapping so the
|
|
14
|
+
* id-keyed document is shared between `/:id` and `/slug/:slug`. The
|
|
15
|
+
* mapping is deliberately NOT invalidated on mutation: it's cheap to
|
|
16
|
+
* refill, and its short TTL bounds the only affected case (a renamed
|
|
17
|
+
* slug serving the old document) to a few minutes.
|
|
18
|
+
*/
|
|
19
|
+
const RM_PREFIX = "rm:v1:product";
|
|
20
|
+
/** Product documents live long — exact invalidation keeps them fresh. */
|
|
21
|
+
const PRODUCT_DOC_TTL_SECONDS = 24 * 60 * 60;
|
|
22
|
+
/** Slug→id mappings are refill-cheap; the TTL bounds rename staleness. */
|
|
23
|
+
const SLUG_MAP_TTL_SECONDS = 5 * 60;
|
|
24
|
+
export function productDocKey(productId, variant) {
|
|
25
|
+
return `${RM_PREFIX}:${productId}:${variant}`;
|
|
26
|
+
}
|
|
27
|
+
export function productSlugMapKey(slug) {
|
|
28
|
+
return `rm:v1:product-slug:${slug}`;
|
|
29
|
+
}
|
|
30
|
+
/** Stable variant id from the detail query (currently just the locale). */
|
|
31
|
+
export function productDocVariant(query) {
|
|
32
|
+
return query.languageTag ? `lang=${query.languageTag}` : "default";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read-through document fetch. `null` compute results (missing/inactive
|
|
36
|
+
* product) are never cached — a 404 must not mask a product that
|
|
37
|
+
* activates a second later. Cache failures degrade to the live path.
|
|
38
|
+
*/
|
|
39
|
+
export async function readThroughProductDoc(kv, key, compute) {
|
|
40
|
+
if (kv) {
|
|
41
|
+
try {
|
|
42
|
+
const hit = await kv.get(key, { type: "json" });
|
|
43
|
+
if (hit !== null && hit !== undefined)
|
|
44
|
+
return { data: hit, fromReadModel: true };
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// fall through to live compute
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const data = await compute();
|
|
51
|
+
if (data !== null && kv) {
|
|
52
|
+
try {
|
|
53
|
+
await kv.put(key, JSON.stringify(data), { expirationTtl: PRODUCT_DOC_TTL_SECONDS });
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// best-effort materialization
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { data, fromReadModel: false };
|
|
60
|
+
}
|
|
61
|
+
/** Resolve a slug to a product id through the KV mapping. */
|
|
62
|
+
export async function readThroughSlugMapping(kv, slug, resolve) {
|
|
63
|
+
if (kv) {
|
|
64
|
+
try {
|
|
65
|
+
const hit = await kv.get(productSlugMapKey(slug), { type: "text" });
|
|
66
|
+
if (hit)
|
|
67
|
+
return hit;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// fall through
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const id = await resolve();
|
|
74
|
+
if (id && kv) {
|
|
75
|
+
try {
|
|
76
|
+
await kv.put(productSlugMapKey(slug), id, { expirationTtl: SLUG_MAP_TTL_SECONDS });
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// best-effort
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return id;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Drop every cached document variant for a product. Uses KV `list` by
|
|
86
|
+
* prefix (optional on the KVStore contract — silently a no-op without
|
|
87
|
+
* it, where the TTL becomes the only freshness bound).
|
|
88
|
+
*/
|
|
89
|
+
export async function invalidateProductReadModel(kv, productId) {
|
|
90
|
+
if (!kv.list)
|
|
91
|
+
return;
|
|
92
|
+
try {
|
|
93
|
+
const { keys } = await kv.list({ prefix: `${RM_PREFIX}:${productId}:` });
|
|
94
|
+
await Promise.all(keys.map((key) => kv.delete(key.name)));
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// best-effort — the document TTL bounds staleness if this fails
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EventBus } from "@voyant-travel/core";
|
|
2
|
+
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
3
|
+
export type Env = {
|
|
4
|
+
Variables: {
|
|
5
|
+
db: PostgresJsDatabase;
|
|
6
|
+
userId?: string;
|
|
7
|
+
agentId?: string;
|
|
8
|
+
workflowPrincipalId?: string;
|
|
9
|
+
principalSubtype?: string;
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
apiTokenId?: string;
|
|
12
|
+
apiKeyId?: string;
|
|
13
|
+
callerType?: string;
|
|
14
|
+
actor?: string;
|
|
15
|
+
isInternalRequest?: boolean;
|
|
16
|
+
organizationId?: string;
|
|
17
|
+
workflowRunId?: string;
|
|
18
|
+
workflowStepId?: string;
|
|
19
|
+
eventBus?: EventBus;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=route-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-env.d.ts","sourceRoot":"","sources":["../src/route-env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,MAAM,MAAM,GAAG,GAAG;IAChB,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,EAAE,QAAQ,CAAA;KACpB,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Env } from "./route-env.js";
|
|
2
|
+
export declare const productAssociationRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
3
|
+
"/:id/categories": {
|
|
4
|
+
$get: {
|
|
5
|
+
input: {
|
|
6
|
+
param: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
output: {
|
|
11
|
+
data: {
|
|
12
|
+
id: string;
|
|
13
|
+
parentId: string | null;
|
|
14
|
+
name: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
description: string | null;
|
|
17
|
+
sortOrder: number;
|
|
18
|
+
active: boolean;
|
|
19
|
+
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
20
|
+
metadata: {
|
|
21
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
22
|
+
} | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
outputFormat: "json";
|
|
28
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
} & {
|
|
32
|
+
"/:id/categories": {
|
|
33
|
+
$post: {
|
|
34
|
+
input: {
|
|
35
|
+
param: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
output: {
|
|
40
|
+
error: string;
|
|
41
|
+
};
|
|
42
|
+
outputFormat: "json";
|
|
43
|
+
status: 409;
|
|
44
|
+
} | {
|
|
45
|
+
input: {
|
|
46
|
+
param: {
|
|
47
|
+
id: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
output: {
|
|
51
|
+
success: true;
|
|
52
|
+
};
|
|
53
|
+
outputFormat: "json";
|
|
54
|
+
status: 201;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
} & {
|
|
58
|
+
"/:id/categories/:categoryId": {
|
|
59
|
+
$delete: {
|
|
60
|
+
input: {
|
|
61
|
+
param: {
|
|
62
|
+
id: string;
|
|
63
|
+
} & {
|
|
64
|
+
categoryId: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
output: {
|
|
68
|
+
error: string;
|
|
69
|
+
};
|
|
70
|
+
outputFormat: "json";
|
|
71
|
+
status: 404;
|
|
72
|
+
} | {
|
|
73
|
+
input: {
|
|
74
|
+
param: {
|
|
75
|
+
id: string;
|
|
76
|
+
} & {
|
|
77
|
+
categoryId: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
output: {
|
|
81
|
+
success: true;
|
|
82
|
+
};
|
|
83
|
+
outputFormat: "json";
|
|
84
|
+
status: 200;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
} & {
|
|
88
|
+
"/:id/tags": {
|
|
89
|
+
$get: {
|
|
90
|
+
input: {
|
|
91
|
+
param: {
|
|
92
|
+
id: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
output: {
|
|
96
|
+
data: {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
createdAt: string;
|
|
100
|
+
updatedAt: string;
|
|
101
|
+
}[];
|
|
102
|
+
};
|
|
103
|
+
outputFormat: "json";
|
|
104
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
} & {
|
|
108
|
+
"/:id/tags": {
|
|
109
|
+
$post: {
|
|
110
|
+
input: {
|
|
111
|
+
param: {
|
|
112
|
+
id: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
output: {
|
|
116
|
+
error: string;
|
|
117
|
+
};
|
|
118
|
+
outputFormat: "json";
|
|
119
|
+
status: 409;
|
|
120
|
+
} | {
|
|
121
|
+
input: {
|
|
122
|
+
param: {
|
|
123
|
+
id: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
output: {
|
|
127
|
+
success: true;
|
|
128
|
+
};
|
|
129
|
+
outputFormat: "json";
|
|
130
|
+
status: 201;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
} & {
|
|
134
|
+
"/:id/tags/:tagId": {
|
|
135
|
+
$delete: {
|
|
136
|
+
input: {
|
|
137
|
+
param: {
|
|
138
|
+
id: string;
|
|
139
|
+
} & {
|
|
140
|
+
tagId: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
output: {
|
|
144
|
+
error: string;
|
|
145
|
+
};
|
|
146
|
+
outputFormat: "json";
|
|
147
|
+
status: 404;
|
|
148
|
+
} | {
|
|
149
|
+
input: {
|
|
150
|
+
param: {
|
|
151
|
+
id: string;
|
|
152
|
+
} & {
|
|
153
|
+
tagId: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
output: {
|
|
157
|
+
success: true;
|
|
158
|
+
};
|
|
159
|
+
outputFormat: "json";
|
|
160
|
+
status: 200;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}, "/", "/:id/tags/:tagId">;
|
|
164
|
+
//# sourceMappingURL=routes-associations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-associations.d.ts","sourceRoot":"","sources":["../src/routes-associations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAGzC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAmHjC,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { parseJsonBody } from "@voyant-travel/hono";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { appendProductMutationLedgerEntry, changedMutationFields } from "./action-ledger.js";
|
|
5
|
+
import { emitProductContentChanged } from "./events.js";
|
|
6
|
+
import { productsService } from "./service.js";
|
|
7
|
+
export const productAssociationRoutes = new Hono()
|
|
8
|
+
// ==========================================================================
|
|
9
|
+
// Product <-> Category associations
|
|
10
|
+
// ==========================================================================
|
|
11
|
+
.get("/:id/categories", async (c) => {
|
|
12
|
+
return c.json({
|
|
13
|
+
data: await productsService.listProductCategories_(c.get("db"), c.req.param("id")),
|
|
14
|
+
});
|
|
15
|
+
})
|
|
16
|
+
.post("/:id/categories", async (c) => {
|
|
17
|
+
const productId = c.req.param("id");
|
|
18
|
+
const body = await parseJsonBody(c, z.object({
|
|
19
|
+
categoryId: z.string(),
|
|
20
|
+
sortOrder: z.number().optional(),
|
|
21
|
+
}));
|
|
22
|
+
const { categoryId, sortOrder } = body;
|
|
23
|
+
const row = await productsService.addProductToCategory(c.get("db"), productId, categoryId, sortOrder);
|
|
24
|
+
if (!row) {
|
|
25
|
+
return c.json({ error: "Already assigned or not found" }, 409);
|
|
26
|
+
}
|
|
27
|
+
await appendProductMutationLedgerEntry(c, {
|
|
28
|
+
action: "create",
|
|
29
|
+
productId,
|
|
30
|
+
changedFields: changedMutationFields(body, null, row),
|
|
31
|
+
subject: "product category link",
|
|
32
|
+
actionName: "product.category_link.create",
|
|
33
|
+
routeOrToolName: "products.category_link.create",
|
|
34
|
+
});
|
|
35
|
+
await emitProductContentChanged(c.get("eventBus"), { id: productId, axis: "category" });
|
|
36
|
+
return c.json({ success: true }, 201);
|
|
37
|
+
})
|
|
38
|
+
.delete("/:id/categories/:categoryId", async (c) => {
|
|
39
|
+
const productId = c.req.param("id");
|
|
40
|
+
const row = await productsService.removeProductFromCategory(c.get("db"), productId, c.req.param("categoryId"));
|
|
41
|
+
if (!row) {
|
|
42
|
+
return c.json({ error: "Association not found" }, 404);
|
|
43
|
+
}
|
|
44
|
+
await appendProductMutationLedgerEntry(c, {
|
|
45
|
+
action: "delete",
|
|
46
|
+
productId,
|
|
47
|
+
changedFields: [],
|
|
48
|
+
subject: "product category link",
|
|
49
|
+
actionName: "product.category_link.delete",
|
|
50
|
+
routeOrToolName: "products.category_link.delete",
|
|
51
|
+
});
|
|
52
|
+
await emitProductContentChanged(c.get("eventBus"), { id: productId, axis: "category" });
|
|
53
|
+
return c.json({ success: true }, 200);
|
|
54
|
+
})
|
|
55
|
+
// ==========================================================================
|
|
56
|
+
// Product <-> Tag associations
|
|
57
|
+
// ==========================================================================
|
|
58
|
+
.get("/:id/tags", async (c) => {
|
|
59
|
+
return c.json({
|
|
60
|
+
data: await productsService.listProductTags_(c.get("db"), c.req.param("id")),
|
|
61
|
+
});
|
|
62
|
+
})
|
|
63
|
+
.post("/:id/tags", async (c) => {
|
|
64
|
+
const productId = c.req.param("id");
|
|
65
|
+
const body = await parseJsonBody(c, z.object({
|
|
66
|
+
tagId: z.string(),
|
|
67
|
+
}));
|
|
68
|
+
const { tagId } = body;
|
|
69
|
+
const row = await productsService.addProductTag(c.get("db"), productId, tagId);
|
|
70
|
+
if (!row) {
|
|
71
|
+
return c.json({ error: "Already assigned or not found" }, 409);
|
|
72
|
+
}
|
|
73
|
+
await appendProductMutationLedgerEntry(c, {
|
|
74
|
+
action: "create",
|
|
75
|
+
productId,
|
|
76
|
+
changedFields: changedMutationFields(body, null, row),
|
|
77
|
+
subject: "product tag link",
|
|
78
|
+
actionName: "product.tag_link.create",
|
|
79
|
+
routeOrToolName: "products.tag_link.create",
|
|
80
|
+
});
|
|
81
|
+
await emitProductContentChanged(c.get("eventBus"), { id: productId, axis: "tag" });
|
|
82
|
+
return c.json({ success: true }, 201);
|
|
83
|
+
})
|
|
84
|
+
.delete("/:id/tags/:tagId", async (c) => {
|
|
85
|
+
const productId = c.req.param("id");
|
|
86
|
+
const row = await productsService.removeProductTag(c.get("db"), productId, c.req.param("tagId"));
|
|
87
|
+
if (!row) {
|
|
88
|
+
return c.json({ error: "Association not found" }, 404);
|
|
89
|
+
}
|
|
90
|
+
await appendProductMutationLedgerEntry(c, {
|
|
91
|
+
action: "delete",
|
|
92
|
+
productId,
|
|
93
|
+
changedFields: [],
|
|
94
|
+
subject: "product tag link",
|
|
95
|
+
actionName: "product.tag_link.delete",
|
|
96
|
+
routeOrToolName: "products.tag_link.delete",
|
|
97
|
+
});
|
|
98
|
+
await emitProductContentChanged(c.get("eventBus"), { id: productId, axis: "tag" });
|
|
99
|
+
return c.json({ success: true }, 200);
|
|
100
|
+
});
|