@voyantjs/products 0.2.0 → 0.3.1
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 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/routes-public.d.ts +337 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +32 -0
- package/dist/routes.d.ts +4 -4
- package/dist/schema-core.d.ts +897 -0
- package/dist/schema-core.d.ts.map +1 -0
- package/dist/schema-core.js +77 -0
- package/dist/schema-itinerary.d.ts +828 -0
- package/dist/schema-itinerary.d.ts.map +1 -0
- package/dist/schema-itinerary.js +77 -0
- package/dist/schema-relations.d.ts +99 -0
- package/dist/schema-relations.d.ts.map +1 -0
- package/dist/schema-relations.js +155 -0
- package/dist/schema-settings.d.ts +1749 -0
- package/dist/schema-settings.d.ts.map +1 -0
- package/dist/schema-settings.js +175 -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-taxonomy.d.ts +573 -0
- package/dist/schema-taxonomy.d.ts.map +1 -0
- package/dist/schema-taxonomy.js +65 -0
- package/dist/schema.d.ts +6 -4155
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +6 -653
- package/dist/service-public.d.ts +259 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +479 -0
- package/dist/service.d.ts +4 -4
- package/dist/validation-config.d.ts +233 -0
- package/dist/validation-config.d.ts.map +1 -0
- package/dist/validation-config.js +73 -0
- package/dist/validation-content.d.ts +358 -0
- package/dist/validation-content.d.ts.map +1 -0
- package/dist/validation-content.js +177 -0
- package/dist/validation-core.d.ts +268 -0
- package/dist/validation-core.d.ts.map +1 -0
- package/dist/validation-core.js +91 -0
- package/dist/validation-public.d.ts +454 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +130 -0
- package/dist/validation-shared.d.ts +108 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +87 -0
- package/dist/validation.d.ts +5 -854
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +5 -433
- package/package.json +12 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ 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 { publicProductsService } from "./service-public.js";
|
|
6
9
|
export declare const productLinkable: LinkableDefinition;
|
|
7
10
|
export declare const productsModule: Module;
|
|
8
11
|
export declare const productsHonoModule: HonoModule;
|
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,9 @@
|
|
|
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 { publicProductsService } from "./service-public.js";
|
|
4
7
|
export const productLinkable = {
|
|
5
8
|
module: "products",
|
|
6
9
|
entity: "product",
|
|
@@ -15,6 +18,8 @@ export const productsModule = {
|
|
|
15
18
|
};
|
|
16
19
|
export const productsHonoModule = {
|
|
17
20
|
module: productsModule,
|
|
21
|
+
adminRoutes: productRoutes,
|
|
22
|
+
publicRoutes: publicProductRoutes,
|
|
18
23
|
routes: productRoutes,
|
|
19
24
|
};
|
|
20
25
|
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";
|
|
@@ -0,0 +1,337 @@
|
|
|
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
|
+
coverMedia: {
|
|
50
|
+
id: string;
|
|
51
|
+
mediaType: "image" | "video" | "document";
|
|
52
|
+
name: string;
|
|
53
|
+
url: string;
|
|
54
|
+
mimeType: string | null;
|
|
55
|
+
altText: string | null;
|
|
56
|
+
sortOrder: number;
|
|
57
|
+
isCover: boolean;
|
|
58
|
+
} | null;
|
|
59
|
+
isFeatured: boolean;
|
|
60
|
+
} | {
|
|
61
|
+
media: {
|
|
62
|
+
id: string;
|
|
63
|
+
mediaType: "image" | "video" | "document";
|
|
64
|
+
name: string;
|
|
65
|
+
url: string;
|
|
66
|
+
mimeType: string | null;
|
|
67
|
+
altText: string | null;
|
|
68
|
+
sortOrder: number;
|
|
69
|
+
isCover: boolean;
|
|
70
|
+
}[];
|
|
71
|
+
features: {
|
|
72
|
+
id: string;
|
|
73
|
+
featureType: "other" | "inclusion" | "exclusion" | "highlight" | "important_information";
|
|
74
|
+
title: string;
|
|
75
|
+
description: string | null;
|
|
76
|
+
sortOrder: number;
|
|
77
|
+
}[];
|
|
78
|
+
faqs: {
|
|
79
|
+
id: string;
|
|
80
|
+
question: string;
|
|
81
|
+
answer: string;
|
|
82
|
+
sortOrder: number;
|
|
83
|
+
}[];
|
|
84
|
+
locations: {
|
|
85
|
+
id: string;
|
|
86
|
+
locationType: "other" | "start" | "end" | "meeting_point" | "pickup" | "dropoff" | "point_of_interest";
|
|
87
|
+
title: string;
|
|
88
|
+
address: string | null;
|
|
89
|
+
city: string | null;
|
|
90
|
+
countryCode: string | null;
|
|
91
|
+
latitude: number | null;
|
|
92
|
+
longitude: number | null;
|
|
93
|
+
sortOrder: number;
|
|
94
|
+
}[];
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description: string | null;
|
|
98
|
+
contentLanguageTag: string | null;
|
|
99
|
+
slug: string | null;
|
|
100
|
+
shortDescription: string | null;
|
|
101
|
+
seoTitle: string | null;
|
|
102
|
+
seoDescription: string | null;
|
|
103
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
104
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
105
|
+
visibility: "public" | "private" | "hidden";
|
|
106
|
+
sellCurrency: string;
|
|
107
|
+
sellAmountCents: number | null;
|
|
108
|
+
startDate: string | null;
|
|
109
|
+
endDate: string | null;
|
|
110
|
+
pax: number | null;
|
|
111
|
+
productType: {
|
|
112
|
+
id: string;
|
|
113
|
+
code: string;
|
|
114
|
+
name: string;
|
|
115
|
+
description: string | null;
|
|
116
|
+
} | null;
|
|
117
|
+
categories: {
|
|
118
|
+
id: string;
|
|
119
|
+
parentId: string | null;
|
|
120
|
+
name: string;
|
|
121
|
+
slug: string;
|
|
122
|
+
description: string | null;
|
|
123
|
+
sortOrder: number;
|
|
124
|
+
}[];
|
|
125
|
+
tags: {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
}[];
|
|
129
|
+
capabilities: string[];
|
|
130
|
+
coverMedia: {
|
|
131
|
+
id: string;
|
|
132
|
+
mediaType: "image" | "video" | "document";
|
|
133
|
+
name: string;
|
|
134
|
+
url: string;
|
|
135
|
+
mimeType: string | null;
|
|
136
|
+
altText: string | null;
|
|
137
|
+
sortOrder: number;
|
|
138
|
+
isCover: boolean;
|
|
139
|
+
} | null;
|
|
140
|
+
isFeatured: boolean;
|
|
141
|
+
})[];
|
|
142
|
+
total: number;
|
|
143
|
+
limit: number;
|
|
144
|
+
offset: number;
|
|
145
|
+
};
|
|
146
|
+
outputFormat: "json";
|
|
147
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
} & {
|
|
151
|
+
"/slug/:slug": {
|
|
152
|
+
$get: {
|
|
153
|
+
input: {
|
|
154
|
+
param: {
|
|
155
|
+
slug: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
output: {
|
|
159
|
+
error: string;
|
|
160
|
+
};
|
|
161
|
+
outputFormat: "json";
|
|
162
|
+
status: 404;
|
|
163
|
+
} | {
|
|
164
|
+
input: {
|
|
165
|
+
param: {
|
|
166
|
+
slug: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
output: {
|
|
170
|
+
data: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
description: string | null;
|
|
174
|
+
contentLanguageTag: string | null;
|
|
175
|
+
slug: string | null;
|
|
176
|
+
shortDescription: string | null;
|
|
177
|
+
seoTitle: string | null;
|
|
178
|
+
seoDescription: string | null;
|
|
179
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
180
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
181
|
+
visibility: "public" | "private" | "hidden";
|
|
182
|
+
sellCurrency: string;
|
|
183
|
+
sellAmountCents: number | null;
|
|
184
|
+
startDate: string | null;
|
|
185
|
+
endDate: string | null;
|
|
186
|
+
pax: number | null;
|
|
187
|
+
productType: {
|
|
188
|
+
id: string;
|
|
189
|
+
code: string;
|
|
190
|
+
name: string;
|
|
191
|
+
description: string | null;
|
|
192
|
+
} | null;
|
|
193
|
+
categories: {
|
|
194
|
+
id: string;
|
|
195
|
+
parentId: string | null;
|
|
196
|
+
name: string;
|
|
197
|
+
slug: string;
|
|
198
|
+
description: string | null;
|
|
199
|
+
sortOrder: number;
|
|
200
|
+
}[];
|
|
201
|
+
tags: {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
}[];
|
|
205
|
+
capabilities: string[];
|
|
206
|
+
coverMedia: {
|
|
207
|
+
id: string;
|
|
208
|
+
mediaType: "image" | "video" | "document";
|
|
209
|
+
name: string;
|
|
210
|
+
url: string;
|
|
211
|
+
mimeType: string | null;
|
|
212
|
+
altText: string | null;
|
|
213
|
+
sortOrder: number;
|
|
214
|
+
isCover: boolean;
|
|
215
|
+
} | null;
|
|
216
|
+
isFeatured: boolean;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
outputFormat: "json";
|
|
220
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
} & {
|
|
224
|
+
"/categories": {
|
|
225
|
+
$get: {
|
|
226
|
+
input: {};
|
|
227
|
+
output: {
|
|
228
|
+
data: {
|
|
229
|
+
parentId: string | null;
|
|
230
|
+
description: string | null;
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
slug: string;
|
|
234
|
+
sortOrder: number;
|
|
235
|
+
}[];
|
|
236
|
+
total: number;
|
|
237
|
+
limit: number;
|
|
238
|
+
offset: number;
|
|
239
|
+
};
|
|
240
|
+
outputFormat: "json";
|
|
241
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
} & {
|
|
245
|
+
"/tags": {
|
|
246
|
+
$get: {
|
|
247
|
+
input: {};
|
|
248
|
+
output: {
|
|
249
|
+
data: {
|
|
250
|
+
id: string;
|
|
251
|
+
name: string;
|
|
252
|
+
}[];
|
|
253
|
+
total: number;
|
|
254
|
+
limit: number;
|
|
255
|
+
offset: number;
|
|
256
|
+
};
|
|
257
|
+
outputFormat: "json";
|
|
258
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
} & {
|
|
262
|
+
"/:id": {
|
|
263
|
+
$get: {
|
|
264
|
+
input: {
|
|
265
|
+
param: {
|
|
266
|
+
id: string;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
output: {
|
|
270
|
+
error: string;
|
|
271
|
+
};
|
|
272
|
+
outputFormat: "json";
|
|
273
|
+
status: 404;
|
|
274
|
+
} | {
|
|
275
|
+
input: {
|
|
276
|
+
param: {
|
|
277
|
+
id: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
output: {
|
|
281
|
+
data: {
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
description: string | null;
|
|
285
|
+
contentLanguageTag: string | null;
|
|
286
|
+
slug: string | null;
|
|
287
|
+
shortDescription: string | null;
|
|
288
|
+
seoTitle: string | null;
|
|
289
|
+
seoDescription: string | null;
|
|
290
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
291
|
+
capacityMode: "free_sale" | "limited" | "on_request";
|
|
292
|
+
visibility: "public" | "private" | "hidden";
|
|
293
|
+
sellCurrency: string;
|
|
294
|
+
sellAmountCents: number | null;
|
|
295
|
+
startDate: string | null;
|
|
296
|
+
endDate: string | null;
|
|
297
|
+
pax: number | null;
|
|
298
|
+
productType: {
|
|
299
|
+
id: string;
|
|
300
|
+
code: string;
|
|
301
|
+
name: string;
|
|
302
|
+
description: string | null;
|
|
303
|
+
} | null;
|
|
304
|
+
categories: {
|
|
305
|
+
id: string;
|
|
306
|
+
parentId: string | null;
|
|
307
|
+
name: string;
|
|
308
|
+
slug: string;
|
|
309
|
+
description: string | null;
|
|
310
|
+
sortOrder: number;
|
|
311
|
+
}[];
|
|
312
|
+
tags: {
|
|
313
|
+
id: string;
|
|
314
|
+
name: string;
|
|
315
|
+
}[];
|
|
316
|
+
capabilities: string[];
|
|
317
|
+
coverMedia: {
|
|
318
|
+
id: string;
|
|
319
|
+
mediaType: "image" | "video" | "document";
|
|
320
|
+
name: string;
|
|
321
|
+
url: string;
|
|
322
|
+
mimeType: string | null;
|
|
323
|
+
altText: string | null;
|
|
324
|
+
sortOrder: number;
|
|
325
|
+
isCover: boolean;
|
|
326
|
+
} | null;
|
|
327
|
+
isFeatured: boolean;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
outputFormat: "json";
|
|
331
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
}, "/", "/:id">;
|
|
335
|
+
export type PublicProductRoutes = typeof publicProductRoutes;
|
|
336
|
+
export {};
|
|
337
|
+
//# 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;AAWjE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAkD5B,CAAA;AAEJ,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { publicProductsService } from "./service-public.js";
|
|
3
|
+
import { publicCatalogCategoryListQuerySchema, 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("/:id", async (c) => {
|
|
26
|
+
const query = publicCatalogProductLookupBySlugQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
27
|
+
const row = await publicProductsService.getCatalogProductById(c.get("db"), c.req.param("id"), query);
|
|
28
|
+
if (!row) {
|
|
29
|
+
return c.json({ error: "Catalog product not found" }, 404);
|
|
30
|
+
}
|
|
31
|
+
return c.json({ data: row });
|
|
32
|
+
});
|
package/dist/routes.d.ts
CHANGED
|
@@ -632,8 +632,8 @@ export declare const productRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
632
632
|
createdAt: string;
|
|
633
633
|
updatedAt: string;
|
|
634
634
|
id: string;
|
|
635
|
-
capability: "on_request" | "private" | "instant_confirmation" | "pickup_available" | "dropoff_available" | "guided" | "shared" | "digital_ticket" | "voucher_required" | "external_inventory" | "multi_day" | "accommodation" | "transport";
|
|
636
635
|
notes: string | null;
|
|
636
|
+
capability: "on_request" | "private" | "instant_confirmation" | "pickup_available" | "dropoff_available" | "guided" | "shared" | "digital_ticket" | "voucher_required" | "external_inventory" | "multi_day" | "accommodation" | "transport";
|
|
637
637
|
};
|
|
638
638
|
};
|
|
639
639
|
outputFormat: "json";
|
|
@@ -931,8 +931,8 @@ export declare const productRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
931
931
|
description: string | null;
|
|
932
932
|
id: string;
|
|
933
933
|
sortOrder: number;
|
|
934
|
-
featureType: "other" | "inclusion" | "exclusion" | "highlight" | "important_information";
|
|
935
934
|
title: string;
|
|
935
|
+
featureType: "other" | "inclusion" | "exclusion" | "highlight" | "important_information";
|
|
936
936
|
};
|
|
937
937
|
};
|
|
938
938
|
outputFormat: "json";
|
|
@@ -2944,8 +2944,8 @@ export declare const productRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
2944
2944
|
updatedAt: string;
|
|
2945
2945
|
description: string | null;
|
|
2946
2946
|
id: string;
|
|
2947
|
-
title: string | null;
|
|
2948
2947
|
dayNumber: number;
|
|
2948
|
+
title: string | null;
|
|
2949
2949
|
location: string | null;
|
|
2950
2950
|
};
|
|
2951
2951
|
};
|
|
@@ -3084,11 +3084,11 @@ export declare const productRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
3084
3084
|
id: string;
|
|
3085
3085
|
costAmountCents: number;
|
|
3086
3086
|
sortOrder: number | null;
|
|
3087
|
-
notes: string | null;
|
|
3088
3087
|
dayId: string;
|
|
3089
3088
|
serviceType: "other" | "transfer" | "accommodation" | "experience" | "guide" | "meal";
|
|
3090
3089
|
costCurrency: string;
|
|
3091
3090
|
quantity: number;
|
|
3091
|
+
notes: string | null;
|
|
3092
3092
|
};
|
|
3093
3093
|
};
|
|
3094
3094
|
outputFormat: "json";
|