@voyantjs/products 0.3.0 → 0.4.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/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/routes-public.d.ts +492 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +44 -0
- package/dist/routes.d.ts +669 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +117 -1
- package/dist/schema-itinerary.d.ts +51 -0
- package/dist/schema-itinerary.d.ts.map +1 -1
- package/dist/schema-itinerary.js +3 -0
- package/dist/schema-relations.d.ts +14 -0
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +28 -1
- package/dist/schema-taxonomy.d.ts +435 -0
- package/dist/schema-taxonomy.d.ts.map +1 -1
- package/dist/schema-taxonomy.js +47 -0
- package/dist/service-catalog.d.ts +237 -0
- package/dist/service-catalog.d.ts.map +1 -0
- package/dist/service-catalog.js +478 -0
- package/dist/service-public.d.ts +383 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +365 -0
- package/dist/service.d.ts +292 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +388 -2
- package/dist/tasks/brochure-printers.d.ts +29 -0
- package/dist/tasks/brochure-printers.d.ts.map +1 -0
- package/dist/tasks/brochure-printers.js +94 -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 +98 -0
- package/dist/tasks/brochures.d.ts +42 -0
- package/dist/tasks/brochures.d.ts.map +1 -0
- package/dist/tasks/brochures.js +69 -0
- package/dist/tasks/index.d.ts +3 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +3 -0
- package/dist/validation-catalog.d.ts +388 -0
- package/dist/validation-catalog.d.ts.map +1 -0
- package/dist/validation-catalog.js +54 -0
- package/dist/validation-content.d.ts +109 -0
- package/dist/validation-content.d.ts.map +1 -1
- package/dist/validation-content.js +63 -1
- package/dist/validation-public.d.ts +643 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +167 -0
- package/dist/validation-shared.d.ts +11 -0
- package/dist/validation-shared.d.ts.map +1 -1
- package/dist/validation-shared.js +2 -0
- package/dist/validation.d.ts +1 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +1 -0
- package/package.json +14 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,19 @@ import type { LinkableDefinition, Module } from "@voyantjs/core";
|
|
|
2
2
|
import type { HonoModule } from "@voyantjs/hono/module";
|
|
3
3
|
export { productsBookingExtension } from "./booking-extension.js";
|
|
4
4
|
export type { ProductRoutes } from "./routes.js";
|
|
5
|
+
export type { PublicProductRoutes } from "./routes-public.js";
|
|
6
|
+
export { publicProductRoutes } from "./routes-public.js";
|
|
5
7
|
export { productsService } from "./service.js";
|
|
8
|
+
export { catalogProductsService } from "./service-catalog.js";
|
|
9
|
+
export { publicProductsService } from "./service-public.js";
|
|
10
|
+
export { createBasicPdfProductBrochurePrinter, createCloudflareBrowserProductBrochurePrinter, createCloudflareBrowserProductBrochurePrinterFromEnv, createDefaultProductBrochureTemplate, type GenerateAndStoreProductBrochureOptions, generateAndStoreProductBrochure, loadProductBrochureTemplateContext, type ProductBrochurePrinter, type ProductBrochureTemplateDefinition, renderProductBrochureTemplate, } from "./tasks/index.js";
|
|
6
11
|
export declare const productLinkable: LinkableDefinition;
|
|
7
12
|
export declare const productsModule: Module;
|
|
8
13
|
export declare const productsHonoModule: HonoModule;
|
|
9
14
|
export type { NewOptionUnit, NewOptionUnitTranslation, NewProduct, NewProductActivationSetting, NewProductCapability, NewProductCategory, NewProductDay, NewProductDayService, NewProductDeliveryFormat, NewProductFaq, NewProductFeature, NewProductLocation, NewProductMedia, NewProductNote, NewProductOption, NewProductOptionTranslation, NewProductTag, NewProductTicketSetting, NewProductTranslation, NewProductType, NewProductVersion, NewProductVisibilitySetting, OptionUnit, OptionUnitTranslation, Product, ProductActivationSetting, ProductCapability, ProductCategory, ProductDay, ProductDayService, ProductDeliveryFormat, ProductFaq, ProductFeature, ProductLocation, ProductMedia, ProductNote, ProductOption, ProductOptionTranslation, ProductTag, ProductTicketSetting, ProductTranslation, ProductType, ProductVersion, ProductVisibilitySetting, } from "./schema.js";
|
|
10
15
|
export { optionUnits, optionUnitTranslations, productActivationSettings, productCapabilities, productCategories, productCategoryProducts, productDayServices, productDays, productDeliveryFormats, productFaqs, productFeatures, productLocations, productMedia, productMediaTypeEnum, productNotes, productOptions, productOptionTranslations, products, productTagProducts, productTags, productTicketSettings, productTranslations, productTypes, productVersions, productVisibilitySettings, } from "./schema.js";
|
|
11
|
-
export { insertDaySchema, insertDayServiceSchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, 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, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, } from "./validation.js";
|
|
16
|
+
export { insertDaySchema, insertDayServiceSchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, 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, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, upsertProductBrochureSchema, } from "./validation.js";
|
|
17
|
+
export type { CatalogSearchDocument, CatalogSearchDocumentListQuery, CatalogSearchDocumentListResponse, LocalizedCatalogProductDetail, LocalizedCatalogProductSummary, } from "./validation-catalog.js";
|
|
18
|
+
export { catalogSearchDocumentListQuerySchema, catalogSearchDocumentListResponseSchema, catalogSearchDocumentSchema, localizedCatalogProductDetailSchema, localizedCatalogProductSummarySchema, } from "./validation-catalog.js";
|
|
19
|
+
export { publicCatalogDestinationListQuerySchema, publicCatalogDestinationListResponseSchema, publicCatalogDestinationSchema, } from "./validation-public.js";
|
|
12
20
|
//# sourceMappingURL=index.d.ts.map
|
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,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { productRoutes } from "./routes.js";
|
|
2
|
+
import { publicProductRoutes } from "./routes-public.js";
|
|
2
3
|
export { productsBookingExtension } from "./booking-extension.js";
|
|
4
|
+
export { publicProductRoutes } from "./routes-public.js";
|
|
3
5
|
export { productsService } from "./service.js";
|
|
6
|
+
export { catalogProductsService } from "./service-catalog.js";
|
|
7
|
+
export { publicProductsService } from "./service-public.js";
|
|
8
|
+
export { createBasicPdfProductBrochurePrinter, createCloudflareBrowserProductBrochurePrinter, createCloudflareBrowserProductBrochurePrinterFromEnv, createDefaultProductBrochureTemplate, generateAndStoreProductBrochure, loadProductBrochureTemplateContext, renderProductBrochureTemplate, } from "./tasks/index.js";
|
|
4
9
|
export const productLinkable = {
|
|
5
10
|
module: "products",
|
|
6
11
|
entity: "product",
|
|
@@ -15,7 +20,11 @@ export const productsModule = {
|
|
|
15
20
|
};
|
|
16
21
|
export const productsHonoModule = {
|
|
17
22
|
module: productsModule,
|
|
23
|
+
adminRoutes: productRoutes,
|
|
24
|
+
publicRoutes: publicProductRoutes,
|
|
18
25
|
routes: productRoutes,
|
|
19
26
|
};
|
|
20
27
|
export { optionUnits, optionUnitTranslations, productActivationSettings, productCapabilities, productCategories, productCategoryProducts, productDayServices, productDays, productDeliveryFormats, productFaqs, productFeatures, productLocations, productMedia, productMediaTypeEnum, productNotes, productOptions, productOptionTranslations, products, productTagProducts, productTags, productTicketSettings, productTranslations, productTypes, productVersions, productVisibilitySettings, } from "./schema.js";
|
|
21
|
-
export { insertDaySchema, insertDayServiceSchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, 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, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, } from "./validation.js";
|
|
28
|
+
export { insertDaySchema, insertDayServiceSchema, insertOptionUnitSchema, insertOptionUnitTranslationSchema, insertProductActivationSettingSchema, insertProductCapabilitySchema, insertProductCategorySchema, 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, updateOptionUnitSchema, updateOptionUnitTranslationSchema, updateProductActivationSettingSchema, updateProductCapabilitySchema, updateProductCategorySchema, updateProductDeliveryFormatSchema, updateProductFaqSchema, updateProductFeatureSchema, updateProductLocationSchema, updateProductMediaSchema, updateProductOptionSchema, updateProductOptionTranslationSchema, updateProductSchema, updateProductTagSchema, updateProductTicketSettingSchema, updateProductTranslationSchema, updateProductTypeSchema, updateProductVisibilitySettingSchema, upsertProductBrochureSchema, } from "./validation.js";
|
|
29
|
+
export { catalogSearchDocumentListQuerySchema, catalogSearchDocumentListResponseSchema, catalogSearchDocumentSchema, localizedCatalogProductDetailSchema, localizedCatalogProductSummarySchema, } from "./validation-catalog.js";
|
|
30
|
+
export { publicCatalogDestinationListQuerySchema, publicCatalogDestinationListResponseSchema, publicCatalogDestinationSchema, } from "./validation-public.js";
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
|
+
type Env = {
|
|
3
|
+
Variables: {
|
|
4
|
+
db: PostgresJsDatabase;
|
|
5
|
+
userId?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const publicProductRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
9
|
+
"/": {
|
|
10
|
+
$get: {
|
|
11
|
+
input: {};
|
|
12
|
+
output: {
|
|
13
|
+
data: ({
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description: string | null;
|
|
17
|
+
contentLanguageTag: string | null;
|
|
18
|
+
slug: string | null;
|
|
19
|
+
shortDescription: string | null;
|
|
20
|
+
seoTitle: string | null;
|
|
21
|
+
seoDescription: string | null;
|
|
22
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
23
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
24
|
+
visibility: "public" | "private" | "hidden";
|
|
25
|
+
sellCurrency: string;
|
|
26
|
+
sellAmountCents: number | null;
|
|
27
|
+
startDate: string | null;
|
|
28
|
+
endDate: string | null;
|
|
29
|
+
pax: number | null;
|
|
30
|
+
productType: {
|
|
31
|
+
id: string;
|
|
32
|
+
code: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description: string | null;
|
|
35
|
+
} | null;
|
|
36
|
+
categories: {
|
|
37
|
+
id: string;
|
|
38
|
+
parentId: string | null;
|
|
39
|
+
name: string;
|
|
40
|
+
slug: string;
|
|
41
|
+
description: string | null;
|
|
42
|
+
sortOrder: number;
|
|
43
|
+
}[];
|
|
44
|
+
tags: {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
}[];
|
|
48
|
+
capabilities: string[];
|
|
49
|
+
destinations: {
|
|
50
|
+
id: string;
|
|
51
|
+
parentId: string | null;
|
|
52
|
+
slug: string;
|
|
53
|
+
name: string;
|
|
54
|
+
description: string | null;
|
|
55
|
+
seoTitle: string | null;
|
|
56
|
+
seoDescription: string | null;
|
|
57
|
+
destinationType: string;
|
|
58
|
+
sortOrder: number;
|
|
59
|
+
}[];
|
|
60
|
+
locations: {
|
|
61
|
+
id: string;
|
|
62
|
+
locationType: "other" | "start" | "end" | "meeting_point" | "pickup" | "dropoff" | "point_of_interest";
|
|
63
|
+
title: string;
|
|
64
|
+
address: string | null;
|
|
65
|
+
city: string | null;
|
|
66
|
+
countryCode: string | null;
|
|
67
|
+
latitude: number | null;
|
|
68
|
+
longitude: number | null;
|
|
69
|
+
sortOrder: number;
|
|
70
|
+
}[];
|
|
71
|
+
coverMedia: {
|
|
72
|
+
id: string;
|
|
73
|
+
mediaType: "image" | "video" | "document";
|
|
74
|
+
name: string;
|
|
75
|
+
url: string;
|
|
76
|
+
mimeType: string | null;
|
|
77
|
+
altText: string | null;
|
|
78
|
+
sortOrder: number;
|
|
79
|
+
isCover: boolean;
|
|
80
|
+
isBrochure: boolean;
|
|
81
|
+
isBrochureCurrent: boolean;
|
|
82
|
+
brochureVersion: number | null;
|
|
83
|
+
} | null;
|
|
84
|
+
isFeatured: boolean;
|
|
85
|
+
} | {
|
|
86
|
+
brochure: {
|
|
87
|
+
id: string;
|
|
88
|
+
mediaType: "image" | "video" | "document";
|
|
89
|
+
name: string;
|
|
90
|
+
url: string;
|
|
91
|
+
mimeType: string | null;
|
|
92
|
+
altText: string | null;
|
|
93
|
+
sortOrder: number;
|
|
94
|
+
isCover: boolean;
|
|
95
|
+
isBrochure: boolean;
|
|
96
|
+
isBrochureCurrent: boolean;
|
|
97
|
+
brochureVersion: number | null;
|
|
98
|
+
} | null;
|
|
99
|
+
media: {
|
|
100
|
+
id: string;
|
|
101
|
+
mediaType: "image" | "video" | "document";
|
|
102
|
+
name: string;
|
|
103
|
+
url: string;
|
|
104
|
+
mimeType: string | null;
|
|
105
|
+
altText: string | null;
|
|
106
|
+
sortOrder: number;
|
|
107
|
+
isCover: boolean;
|
|
108
|
+
isBrochure: boolean;
|
|
109
|
+
isBrochureCurrent: boolean;
|
|
110
|
+
brochureVersion: number | null;
|
|
111
|
+
}[];
|
|
112
|
+
features: {
|
|
113
|
+
id: string;
|
|
114
|
+
featureType: "other" | "inclusion" | "exclusion" | "highlight" | "important_information";
|
|
115
|
+
title: string;
|
|
116
|
+
description: string | null;
|
|
117
|
+
sortOrder: number;
|
|
118
|
+
}[];
|
|
119
|
+
faqs: {
|
|
120
|
+
id: string;
|
|
121
|
+
question: string;
|
|
122
|
+
answer: string;
|
|
123
|
+
sortOrder: number;
|
|
124
|
+
}[];
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
description: string | null;
|
|
128
|
+
contentLanguageTag: string | null;
|
|
129
|
+
slug: string | null;
|
|
130
|
+
shortDescription: string | null;
|
|
131
|
+
seoTitle: string | null;
|
|
132
|
+
seoDescription: string | null;
|
|
133
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
134
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
135
|
+
visibility: "public" | "private" | "hidden";
|
|
136
|
+
sellCurrency: string;
|
|
137
|
+
sellAmountCents: number | null;
|
|
138
|
+
startDate: string | null;
|
|
139
|
+
endDate: string | null;
|
|
140
|
+
pax: number | null;
|
|
141
|
+
productType: {
|
|
142
|
+
id: string;
|
|
143
|
+
code: string;
|
|
144
|
+
name: string;
|
|
145
|
+
description: string | null;
|
|
146
|
+
} | null;
|
|
147
|
+
categories: {
|
|
148
|
+
id: string;
|
|
149
|
+
parentId: string | null;
|
|
150
|
+
name: string;
|
|
151
|
+
slug: string;
|
|
152
|
+
description: string | null;
|
|
153
|
+
sortOrder: number;
|
|
154
|
+
}[];
|
|
155
|
+
tags: {
|
|
156
|
+
id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
}[];
|
|
159
|
+
capabilities: string[];
|
|
160
|
+
destinations: {
|
|
161
|
+
id: string;
|
|
162
|
+
parentId: string | null;
|
|
163
|
+
slug: string;
|
|
164
|
+
name: string;
|
|
165
|
+
description: string | null;
|
|
166
|
+
seoTitle: string | null;
|
|
167
|
+
seoDescription: string | null;
|
|
168
|
+
destinationType: string;
|
|
169
|
+
sortOrder: number;
|
|
170
|
+
}[];
|
|
171
|
+
locations: {
|
|
172
|
+
id: string;
|
|
173
|
+
locationType: "other" | "start" | "end" | "meeting_point" | "pickup" | "dropoff" | "point_of_interest";
|
|
174
|
+
title: string;
|
|
175
|
+
address: string | null;
|
|
176
|
+
city: string | null;
|
|
177
|
+
countryCode: string | null;
|
|
178
|
+
latitude: number | null;
|
|
179
|
+
longitude: number | null;
|
|
180
|
+
sortOrder: number;
|
|
181
|
+
}[];
|
|
182
|
+
coverMedia: {
|
|
183
|
+
id: string;
|
|
184
|
+
mediaType: "image" | "video" | "document";
|
|
185
|
+
name: string;
|
|
186
|
+
url: string;
|
|
187
|
+
mimeType: string | null;
|
|
188
|
+
altText: string | null;
|
|
189
|
+
sortOrder: number;
|
|
190
|
+
isCover: boolean;
|
|
191
|
+
isBrochure: boolean;
|
|
192
|
+
isBrochureCurrent: boolean;
|
|
193
|
+
brochureVersion: number | null;
|
|
194
|
+
} | null;
|
|
195
|
+
isFeatured: boolean;
|
|
196
|
+
})[];
|
|
197
|
+
total: number;
|
|
198
|
+
limit: number;
|
|
199
|
+
offset: number;
|
|
200
|
+
};
|
|
201
|
+
outputFormat: "json";
|
|
202
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
} & {
|
|
206
|
+
"/slug/:slug": {
|
|
207
|
+
$get: {
|
|
208
|
+
input: {
|
|
209
|
+
param: {
|
|
210
|
+
slug: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
output: {
|
|
214
|
+
error: string;
|
|
215
|
+
};
|
|
216
|
+
outputFormat: "json";
|
|
217
|
+
status: 404;
|
|
218
|
+
} | {
|
|
219
|
+
input: {
|
|
220
|
+
param: {
|
|
221
|
+
slug: string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
output: {
|
|
225
|
+
data: {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
description: string | null;
|
|
229
|
+
contentLanguageTag: string | null;
|
|
230
|
+
slug: string | null;
|
|
231
|
+
shortDescription: string | null;
|
|
232
|
+
seoTitle: string | null;
|
|
233
|
+
seoDescription: string | null;
|
|
234
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
235
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
236
|
+
visibility: "public" | "private" | "hidden";
|
|
237
|
+
sellCurrency: string;
|
|
238
|
+
sellAmountCents: number | null;
|
|
239
|
+
startDate: string | null;
|
|
240
|
+
endDate: string | null;
|
|
241
|
+
pax: number | null;
|
|
242
|
+
productType: {
|
|
243
|
+
id: string;
|
|
244
|
+
code: string;
|
|
245
|
+
name: string;
|
|
246
|
+
description: string | null;
|
|
247
|
+
} | null;
|
|
248
|
+
categories: {
|
|
249
|
+
id: string;
|
|
250
|
+
parentId: string | null;
|
|
251
|
+
name: string;
|
|
252
|
+
slug: string;
|
|
253
|
+
description: string | null;
|
|
254
|
+
sortOrder: number;
|
|
255
|
+
}[];
|
|
256
|
+
tags: {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
}[];
|
|
260
|
+
capabilities: string[];
|
|
261
|
+
destinations: {
|
|
262
|
+
id: string;
|
|
263
|
+
parentId: string | null;
|
|
264
|
+
slug: string;
|
|
265
|
+
name: string;
|
|
266
|
+
description: string | null;
|
|
267
|
+
seoTitle: string | null;
|
|
268
|
+
seoDescription: string | null;
|
|
269
|
+
destinationType: string;
|
|
270
|
+
sortOrder: number;
|
|
271
|
+
}[];
|
|
272
|
+
locations: {
|
|
273
|
+
id: string;
|
|
274
|
+
locationType: "other" | "start" | "end" | "meeting_point" | "pickup" | "dropoff" | "point_of_interest";
|
|
275
|
+
title: string;
|
|
276
|
+
address: string | null;
|
|
277
|
+
city: string | null;
|
|
278
|
+
countryCode: string | null;
|
|
279
|
+
latitude: number | null;
|
|
280
|
+
longitude: number | null;
|
|
281
|
+
sortOrder: number;
|
|
282
|
+
}[];
|
|
283
|
+
coverMedia: {
|
|
284
|
+
id: string;
|
|
285
|
+
mediaType: "image" | "video" | "document";
|
|
286
|
+
name: string;
|
|
287
|
+
url: string;
|
|
288
|
+
mimeType: string | null;
|
|
289
|
+
altText: string | null;
|
|
290
|
+
sortOrder: number;
|
|
291
|
+
isCover: boolean;
|
|
292
|
+
isBrochure: boolean;
|
|
293
|
+
isBrochureCurrent: boolean;
|
|
294
|
+
brochureVersion: number | null;
|
|
295
|
+
} | null;
|
|
296
|
+
isFeatured: boolean;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
outputFormat: "json";
|
|
300
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
} & {
|
|
304
|
+
"/categories": {
|
|
305
|
+
$get: {
|
|
306
|
+
input: {};
|
|
307
|
+
output: {
|
|
308
|
+
data: {
|
|
309
|
+
parentId: string | null;
|
|
310
|
+
description: string | null;
|
|
311
|
+
id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
slug: string;
|
|
314
|
+
sortOrder: number;
|
|
315
|
+
}[];
|
|
316
|
+
total: number;
|
|
317
|
+
limit: number;
|
|
318
|
+
offset: number;
|
|
319
|
+
};
|
|
320
|
+
outputFormat: "json";
|
|
321
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
} & {
|
|
325
|
+
"/tags": {
|
|
326
|
+
$get: {
|
|
327
|
+
input: {};
|
|
328
|
+
output: {
|
|
329
|
+
data: {
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
332
|
+
}[];
|
|
333
|
+
total: number;
|
|
334
|
+
limit: number;
|
|
335
|
+
offset: number;
|
|
336
|
+
};
|
|
337
|
+
outputFormat: "json";
|
|
338
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
} & {
|
|
342
|
+
"/destinations": {
|
|
343
|
+
$get: {
|
|
344
|
+
input: {};
|
|
345
|
+
output: {
|
|
346
|
+
data: {
|
|
347
|
+
id: string;
|
|
348
|
+
parentId: string | null;
|
|
349
|
+
slug: string;
|
|
350
|
+
name: string;
|
|
351
|
+
description: string | null;
|
|
352
|
+
seoTitle: string | null;
|
|
353
|
+
seoDescription: string | null;
|
|
354
|
+
destinationType: string;
|
|
355
|
+
sortOrder: number;
|
|
356
|
+
}[];
|
|
357
|
+
total: number;
|
|
358
|
+
limit: number;
|
|
359
|
+
offset: number;
|
|
360
|
+
};
|
|
361
|
+
outputFormat: "json";
|
|
362
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
} & {
|
|
366
|
+
"/:id": {
|
|
367
|
+
$get: {
|
|
368
|
+
input: {
|
|
369
|
+
param: {
|
|
370
|
+
id: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
output: {
|
|
374
|
+
error: string;
|
|
375
|
+
};
|
|
376
|
+
outputFormat: "json";
|
|
377
|
+
status: 404;
|
|
378
|
+
} | {
|
|
379
|
+
input: {
|
|
380
|
+
param: {
|
|
381
|
+
id: string;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
output: {
|
|
385
|
+
data: {
|
|
386
|
+
id: string;
|
|
387
|
+
name: string;
|
|
388
|
+
description: string | null;
|
|
389
|
+
contentLanguageTag: string | null;
|
|
390
|
+
slug: string | null;
|
|
391
|
+
shortDescription: string | null;
|
|
392
|
+
seoTitle: string | null;
|
|
393
|
+
seoDescription: string | null;
|
|
394
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
395
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
396
|
+
visibility: "public" | "private" | "hidden";
|
|
397
|
+
sellCurrency: string;
|
|
398
|
+
sellAmountCents: number | null;
|
|
399
|
+
startDate: string | null;
|
|
400
|
+
endDate: string | null;
|
|
401
|
+
pax: number | null;
|
|
402
|
+
productType: {
|
|
403
|
+
id: string;
|
|
404
|
+
code: string;
|
|
405
|
+
name: string;
|
|
406
|
+
description: string | null;
|
|
407
|
+
} | null;
|
|
408
|
+
categories: {
|
|
409
|
+
id: string;
|
|
410
|
+
parentId: string | null;
|
|
411
|
+
name: string;
|
|
412
|
+
slug: string;
|
|
413
|
+
description: string | null;
|
|
414
|
+
sortOrder: number;
|
|
415
|
+
}[];
|
|
416
|
+
tags: {
|
|
417
|
+
id: string;
|
|
418
|
+
name: string;
|
|
419
|
+
}[];
|
|
420
|
+
capabilities: string[];
|
|
421
|
+
destinations: {
|
|
422
|
+
id: string;
|
|
423
|
+
parentId: string | null;
|
|
424
|
+
slug: string;
|
|
425
|
+
name: string;
|
|
426
|
+
description: string | null;
|
|
427
|
+
seoTitle: string | null;
|
|
428
|
+
seoDescription: string | null;
|
|
429
|
+
destinationType: string;
|
|
430
|
+
sortOrder: number;
|
|
431
|
+
}[];
|
|
432
|
+
locations: {
|
|
433
|
+
id: string;
|
|
434
|
+
locationType: "other" | "start" | "end" | "meeting_point" | "pickup" | "dropoff" | "point_of_interest";
|
|
435
|
+
title: string;
|
|
436
|
+
address: string | null;
|
|
437
|
+
city: string | null;
|
|
438
|
+
countryCode: string | null;
|
|
439
|
+
latitude: number | null;
|
|
440
|
+
longitude: number | null;
|
|
441
|
+
sortOrder: number;
|
|
442
|
+
}[];
|
|
443
|
+
coverMedia: {
|
|
444
|
+
id: string;
|
|
445
|
+
mediaType: "image" | "video" | "document";
|
|
446
|
+
name: string;
|
|
447
|
+
url: string;
|
|
448
|
+
mimeType: string | null;
|
|
449
|
+
altText: string | null;
|
|
450
|
+
sortOrder: number;
|
|
451
|
+
isCover: boolean;
|
|
452
|
+
isBrochure: boolean;
|
|
453
|
+
isBrochureCurrent: boolean;
|
|
454
|
+
brochureVersion: number | null;
|
|
455
|
+
} | null;
|
|
456
|
+
isFeatured: boolean;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
outputFormat: "json";
|
|
460
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
} & {
|
|
464
|
+
"/:id/brochure": {
|
|
465
|
+
$get: {
|
|
466
|
+
input: {
|
|
467
|
+
param: {
|
|
468
|
+
id: string;
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
output: {
|
|
472
|
+
error: string;
|
|
473
|
+
};
|
|
474
|
+
outputFormat: "json";
|
|
475
|
+
status: 404;
|
|
476
|
+
} | {
|
|
477
|
+
input: {
|
|
478
|
+
param: {
|
|
479
|
+
id: string;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
output: {
|
|
483
|
+
data: never;
|
|
484
|
+
};
|
|
485
|
+
outputFormat: "json";
|
|
486
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
}, "/", "/:id/brochure">;
|
|
490
|
+
export type PublicProductRoutes = typeof publicProductRoutes;
|
|
491
|
+
export {};
|
|
492
|
+
//# sourceMappingURL=routes-public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAYjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwE5B,CAAA;AAEJ,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { publicProductsService } from "./service-public.js";
|
|
3
|
+
import { publicCatalogCategoryListQuerySchema, publicCatalogDestinationListQuerySchema, publicCatalogProductListQuerySchema, publicCatalogProductLookupBySlugQuerySchema, publicCatalogTagListQuerySchema, } from "./validation-public.js";
|
|
4
|
+
export const publicProductRoutes = new Hono()
|
|
5
|
+
.get("/", async (c) => {
|
|
6
|
+
const query = publicCatalogProductListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
7
|
+
return c.json(await publicProductsService.listCatalogProducts(c.get("db"), query));
|
|
8
|
+
})
|
|
9
|
+
.get("/slug/:slug", async (c) => {
|
|
10
|
+
const query = publicCatalogProductLookupBySlugQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
11
|
+
const row = await publicProductsService.getCatalogProductBySlug(c.get("db"), c.req.param("slug"), query);
|
|
12
|
+
if (!row) {
|
|
13
|
+
return c.json({ error: "Catalog product not found" }, 404);
|
|
14
|
+
}
|
|
15
|
+
return c.json({ data: row });
|
|
16
|
+
})
|
|
17
|
+
.get("/categories", async (c) => {
|
|
18
|
+
const query = publicCatalogCategoryListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
19
|
+
return c.json(await publicProductsService.listCatalogCategories(c.get("db"), query));
|
|
20
|
+
})
|
|
21
|
+
.get("/tags", async (c) => {
|
|
22
|
+
const query = publicCatalogTagListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
23
|
+
return c.json(await publicProductsService.listCatalogTags(c.get("db"), query));
|
|
24
|
+
})
|
|
25
|
+
.get("/destinations", async (c) => {
|
|
26
|
+
const query = publicCatalogDestinationListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
27
|
+
return c.json(await publicProductsService.listCatalogDestinations(c.get("db"), query));
|
|
28
|
+
})
|
|
29
|
+
.get("/:id", async (c) => {
|
|
30
|
+
const query = publicCatalogProductLookupBySlugQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
31
|
+
const row = await publicProductsService.getCatalogProductById(c.get("db"), c.req.param("id"), query);
|
|
32
|
+
if (!row) {
|
|
33
|
+
return c.json({ error: "Catalog product not found" }, 404);
|
|
34
|
+
}
|
|
35
|
+
return c.json({ data: row });
|
|
36
|
+
})
|
|
37
|
+
.get("/:id/brochure", async (c) => {
|
|
38
|
+
const query = publicCatalogProductLookupBySlugQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
39
|
+
const row = await publicProductsService.getCatalogProductBrochure(c.get("db"), c.req.param("id"), query);
|
|
40
|
+
if (!row) {
|
|
41
|
+
return c.json({ error: "Catalog product brochure not found" }, 404);
|
|
42
|
+
}
|
|
43
|
+
return c.json({ data: row });
|
|
44
|
+
});
|