@trpc/server 11.0.0-next-beta.308 → 11.0.0-next-beta.314

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAUjB,cAAc,SAAS,CAAC;AAqDxB;;IAEI;AACJ,KAAK,gBAAgB,CAAC,KAAK,IAAI,KAAK,SAAS,oBAAoB,GAC7D,qBAAqB,GACrB,KAAK,SAAS,sBAAsB,GACpC,iCAAiC,GACjC,KAAK,CAAC;AACV,wBAAgB,uBAAuB,CACrC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,EAC9B,OAAO,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAExC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,GACtC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CA4B5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAUjB,cAAc,SAAS,CAAC;AAqDxB;;IAEI;AACJ,KAAK,gBAAgB,CAAC,KAAK,IAAI,KAAK,SAAS,oBAAoB,GAC7D,qBAAqB,GACrB,KAAK,SAAS,sBAAsB,GACpC,iCAAiC,GACjC,KAAK,CAAC;AACV,wBAAgB,uBAAuB,CACrC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,EAC9B,OAAO,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAExC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,GACtC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CA0B5D"}
@@ -68,9 +68,7 @@ function awsLambdaRequestHandler(opts) {
68
68
  });
69
69
  };
70
70
  const response = await resolveHTTPResponse.resolveHTTPResponse({
71
- router: opts.router,
72
- batching: opts.batching,
73
- responseMeta: opts?.responseMeta,
71
+ ...opts,
74
72
  createContext,
75
73
  req,
76
74
  path,
@@ -66,9 +66,7 @@ function awsLambdaRequestHandler(opts) {
66
66
  });
67
67
  };
68
68
  const response = await resolveHTTPResponse({
69
- router: opts.router,
70
- batching: opts.batching,
71
- responseMeta: opts?.responseMeta,
69
+ ...opts,
72
70
  createContext,
73
71
  req,
74
72
  path,
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
11
11
  import type { AnyRouter, inferRouterContext } from '../../@trpc/server';
12
- import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn, TRPCRequestInfo } from '../../@trpc/server/http';
12
+ import type { HTTPBaseHandlerOptions, HTTPHeaders, TRPCRequestInfo } from '../../@trpc/server/http';
13
13
  export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
14
14
  export type APIGatewayResult = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
15
15
  export type CreateAWSLambdaContextOptions<TEvent extends APIGatewayEvent> = {
@@ -18,14 +18,7 @@ export type CreateAWSLambdaContextOptions<TEvent extends APIGatewayEvent> = {
18
18
  info: TRPCRequestInfo;
19
19
  };
20
20
  export type AWSLambdaCreateContextFn<TRouter extends AnyRouter, TEvent extends APIGatewayEvent> = ({ event, context, info, }: CreateAWSLambdaContextOptions<TEvent>) => inferRouterContext<TRouter> | Promise<inferRouterContext<TRouter>>;
21
- export type AWSLambdaOptions<TRouter extends AnyRouter, TEvent extends APIGatewayEvent> = {
22
- router: TRouter;
23
- batching?: {
24
- enabled: boolean;
25
- };
26
- onError?: OnErrorFunction<TRouter, TEvent>;
27
- responseMeta?: ResponseMetaFn<TRouter>;
28
- } & ({
21
+ export type AWSLambdaOptions<TRouter extends AnyRouter, TEvent extends APIGatewayEvent> = HTTPBaseHandlerOptions<TRouter, TEvent> & ({
29
22
  /**
30
23
  * @link https://trpc.io/docs/v11/context
31
24
  **/
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,iCAAiC,CAAC;AAEtC,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,eAAe,IA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wBAAsB,qBAAqB,CACzC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,EAC9B,IAAI,EAAE,4BAA4B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,kBAsFjE"}
@@ -53,12 +53,9 @@ async function fastifyRequestHandler(opts) {
53
53
  }
54
54
  };
55
55
  resolveHTTPResponse.resolveHTTPResponse({
56
+ ...opts,
56
57
  req,
57
58
  createContext,
58
- path: opts.path,
59
- router: opts.router,
60
- batching: opts.batching,
61
- responseMeta: opts.responseMeta,
62
59
  onError (o) {
63
60
  opts?.onError?.({
64
61
  ...o,
@@ -51,12 +51,9 @@ async function fastifyRequestHandler(opts) {
51
51
  }
52
52
  };
53
53
  resolveHTTPResponse({
54
+ ...opts,
54
55
  req,
55
56
  createContext,
56
- path: opts.path,
57
- router: opts.router,
58
- batching: opts.batching,
59
- responseMeta: opts.responseMeta,
60
57
  onError (o) {
61
58
  opts?.onError?.({
62
59
  ...o,
@@ -1 +1 @@
1
- {"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAYpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAC9D,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASJ,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,CAyGnB"}
1
+ {"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAYpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAC9D,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASJ,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,CAuGnB"}
@@ -90,12 +90,10 @@ async function fetchRequestHandler(opts) {
90
90
  }
91
91
  };
92
92
  resolveHTTPResponse.resolveHTTPResponse({
93
+ ...opts,
93
94
  req,
94
95
  createContext,
95
96
  path,
96
- router: opts.router,
97
- batching: opts.batching,
98
- responseMeta: opts.responseMeta,
99
97
  onError (o) {
100
98
  opts?.onError?.({
101
99
  ...o,
@@ -88,12 +88,10 @@ async function fetchRequestHandler(opts) {
88
88
  }
89
89
  };
90
90
  resolveHTTPResponse({
91
+ ...opts,
91
92
  req,
92
93
  createContext,
93
94
  path,
94
- router: opts.router,
95
- batching: opts.batching,
96
- responseMeta: opts.responseMeta,
97
95
  onError (o) {
98
96
  opts?.onError?.({
99
97
  ...o,
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 92666,
3
- "bundleOrigSize": 147947,
4
- "bundleReduction": 37.37,
2
+ "bundleSize": 92374,
3
+ "bundleOrigSize": 147567,
4
+ "bundleReduction": 37.4,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/adapters/ws.ts",
@@ -15,7 +15,7 @@
15
15
  "dependents": [
16
16
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
17
17
  ],
18
- "percent": 10.97,
18
+ "percent": 11.01,
19
19
  "reduction": 0
20
20
  },
21
21
  {
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "removedExports": [],
29
29
  "dependents": [],
30
- "percent": 10.13,
30
+ "percent": 10.16,
31
31
  "reduction": 21.23
32
32
  },
33
33
  {
@@ -46,7 +46,7 @@
46
46
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
47
47
  "/src/unstable-core-do-not-import/initTRPC.ts"
48
48
  ],
49
- "percent": 6.55,
49
+ "percent": 6.57,
50
50
  "reduction": 38.58
51
51
  },
52
52
  {
@@ -62,7 +62,7 @@
62
62
  "/src/unstable-core-do-not-import.ts",
63
63
  "/src/unstable-core-do-not-import/initTRPC.ts"
64
64
  ],
65
- "percent": 6.16,
65
+ "percent": 6.18,
66
66
  "reduction": 58.57
67
67
  },
68
68
  {
@@ -78,7 +78,7 @@
78
78
  "dependents": [
79
79
  "/src/adapters/node-http/content-type/form-data/index.ts"
80
80
  ],
81
- "percent": 5.37,
81
+ "percent": 5.39,
82
82
  "reduction": 36.77
83
83
  },
84
84
  {
@@ -92,7 +92,7 @@
92
92
  ],
93
93
  "removedExports": [],
94
94
  "dependents": [],
95
- "percent": 4.77,
95
+ "percent": 4.78,
96
96
  "reduction": 32.71
97
97
  },
98
98
  {
@@ -106,13 +106,13 @@
106
106
  "dependents": [
107
107
  "/src/adapters/node-http/index.ts"
108
108
  ],
109
- "percent": 4.24,
109
+ "percent": 4.26,
110
110
  "reduction": 13.56
111
111
  },
112
112
  {
113
113
  "id": "/src/adapters/fetch/fetchRequestHandler.ts",
114
- "size": 3554,
115
- "origSize": 3927,
114
+ "size": 3468,
115
+ "origSize": 3849,
116
116
  "renderedExports": [
117
117
  "fetchRequestHandler"
118
118
  ],
@@ -120,13 +120,13 @@
120
120
  "dependents": [
121
121
  "/src/adapters/fetch/index.ts"
122
122
  ],
123
- "percent": 3.84,
124
- "reduction": 9.5
123
+ "percent": 3.75,
124
+ "reduction": 9.9
125
125
  },
126
126
  {
127
127
  "id": "/src/adapters/aws-lambda/utils.ts",
128
128
  "size": 3308,
129
- "origSize": 5208,
129
+ "origSize": 5088,
130
130
  "renderedExports": [
131
131
  "isPayloadV1",
132
132
  "isPayloadV2",
@@ -139,8 +139,8 @@
139
139
  "dependents": [
140
140
  "/src/adapters/aws-lambda/index.ts"
141
141
  ],
142
- "percent": 3.57,
143
- "reduction": 36.48
142
+ "percent": 3.58,
143
+ "reduction": 34.98
144
144
  },
145
145
  {
146
146
  "id": "/src/observable/observable.ts",
@@ -156,7 +156,7 @@
156
156
  "/src/observable/index.ts",
157
157
  "/src/observable/operators.ts"
158
158
  ],
159
- "percent": 3.38,
159
+ "percent": 3.39,
160
160
  "reduction": 0.67
161
161
  },
162
162
  {
@@ -172,7 +172,7 @@
172
172
  "dependents": [
173
173
  "/src/observable/index.ts"
174
174
  ],
175
- "percent": 2.97,
175
+ "percent": 2.98,
176
176
  "reduction": 0
177
177
  },
178
178
  {
@@ -192,7 +192,7 @@
192
192
  "/src/unstable-core-do-not-import/router.ts",
193
193
  "/src/unstable-core-do-not-import/initTRPC.ts"
194
194
  ],
195
- "percent": 2.96,
195
+ "percent": 2.97,
196
196
  "reduction": 45.94
197
197
  },
198
198
  {
@@ -206,7 +206,7 @@
206
206
  "dependents": [
207
207
  "/src/unstable-core-do-not-import.ts"
208
208
  ],
209
- "percent": 2.94,
209
+ "percent": 2.95,
210
210
  "reduction": 39.13
211
211
  },
212
212
  {
@@ -226,13 +226,13 @@
226
226
  "/src/unstable-core-do-not-import/initTRPC.ts",
227
227
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
228
228
  ],
229
- "percent": 2.83,
229
+ "percent": 2.84,
230
230
  "reduction": 55.5
231
231
  },
232
232
  {
233
233
  "id": "/src/adapters/fastify/fastifyRequestHandler.ts",
234
- "size": 2590,
235
- "origSize": 4005,
234
+ "size": 2479,
235
+ "origSize": 3906,
236
236
  "renderedExports": [
237
237
  "fastifyRequestHandler"
238
238
  ],
@@ -241,20 +241,20 @@
241
241
  "/src/adapters/fastify/index.ts",
242
242
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
243
243
  ],
244
- "percent": 2.79,
245
- "reduction": 35.33
244
+ "percent": 2.68,
245
+ "reduction": 36.53
246
246
  },
247
247
  {
248
248
  "id": "/src/adapters/aws-lambda/index.ts",
249
- "size": 2540,
250
- "origSize": 3701,
249
+ "size": 2445,
250
+ "origSize": 3618,
251
251
  "renderedExports": [
252
252
  "awsLambdaRequestHandler"
253
253
  ],
254
254
  "removedExports": [],
255
255
  "dependents": [],
256
- "percent": 2.74,
257
- "reduction": 31.37
256
+ "percent": 2.65,
257
+ "reduction": 32.42
258
258
  },
259
259
  {
260
260
  "id": "/src/unstable-core-do-not-import/error/TRPCError.ts",
@@ -274,7 +274,7 @@
274
274
  "/src/unstable-core-do-not-import/middleware.ts",
275
275
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
276
276
  ],
277
- "percent": 1.87,
277
+ "percent": 1.88,
278
278
  "reduction": 19.47
279
279
  },
280
280
  {
@@ -288,7 +288,7 @@
288
288
  "dependents": [
289
289
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
290
290
  ],
291
- "percent": 1.77,
291
+ "percent": 1.78,
292
292
  "reduction": 34.79
293
293
  },
294
294
  {
@@ -339,7 +339,7 @@
339
339
  ],
340
340
  "removedExports": [],
341
341
  "dependents": [],
342
- "percent": 1.64,
342
+ "percent": 1.65,
343
343
  "reduction": 27.6
344
344
  },
345
345
  {
@@ -370,7 +370,7 @@
370
370
  "dependents": [
371
371
  "/src/adapters/fastify/index.ts"
372
372
  ],
373
- "percent": 1.6,
373
+ "percent": 1.61,
374
374
  "reduction": 34.33
375
375
  },
376
376
  {
@@ -384,7 +384,7 @@
384
384
  "dependents": [
385
385
  "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"
386
386
  ],
387
- "percent": 1.5,
387
+ "percent": 1.51,
388
388
  "reduction": 0
389
389
  },
390
390
  {
@@ -430,12 +430,12 @@
430
430
  "removedExports": [],
431
431
  "dependents": [
432
432
  "/src/unstable-core-do-not-import.ts",
433
- "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
434
433
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
435
434
  "/src/unstable-core-do-not-import/router.ts",
436
435
  "/src/unstable-core-do-not-import/transformer.ts",
437
436
  "/src/unstable-core-do-not-import/middleware.ts",
438
- "/src/unstable-core-do-not-import/procedureBuilder.ts"
437
+ "/src/unstable-core-do-not-import/procedureBuilder.ts",
438
+ "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts"
439
439
  ],
440
440
  "percent": 0.88,
441
441
  "reduction": 19.78
@@ -457,7 +457,7 @@
457
457
  "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
458
458
  "/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts"
459
459
  ],
460
- "percent": 0.78,
460
+ "percent": 0.79,
461
461
  "reduction": 67.52
462
462
  },
463
463
  {
@@ -471,7 +471,7 @@
471
471
  "dependents": [
472
472
  "/src/adapters/node-http/content-type/form-data/index.ts"
473
473
  ],
474
- "percent": 0.75,
474
+ "percent": 0.76,
475
475
  "reduction": 71.21
476
476
  },
477
477
  {
@@ -498,7 +498,7 @@
498
498
  "/src/unstable-core-do-not-import.ts",
499
499
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
500
500
  ],
501
- "percent": 0.67,
501
+ "percent": 0.68,
502
502
  "reduction": 43.49
503
503
  },
504
504
  {
@@ -511,7 +511,7 @@
511
511
  ],
512
512
  "removedExports": [],
513
513
  "dependents": [],
514
- "percent": 0.62,
514
+ "percent": 0.63,
515
515
  "reduction": 65.23
516
516
  },
517
517
  {
@@ -638,9 +638,9 @@
638
638
  "reduction": 100
639
639
  },
640
640
  {
641
- "id": "/src/rpc.ts",
641
+ "id": "/src/index.ts",
642
642
  "size": 0,
643
- "origSize": 36,
643
+ "origSize": 32,
644
644
  "renderedExports": [],
645
645
  "removedExports": [],
646
646
  "dependents": [],
@@ -648,9 +648,9 @@
648
648
  "reduction": 100
649
649
  },
650
650
  {
651
- "id": "/src/shared.ts",
651
+ "id": "/src/unstable-core-do-not-import.ts",
652
652
  "size": 0,
653
- "origSize": 653,
653
+ "origSize": 1552,
654
654
  "renderedExports": [],
655
655
  "removedExports": [],
656
656
  "dependents": [],
@@ -658,9 +658,9 @@
658
658
  "reduction": 100
659
659
  },
660
660
  {
661
- "id": "/src/index.ts",
661
+ "id": "/src/shared.ts",
662
662
  "size": 0,
663
- "origSize": 32,
663
+ "origSize": 653,
664
664
  "renderedExports": [],
665
665
  "removedExports": [],
666
666
  "dependents": [],
@@ -668,9 +668,9 @@
668
668
  "reduction": 100
669
669
  },
670
670
  {
671
- "id": "/src/unstable-core-do-not-import.ts",
671
+ "id": "/src/rpc.ts",
672
672
  "size": 0,
673
- "origSize": 1552,
673
+ "origSize": 36,
674
674
  "renderedExports": [],
675
675
  "removedExports": [],
676
676
  "dependents": [],
@@ -690,9 +690,9 @@
690
690
  "reduction": 100
691
691
  },
692
692
  {
693
- "id": "/src/adapters/fetch/index.ts",
693
+ "id": "/src/adapters/fastify/index.ts",
694
694
  "size": 0,
695
- "origSize": 64,
695
+ "origSize": 78,
696
696
  "renderedExports": [],
697
697
  "removedExports": [],
698
698
  "dependents": [],
@@ -700,9 +700,9 @@
700
700
  "reduction": 100
701
701
  },
702
702
  {
703
- "id": "/src/adapters/fastify/index.ts",
703
+ "id": "/src/adapters/fetch/index.ts",
704
704
  "size": 0,
705
- "origSize": 78,
705
+ "origSize": 64,
706
706
  "renderedExports": [],
707
707
  "removedExports": [],
708
708
  "dependents": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-next-beta.308+955edd79a",
3
+ "version": "11.0.0-next-beta.314+e7bec4272",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -122,7 +122,7 @@
122
122
  },
123
123
  "devDependencies": {
124
124
  "@fastify/websocket": "^7.1.2",
125
- "@tanstack/react-query": "^5.0.0",
125
+ "@tanstack/react-query": "^5.25.0",
126
126
  "@types/aws-lambda": "^8.10.97",
127
127
  "@types/express": "^4.17.17",
128
128
  "@types/hash-sum": "^1.0.0",
@@ -148,7 +148,7 @@
148
148
  "tslib": "^2.5.0",
149
149
  "tsx": "^4.0.0",
150
150
  "typescript": "^5.3.3",
151
- "valibot": "^0.29.0",
151
+ "valibot": "^0.30.0",
152
152
  "ws": "^8.0.0",
153
153
  "yup": "^1.0.0",
154
154
  "zod": "^3.0.0"
@@ -156,5 +156,5 @@
156
156
  "funding": [
157
157
  "https://trpc.io/sponsor"
158
158
  ],
159
- "gitHead": "955edd79adaf441bfabc1f45bb83fc74355568b5"
159
+ "gitHead": "e7bec427242d54d7954a0f7af9599b78b2c01fcd"
160
160
  }
@@ -116,9 +116,7 @@ export function awsLambdaRequestHandler<
116
116
  };
117
117
 
118
118
  const response = await resolveHTTPResponse({
119
- router: opts.router,
120
- batching: opts.batching,
121
- responseMeta: opts?.responseMeta,
119
+ ...opts,
122
120
  createContext,
123
121
  req,
124
122
  path,
@@ -19,9 +19,8 @@ import type { AnyRouter, inferRouterContext } from '../../@trpc/server'; // impo
19
19
  // @trpc/server
20
20
  import { TRPCError } from '../../@trpc/server';
21
21
  import type {
22
+ HTTPBaseHandlerOptions,
22
23
  HTTPHeaders,
23
- OnErrorFunction,
24
- ResponseMetaFn,
25
24
  TRPCRequestInfo,
26
25
  } from '../../@trpc/server/http';
27
26
 
@@ -50,27 +49,21 @@ export type AWSLambdaOptions<
50
49
  TRouter extends AnyRouter,
51
50
  TEvent extends APIGatewayEvent,
52
51
  > =
53
- | {
54
- router: TRouter;
55
- batching?: {
56
- enabled: boolean;
57
- };
58
- onError?: OnErrorFunction<TRouter, TEvent>;
59
- responseMeta?: ResponseMetaFn<TRouter>;
60
- } & (
61
- | {
62
- /**
63
- * @link https://trpc.io/docs/v11/context
64
- **/
65
- createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
66
- }
67
- | {
68
- /**
69
- * @link https://trpc.io/docs/v11/context
70
- **/
71
- createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
72
- }
73
- );
52
+ | HTTPBaseHandlerOptions<TRouter, TEvent> &
53
+ (
54
+ | {
55
+ /**
56
+ * @link https://trpc.io/docs/v11/context
57
+ **/
58
+ createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
59
+ }
60
+ | {
61
+ /**
62
+ * @link https://trpc.io/docs/v11/context
63
+ **/
64
+ createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
65
+ }
66
+ );
74
67
 
75
68
  export function isPayloadV1(
76
69
  event: APIGatewayEvent,
@@ -109,12 +109,9 @@ export async function fastifyRequestHandler<
109
109
  };
110
110
 
111
111
  resolveHTTPResponse({
112
+ ...opts,
112
113
  req,
113
114
  createContext,
114
- path: opts.path,
115
- router: opts.router,
116
- batching: opts.batching,
117
- responseMeta: opts.responseMeta,
118
115
  onError(o) {
119
116
  opts?.onError?.({ ...o, req: opts.req });
120
117
  },
@@ -118,12 +118,10 @@ export async function fetchRequestHandler<TRouter extends AnyRouter>(
118
118
  };
119
119
 
120
120
  resolveHTTPResponse({
121
+ ...opts,
121
122
  req,
122
123
  createContext,
123
124
  path,
124
- router: opts.router,
125
- batching: opts.batching,
126
- responseMeta: opts.responseMeta,
127
125
  onError(o) {
128
126
  opts?.onError?.({ ...o, req: opts.req });
129
127
  },