@donotdev/functions 0.2.1 → 0.2.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 (184) hide show
  1. package/README.md +2 -2
  2. package/lib/chunks/chunk-6NXIK35R.js +23 -0
  3. package/lib/chunks/chunk-6NXIK35R.js.map +7 -0
  4. package/lib/chunks/chunk-EZKRLLSQ.js +22 -0
  5. package/lib/chunks/chunk-EZKRLLSQ.js.map +7 -0
  6. package/lib/chunks/chunk-F3PHE627.js +22 -0
  7. package/lib/chunks/chunk-F3PHE627.js.map +7 -0
  8. package/lib/chunks/chunk-F3WBFWPO.js +151 -0
  9. package/lib/chunks/chunk-F3WBFWPO.js.map +7 -0
  10. package/lib/chunks/chunk-G5DRV3DH.js +22 -0
  11. package/lib/chunks/chunk-G5DRV3DH.js.map +7 -0
  12. package/lib/chunks/{chunk-5IPULSUX.js → chunk-GDIUOJMD.js} +2 -2
  13. package/lib/chunks/chunk-GDIUOJMD.js.map +7 -0
  14. package/lib/chunks/chunk-Q2WLRFOE.js +22 -0
  15. package/lib/chunks/chunk-Q2WLRFOE.js.map +7 -0
  16. package/lib/chunks/chunk-QXIOO2RL.js +22 -0
  17. package/lib/chunks/chunk-QXIOO2RL.js.map +7 -0
  18. package/lib/chunks/{chunk-3F4BWKQD.js → chunk-UH445BGK.js} +2 -2
  19. package/lib/chunks/chunk-W6W4L44F.js +22 -0
  20. package/lib/chunks/chunk-W6W4L44F.js.map +7 -0
  21. package/lib/chunks/chunk-W74UL7AY.js +22 -0
  22. package/lib/chunks/chunk-W74UL7AY.js.map +7 -0
  23. package/lib/chunks/{monitoring-E7JBYBHQ.js → monitoring-LXNVBD3G.js} +2 -2
  24. package/lib/chunks/{rateLimiter-SQISLOP5.js → rateLimiter-GG5LPWXJ.js} +2 -2
  25. package/lib/chunks/server-NODQAE3F.js +22 -0
  26. package/lib/firebase/billing/index.d.ts +2 -2
  27. package/lib/firebase/crud/aggregate.d.ts +1 -1
  28. package/lib/firebase/index.d.ts +1 -1
  29. package/lib/firebase/index.js +1 -1
  30. package/lib/firebase/index.js.map +4 -4
  31. package/lib/firebase/registerCrudFunctions.d.ts +0 -5
  32. package/lib/shared/billing/checkoutPrice.d.ts +3 -6
  33. package/lib/shared/billing/checkoutValidation.d.ts +1 -1
  34. package/lib/shared/billing/createCheckout.d.ts +4 -4
  35. package/lib/shared/billing/firestoreIdempotency.d.ts +2 -2
  36. package/lib/shared/billing/helpers/subscriptionManagement.d.ts +2 -2
  37. package/lib/shared/billing/idempotency.d.ts +3 -23
  38. package/lib/shared/billing/idempotencyContract.d.ts +0 -20
  39. package/lib/shared/billing/orderWebhook.d.ts +29 -2
  40. package/lib/shared/billing/stripePinned.d.ts +43 -0
  41. package/lib/shared/denoEnv.d.ts +25 -0
  42. package/lib/shared/github.d.ts +0 -8
  43. package/lib/shared/index.js +1 -1
  44. package/lib/shared/logger.d.ts +14 -14
  45. package/lib/shared/utils/external/subscription.d.ts +0 -8
  46. package/lib/shared/utils/internal/auth.d.ts +1 -5
  47. package/lib/shared/utils.d.ts +12 -83
  48. package/lib/supabase/auth/deleteAccount.d.ts +34 -2
  49. package/lib/supabase/crud/create.d.ts +0 -8
  50. package/lib/supabase/crud/entityStore.d.ts +13 -0
  51. package/lib/supabase/crud/update.d.ts +0 -8
  52. package/lib/supabase/index.d.ts +1 -0
  53. package/lib/supabase/index.js +1 -1
  54. package/lib/supabase/index.js.map +4 -4
  55. package/lib/vercel/api/index.js +1 -1
  56. package/lib/vercel/api/index.js.map +3 -3
  57. package/package.json +9 -9
  58. package/src/firebase/auth/getCustomClaims.ts +2 -0
  59. package/src/firebase/auth/getUserAuthStatus.ts +2 -0
  60. package/src/firebase/auth/removeCustomClaims.ts +2 -0
  61. package/src/firebase/auth/setCustomClaims.ts +3 -0
  62. package/src/firebase/baseFunction.ts +8 -4
  63. package/src/firebase/billing/changePlan.ts +6 -5
  64. package/src/firebase/billing/createCustomerPortal.ts +6 -4
  65. package/src/firebase/billing/index.d.ts +0 -12
  66. package/src/firebase/billing/index.ts +0 -3
  67. package/src/firebase/billing/refreshSubscriptionStatus.ts +7 -5
  68. package/src/firebase/billing/webhookHandler.ts +4 -4
  69. package/src/firebase/crud/aggregate.ts +41 -12
  70. package/src/firebase/crud/bulk.ts +7 -0
  71. package/src/firebase/crud/create.ts +21 -8
  72. package/src/firebase/crud/delete.ts +6 -1
  73. package/src/firebase/crud/get.ts +9 -2
  74. package/src/firebase/crud/list.ts +18 -8
  75. package/src/firebase/crud/update.ts +15 -7
  76. package/src/firebase/helpers/githubAccessHelper.ts +3 -0
  77. package/src/firebase/helpers/githubTeamAccessHelper.ts +1 -0
  78. package/src/firebase/index.ts +0 -1
  79. package/src/firebase/oauth/disconnect.ts +2 -2
  80. package/src/firebase/oauth/exchangeToken.ts +6 -2
  81. package/src/firebase/oauth/getConnections.ts +3 -3
  82. package/src/firebase/oauth/githubAccess.ts +7 -4
  83. package/src/firebase/oauth/refreshToken.ts +3 -2
  84. package/src/firebase/registerCrudFunctions.ts +0 -19
  85. package/src/firebase/scheduled/checkExpiredSubscriptions.ts +4 -1
  86. package/src/shared/__tests__/idempotency.test.ts +0 -32
  87. package/src/shared/__tests__/utils.test.ts +0 -25
  88. package/src/shared/ai/classifyAIError.ts +18 -10
  89. package/src/shared/ai/createAIRoute.ts +2 -1
  90. package/src/shared/ai/resolveModelTier.ts +2 -1
  91. package/src/shared/billing/__tests__/createCheckout.compat.test.ts +4 -110
  92. package/src/shared/billing/__tests__/createCheckout.test.ts +94 -0
  93. package/src/shared/billing/__tests__/firestoreIdempotency.emulator.test.ts +1 -1
  94. package/src/shared/billing/__tests__/webhookHandler.test.ts +108 -0
  95. package/src/shared/billing/checkoutPrice.ts +7 -42
  96. package/src/shared/billing/checkoutValidation.ts +19 -2
  97. package/src/shared/billing/createCheckout.ts +59 -30
  98. package/src/shared/billing/firestoreIdempotency.ts +2 -21
  99. package/src/shared/billing/helpers/subscriptionManagement.ts +14 -10
  100. package/src/shared/billing/idempotency.ts +4 -54
  101. package/src/shared/billing/idempotencyContract.ts +0 -21
  102. package/src/shared/billing/orderWebhook.ts +69 -1
  103. package/src/shared/billing/stripeClient.ts +2 -1
  104. package/src/shared/billing/stripePinned.ts +71 -0
  105. package/src/shared/billing/tierWebhookEvents.ts +3 -2
  106. package/src/shared/billing/webhookHandler.ts +5 -1
  107. package/src/shared/crud/bulkCore.ts +3 -2
  108. package/src/shared/denoEnv.ts +29 -0
  109. package/src/shared/email/createEmailRoute.ts +2 -2
  110. package/src/shared/errorHandling.ts +8 -8
  111. package/src/shared/firebase.ts +26 -9
  112. package/src/shared/github.ts +15 -5
  113. package/src/shared/logger.ts +37 -38
  114. package/src/shared/schema.ts +6 -10
  115. package/src/shared/utils/external/date.ts +4 -4
  116. package/src/shared/utils/external/subscription.ts +2 -89
  117. package/src/shared/utils/firebaseHelpers.ts +2 -0
  118. package/src/shared/utils/internal/auth.ts +1 -6
  119. package/src/shared/utils/internal/idempotency.ts +3 -0
  120. package/src/shared/utils/internal/monitoring.ts +6 -5
  121. package/src/shared/utils/internal/validation.ts +2 -0
  122. package/src/shared/utils/schemaValidation.ts +1 -0
  123. package/src/shared/utils/validation.ts +10 -20
  124. package/src/shared/utils.ts +12 -138
  125. package/src/supabase/__tests__/aggregate.test.ts +132 -0
  126. package/src/supabase/auth/__tests__/deleteAccount.test.ts +102 -0
  127. package/src/supabase/auth/deleteAccount.ts +72 -5
  128. package/src/supabase/billing/refreshSubscriptionStatus.ts +6 -5
  129. package/src/supabase/crud/aggregate.ts +85 -72
  130. package/src/supabase/crud/bulk.ts +3 -0
  131. package/src/supabase/crud/create.ts +13 -9
  132. package/src/supabase/crud/delete.ts +2 -1
  133. package/src/supabase/crud/entityStore.ts +1 -1
  134. package/src/supabase/crud/get.ts +2 -1
  135. package/src/supabase/crud/list.ts +23 -17
  136. package/src/supabase/crud/update.ts +9 -6
  137. package/src/supabase/edgeFunction.ts +2 -1
  138. package/src/supabase/email/createEmailFunction.ts +2 -1
  139. package/src/supabase/index.ts +1 -0
  140. package/src/supabase/oauth/exchangeToken.ts +1 -0
  141. package/src/supabase/oauth/getConnections.ts +1 -1
  142. package/src/supabase/oauth/refreshToken.ts +1 -0
  143. package/src/supabase/utils/idempotency.ts +1 -1
  144. package/src/supabase/utils/monitoring.ts +1 -0
  145. package/src/vercel/api/billing/change-plan.ts +6 -5
  146. package/src/vercel/api/billing/refresh-subscription-status.ts +3 -1
  147. package/src/vercel/api/crud/bulk.ts +7 -2
  148. package/src/vercel/api/crud/create.ts +6 -3
  149. package/src/vercel/api/crud/delete.ts +5 -2
  150. package/src/vercel/api/crud/get.ts +5 -2
  151. package/src/vercel/api/crud/list.ts +6 -3
  152. package/src/vercel/api/crud/update.ts +6 -3
  153. package/src/vercel/api/oauth/check-github-access.ts +1 -0
  154. package/src/vercel/api/oauth/exchange-token.ts +5 -2
  155. package/src/vercel/api/oauth/grant-github-access.ts +1 -0
  156. package/src/vercel/api/oauth/revoke-github-access.ts +1 -0
  157. package/src/vercel/baseFunction.ts +5 -1
  158. package/lib/chunks/chunk-5IPULSUX.js.map +0 -7
  159. package/lib/chunks/chunk-6USHTJED.js +0 -22
  160. package/lib/chunks/chunk-6USHTJED.js.map +0 -7
  161. package/lib/chunks/chunk-CXBSROEW.js +0 -23
  162. package/lib/chunks/chunk-CXBSROEW.js.map +0 -7
  163. package/lib/chunks/chunk-GYTCWMXV.js +0 -22
  164. package/lib/chunks/chunk-GYTCWMXV.js.map +0 -7
  165. package/lib/chunks/chunk-LCDLG4VG.js +0 -151
  166. package/lib/chunks/chunk-LCDLG4VG.js.map +0 -7
  167. package/lib/chunks/chunk-MQANUSY3.js +0 -22
  168. package/lib/chunks/chunk-MQANUSY3.js.map +0 -7
  169. package/lib/chunks/chunk-OFQVO3FD.js +0 -22
  170. package/lib/chunks/chunk-OFQVO3FD.js.map +0 -7
  171. package/lib/chunks/chunk-PWAGW4R6.js +0 -22
  172. package/lib/chunks/chunk-PWAGW4R6.js.map +0 -7
  173. package/lib/chunks/chunk-US2VOP4S.js +0 -22
  174. package/lib/chunks/chunk-US2VOP4S.js.map +0 -7
  175. package/lib/chunks/chunk-YTKDNZNW.js +0 -22
  176. package/lib/chunks/chunk-YTKDNZNW.js.map +0 -7
  177. package/lib/chunks/server-IQ5JNJOM.js +0 -22
  178. package/lib/shared/utils/functionWrapper.d.ts +0 -36
  179. package/src/shared/utils/__tests__/functionWrapper.test.ts +0 -122
  180. package/src/shared/utils/functionWrapper.ts +0 -73
  181. /package/lib/chunks/{chunk-3F4BWKQD.js.map → chunk-UH445BGK.js.map} +0 -0
  182. /package/lib/chunks/{monitoring-E7JBYBHQ.js.map → monitoring-LXNVBD3G.js.map} +0 -0
  183. /package/lib/chunks/{rateLimiter-SQISLOP5.js.map → rateLimiter-GG5LPWXJ.js.map} +0 -0
  184. /package/lib/chunks/{server-IQ5JNJOM.js.map → server-NODQAE3F.js.map} +0 -0
@@ -1,22 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath } from 'node:url';
3
- import { dirname } from 'node:path';
4
- import { Buffer } from 'node:buffer';
5
- import process from 'node:process';
6
-
7
- const require = __createRequire(import.meta.url);
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
10
-
11
- if (typeof globalThis !== 'undefined') {
12
- globalThis.require = require;
13
- globalThis.__filename = __filename;
14
- globalThis.__dirname = __dirname;
15
- globalThis.Buffer = Buffer;
16
- globalThis.process = process;
17
- if (typeof global === 'undefined') {
18
- globalThis.global = globalThis;
19
- }
20
- }
21
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-CXBSROEW.js";import"./chunk-GYTCWMXV.js";import"./chunk-AYY7UXNI.js";export{M as FieldValue,f as FirebaseServerAuthAdapter,N as Query,O as Timestamp,s as batchCreate,u as batchDelete,t as batchUpdate,r as batchWrite,w as bulkGet,n as convertISOStringsToDates,H as createAdminFirestoreValidator,I as createFirestoreClientValidator,q as createFirestorePartialUpdate,G as createFirestoreValidator,j as createTimestamp,L as enhanceSchema,l as firestoreToISOString,i as generateServerId,x as getActiveSubscription,b as getFirebaseAdminApp,c as getFirebaseAdminAuth,d as getFirebaseAdminFirestore,e as getFirebaseAdminFunctions,g as getServerAdmin,h as getServerFirestore,E as getUniqueConstraintValidator,y as getUserSubscriptions,B as hasFeatureAccess,F as hasUniqueConstraintValidator,a as initFirebaseAdmin,m as isTimestamp,p as prepareForFirestore,D as registerUniqueConstraintValidator,v as runTransaction,z as saveSubscription,k as toTimestamp,o as transformFirestoreData,A as updateSubscriptionStatus,K as validateFirestoreDocument,J as validateUniqueness,C as verifyAndHandleStripeWebhook};
22
- //# sourceMappingURL=server-IQ5JNJOM.js.map
@@ -1,36 +0,0 @@
1
- /**
2
- * @fileoverview Simple DRY wrapper for functions with schema validation
3
- * @description Eliminates duplication by providing a clean pattern for all functions
4
- *
5
- * @version 0.1.0
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- import type { CallableRequest } from 'firebase-functions/v2/https';
10
- import type { NextApiRequest, NextApiResponse } from 'next';
11
- import * as v from 'valibot';
12
- /**
13
- * Simple wrapper that validates data against schema and calls the handler
14
- * This is the ONLY pattern needed for all functions
15
- *
16
- * @version 0.1.0
17
- * @since 0.0.1
18
- * @author AMBROISE PARK Consulting
19
- */
20
- export declare function withValidation<TData, TResponse>(schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>, handler: (data: TData) => Promise<TResponse>): (data: any) => Promise<TResponse>;
21
- /**
22
- * Firebase function wrapper
23
- *
24
- * @version 0.1.0
25
- * @since 0.0.1
26
- * @author AMBROISE PARK Consulting
27
- */
28
- export declare function firebaseFunction<TData, TResponse>(schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>, handler: (data: TData) => Promise<TResponse>): (request: CallableRequest<TData>) => Promise<TResponse>;
29
- /**
30
- * Vercel function wrapper
31
- *
32
- * @version 0.1.0
33
- * @since 0.0.1
34
- * @author AMBROISE PARK Consulting
35
- */
36
- export declare function vercelFunction<TData, TResponse>(schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>, handler: (req: NextApiRequest, res: NextApiResponse, data: TData) => Promise<TResponse>): (req: NextApiRequest, res: NextApiResponse) => Promise<TResponse>;
@@ -1,122 +0,0 @@
1
- // packages/functions/src/shared/utils/__tests__/functionWrapper.test.ts
2
-
3
- /**
4
- * @fileoverview Tests for withValidation, firebaseFunction, vercelFunction
5
- * @description Unit tests for schema validation wrappers.
6
- *
7
- * @version 0.1.0
8
- * @since 0.0.1
9
- * @author AMBROISE PARK Consulting
10
- */
11
-
12
- import * as v from 'valibot';
13
- import { describe, it, expect, vi, beforeEach } from 'vitest';
14
-
15
- import {
16
- withValidation,
17
- firebaseFunction,
18
- vercelFunction,
19
- } from '../functionWrapper';
20
-
21
- // ---------------------------------------------------------------------------
22
- // Schemas and fixtures
23
- // ---------------------------------------------------------------------------
24
-
25
- const TestSchema = v.object({
26
- name: v.pipe(v.string(), v.minLength(1)),
27
- count: v.optional(v.pipe(v.number(), v.minValue(0))),
28
- });
29
-
30
- type TestData = v.InferOutput<typeof TestSchema>;
31
-
32
- // ---------------------------------------------------------------------------
33
- // withValidation
34
- // ---------------------------------------------------------------------------
35
-
36
- describe('withValidation', () => {
37
- it('returns handler result when data is valid', async () => {
38
- const handler = vi.fn().mockResolvedValue({ id: '123' });
39
- const wrapped = withValidation(TestSchema, handler);
40
- const data = { name: 'foo', count: 2 };
41
-
42
- const result = await wrapped(data);
43
-
44
- expect(result).toEqual({ id: '123' });
45
- expect(handler).toHaveBeenCalledWith({ name: 'foo', count: 2 });
46
- });
47
-
48
- it('throws when data fails validation', async () => {
49
- const handler = vi.fn();
50
- const wrapped = withValidation(TestSchema, handler);
51
-
52
- await expect(wrapped({ name: '' })).rejects.toThrow();
53
- expect(handler).not.toHaveBeenCalled();
54
- });
55
-
56
- it('passes validated (parsed) data to handler', async () => {
57
- const handler = vi.fn().mockResolvedValue(undefined);
58
- const wrapped = withValidation(TestSchema, handler);
59
- await wrapped({ name: 'a', count: 0 });
60
-
61
- expect(handler).toHaveBeenCalledWith(
62
- expect.objectContaining({ name: 'a', count: 0 })
63
- );
64
- });
65
- });
66
-
67
- // ---------------------------------------------------------------------------
68
- // firebaseFunction
69
- // ---------------------------------------------------------------------------
70
-
71
- describe('firebaseFunction', () => {
72
- it('calls handler with parsed request.data', async () => {
73
- const handler = vi.fn().mockResolvedValue({ success: true });
74
- const fn = firebaseFunction(TestSchema, handler);
75
- const request = {
76
- data: { name: 'test', count: 1 },
77
- rawRequest: {} as any,
78
- };
79
-
80
- const result = await fn(request);
81
-
82
- expect(result).toEqual({ success: true });
83
- expect(handler).toHaveBeenCalledWith({ name: 'test', count: 1 });
84
- });
85
-
86
- it('throws when request.data is invalid', async () => {
87
- const handler = vi.fn();
88
- const fn = firebaseFunction(TestSchema, handler);
89
- const request = { data: { name: '' }, rawRequest: {} as any };
90
-
91
- await expect(fn(request)).rejects.toThrow();
92
- expect(handler).not.toHaveBeenCalled();
93
- });
94
- });
95
-
96
- // ---------------------------------------------------------------------------
97
- // vercelFunction
98
- // ---------------------------------------------------------------------------
99
-
100
- describe('vercelFunction', () => {
101
- it('parses req.body and calls handler with (req, res, data)', async () => {
102
- const handler = vi.fn().mockResolvedValue({ ok: true });
103
- const fn = vercelFunction(TestSchema, handler);
104
- const req = { body: { name: 'v', count: 0 } } as any;
105
- const res = {} as any;
106
-
107
- const result = await fn(req, res);
108
-
109
- expect(result).toEqual({ ok: true });
110
- expect(handler).toHaveBeenCalledWith(req, res, { name: 'v', count: 0 });
111
- });
112
-
113
- it('throws when req.body is invalid', async () => {
114
- const handler = vi.fn();
115
- const fn = vercelFunction(TestSchema, handler);
116
- const req = { body: {} } as any;
117
- const res = {} as any;
118
-
119
- await expect(fn(req, res)).rejects.toThrow();
120
- expect(handler).not.toHaveBeenCalled();
121
- });
122
- });
@@ -1,73 +0,0 @@
1
- // packages/functions/src/shared/utils/functionWrapper.ts
2
-
3
- /**
4
- * @fileoverview Simple DRY wrapper for functions with schema validation
5
- * @description Eliminates duplication by providing a clean pattern for all functions
6
- *
7
- * @version 0.1.0
8
- * @since 0.0.1
9
- * @author AMBROISE PARK Consulting
10
- */
11
-
12
- import type { CallableRequest } from 'firebase-functions/v2/https';
13
- import type { NextApiRequest, NextApiResponse } from 'next';
14
- import * as v from 'valibot';
15
-
16
- /**
17
- * Simple wrapper that validates data against schema and calls the handler
18
- * This is the ONLY pattern needed for all functions
19
- *
20
- * @version 0.1.0
21
- * @since 0.0.1
22
- * @author AMBROISE PARK Consulting
23
- */
24
- export function withValidation<TData, TResponse>(
25
- schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>,
26
- handler: (data: TData) => Promise<TResponse>
27
- ) {
28
- return async (data: any): Promise<TResponse> => {
29
- // Schema handles ALL validation - no manual checks needed
30
- const validatedData = v.parse(schema, data);
31
- return await handler(validatedData);
32
- };
33
- }
34
-
35
- /**
36
- * Firebase function wrapper
37
- *
38
- * @version 0.1.0
39
- * @since 0.0.1
40
- * @author AMBROISE PARK Consulting
41
- */
42
- export function firebaseFunction<TData, TResponse>(
43
- schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>,
44
- handler: (data: TData) => Promise<TResponse>
45
- ) {
46
- return async (request: CallableRequest<TData>): Promise<TResponse> => {
47
- return await withValidation(schema, handler)(request.data as any);
48
- };
49
- }
50
-
51
- /**
52
- * Vercel function wrapper
53
- *
54
- * @version 0.1.0
55
- * @since 0.0.1
56
- * @author AMBROISE PARK Consulting
57
- */
58
- export function vercelFunction<TData, TResponse>(
59
- schema: v.BaseSchema<unknown, TData, v.BaseIssue<unknown>>,
60
- handler: (
61
- req: NextApiRequest,
62
- res: NextApiResponse,
63
- data: TData
64
- ) => Promise<TResponse>
65
- ) {
66
- return async (
67
- req: NextApiRequest,
68
- res: NextApiResponse
69
- ): Promise<TResponse> => {
70
- const validatedData = v.parse(schema, req.body);
71
- return await handler(req, res, validatedData);
72
- };
73
- }