@voyantjs/products 0.52.1 → 0.52.3

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.
Files changed (73) hide show
  1. package/dist/action-ledger-drift.d.ts +29 -0
  2. package/dist/action-ledger-drift.d.ts.map +1 -0
  3. package/dist/action-ledger-drift.js +335 -0
  4. package/dist/action-ledger.d.ts +104 -0
  5. package/dist/action-ledger.d.ts.map +1 -0
  6. package/dist/action-ledger.js +100 -0
  7. package/dist/booking-extension.d.ts +3 -3
  8. package/dist/catalog-policy.d.ts.map +1 -1
  9. package/dist/catalog-policy.js +18 -0
  10. package/dist/content-shape.d.ts +2 -0
  11. package/dist/content-shape.d.ts.map +1 -1
  12. package/dist/content-shape.js +2 -0
  13. package/dist/events.d.ts +1 -1
  14. package/dist/events.d.ts.map +1 -1
  15. package/dist/route-env.d.ts +22 -0
  16. package/dist/route-env.d.ts.map +1 -0
  17. package/dist/route-env.js +1 -0
  18. package/dist/routes-associations.d.ts +164 -0
  19. package/dist/routes-associations.d.ts.map +1 -0
  20. package/dist/routes-associations.js +100 -0
  21. package/dist/routes-catalog.d.ts +436 -0
  22. package/dist/routes-catalog.d.ts.map +1 -0
  23. package/dist/routes-catalog.js +104 -0
  24. package/dist/routes-configuration.d.ts +773 -0
  25. package/dist/routes-configuration.d.ts.map +1 -0
  26. package/dist/routes-configuration.js +364 -0
  27. package/dist/routes-core.d.ts +302 -0
  28. package/dist/routes-core.d.ts.map +1 -0
  29. package/dist/routes-core.js +79 -0
  30. package/dist/routes-itinerary.d.ts +614 -0
  31. package/dist/routes-itinerary.d.ts.map +1 -0
  32. package/dist/routes-itinerary.js +309 -0
  33. package/dist/routes-maintenance.d.ts +32 -0
  34. package/dist/routes-maintenance.d.ts.map +1 -0
  35. package/dist/routes-maintenance.js +14 -0
  36. package/dist/routes-media.d.ts +634 -0
  37. package/dist/routes-media.d.ts.map +1 -0
  38. package/dist/routes-media.js +245 -0
  39. package/dist/routes-merchandising.d.ts +1108 -0
  40. package/dist/routes-merchandising.d.ts.map +1 -0
  41. package/dist/routes-merchandising.js +376 -0
  42. package/dist/routes-options.d.ts +363 -0
  43. package/dist/routes-options.d.ts.map +1 -0
  44. package/dist/routes-options.js +173 -0
  45. package/dist/routes-public.d.ts +4 -4
  46. package/dist/routes-translations.d.ts +477 -0
  47. package/dist/routes-translations.d.ts.map +1 -0
  48. package/dist/routes-translations.js +258 -0
  49. package/dist/routes.d.ts +417 -355
  50. package/dist/routes.d.ts.map +1 -1
  51. package/dist/routes.js +21 -1133
  52. package/dist/schema-core.d.ts +3 -3
  53. package/dist/schema-itinerary.d.ts +1 -1
  54. package/dist/schema-settings.d.ts +4 -4
  55. package/dist/service-catalog-plane.d.ts.map +1 -1
  56. package/dist/service-catalog-plane.js +48 -1
  57. package/dist/service-catalog.d.ts +2 -2
  58. package/dist/service-content-owned.d.ts.map +1 -1
  59. package/dist/service-content-owned.js +98 -4
  60. package/dist/service-public.d.ts +4 -4
  61. package/dist/service.d.ts +225 -97
  62. package/dist/service.d.ts.map +1 -1
  63. package/dist/service.js +91 -0
  64. package/dist/tasks/brochures.d.ts +1 -1
  65. package/dist/validation-catalog.d.ts +10 -10
  66. package/dist/validation-config.d.ts +17 -17
  67. package/dist/validation-content.d.ts +26 -26
  68. package/dist/validation-core.d.ts +46 -46
  69. package/dist/validation-core.d.ts.map +1 -1
  70. package/dist/validation-core.js +17 -1
  71. package/dist/validation-public.d.ts +25 -25
  72. package/dist/validation-shared.d.ts +11 -11
  73. package/package.json +13 -7
@@ -0,0 +1,436 @@
1
+ import type { Env } from "./route-env.js";
2
+ export declare const productCatalogRoutes: import("hono/hono-base").HonoBase<Env, {
3
+ "/product-types": {
4
+ $get: {
5
+ input: {};
6
+ output: {
7
+ data: {
8
+ id: string;
9
+ name: string;
10
+ code: string;
11
+ description: string | null;
12
+ sortOrder: number;
13
+ active: boolean;
14
+ metadata: {
15
+ [x: string]: import("hono/utils/types").JSONValue;
16
+ } | null;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ }[];
20
+ total: number;
21
+ limit: number;
22
+ offset: number;
23
+ };
24
+ outputFormat: "json";
25
+ status: import("hono/utils/http-status").ContentfulStatusCode;
26
+ };
27
+ };
28
+ } & {
29
+ "/product-types/:typeId": {
30
+ $get: {
31
+ input: {
32
+ param: {
33
+ typeId: string;
34
+ };
35
+ };
36
+ output: {
37
+ error: string;
38
+ };
39
+ outputFormat: "json";
40
+ status: 404;
41
+ } | {
42
+ input: {
43
+ param: {
44
+ typeId: string;
45
+ };
46
+ };
47
+ output: {
48
+ data: {
49
+ id: string;
50
+ name: string;
51
+ code: string;
52
+ description: string | null;
53
+ sortOrder: number;
54
+ active: boolean;
55
+ metadata: {
56
+ [x: string]: import("hono/utils/types").JSONValue;
57
+ } | null;
58
+ createdAt: string;
59
+ updatedAt: string;
60
+ };
61
+ };
62
+ outputFormat: "json";
63
+ status: import("hono/utils/http-status").ContentfulStatusCode;
64
+ };
65
+ };
66
+ } & {
67
+ "/product-types": {
68
+ $post: {
69
+ input: {};
70
+ output: {
71
+ data: {
72
+ name: string;
73
+ id: string;
74
+ description: string | null;
75
+ createdAt: string;
76
+ active: boolean;
77
+ updatedAt: string;
78
+ code: string;
79
+ sortOrder: number;
80
+ metadata: {
81
+ [x: string]: import("hono/utils/types").JSONValue;
82
+ } | null;
83
+ } | undefined;
84
+ };
85
+ outputFormat: "json";
86
+ status: 201;
87
+ };
88
+ };
89
+ } & {
90
+ "/product-types/:typeId": {
91
+ $patch: {
92
+ input: {
93
+ param: {
94
+ typeId: string;
95
+ };
96
+ };
97
+ output: {
98
+ error: string;
99
+ };
100
+ outputFormat: "json";
101
+ status: 404;
102
+ } | {
103
+ input: {
104
+ param: {
105
+ typeId: string;
106
+ };
107
+ };
108
+ output: {
109
+ data: {
110
+ id: string;
111
+ name: string;
112
+ code: string;
113
+ description: string | null;
114
+ sortOrder: number;
115
+ active: boolean;
116
+ metadata: {
117
+ [x: string]: import("hono/utils/types").JSONValue;
118
+ } | null;
119
+ createdAt: string;
120
+ updatedAt: string;
121
+ };
122
+ };
123
+ outputFormat: "json";
124
+ status: import("hono/utils/http-status").ContentfulStatusCode;
125
+ };
126
+ };
127
+ } & {
128
+ "/product-types/:typeId": {
129
+ $delete: {
130
+ input: {
131
+ param: {
132
+ typeId: string;
133
+ };
134
+ };
135
+ output: {
136
+ error: string;
137
+ };
138
+ outputFormat: "json";
139
+ status: 404;
140
+ } | {
141
+ input: {
142
+ param: {
143
+ typeId: string;
144
+ };
145
+ };
146
+ output: {
147
+ success: true;
148
+ };
149
+ outputFormat: "json";
150
+ status: 200;
151
+ };
152
+ };
153
+ } & {
154
+ "/product-categories": {
155
+ $get: {
156
+ input: {};
157
+ output: {
158
+ data: {
159
+ id: string;
160
+ parentId: string | null;
161
+ name: string;
162
+ slug: string;
163
+ description: string | null;
164
+ sortOrder: number;
165
+ active: boolean;
166
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
167
+ metadata: {
168
+ [x: string]: import("hono/utils/types").JSONValue;
169
+ } | null;
170
+ createdAt: string;
171
+ updatedAt: string;
172
+ }[];
173
+ total: number;
174
+ limit: number;
175
+ offset: number;
176
+ };
177
+ outputFormat: "json";
178
+ status: import("hono/utils/http-status").ContentfulStatusCode;
179
+ };
180
+ };
181
+ } & {
182
+ "/product-categories/:categoryId": {
183
+ $get: {
184
+ input: {
185
+ param: {
186
+ categoryId: string;
187
+ };
188
+ };
189
+ output: {
190
+ error: string;
191
+ };
192
+ outputFormat: "json";
193
+ status: 404;
194
+ } | {
195
+ input: {
196
+ param: {
197
+ categoryId: string;
198
+ };
199
+ };
200
+ output: {
201
+ data: {
202
+ id: string;
203
+ parentId: string | null;
204
+ name: string;
205
+ slug: string;
206
+ description: string | null;
207
+ sortOrder: number;
208
+ active: boolean;
209
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
210
+ metadata: {
211
+ [x: string]: import("hono/utils/types").JSONValue;
212
+ } | null;
213
+ createdAt: string;
214
+ updatedAt: string;
215
+ };
216
+ };
217
+ outputFormat: "json";
218
+ status: import("hono/utils/http-status").ContentfulStatusCode;
219
+ };
220
+ };
221
+ } & {
222
+ "/product-categories": {
223
+ $post: {
224
+ input: {};
225
+ output: {
226
+ data: {
227
+ name: string;
228
+ id: string;
229
+ description: string | null;
230
+ createdAt: string;
231
+ active: boolean;
232
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
233
+ updatedAt: string;
234
+ sortOrder: number;
235
+ slug: string;
236
+ metadata: {
237
+ [x: string]: import("hono/utils/types").JSONValue;
238
+ } | null;
239
+ parentId: string | null;
240
+ } | undefined;
241
+ };
242
+ outputFormat: "json";
243
+ status: 201;
244
+ };
245
+ };
246
+ } & {
247
+ "/product-categories/:categoryId": {
248
+ $patch: {
249
+ input: {
250
+ param: {
251
+ categoryId: string;
252
+ };
253
+ };
254
+ output: {
255
+ error: string;
256
+ };
257
+ outputFormat: "json";
258
+ status: 404;
259
+ } | {
260
+ input: {
261
+ param: {
262
+ categoryId: string;
263
+ };
264
+ };
265
+ output: {
266
+ data: {
267
+ id: string;
268
+ parentId: string | null;
269
+ name: string;
270
+ slug: string;
271
+ description: string | null;
272
+ sortOrder: number;
273
+ active: boolean;
274
+ customerPaymentPolicy: import("hono/utils/types").JSONValue;
275
+ metadata: {
276
+ [x: string]: import("hono/utils/types").JSONValue;
277
+ } | null;
278
+ createdAt: string;
279
+ updatedAt: string;
280
+ };
281
+ };
282
+ outputFormat: "json";
283
+ status: import("hono/utils/http-status").ContentfulStatusCode;
284
+ };
285
+ };
286
+ } & {
287
+ "/product-categories/:categoryId": {
288
+ $delete: {
289
+ input: {
290
+ param: {
291
+ categoryId: string;
292
+ };
293
+ };
294
+ output: {
295
+ error: string;
296
+ };
297
+ outputFormat: "json";
298
+ status: 404;
299
+ } | {
300
+ input: {
301
+ param: {
302
+ categoryId: string;
303
+ };
304
+ };
305
+ output: {
306
+ success: true;
307
+ };
308
+ outputFormat: "json";
309
+ status: 200;
310
+ };
311
+ };
312
+ } & {
313
+ "/product-tags": {
314
+ $get: {
315
+ input: {};
316
+ output: {
317
+ data: {
318
+ id: string;
319
+ name: string;
320
+ createdAt: string;
321
+ updatedAt: string;
322
+ }[];
323
+ total: number;
324
+ limit: number;
325
+ offset: number;
326
+ };
327
+ outputFormat: "json";
328
+ status: import("hono/utils/http-status").ContentfulStatusCode;
329
+ };
330
+ };
331
+ } & {
332
+ "/product-tags/:tagId": {
333
+ $get: {
334
+ input: {
335
+ param: {
336
+ tagId: string;
337
+ };
338
+ };
339
+ output: {
340
+ error: string;
341
+ };
342
+ outputFormat: "json";
343
+ status: 404;
344
+ } | {
345
+ input: {
346
+ param: {
347
+ tagId: string;
348
+ };
349
+ };
350
+ output: {
351
+ data: {
352
+ id: string;
353
+ name: string;
354
+ createdAt: string;
355
+ updatedAt: string;
356
+ };
357
+ };
358
+ outputFormat: "json";
359
+ status: import("hono/utils/http-status").ContentfulStatusCode;
360
+ };
361
+ };
362
+ } & {
363
+ "/product-tags": {
364
+ $post: {
365
+ input: {};
366
+ output: {
367
+ data: {
368
+ name: string;
369
+ id: string;
370
+ createdAt: string;
371
+ updatedAt: string;
372
+ } | undefined;
373
+ };
374
+ outputFormat: "json";
375
+ status: 201;
376
+ };
377
+ };
378
+ } & {
379
+ "/product-tags/:tagId": {
380
+ $patch: {
381
+ input: {
382
+ param: {
383
+ tagId: string;
384
+ };
385
+ };
386
+ output: {
387
+ error: string;
388
+ };
389
+ outputFormat: "json";
390
+ status: 404;
391
+ } | {
392
+ input: {
393
+ param: {
394
+ tagId: string;
395
+ };
396
+ };
397
+ output: {
398
+ data: {
399
+ id: string;
400
+ name: string;
401
+ createdAt: string;
402
+ updatedAt: string;
403
+ };
404
+ };
405
+ outputFormat: "json";
406
+ status: import("hono/utils/http-status").ContentfulStatusCode;
407
+ };
408
+ };
409
+ } & {
410
+ "/product-tags/:tagId": {
411
+ $delete: {
412
+ input: {
413
+ param: {
414
+ tagId: string;
415
+ };
416
+ };
417
+ output: {
418
+ error: string;
419
+ };
420
+ outputFormat: "json";
421
+ status: 404;
422
+ } | {
423
+ input: {
424
+ param: {
425
+ tagId: string;
426
+ };
427
+ };
428
+ output: {
429
+ success: true;
430
+ };
431
+ outputFormat: "json";
432
+ status: 200;
433
+ };
434
+ };
435
+ }, "/", "/product-tags/:tagId">;
436
+ //# sourceMappingURL=routes-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-catalog.d.ts","sourceRoot":"","sources":["../src/routes-catalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAIzC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAkJ7B,CAAA"}
@@ -0,0 +1,104 @@
1
+ import { parseJsonBody, parseQuery } from "@voyantjs/hono";
2
+ import { Hono } from "hono";
3
+ import { productsService } from "./service.js";
4
+ import * as validation from "./validation.js";
5
+ export const productCatalogRoutes = new Hono()
6
+ // ==========================================================================
7
+ // Product Types
8
+ // ==========================================================================
9
+ .get("/product-types", async (c) => {
10
+ const query = parseQuery(c, validation.productTypeListQuerySchema);
11
+ return c.json(await productsService.listProductTypes(c.get("db"), query));
12
+ })
13
+ .get("/product-types/:typeId", async (c) => {
14
+ const row = await productsService.getProductTypeById(c.get("db"), c.req.param("typeId"));
15
+ if (!row) {
16
+ return c.json({ error: "Product type not found" }, 404);
17
+ }
18
+ return c.json({ data: row });
19
+ })
20
+ .post("/product-types", async (c) => {
21
+ return c.json({
22
+ data: await productsService.createProductType(c.get("db"), await parseJsonBody(c, validation.insertProductTypeSchema)),
23
+ }, 201);
24
+ })
25
+ .patch("/product-types/:typeId", async (c) => {
26
+ const row = await productsService.updateProductType(c.get("db"), c.req.param("typeId"), await parseJsonBody(c, validation.updateProductTypeSchema));
27
+ if (!row) {
28
+ return c.json({ error: "Product type not found" }, 404);
29
+ }
30
+ return c.json({ data: row });
31
+ })
32
+ .delete("/product-types/:typeId", async (c) => {
33
+ const row = await productsService.deleteProductType(c.get("db"), c.req.param("typeId"));
34
+ if (!row) {
35
+ return c.json({ error: "Product type not found" }, 404);
36
+ }
37
+ return c.json({ success: true }, 200);
38
+ })
39
+ // ==========================================================================
40
+ // Product Categories
41
+ // ==========================================================================
42
+ .get("/product-categories", async (c) => {
43
+ const query = parseQuery(c, validation.productCategoryListQuerySchema);
44
+ return c.json(await productsService.listProductCategories(c.get("db"), query));
45
+ })
46
+ .get("/product-categories/:categoryId", async (c) => {
47
+ const row = await productsService.getProductCategoryById(c.get("db"), c.req.param("categoryId"));
48
+ if (!row) {
49
+ return c.json({ error: "Product category not found" }, 404);
50
+ }
51
+ return c.json({ data: row });
52
+ })
53
+ .post("/product-categories", async (c) => {
54
+ return c.json({
55
+ data: await productsService.createProductCategory(c.get("db"), await parseJsonBody(c, validation.insertProductCategorySchema)),
56
+ }, 201);
57
+ })
58
+ .patch("/product-categories/:categoryId", async (c) => {
59
+ const row = await productsService.updateProductCategory(c.get("db"), c.req.param("categoryId"), await parseJsonBody(c, validation.updateProductCategorySchema));
60
+ if (!row) {
61
+ return c.json({ error: "Product category not found" }, 404);
62
+ }
63
+ return c.json({ data: row });
64
+ })
65
+ .delete("/product-categories/:categoryId", async (c) => {
66
+ const row = await productsService.deleteProductCategory(c.get("db"), c.req.param("categoryId"));
67
+ if (!row) {
68
+ return c.json({ error: "Product category not found" }, 404);
69
+ }
70
+ return c.json({ success: true }, 200);
71
+ })
72
+ // ==========================================================================
73
+ // Product Tags
74
+ // ==========================================================================
75
+ .get("/product-tags", async (c) => {
76
+ const query = parseQuery(c, validation.productTagListQuerySchema);
77
+ return c.json(await productsService.listProductTags(c.get("db"), query));
78
+ })
79
+ .get("/product-tags/:tagId", async (c) => {
80
+ const row = await productsService.getProductTagById(c.get("db"), c.req.param("tagId"));
81
+ if (!row) {
82
+ return c.json({ error: "Product tag not found" }, 404);
83
+ }
84
+ return c.json({ data: row });
85
+ })
86
+ .post("/product-tags", async (c) => {
87
+ return c.json({
88
+ data: await productsService.createProductTag(c.get("db"), await parseJsonBody(c, validation.insertProductTagSchema)),
89
+ }, 201);
90
+ })
91
+ .patch("/product-tags/:tagId", async (c) => {
92
+ const row = await productsService.updateProductTag(c.get("db"), c.req.param("tagId"), await parseJsonBody(c, validation.updateProductTagSchema));
93
+ if (!row) {
94
+ return c.json({ error: "Product tag not found" }, 404);
95
+ }
96
+ return c.json({ data: row });
97
+ })
98
+ .delete("/product-tags/:tagId", async (c) => {
99
+ const row = await productsService.deleteProductTag(c.get("db"), c.req.param("tagId"));
100
+ if (!row) {
101
+ return c.json({ error: "Product tag not found" }, 404);
102
+ }
103
+ return c.json({ success: true }, 200);
104
+ });