@voyant-travel/inventory 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -10
- package/dist/interface.d.ts +25 -20
- package/dist/interface.d.ts.map +1 -1
- package/dist/interface.js +7 -22
- package/dist/linkables.d.ts +11 -0
- package/dist/linkables.d.ts.map +1 -0
- package/dist/linkables.js +19 -0
- package/dist/public-tags-contract.test.d.ts +2 -0
- package/dist/public-tags-contract.test.d.ts.map +1 -0
- package/dist/public-tags-contract.test.js +11 -0
- package/dist/routes-public.d.ts +29 -17
- package/dist/routes-public.d.ts.map +1 -1
- package/dist/routes-public.js +34 -11
- package/package.json +14 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Module } from "@voyant-travel/core";
|
|
2
2
|
import type { HonoModule } from "@voyant-travel/hono/module";
|
|
3
3
|
export { appendProductMutationLedgerEntry, type ProductLedgerMutationAction, } from "./action-ledger.js";
|
|
4
4
|
export { productsBookingExtension } from "./booking-extension.js";
|
|
5
5
|
export { emitProductContentChanged, PRODUCT_CONTENT_CHANGED_EVENT, type ProductContentChangedEvent, } from "./events.js";
|
|
6
|
+
export { productLinkable } from "./linkables.js";
|
|
6
7
|
export type { ProductRoutes } from "./routes.js";
|
|
7
8
|
export type { PublicProductRoutes } from "./routes-public.js";
|
|
8
9
|
export { publicProductRoutes } from "./routes-public.js";
|
|
9
10
|
export { productsService } from "./service.js";
|
|
10
11
|
export { catalogProductsService } from "./service-catalog.js";
|
|
11
12
|
export { publicProductsService } from "./service-public.js";
|
|
12
|
-
export declare const productLinkable: LinkableDefinition;
|
|
13
13
|
export declare const productsModule: Module;
|
|
14
14
|
export declare const productsHonoModule: HonoModule;
|
|
15
|
-
export { type InventoryAuthoringSurface, type InventoryInterfaceDescriptor, inventoryBookingExtension, inventoryHonoModule, inventoryInterfaceDescriptor, inventoryModule, inventoryProductCompatibilityLinkable, inventoryProductLinkable, inventoryProductRoutes, publicInventoryProductRoutes, } from "./interface.js";
|
|
15
|
+
export { type InventoryAuthoringSurface, type InventoryInterfaceDescriptor, inventoryBookingExtension, inventoryHonoModule, inventoryInterfaceDescriptor, inventoryLinkable, inventoryModule, inventoryProductCompatibilityLinkable, inventoryProductLinkable, inventoryProductRoutes, productsCompatibilityLinkable, publicInventoryProductRoutes, } from "./interface.js";
|
|
16
16
|
export type { NewOptionUnit, NewOptionUnitTranslation, NewProduct, NewProductActivationSetting, NewProductCapability, NewProductCategory, NewProductDay, NewProductDayService, NewProductDayTranslation, NewProductDeliveryFormat, NewProductFaq, NewProductFeature, NewProductItinerary, NewProductLocation, NewProductMedia, NewProductNote, NewProductOption, NewProductOptionTranslation, NewProductTag, NewProductTicketSetting, NewProductTranslation, NewProductType, NewProductVersion, NewProductVisibilitySetting, OptionUnit, OptionUnitTranslation, Product, ProductActivationSetting, ProductCapability, ProductCategory, ProductDay, ProductDayService, ProductDayTranslation, ProductDeliveryFormat, ProductFaq, ProductFeature, ProductItinerary, ProductLocation, ProductMedia, ProductNote, ProductOption, ProductOptionTranslation, ProductTag, ProductTicketSetting, ProductTranslation, ProductType, ProductVersion, ProductVisibilitySetting, } from "./schema.js";
|
|
17
17
|
export { destinations, destinationTranslations, optionUnits, optionUnitTranslations, productActivationSettings, productCapabilities, productCategories, productCategoryProducts, productDayServices, productDays, productDayTranslations, productDeliveryFormats, productDestinations, productFaqs, productFeatures, productItineraries, productLocations, productMedia, productMediaTypeEnum, productNotes, productOptions, productOptionTranslations, products, productTagProducts, productTags, productTicketSettings, productTranslations, productTypes, productVersions, productVisibilitySettings, } from "./schema.js";
|
|
18
18
|
export { duplicateItinerarySchema, insertDaySchema, insertDayServiceSchema, insertItinerarySchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, insertProductDayTranslationSchema, insertProductDeliveryFormatSchema, insertProductFaqSchema, insertProductFeatureSchema, insertProductLocationSchema, insertProductMediaSchema, insertProductNoteSchema, insertProductOptionSchema, insertProductOptionTranslationSchema, insertProductSchema, insertProductTagSchema, insertProductTicketSettingSchema, insertProductTranslationSchema, insertProductTypeSchema, insertProductVisibilitySettingSchema, insertVersionSchema, optionUnitListQuerySchema, optionUnitTranslationListQuerySchema, productActivationSettingListQuerySchema, productCapabilityListQuerySchema, productCategoryListQuerySchema, productDeliveryFormatListQuerySchema, productFaqListQuerySchema, productFeatureListQuerySchema, productListQuerySchema, productLocationListQuerySchema, productMediaListQuerySchema, productOptionListQuerySchema, productOptionTranslationListQuerySchema, productTagListQuerySchema, productTicketSettingListQuerySchema, productTranslationListQuerySchema, productTypeListQuerySchema, productVisibilitySettingListQuerySchema, reorderProductMediaSchema, selectProductSchema, updateDaySchema, updateDayServiceSchema, updateItinerarySchema, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDayTranslationSchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, upsertProductBrochureSchema, } from "./validation.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;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B,EAC7B,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,uCAAuC,EACvC,yBAAyB,EACzB,mCAAmC,EACnC,iCAAiC,EACjC,0BAA0B,EAC1B,uCAAuC,EACvC,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,oCAAoC,EACpC,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,oCAAoC,EACpC,mBAAmB,EACnB,sBAAsB,EACtB,gCAAgC,EAChC,8BAA8B,EAC9B,uBAAuB,EACvB,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,qBAAqB,EACrB,8BAA8B,EAC9B,iCAAiC,EACjC,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,oCAAoC,EACpC,uCAAuC,EACvC,2BAA2B,EAC3B,mCAAmC,EACnC,oCAAoC,GACrC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,uCAAuC,EACvC,0CAA0C,EAC1C,8BAA8B,GAC/B,MAAM,wBAAwB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
+
import { productsCompatibilityLinkable } from "./linkables.js";
|
|
1
2
|
import { productRoutes } from "./routes.js";
|
|
2
3
|
import { publicProductRoutes } from "./routes-public.js";
|
|
3
4
|
export { appendProductMutationLedgerEntry, } from "./action-ledger.js";
|
|
4
5
|
export { productsBookingExtension } from "./booking-extension.js";
|
|
5
6
|
export { emitProductContentChanged, PRODUCT_CONTENT_CHANGED_EVENT, } from "./events.js";
|
|
7
|
+
export { productLinkable } from "./linkables.js";
|
|
6
8
|
export { publicProductRoutes } from "./routes-public.js";
|
|
7
9
|
export { productsService } from "./service.js";
|
|
8
10
|
export { catalogProductsService } from "./service-catalog.js";
|
|
9
11
|
export { publicProductsService } from "./service-public.js";
|
|
10
|
-
export const productLinkable = {
|
|
11
|
-
module: "products",
|
|
12
|
-
entity: "product",
|
|
13
|
-
table: "products",
|
|
14
|
-
idPrefix: "prod",
|
|
15
|
-
};
|
|
16
12
|
export const productsModule = {
|
|
17
13
|
name: "products",
|
|
18
|
-
linkable:
|
|
19
|
-
product: productLinkable,
|
|
20
|
-
},
|
|
14
|
+
linkable: productsCompatibilityLinkable,
|
|
21
15
|
};
|
|
22
16
|
export const productsHonoModule = {
|
|
23
17
|
module: productsModule,
|
|
@@ -25,7 +19,7 @@ export const productsHonoModule = {
|
|
|
25
19
|
publicRoutes: publicProductRoutes,
|
|
26
20
|
routes: productRoutes,
|
|
27
21
|
};
|
|
28
|
-
export { inventoryBookingExtension, inventoryHonoModule, inventoryInterfaceDescriptor, inventoryModule, inventoryProductCompatibilityLinkable, inventoryProductLinkable, inventoryProductRoutes, publicInventoryProductRoutes, } from "./interface.js";
|
|
22
|
+
export { inventoryBookingExtension, inventoryHonoModule, inventoryInterfaceDescriptor, inventoryLinkable, inventoryModule, inventoryProductCompatibilityLinkable, inventoryProductLinkable, inventoryProductRoutes, productsCompatibilityLinkable, publicInventoryProductRoutes, } from "./interface.js";
|
|
29
23
|
export { destinations, destinationTranslations, optionUnits, optionUnitTranslations, productActivationSettings, productCapabilities, productCategories, productCategoryProducts, productDayServices, productDays, productDayTranslations, productDeliveryFormats, productDestinations, productFaqs, productFeatures, productItineraries, productLocations, productMedia, productMediaTypeEnum, productNotes, productOptions, productOptionTranslations, products, productTagProducts, productTags, productTicketSettings, productTranslations, productTypes, productVersions, productVisibilitySettings, } from "./schema.js";
|
|
30
24
|
export { duplicateItinerarySchema, insertDaySchema, insertDayServiceSchema, insertItinerarySchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, insertProductDayTranslationSchema, insertProductDeliveryFormatSchema, insertProductFaqSchema, insertProductFeatureSchema, insertProductLocationSchema, insertProductMediaSchema, insertProductNoteSchema, insertProductOptionSchema, insertProductOptionTranslationSchema, insertProductSchema, insertProductTagSchema, insertProductTicketSettingSchema, insertProductTranslationSchema, insertProductTypeSchema, insertProductVisibilitySettingSchema, insertVersionSchema, optionUnitListQuerySchema, optionUnitTranslationListQuerySchema, productActivationSettingListQuerySchema, productCapabilityListQuerySchema, productCategoryListQuerySchema, productDeliveryFormatListQuerySchema, productFaqListQuerySchema, productFeatureListQuerySchema, productListQuerySchema, productLocationListQuerySchema, productMediaListQuerySchema, productOptionListQuerySchema, productOptionTranslationListQuerySchema, productTagListQuerySchema, productTicketSettingListQuerySchema, productTranslationListQuerySchema, productTypeListQuerySchema, productVisibilitySettingListQuerySchema, reorderProductMediaSchema, selectProductSchema, updateDaySchema, updateDayServiceSchema, updateItinerarySchema, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDayTranslationSchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, upsertProductBrochureSchema, } from "./validation.js";
|
|
31
25
|
export { catalogSearchDocumentListQuerySchema, catalogSearchDocumentListResponseSchema, catalogSearchDocumentSchema, localizedCatalogProductDetailSchema, localizedCatalogProductSummarySchema, } from "./validation-catalog.js";
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Module } from "@voyant-travel/core";
|
|
2
2
|
import type { HonoModule } from "@voyant-travel/hono/module";
|
|
3
|
-
export
|
|
3
|
+
export { inventoryLinkable, inventoryProductCompatibilityLinkable, inventoryProductLinkable, productLinkable, productsCompatibilityLinkable, } from "./linkables.js";
|
|
4
4
|
export declare const inventoryModule: Module;
|
|
5
|
-
export declare const inventoryProductCompatibilityLinkable: LinkableDefinition;
|
|
6
5
|
/**
|
|
7
6
|
* Compatibility Hono module for the Inventory-owned Product runtime.
|
|
8
7
|
*
|
|
@@ -5389,6 +5388,29 @@ export declare const publicInventoryProductRoutes: import("hono/hono-base").Hono
|
|
|
5389
5388
|
userId?: string;
|
|
5390
5389
|
};
|
|
5391
5390
|
}, {
|
|
5391
|
+
"/tags": {
|
|
5392
|
+
$get: {
|
|
5393
|
+
input: {
|
|
5394
|
+
query: {
|
|
5395
|
+
search?: string | undefined;
|
|
5396
|
+
offset?: unknown;
|
|
5397
|
+
limit?: unknown;
|
|
5398
|
+
};
|
|
5399
|
+
};
|
|
5400
|
+
output: {
|
|
5401
|
+
data: {
|
|
5402
|
+
id: string;
|
|
5403
|
+
name: string;
|
|
5404
|
+
}[];
|
|
5405
|
+
total: number;
|
|
5406
|
+
limit: number;
|
|
5407
|
+
offset: number;
|
|
5408
|
+
};
|
|
5409
|
+
outputFormat: "json";
|
|
5410
|
+
status: 200;
|
|
5411
|
+
};
|
|
5412
|
+
};
|
|
5413
|
+
} & {
|
|
5392
5414
|
"/": {
|
|
5393
5415
|
$get: {
|
|
5394
5416
|
input: {};
|
|
@@ -5843,23 +5865,6 @@ export declare const publicInventoryProductRoutes: import("hono/hono-base").Hono
|
|
|
5843
5865
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
5844
5866
|
};
|
|
5845
5867
|
};
|
|
5846
|
-
} & {
|
|
5847
|
-
"/tags": {
|
|
5848
|
-
$get: {
|
|
5849
|
-
input: {};
|
|
5850
|
-
output: {
|
|
5851
|
-
data: {
|
|
5852
|
-
id: string;
|
|
5853
|
-
name: string;
|
|
5854
|
-
}[];
|
|
5855
|
-
total: number;
|
|
5856
|
-
limit: number;
|
|
5857
|
-
offset: number;
|
|
5858
|
-
};
|
|
5859
|
-
outputFormat: "json";
|
|
5860
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
5861
|
-
};
|
|
5862
|
-
};
|
|
5863
5868
|
} & {
|
|
5864
5869
|
"/destinations": {
|
|
5865
5870
|
$get: {
|
package/dist/interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAO5D,OAAO,EACL,iBAAiB,EACjB,qCAAqC,EACrC,wBAAwB,EACxB,eAAe,EACf,6BAA6B,GAC9B,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,eAAe,EAAE,MAG7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAQjC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA4B,EAAE,4BAW1C,CAAA"}
|
package/dist/interface.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import { productsBookingExtension } from "./booking-extension.js";
|
|
2
|
+
import { inventoryLinkable, productsCompatibilityLinkable } from "./linkables.js";
|
|
2
3
|
import { productRoutes } from "./routes.js";
|
|
3
4
|
import { publicProductRoutes } from "./routes-public.js";
|
|
4
|
-
export
|
|
5
|
-
module: "inventory",
|
|
6
|
-
entity: "product",
|
|
7
|
-
table: "products",
|
|
8
|
-
idPrefix: "prod",
|
|
9
|
-
};
|
|
5
|
+
export { inventoryLinkable, inventoryProductCompatibilityLinkable, inventoryProductLinkable, productLinkable, productsCompatibilityLinkable, } from "./linkables.js";
|
|
10
6
|
export const inventoryModule = {
|
|
11
7
|
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
|
-
},
|
|
8
|
+
linkable: inventoryLinkable,
|
|
27
9
|
};
|
|
28
10
|
/**
|
|
29
11
|
* Compatibility Hono module for the Inventory-owned Product runtime.
|
|
@@ -32,7 +14,10 @@ const productsCompatibilityModule = {
|
|
|
32
14
|
* `/v1/admin/products` and `/v1/public/products` clients do not break.
|
|
33
15
|
*/
|
|
34
16
|
export const inventoryHonoModule = {
|
|
35
|
-
module:
|
|
17
|
+
module: {
|
|
18
|
+
name: "products",
|
|
19
|
+
linkable: productsCompatibilityLinkable,
|
|
20
|
+
},
|
|
36
21
|
adminRoutes: productRoutes,
|
|
37
22
|
publicRoutes: publicProductRoutes,
|
|
38
23
|
routes: productRoutes,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LinkableDefinition } from "@voyant-travel/core";
|
|
2
|
+
export declare const inventoryProductLinkable: LinkableDefinition;
|
|
3
|
+
export declare const inventoryProductCompatibilityLinkable: LinkableDefinition;
|
|
4
|
+
export declare const productLinkable: LinkableDefinition;
|
|
5
|
+
export declare const inventoryLinkable: {
|
|
6
|
+
product: LinkableDefinition;
|
|
7
|
+
};
|
|
8
|
+
export declare const productsCompatibilityLinkable: {
|
|
9
|
+
product: LinkableDefinition;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=linkables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkables.d.ts","sourceRoot":"","sources":["../src/linkables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,eAAO,MAAM,wBAAwB,EAAE,kBAKtC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,kBAKnD,CAAA;AAED,eAAO,MAAM,eAAe,oBAAwC,CAAA;AAEpE,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,eAAO,MAAM,6BAA6B;;CAEzC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const inventoryProductLinkable = {
|
|
2
|
+
module: "inventory",
|
|
3
|
+
entity: "product",
|
|
4
|
+
table: "products",
|
|
5
|
+
idPrefix: "prod",
|
|
6
|
+
};
|
|
7
|
+
export const inventoryProductCompatibilityLinkable = {
|
|
8
|
+
module: "products",
|
|
9
|
+
entity: "product",
|
|
10
|
+
table: "products",
|
|
11
|
+
idPrefix: "prod",
|
|
12
|
+
};
|
|
13
|
+
export const productLinkable = inventoryProductCompatibilityLinkable;
|
|
14
|
+
export const inventoryLinkable = {
|
|
15
|
+
product: inventoryProductLinkable,
|
|
16
|
+
};
|
|
17
|
+
export const productsCompatibilityLinkable = {
|
|
18
|
+
product: inventoryProductCompatibilityLinkable,
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-tags-contract.test.d.ts","sourceRoot":"","sources":["../src/public-tags-contract.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { listResponse, listResponseSchema } from "@voyant-travel/types";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { publicCatalogTagSchema } from "./routes-public.js";
|
|
4
|
+
const row = { id: "ptag_0000000000000000000000", name: "Adventure" };
|
|
5
|
+
describe("public catalog tags response contract", () => {
|
|
6
|
+
it("the serialized wire response satisfies the declared OpenAPI schema", () => {
|
|
7
|
+
const wire = JSON.parse(JSON.stringify(listResponse([row], { total: 1, limit: 100, offset: 0 })));
|
|
8
|
+
const parsed = listResponseSchema(publicCatalogTagSchema).safeParse(wire);
|
|
9
|
+
expect(parsed.success ? null : parsed.error.toString()).toBeNull();
|
|
10
|
+
});
|
|
11
|
+
});
|
package/dist/routes-public.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
1
2
|
import type { KVStore } from "@voyant-travel/utils/cache";
|
|
2
3
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
3
4
|
type Env = {
|
|
@@ -10,7 +11,35 @@ type Env = {
|
|
|
10
11
|
userId?: string;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
14
|
+
/** Wire shape of a public catalog tag (voyant#2114). */
|
|
15
|
+
export declare const publicCatalogTagSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
13
19
|
export declare const publicProductRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
20
|
+
"/tags": {
|
|
21
|
+
$get: {
|
|
22
|
+
input: {
|
|
23
|
+
query: {
|
|
24
|
+
search?: string | undefined;
|
|
25
|
+
offset?: unknown;
|
|
26
|
+
limit?: unknown;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
output: {
|
|
30
|
+
data: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}[];
|
|
34
|
+
total: number;
|
|
35
|
+
limit: number;
|
|
36
|
+
offset: number;
|
|
37
|
+
};
|
|
38
|
+
outputFormat: "json";
|
|
39
|
+
status: 200;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
} & {
|
|
14
43
|
"/": {
|
|
15
44
|
$get: {
|
|
16
45
|
input: {};
|
|
@@ -465,23 +494,6 @@ export declare const publicProductRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
465
494
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
466
495
|
};
|
|
467
496
|
};
|
|
468
|
-
} & {
|
|
469
|
-
"/tags": {
|
|
470
|
-
$get: {
|
|
471
|
-
input: {};
|
|
472
|
-
output: {
|
|
473
|
-
data: {
|
|
474
|
-
id: string;
|
|
475
|
-
name: string;
|
|
476
|
-
}[];
|
|
477
|
-
total: number;
|
|
478
|
-
limit: number;
|
|
479
|
-
offset: number;
|
|
480
|
-
};
|
|
481
|
-
outputFormat: "json";
|
|
482
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
483
|
-
};
|
|
484
|
-
};
|
|
485
497
|
} & {
|
|
486
498
|
"/destinations": {
|
|
487
499
|
$get: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAG/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAmBjE,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,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/dist/routes-public.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
|
2
|
+
import { openApiValidationHook, parseQuery } from "@voyant-travel/hono";
|
|
3
|
+
import { listResponseSchema } from "@voyant-travel/types";
|
|
4
4
|
import { productDocKey, productDocVariant, readThroughProductDoc, readThroughSlugMapping, } from "./read-model.js";
|
|
5
5
|
import { publicProductsService } from "./service-public.js";
|
|
6
6
|
import { publicCatalogCategoryListQuerySchema, publicCatalogDestinationListQuerySchema, publicCatalogProductListQuerySchema, publicCatalogProductLookupBySlugQuerySchema, publicCatalogTagListQuerySchema, } from "./validation-public.js";
|
|
@@ -48,12 +48,41 @@ const clampedCategoryListQuerySchema = publicCatalogCategoryListQuerySchema.exte
|
|
|
48
48
|
limit: clampedLimitParam(PUBLIC_LIST_MAX_LIMIT, PUBLIC_LIST_MAX_LIMIT),
|
|
49
49
|
});
|
|
50
50
|
const clampedTagListQuerySchema = publicCatalogTagListQuerySchema.extend({
|
|
51
|
-
|
|
51
|
+
// `.catch()`/`.transform()` (clamping) can't be introspected by
|
|
52
|
+
// zod-to-openapi, so pin the documented param type explicitly (voyant#2114).
|
|
53
|
+
limit: clampedLimitParam(PUBLIC_LIST_MAX_LIMIT, PUBLIC_LIST_MAX_LIMIT).openapi({
|
|
54
|
+
type: "integer",
|
|
55
|
+
example: PUBLIC_LIST_MAX_LIMIT,
|
|
56
|
+
}),
|
|
52
57
|
});
|
|
53
58
|
const clampedDestinationListQuerySchema = publicCatalogDestinationListQuerySchema.extend({
|
|
54
59
|
limit: clampedLimitParam(PUBLIC_LIST_MAX_LIMIT, PUBLIC_LIST_MAX_LIMIT),
|
|
55
60
|
});
|
|
56
|
-
|
|
61
|
+
/** Wire shape of a public catalog tag (voyant#2114). */
|
|
62
|
+
export const publicCatalogTagSchema = z.object({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
name: z.string(),
|
|
65
|
+
});
|
|
66
|
+
const listTagsRoute = createRoute({
|
|
67
|
+
method: "get",
|
|
68
|
+
path: "/tags",
|
|
69
|
+
request: { query: clampedTagListQuerySchema },
|
|
70
|
+
responses: {
|
|
71
|
+
200: {
|
|
72
|
+
description: "Paginated list of public catalog tags",
|
|
73
|
+
content: { "application/json": { schema: listResponseSchema(publicCatalogTagSchema) } },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
// `.openapi()` is declared first: `OpenAPIHono#get` returns the base `Hono`
|
|
78
|
+
// type (honojs/middleware#637), so it cannot precede an `.openapi()` in the
|
|
79
|
+
// chain; it stays ahead of the `/:id` catch-all so `/tags` still matches first.
|
|
80
|
+
export const publicProductRoutes = new OpenAPIHono({ defaultHook: openApiValidationHook })
|
|
81
|
+
.openapi(listTagsRoute, async (c) => {
|
|
82
|
+
const result = await publicProductsService.listCatalogTags(c.get("db"), c.req.valid("query"));
|
|
83
|
+
setPublicCacheHeaders(c);
|
|
84
|
+
return c.json(result, 200);
|
|
85
|
+
})
|
|
57
86
|
.get("/", async (c) => {
|
|
58
87
|
const query = await parseQuery(c, trimmedProductListQuerySchema);
|
|
59
88
|
const result = await publicProductsService.listCatalogProducts(c.get("db"), query);
|
|
@@ -97,12 +126,6 @@ export const publicProductRoutes = new Hono()
|
|
|
97
126
|
const result = await publicProductsService.listCatalogCategories(c.get("db"), query);
|
|
98
127
|
setPublicCacheHeaders(c);
|
|
99
128
|
return c.json(result);
|
|
100
|
-
})
|
|
101
|
-
.get("/tags", async (c) => {
|
|
102
|
-
const query = await parseQuery(c, clampedTagListQuerySchema);
|
|
103
|
-
const result = await publicProductsService.listCatalogTags(c.get("db"), query);
|
|
104
|
-
setPublicCacheHeaders(c);
|
|
105
|
-
return c.json(result);
|
|
106
129
|
})
|
|
107
130
|
.get("/destinations", async (c) => {
|
|
108
131
|
const query = await parseQuery(c, clampedDestinationListQuerySchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/inventory",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./linkables": {
|
|
13
|
+
"types": "./dist/linkables.d.ts",
|
|
14
|
+
"import": "./dist/linkables.js",
|
|
15
|
+
"default": "./dist/linkables.js"
|
|
16
|
+
},
|
|
12
17
|
"./schema": {
|
|
13
18
|
"types": "./dist/schema.d.ts",
|
|
14
19
|
"import": "./dist/schema.js",
|
|
@@ -156,24 +161,25 @@
|
|
|
156
161
|
}
|
|
157
162
|
},
|
|
158
163
|
"dependencies": {
|
|
164
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
159
165
|
"drizzle-orm": "^0.45.2",
|
|
160
166
|
"hono": "^4.12.10",
|
|
161
167
|
"marked": "^18.0.3",
|
|
162
168
|
"pdf-lib": "^1.17.1",
|
|
163
169
|
"sanitize-html": "^2.17.4",
|
|
164
170
|
"zod": "^4.3.6",
|
|
165
|
-
"@voyant-travel/action-ledger": "^0.105.
|
|
166
|
-
"@voyant-travel/catalog": "^0.
|
|
171
|
+
"@voyant-travel/action-ledger": "^0.105.8",
|
|
172
|
+
"@voyant-travel/catalog": "^0.135.0",
|
|
167
173
|
"@voyant-travel/core": "^0.111.0",
|
|
168
|
-
"@voyant-travel/db": "^0.109.
|
|
174
|
+
"@voyant-travel/db": "^0.109.4",
|
|
169
175
|
"@voyant-travel/types": "^0.106.0",
|
|
170
176
|
"@voyant-travel/extras-contracts": "^0.104.2",
|
|
171
|
-
"@voyant-travel/hono": "^0.
|
|
172
|
-
"@voyant-travel/commerce": "^0.
|
|
173
|
-
"@voyant-travel/products-contracts": "^0.105.
|
|
177
|
+
"@voyant-travel/hono": "^0.117.0",
|
|
178
|
+
"@voyant-travel/commerce": "^0.19.0",
|
|
179
|
+
"@voyant-travel/products-contracts": "^0.105.14",
|
|
174
180
|
"@voyant-travel/storage": "^0.105.0",
|
|
175
181
|
"@voyant-travel/utils": "^0.105.4",
|
|
176
|
-
"@voyant-travel/operations": "^0.5.
|
|
182
|
+
"@voyant-travel/operations": "^0.5.2"
|
|
177
183
|
},
|
|
178
184
|
"devDependencies": {
|
|
179
185
|
"@types/sanitize-html": "^2.16.1",
|