@shophost/rest-api 2.0.36 → 2.0.37

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 (68) hide show
  1. package/package.json +1 -1
  2. package/src/core/hono/hono.d.ts +53 -11
  3. package/src/core/hono/hono.js +1 -1
  4. package/src/core/hono/hono.js.map +1 -1
  5. package/src/features/access/access.handler.js.map +1 -1
  6. package/src/features/access/access.route.d.ts +774 -10
  7. package/src/features/analytics/analytics.handler.js.map +1 -1
  8. package/src/features/analytics/analytics.route.d.ts +146 -1
  9. package/src/features/cart/cart.handler.js.map +1 -1
  10. package/src/features/cart/cart.route.d.ts +349 -1
  11. package/src/features/file/file.handler.js.map +1 -1
  12. package/src/features/file/file.route.d.ts +104 -2
  13. package/src/features/file/file.service.d.ts +2 -1
  14. package/src/features/file/file.service.js.map +1 -1
  15. package/src/features/health/health.handler.js.map +1 -1
  16. package/src/features/health/health.route.d.ts +40 -1
  17. package/src/features/location/location.handler.js +1 -1
  18. package/src/features/location/location.handler.js.map +1 -1
  19. package/src/features/location/location.route.d.ts +118 -2
  20. package/src/features/manufacturer/manufacturer.handler.js.map +1 -1
  21. package/src/features/manufacturer/manufacturer.route.d.ts +675 -5
  22. package/src/features/order/order.handler.js +1 -1
  23. package/src/features/order/order.handler.js.map +1 -1
  24. package/src/features/order/order.route.d.ts +3193 -5
  25. package/src/features/order/order.route.js +1 -1
  26. package/src/features/order/order.route.js.map +1 -1
  27. package/src/features/order/order.service.d.ts +115 -0
  28. package/src/features/order/order.service.js +1 -1
  29. package/src/features/order/order.service.js.map +1 -1
  30. package/src/features/organization/organization.handler.js.map +1 -1
  31. package/src/features/organization/organization.route.d.ts +1973 -5
  32. package/src/features/payment/payment.handler.js.map +1 -1
  33. package/src/features/payment/payment.route.d.ts +67 -1
  34. package/src/features/product/product.handler.js.map +1 -1
  35. package/src/features/product/product.route.d.ts +4267 -7
  36. package/src/features/product-category/product-category.handler.js.map +1 -1
  37. package/src/features/product-category/product-category.route.d.ts +774 -6
  38. package/src/features/reservation/reservation.handler.js +1 -1
  39. package/src/features/reservation/reservation.handler.js.map +1 -1
  40. package/src/features/reservation/reservation.route.d.ts +854 -6
  41. package/src/features/reservation/reservation.route.js +1 -1
  42. package/src/features/reservation/reservation.route.js.map +1 -1
  43. package/src/features/reservation/reservation.service.d.ts +27 -0
  44. package/src/features/reservation/reservation.service.js +1 -1
  45. package/src/features/reservation/reservation.service.js.map +1 -1
  46. package/src/features/shipping/shipping.handler.js.map +1 -1
  47. package/src/features/shipping/shipping.route.d.ts +214 -3
  48. package/src/features/shipping-method/shipping-method.handler.js.map +1 -1
  49. package/src/features/shipping-method/shipping-method.route.d.ts +663 -6
  50. package/src/features/webhook/webhook.handler.d.ts +0 -1
  51. package/src/features/webhook/webhook.handler.js +1 -1
  52. package/src/features/webhook/webhook.handler.js.map +1 -1
  53. package/src/features/webhook/webhook.route.d.ts +64 -1
  54. package/src/test/global-setup.d.ts +0 -1
  55. package/src/test/global-setup.js +0 -1
  56. package/src/test/global-setup.js.map +0 -1
  57. package/src/test/integration/api-fixtures.d.ts +0 -147
  58. package/src/test/integration/api-fixtures.js +0 -1
  59. package/src/test/integration/api-fixtures.js.map +0 -1
  60. package/src/test/integration/seed.d.ts +0 -81
  61. package/src/test/integration/seed.js +0 -1
  62. package/src/test/integration/seed.js.map +0 -1
  63. package/src/test/integration/test-helpers.d.ts +0 -146
  64. package/src/test/integration/test-helpers.js +0 -1
  65. package/src/test/integration/test-helpers.js.map +0 -1
  66. package/src/test/setup-test-env.d.ts +0 -1
  67. package/src/test/setup-test-env.js +0 -1
  68. package/src/test/setup-test-env.js.map +0 -1
@@ -1,8 +1,665 @@
1
+ import { z } from "@hono/zod-openapi";
1
2
  export declare const shippingMethodRoute: {
2
- getShippingMethod: any;
3
- accessEligibility: any;
4
- getShippingMethods: any;
5
- createShippingMethod: any;
6
- updateShippingMethod: any;
7
- deleteShippingMethod: any;
3
+ getShippingMethod: {
4
+ description: string | undefined;
5
+ method: import("@hono/zod-openapi").RouteConfig["method"];
6
+ operationId: string;
7
+ path: string;
8
+ request: Record<never, never> & {
9
+ headers: z.ZodObject<{
10
+ "accept-language": z.ZodOptional<z.ZodString>;
11
+ cookie: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ } & {
14
+ params: z.ZodObject<{
15
+ organizationId: z.ZodString;
16
+ id: z.ZodString;
17
+ }, z.core.$strip>;
18
+ };
19
+ responses: {
20
+ 200: {
21
+ content: {
22
+ "application/json": {
23
+ schema: z.ZodObject<{
24
+ id: z.ZodString;
25
+ title: z.ZodString;
26
+ providerName: z.ZodString;
27
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
28
+ id: z.ZodString;
29
+ url: z.ZodString;
30
+ mimeType: z.ZodString;
31
+ size: z.ZodNumber;
32
+ filename: z.ZodString;
33
+ }, z.core.$strip>>>;
34
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
35
+ shippingZones: z.ZodArray<z.ZodObject<{
36
+ id: z.ZodOptional<z.ZodString>;
37
+ title: z.ZodString;
38
+ distanceUpto: z.ZodCoercedNumber<unknown>;
39
+ price: z.ZodCoercedNumber<unknown>;
40
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
41
+ eta: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ eligibleShippingZone: z.ZodOptional<z.ZodObject<{
44
+ id: z.ZodOptional<z.ZodString>;
45
+ title: z.ZodString;
46
+ distanceUpto: z.ZodCoercedNumber<unknown>;
47
+ price: z.ZodCoercedNumber<unknown>;
48
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
49
+ eta: z.ZodString;
50
+ }, z.core.$strip>>;
51
+ createdAt: z.ZodDate;
52
+ updatedAt: z.ZodDate;
53
+ }, z.core.$strip>;
54
+ };
55
+ };
56
+ description: string;
57
+ };
58
+ 401: {
59
+ content: {
60
+ "application/json": {
61
+ schema: z.ZodObject<{
62
+ status: z.ZodNumber;
63
+ message: z.ZodString;
64
+ }, z.core.$strip>;
65
+ };
66
+ };
67
+ description: string;
68
+ };
69
+ 404: {
70
+ content: {
71
+ "application/json": {
72
+ schema: z.ZodObject<{
73
+ status: z.ZodNumber;
74
+ message: z.ZodString;
75
+ }, z.core.$strip>;
76
+ };
77
+ };
78
+ description: string;
79
+ };
80
+ };
81
+ summary: string;
82
+ tags: string[];
83
+ } & {
84
+ getRoutingPath(): string;
85
+ };
86
+ accessEligibility: {
87
+ description: string | undefined;
88
+ method: import("@hono/zod-openapi").RouteConfig["method"];
89
+ operationId: string;
90
+ path: string;
91
+ request: Record<never, never> & {
92
+ headers: z.ZodObject<{
93
+ "accept-language": z.ZodOptional<z.ZodString>;
94
+ cookie: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>;
96
+ } & {
97
+ params: z.ZodObject<{
98
+ organizationId: z.ZodString;
99
+ }, z.core.$strip>;
100
+ };
101
+ responses: {
102
+ 200: {
103
+ content: {
104
+ "application/json": {
105
+ schema: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ title: z.ZodString;
108
+ providerName: z.ZodString;
109
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
110
+ id: z.ZodString;
111
+ url: z.ZodString;
112
+ mimeType: z.ZodString;
113
+ size: z.ZodNumber;
114
+ filename: z.ZodString;
115
+ }, z.core.$strip>>>;
116
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
117
+ shippingZones: z.ZodArray<z.ZodObject<{
118
+ id: z.ZodOptional<z.ZodString>;
119
+ title: z.ZodString;
120
+ distanceUpto: z.ZodCoercedNumber<unknown>;
121
+ price: z.ZodCoercedNumber<unknown>;
122
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
123
+ eta: z.ZodString;
124
+ }, z.core.$strip>>;
125
+ eligibleShippingZone: z.ZodOptional<z.ZodObject<{
126
+ id: z.ZodOptional<z.ZodString>;
127
+ title: z.ZodString;
128
+ distanceUpto: z.ZodCoercedNumber<unknown>;
129
+ price: z.ZodCoercedNumber<unknown>;
130
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
131
+ eta: z.ZodString;
132
+ }, z.core.$strip>>;
133
+ createdAt: z.ZodDate;
134
+ updatedAt: z.ZodDate;
135
+ }, z.core.$strip>>;
136
+ };
137
+ };
138
+ description: string;
139
+ };
140
+ };
141
+ summary: string;
142
+ tags: string[];
143
+ } & {
144
+ getRoutingPath(): string;
145
+ };
146
+ getShippingMethods: {
147
+ description: string | undefined;
148
+ method: import("@hono/zod-openapi").RouteConfig["method"];
149
+ operationId: string;
150
+ path: string;
151
+ request: Record<never, never> & {
152
+ headers: z.ZodObject<{
153
+ "accept-language": z.ZodOptional<z.ZodString>;
154
+ cookie: z.ZodOptional<z.ZodString>;
155
+ }, z.core.$strip>;
156
+ } & {
157
+ params: z.ZodObject<{
158
+ organizationId: z.ZodString;
159
+ }, z.core.$strip>;
160
+ } & {
161
+ query: z.ZodObject<{
162
+ page: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
163
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
164
+ search: z.ZodOptional<z.ZodString>;
165
+ published: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
166
+ locale: z.ZodOptional<z.ZodEnum<{
167
+ id: "id";
168
+ af: "af";
169
+ sq: "sq";
170
+ ar_dz: "ar_dz";
171
+ ar_bh: "ar_bh";
172
+ ar_eg: "ar_eg";
173
+ ar_iq: "ar_iq";
174
+ ar_jo: "ar_jo";
175
+ ar_kw: "ar_kw";
176
+ ar_lb: "ar_lb";
177
+ ar_ly: "ar_ly";
178
+ ar_ma: "ar_ma";
179
+ ar_om: "ar_om";
180
+ ar_qa: "ar_qa";
181
+ ar_sa: "ar_sa";
182
+ ar_sy: "ar_sy";
183
+ ar_tn: "ar_tn";
184
+ ar_ae: "ar_ae";
185
+ ar_ye: "ar_ye";
186
+ eu: "eu";
187
+ be: "be";
188
+ bg: "bg";
189
+ ca: "ca";
190
+ zh_hk: "zh_hk";
191
+ zh_cn: "zh_cn";
192
+ zh_sg: "zh_sg";
193
+ zh_tw: "zh_tw";
194
+ hr: "hr";
195
+ cs: "cs";
196
+ da: "da";
197
+ nl_be: "nl_be";
198
+ nl: "nl";
199
+ en: "en";
200
+ en_au: "en_au";
201
+ en_bz: "en_bz";
202
+ en_ca: "en_ca";
203
+ en_ie: "en_ie";
204
+ en_jm: "en_jm";
205
+ en_nz: "en_nz";
206
+ en_za: "en_za";
207
+ en_tt: "en_tt";
208
+ en_gb: "en_gb";
209
+ en_us: "en_us";
210
+ et: "et";
211
+ fo: "fo";
212
+ fa: "fa";
213
+ fi: "fi";
214
+ fr_be: "fr_be";
215
+ fr_ca: "fr_ca";
216
+ fr_lu: "fr_lu";
217
+ fr: "fr";
218
+ fr_ch: "fr_ch";
219
+ gd: "gd";
220
+ de_at: "de_at";
221
+ de_li: "de_li";
222
+ de_lu: "de_lu";
223
+ de: "de";
224
+ de_ch: "de_ch";
225
+ el: "el";
226
+ he: "he";
227
+ hi: "hi";
228
+ hu: "hu";
229
+ is: "is";
230
+ ga: "ga";
231
+ it: "it";
232
+ it_ch: "it_ch";
233
+ ja: "ja";
234
+ ko: "ko";
235
+ ku: "ku";
236
+ lv: "lv";
237
+ lt: "lt";
238
+ mk: "mk";
239
+ ml: "ml";
240
+ ms: "ms";
241
+ mt: "mt";
242
+ no: "no";
243
+ nb: "nb";
244
+ nn: "nn";
245
+ pl: "pl";
246
+ pt_br: "pt_br";
247
+ pt: "pt";
248
+ pa: "pa";
249
+ rm: "rm";
250
+ ro: "ro";
251
+ ro_md: "ro_md";
252
+ ru: "ru";
253
+ ru_md: "ru_md";
254
+ sr: "sr";
255
+ sk: "sk";
256
+ sl: "sl";
257
+ sb: "sb";
258
+ es_ar: "es_ar";
259
+ es_bo: "es_bo";
260
+ es_cl: "es_cl";
261
+ es_co: "es_co";
262
+ es_cr: "es_cr";
263
+ es_do: "es_do";
264
+ es_ec: "es_ec";
265
+ es_sv: "es_sv";
266
+ es_gt: "es_gt";
267
+ es_hn: "es_hn";
268
+ es_mx: "es_mx";
269
+ es: "es";
270
+ sv: "sv";
271
+ sv_fi: "sv_fi";
272
+ th: "th";
273
+ tr: "tr";
274
+ uk: "uk";
275
+ ur: "ur";
276
+ vi: "vi";
277
+ cy: "cy";
278
+ ji: "ji";
279
+ zu: "zu";
280
+ }>>;
281
+ }, z.core.$strip>;
282
+ };
283
+ responses: {
284
+ 200: {
285
+ content: {
286
+ "application/json": {
287
+ schema: z.ZodObject<{
288
+ list: z.ZodArray<z.ZodObject<{
289
+ id: z.ZodString;
290
+ title: z.ZodString;
291
+ providerName: z.ZodString;
292
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
293
+ id: z.ZodString;
294
+ url: z.ZodString;
295
+ mimeType: z.ZodString;
296
+ size: z.ZodNumber;
297
+ filename: z.ZodString;
298
+ }, z.core.$strip>>>;
299
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
300
+ shippingZones: z.ZodArray<z.ZodObject<{
301
+ id: z.ZodOptional<z.ZodString>;
302
+ title: z.ZodString;
303
+ distanceUpto: z.ZodCoercedNumber<unknown>;
304
+ price: z.ZodCoercedNumber<unknown>;
305
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
306
+ eta: z.ZodString;
307
+ }, z.core.$strip>>;
308
+ eligibleShippingZone: z.ZodOptional<z.ZodObject<{
309
+ id: z.ZodOptional<z.ZodString>;
310
+ title: z.ZodString;
311
+ distanceUpto: z.ZodCoercedNumber<unknown>;
312
+ price: z.ZodCoercedNumber<unknown>;
313
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
314
+ eta: z.ZodString;
315
+ }, z.core.$strip>>;
316
+ createdAt: z.ZodDate;
317
+ updatedAt: z.ZodDate;
318
+ }, z.core.$strip>>;
319
+ meta: z.ZodObject<{
320
+ isFirstPage: z.ZodBoolean;
321
+ isLastPage: z.ZodBoolean;
322
+ currentPage: z.ZodNumber;
323
+ previousPage: z.ZodNullable<z.ZodNumber>;
324
+ nextPage: z.ZodNullable<z.ZodNumber>;
325
+ pageCount: z.ZodNumber;
326
+ totalCount: z.ZodNumber;
327
+ }, z.core.$strip>;
328
+ }, z.core.$strip>;
329
+ };
330
+ };
331
+ description: string;
332
+ };
333
+ 400: {
334
+ content: {
335
+ "application/json": {
336
+ schema: z.ZodObject<{
337
+ status: z.ZodNumber;
338
+ message: z.ZodString;
339
+ }, z.core.$strip>;
340
+ };
341
+ };
342
+ description: string;
343
+ };
344
+ 401: {
345
+ content: {
346
+ "application/json": {
347
+ schema: z.ZodObject<{
348
+ status: z.ZodNumber;
349
+ message: z.ZodString;
350
+ }, z.core.$strip>;
351
+ };
352
+ };
353
+ description: string;
354
+ };
355
+ };
356
+ summary: string;
357
+ tags: string[];
358
+ } & {
359
+ getRoutingPath(): string;
360
+ };
361
+ createShippingMethod: {
362
+ description: string | undefined;
363
+ method: import("@hono/zod-openapi").RouteConfig["method"];
364
+ operationId: string;
365
+ path: string;
366
+ request: {
367
+ body: {
368
+ content: {
369
+ "application/json": {
370
+ schema: z.ZodObject<{
371
+ title: z.ZodString;
372
+ providerName: z.ZodString;
373
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
374
+ id: z.ZodString;
375
+ url: z.ZodString;
376
+ mimeType: z.ZodString;
377
+ size: z.ZodNumber;
378
+ filename: z.ZodString;
379
+ }, z.core.$strip>>>;
380
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
381
+ shippingZones: z.ZodArray<z.ZodObject<{
382
+ id: z.ZodOptional<z.ZodString>;
383
+ title: z.ZodString;
384
+ distanceUpto: z.ZodCoercedNumber<unknown>;
385
+ price: z.ZodCoercedNumber<unknown>;
386
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
387
+ eta: z.ZodString;
388
+ }, z.core.$strip>>;
389
+ providerLogoId: z.ZodOptional<z.ZodString>;
390
+ }, z.core.$strip>;
391
+ };
392
+ };
393
+ required: boolean;
394
+ };
395
+ } & {
396
+ headers: z.ZodObject<{
397
+ "accept-language": z.ZodOptional<z.ZodString>;
398
+ cookie: z.ZodOptional<z.ZodString>;
399
+ }, z.core.$strip>;
400
+ } & {
401
+ params: z.ZodObject<{
402
+ organizationId: z.ZodString;
403
+ }, z.core.$strip>;
404
+ } & Record<never, never>;
405
+ responses: {
406
+ 201: {
407
+ content: {
408
+ "application/json": {
409
+ schema: z.ZodObject<{
410
+ id: z.ZodString;
411
+ title: z.ZodString;
412
+ providerName: z.ZodString;
413
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
414
+ id: z.ZodString;
415
+ url: z.ZodString;
416
+ mimeType: z.ZodString;
417
+ size: z.ZodNumber;
418
+ filename: z.ZodString;
419
+ }, z.core.$strip>>>;
420
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
421
+ shippingZones: z.ZodArray<z.ZodObject<{
422
+ id: z.ZodOptional<z.ZodString>;
423
+ title: z.ZodString;
424
+ distanceUpto: z.ZodCoercedNumber<unknown>;
425
+ price: z.ZodCoercedNumber<unknown>;
426
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
427
+ eta: z.ZodString;
428
+ }, z.core.$strip>>;
429
+ eligibleShippingZone: z.ZodOptional<z.ZodObject<{
430
+ id: z.ZodOptional<z.ZodString>;
431
+ title: z.ZodString;
432
+ distanceUpto: z.ZodCoercedNumber<unknown>;
433
+ price: z.ZodCoercedNumber<unknown>;
434
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
435
+ eta: z.ZodString;
436
+ }, z.core.$strip>>;
437
+ createdAt: z.ZodDate;
438
+ updatedAt: z.ZodDate;
439
+ }, z.core.$strip>;
440
+ };
441
+ };
442
+ description: string;
443
+ };
444
+ 400: {
445
+ content: {
446
+ "application/json": {
447
+ schema: z.ZodObject<{
448
+ status: z.ZodNumber;
449
+ message: z.ZodString;
450
+ }, z.core.$strip>;
451
+ };
452
+ };
453
+ description: string;
454
+ };
455
+ 401: {
456
+ content: {
457
+ "application/json": {
458
+ schema: z.ZodObject<{
459
+ status: z.ZodNumber;
460
+ message: z.ZodString;
461
+ }, z.core.$strip>;
462
+ };
463
+ };
464
+ description: string;
465
+ };
466
+ 404: {
467
+ content: {
468
+ "application/json": {
469
+ schema: z.ZodObject<{
470
+ status: z.ZodNumber;
471
+ message: z.ZodString;
472
+ }, z.core.$strip>;
473
+ };
474
+ };
475
+ description: string;
476
+ };
477
+ };
478
+ summary: string;
479
+ tags: string[];
480
+ } & {
481
+ getRoutingPath(): string;
482
+ };
483
+ updateShippingMethod: {
484
+ description: string | undefined;
485
+ method: import("@hono/zod-openapi").RouteConfig["method"];
486
+ operationId: string;
487
+ path: string;
488
+ request: {
489
+ body: {
490
+ content: {
491
+ "application/json": {
492
+ schema: z.ZodObject<{
493
+ title: z.ZodOptional<z.ZodString>;
494
+ providerName: z.ZodOptional<z.ZodString>;
495
+ providerLogo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
496
+ id: z.ZodString;
497
+ url: z.ZodString;
498
+ mimeType: z.ZodString;
499
+ size: z.ZodNumber;
500
+ filename: z.ZodString;
501
+ }, z.core.$strip>>>>;
502
+ requireDateOfDelivery: z.ZodOptional<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
503
+ shippingZones: z.ZodOptional<z.ZodArray<z.ZodObject<{
504
+ id: z.ZodOptional<z.ZodString>;
505
+ title: z.ZodString;
506
+ distanceUpto: z.ZodCoercedNumber<unknown>;
507
+ price: z.ZodCoercedNumber<unknown>;
508
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
509
+ eta: z.ZodString;
510
+ }, z.core.$strip>>>;
511
+ providerLogoId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
512
+ }, z.core.$strip>;
513
+ };
514
+ };
515
+ required: boolean;
516
+ };
517
+ } & {
518
+ headers: z.ZodObject<{
519
+ "accept-language": z.ZodOptional<z.ZodString>;
520
+ cookie: z.ZodOptional<z.ZodString>;
521
+ }, z.core.$strip>;
522
+ } & {
523
+ params: z.ZodObject<{
524
+ id: z.ZodString;
525
+ organizationId: z.ZodString;
526
+ }, z.core.$strip>;
527
+ } & Record<never, never>;
528
+ responses: {
529
+ 200: {
530
+ content: {
531
+ "application/json": {
532
+ schema: z.ZodObject<{
533
+ id: z.ZodString;
534
+ title: z.ZodString;
535
+ providerName: z.ZodString;
536
+ providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
537
+ id: z.ZodString;
538
+ url: z.ZodString;
539
+ mimeType: z.ZodString;
540
+ size: z.ZodNumber;
541
+ filename: z.ZodString;
542
+ }, z.core.$strip>>>;
543
+ requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
544
+ shippingZones: z.ZodArray<z.ZodObject<{
545
+ id: z.ZodOptional<z.ZodString>;
546
+ title: z.ZodString;
547
+ distanceUpto: z.ZodCoercedNumber<unknown>;
548
+ price: z.ZodCoercedNumber<unknown>;
549
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
550
+ eta: z.ZodString;
551
+ }, z.core.$strip>>;
552
+ eligibleShippingZone: z.ZodOptional<z.ZodObject<{
553
+ id: z.ZodOptional<z.ZodString>;
554
+ title: z.ZodString;
555
+ distanceUpto: z.ZodCoercedNumber<unknown>;
556
+ price: z.ZodCoercedNumber<unknown>;
557
+ minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
558
+ eta: z.ZodString;
559
+ }, z.core.$strip>>;
560
+ createdAt: z.ZodDate;
561
+ updatedAt: z.ZodDate;
562
+ }, z.core.$strip>;
563
+ };
564
+ };
565
+ description: string;
566
+ };
567
+ 400: {
568
+ content: {
569
+ "application/json": {
570
+ schema: z.ZodObject<{
571
+ status: z.ZodNumber;
572
+ message: z.ZodString;
573
+ }, z.core.$strip>;
574
+ };
575
+ };
576
+ description: string;
577
+ };
578
+ 401: {
579
+ content: {
580
+ "application/json": {
581
+ schema: z.ZodObject<{
582
+ status: z.ZodNumber;
583
+ message: z.ZodString;
584
+ }, z.core.$strip>;
585
+ };
586
+ };
587
+ description: string;
588
+ };
589
+ 404: {
590
+ content: {
591
+ "application/json": {
592
+ schema: z.ZodObject<{
593
+ status: z.ZodNumber;
594
+ message: z.ZodString;
595
+ }, z.core.$strip>;
596
+ };
597
+ };
598
+ description: string;
599
+ };
600
+ };
601
+ summary: string;
602
+ tags: string[];
603
+ } & {
604
+ getRoutingPath(): string;
605
+ };
606
+ deleteShippingMethod: {
607
+ description: string | undefined;
608
+ method: import("@hono/zod-openapi").RouteConfig["method"];
609
+ operationId: string;
610
+ path: string;
611
+ request: Record<never, never> & {
612
+ headers: z.ZodObject<{
613
+ "accept-language": z.ZodOptional<z.ZodString>;
614
+ cookie: z.ZodOptional<z.ZodString>;
615
+ }, z.core.$strip>;
616
+ } & {
617
+ params: z.ZodObject<{
618
+ id: z.ZodString;
619
+ organizationId: z.ZodString;
620
+ }, z.core.$strip>;
621
+ };
622
+ responses: {
623
+ 204: {
624
+ description: string;
625
+ };
626
+ 400: {
627
+ content: {
628
+ "application/json": {
629
+ schema: z.ZodObject<{
630
+ status: z.ZodNumber;
631
+ message: z.ZodString;
632
+ }, z.core.$strip>;
633
+ };
634
+ };
635
+ description: string;
636
+ };
637
+ 401: {
638
+ content: {
639
+ "application/json": {
640
+ schema: z.ZodObject<{
641
+ status: z.ZodNumber;
642
+ message: z.ZodString;
643
+ }, z.core.$strip>;
644
+ };
645
+ };
646
+ description: string;
647
+ };
648
+ 404: {
649
+ content: {
650
+ "application/json": {
651
+ schema: z.ZodObject<{
652
+ status: z.ZodNumber;
653
+ message: z.ZodString;
654
+ }, z.core.$strip>;
655
+ };
656
+ };
657
+ description: string;
658
+ };
659
+ };
660
+ summary: string;
661
+ tags: string[];
662
+ } & {
663
+ getRoutingPath(): string;
664
+ };
8
665
  };
@@ -1,4 +1,3 @@
1
1
  import { PrismaClientType } from "../../core/lib/prisma";
2
2
  import { PaymentServiceOptions } from "../payment/payment.service";
3
- export declare const webhookHandler: (request: Request, prisma: PrismaClientType, options: PaymentServiceOptions, provider?: "stripe" | "revolut") => Promise<Response>;
4
3
  export declare const buildWebhookHandler: (prisma: PrismaClientType, options: PaymentServiceOptions) => import("@hono/zod-openapi").OpenAPIHono<import("../../core/hono/hono").AppBindings, {}, "/">;
@@ -1 +1 @@
1
- import{__awaiter as i}from"tslib";import{HttpException as a}from"../../core/exceptions/http-exception";import{createApiRouter as u}from"../../core/hono/hono";import{PaymentService as c}from"../payment/payment.service";import{webhookRoutes as d}from"./webhook.route";export const webhookHandler=(r,n,t,o)=>i(void 0,void 0,void 0,function*(){try{const e=r.headers.get("stripe-signature"),p=yield r.text(),s=o??(r.url.includes("stripe")?"stripe":r.url.includes("revolut")?"revolut":null);if(!s)throw new a(400,"Payment provider not supported");return yield new c(n,t).processWebhookEvent(s,e,p),Response.json({received:!0},{status:200})}catch(e){return console.error(e),e instanceof a?Response.json({error:e.message},{status:e.status}):Response.json({error:"Internal Server Error"},{status:500})}}),buildWebhookHandler=(r,n)=>{const t=u();return t.openapi(d.webhook,o=>i(void 0,void 0,void 0,function*(){const e=o.req.valid("param");return webhookHandler(o.req.raw,r,n,e.provider)})),t};
1
+ import{__awaiter as i}from"tslib";import{HttpException as p}from"../../core/exceptions/http-exception";import{createApiRouter as m}from"../../core/hono/hono";import{PaymentService as u}from"../payment/payment.service";import{webhookRoutes as c}from"./webhook.route";export const buildWebhookHandler=(o,s)=>{const t=m();return t.openapi(c.webhook,r=>i(void 0,void 0,void 0,function*(){try{const e=r.req.valid("param"),a=r.req.raw.headers.get("stripe-signature"),n=yield r.req.raw.text();return yield new u(o,s).processWebhookEvent(e.provider,a,n),r.json({received:!0},200)}catch(e){if(console.error(e),e instanceof p)switch(e.status){case 400:case 401:return r.json({message:e.message,status:e.status},e.status);default:return r.json({message:"Internal Server Error",status:500},500)}return r.json({message:"Internal Server Error",status:500},500)}})),t};