@trpc/server 11.0.0-next-beta.281 → 11.0.0-next-beta.284

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.
@@ -2,7 +2,7 @@ export { TRPCError,
2
2
  /**
3
3
  * @deprecated use `experimental_trpcMiddleware` instead
4
4
  */
5
- experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type RouterRecord as TRPCRouterRecord, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type ProcedureOptions as TRPCProcedureOptions, } from '../../unstable-core-do-not-import';
5
+ experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferProcedureBuilderResolverOptions, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type RouterRecord as TRPCRouterRecord, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, type ProcedureOptions as TRPCProcedureOptions, } from '../../unstable-core-do-not-import';
6
6
  export type {
7
7
  /**
8
8
  * @deprecated use `AnyTRPCProcedure` instead
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EAER,aAAa,IAAI,iBAAiB,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,IAAI,mBAAmB,EACtC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,kCAAkC,EACvC,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,iBAAiB,IAAI,qBAAqB,EAC/C,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,wBAAwB,IAAI,4BAA4B,EAC7D,KAAK,gBAAgB,IAAI,oBAAoB,GAC9C,MAAM,mCAAmC,CAAC;AAE3C,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,uBAAuB;AAEvB;;GAEG;AACH,IAAI;AAEJ;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AACjB;;GAEG;AACH,wBAAwB,GACzB,M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ACX;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AACjB;;GAEG;AACH,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAE3C,OAAO;AACL;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IACxE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC"}
@@ -0,0 +1,728 @@
1
+ {
2
+ "bundleSize": 92285,
3
+ "bundleOrigSize": 146562,
4
+ "bundleReduction": 37.03,
5
+ "modules": [
6
+ {
7
+ "id": "/src/adapters/ws.ts",
8
+ "size": 9970,
9
+ "origSize": 9269,
10
+ "renderedExports": [
11
+ "applyWSSHandler"
12
+ ],
13
+ "removedExports": [],
14
+ "dependents": [
15
+ "/src/adapters/fastify/fastifyTRPCPlugin.ts"
16
+ ],
17
+ "percent": 10.8,
18
+ "reduction": 0
19
+ },
20
+ {
21
+ "id": "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
22
+ "size": 9259,
23
+ "origSize": 11799,
24
+ "renderedExports": [
25
+ "resolveHTTPResponse"
26
+ ],
27
+ "removedExports": [],
28
+ "dependents": [],
29
+ "percent": 10.03,
30
+ "reduction": 21.53
31
+ },
32
+ {
33
+ "id": "/src/unstable-core-do-not-import/router.ts",
34
+ "size": 6040,
35
+ "origSize": 9792,
36
+ "renderedExports": [
37
+ "createRouterFactory",
38
+ "callProcedure",
39
+ "createCallerFactory",
40
+ "mergeRouters"
41
+ ],
42
+ "removedExports": [],
43
+ "dependents": [
44
+ "/src/unstable-core-do-not-import.ts",
45
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
46
+ "/src/unstable-core-do-not-import/initTRPC.ts"
47
+ ],
48
+ "percent": 6.54,
49
+ "reduction": 38.32
50
+ },
51
+ {
52
+ "id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
53
+ "size": 5602,
54
+ "origSize": 12775,
55
+ "renderedExports": [
56
+ "unsetMarker",
57
+ "createBuilder"
58
+ ],
59
+ "removedExports": [],
60
+ "dependents": [
61
+ "/src/unstable-core-do-not-import.ts",
62
+ "/src/unstable-core-do-not-import/initTRPC.ts"
63
+ ],
64
+ "percent": 6.07,
65
+ "reduction": 56.15
66
+ },
67
+ {
68
+ "id": "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
69
+ "size": 4977,
70
+ "origSize": 7871,
71
+ "renderedExports": [
72
+ "readableStreamToString",
73
+ "createFileUploadHandler",
74
+ "NodeOnDiskFile"
75
+ ],
76
+ "removedExports": [],
77
+ "dependents": [
78
+ "/src/adapters/node-http/content-type/form-data/index.ts"
79
+ ],
80
+ "percent": 5.39,
81
+ "reduction": 36.77
82
+ },
83
+ {
84
+ "id": "/src/adapters/node-http/content-type/form-data/index.ts",
85
+ "size": 4420,
86
+ "origSize": 6569,
87
+ "renderedExports": [
88
+ "nodeHTTPFormDataContentTypeHandler",
89
+ "experimental_isMultipartFormDataRequest",
90
+ "experimental_parseMultipartFormData"
91
+ ],
92
+ "removedExports": [],
93
+ "dependents": [],
94
+ "percent": 4.79,
95
+ "reduction": 32.71
96
+ },
97
+ {
98
+ "id": "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
99
+ "size": 4056,
100
+ "origSize": 4633,
101
+ "renderedExports": [
102
+ "nodeHTTPRequestHandler"
103
+ ],
104
+ "removedExports": [],
105
+ "dependents": [
106
+ "/src/adapters/node-http/index.ts"
107
+ ],
108
+ "percent": 4.4,
109
+ "reduction": 12.45
110
+ },
111
+ {
112
+ "id": "/src/adapters/fetch/fetchRequestHandler.ts",
113
+ "size": 3554,
114
+ "origSize": 3927,
115
+ "renderedExports": [
116
+ "fetchRequestHandler"
117
+ ],
118
+ "removedExports": [],
119
+ "dependents": [
120
+ "/src/adapters/fetch/index.ts"
121
+ ],
122
+ "percent": 3.85,
123
+ "reduction": 9.5
124
+ },
125
+ {
126
+ "id": "/src/observable/observable.ts",
127
+ "size": 3430,
128
+ "origSize": 3627,
129
+ "renderedExports": [
130
+ "isObservable",
131
+ "observable",
132
+ "observableToPromise"
133
+ ],
134
+ "removedExports": [],
135
+ "dependents": [
136
+ "/src/observable/index.ts"
137
+ ],
138
+ "percent": 3.72,
139
+ "reduction": 5.43
140
+ },
141
+ {
142
+ "id": "/src/adapters/aws-lambda/utils.ts",
143
+ "size": 3308,
144
+ "origSize": 5208,
145
+ "renderedExports": [
146
+ "isPayloadV1",
147
+ "isPayloadV2",
148
+ "getHTTPMethod",
149
+ "getPath",
150
+ "transformHeaders",
151
+ "UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE"
152
+ ],
153
+ "removedExports": [],
154
+ "dependents": [
155
+ "/src/adapters/aws-lambda/index.ts"
156
+ ],
157
+ "percent": 3.58,
158
+ "reduction": 36.48
159
+ },
160
+ {
161
+ "id": "/src/observable/operators.ts",
162
+ "size": 2980,
163
+ "origSize": 2812,
164
+ "renderedExports": [
165
+ "map",
166
+ "share",
167
+ "tap"
168
+ ],
169
+ "removedExports": [],
170
+ "dependents": [
171
+ "/src/observable/index.ts"
172
+ ],
173
+ "percent": 3.23,
174
+ "reduction": 0
175
+ },
176
+ {
177
+ "id": "/src/unstable-core-do-not-import/initTRPC.ts",
178
+ "size": 2879,
179
+ "origSize": 4716,
180
+ "renderedExports": [
181
+ "initTRPC"
182
+ ],
183
+ "removedExports": [],
184
+ "dependents": [
185
+ "/src/unstable-core-do-not-import.ts"
186
+ ],
187
+ "percent": 3.12,
188
+ "reduction": 38.95
189
+ },
190
+ {
191
+ "id": "/src/unstable-core-do-not-import/transformer.ts",
192
+ "size": 2744,
193
+ "origSize": 5076,
194
+ "renderedExports": [
195
+ "getDataTransformer",
196
+ "defaultTransformer",
197
+ "transformTRPCResponse",
198
+ "transformResult"
199
+ ],
200
+ "removedExports": [],
201
+ "dependents": [
202
+ "/src/unstable-core-do-not-import.ts",
203
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
204
+ "/src/unstable-core-do-not-import/router.ts",
205
+ "/src/unstable-core-do-not-import/initTRPC.ts"
206
+ ],
207
+ "percent": 2.97,
208
+ "reduction": 45.94
209
+ },
210
+ {
211
+ "id": "/src/adapters/fastify/fastifyRequestHandler.ts",
212
+ "size": 2590,
213
+ "origSize": 4005,
214
+ "renderedExports": [
215
+ "fastifyRequestHandler"
216
+ ],
217
+ "removedExports": [],
218
+ "dependents": [
219
+ "/src/adapters/fastify/index.ts",
220
+ "/src/adapters/fastify/fastifyTRPCPlugin.ts"
221
+ ],
222
+ "percent": 2.81,
223
+ "reduction": 35.33
224
+ },
225
+ {
226
+ "id": "/src/unstable-core-do-not-import/middleware.ts",
227
+ "size": 2579,
228
+ "origSize": 5855,
229
+ "renderedExports": [
230
+ "middlewareMarker",
231
+ "createMiddlewareFactory",
232
+ "experimental_standaloneMiddleware",
233
+ "createInputMiddleware",
234
+ "createOutputMiddleware"
235
+ ],
236
+ "removedExports": [],
237
+ "dependents": [
238
+ "/src/unstable-core-do-not-import.ts",
239
+ "/src/unstable-core-do-not-import/initTRPC.ts",
240
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
241
+ ],
242
+ "percent": 2.79,
243
+ "reduction": 55.95
244
+ },
245
+ {
246
+ "id": "/src/adapters/aws-lambda/index.ts",
247
+ "size": 2540,
248
+ "origSize": 3701,
249
+ "renderedExports": [
250
+ "awsLambdaRequestHandler"
251
+ ],
252
+ "removedExports": [],
253
+ "dependents": [],
254
+ "percent": 2.75,
255
+ "reduction": 31.37
256
+ },
257
+ {
258
+ "id": "/src/unstable-core-do-not-import/error/TRPCError.ts",
259
+ "size": 1733,
260
+ "origSize": 2152,
261
+ "renderedExports": [
262
+ "getCauseFromUnknown",
263
+ "getTRPCErrorFromUnknown",
264
+ "TRPCError"
265
+ ],
266
+ "removedExports": [],
267
+ "dependents": [
268
+ "/src/unstable-core-do-not-import.ts",
269
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
270
+ "/src/unstable-core-do-not-import/http/contentType.ts",
271
+ "/src/unstable-core-do-not-import/router.ts",
272
+ "/src/unstable-core-do-not-import/middleware.ts",
273
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
274
+ ],
275
+ "percent": 1.88,
276
+ "reduction": 19.47
277
+ },
278
+ {
279
+ "id": "/src/unstable-core-do-not-import/http/contentType.ts",
280
+ "size": 1642,
281
+ "origSize": 2518,
282
+ "renderedExports": [
283
+ "getJsonContentTypeInputs"
284
+ ],
285
+ "removedExports": [],
286
+ "dependents": [
287
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
288
+ ],
289
+ "percent": 1.78,
290
+ "reduction": 34.79
291
+ },
292
+ {
293
+ "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
294
+ "size": 1603,
295
+ "origSize": 2343,
296
+ "renderedExports": [
297
+ "fastifyTRPCPlugin"
298
+ ],
299
+ "removedExports": [],
300
+ "dependents": [
301
+ "/src/adapters/fastify/index.ts"
302
+ ],
303
+ "percent": 1.74,
304
+ "reduction": 31.58
305
+ },
306
+ {
307
+ "id": "/src/adapters/next.ts",
308
+ "size": 1602,
309
+ "origSize": 2260,
310
+ "renderedExports": [
311
+ "createNextApiHandler"
312
+ ],
313
+ "removedExports": [],
314
+ "dependents": [],
315
+ "percent": 1.74,
316
+ "reduction": 29.12
317
+ },
318
+ {
319
+ "id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
320
+ "size": 1580,
321
+ "origSize": 2001,
322
+ "renderedExports": [
323
+ "parseTRPCMessage"
324
+ ],
325
+ "removedExports": [],
326
+ "dependents": [],
327
+ "percent": 1.71,
328
+ "reduction": 21.04
329
+ },
330
+ {
331
+ "id": "/src/unstable-core-do-not-import/createProxy.ts",
332
+ "size": 1507,
333
+ "origSize": 1596,
334
+ "renderedExports": [
335
+ "createRecursiveProxy",
336
+ "createFlatProxy"
337
+ ],
338
+ "removedExports": [],
339
+ "dependents": [
340
+ "/src/unstable-core-do-not-import.ts",
341
+ "/src/unstable-core-do-not-import/router.ts",
342
+ "/src/unstable-core-do-not-import/initTRPC.ts"
343
+ ],
344
+ "percent": 1.63,
345
+ "reduction": 5.58
346
+ },
347
+ {
348
+ "id": "/src/adapters/node-http/content-type/form-data/streamSlice.ts",
349
+ "size": 1393,
350
+ "origSize": 1370,
351
+ "renderedExports": [
352
+ "streamSlice"
353
+ ],
354
+ "removedExports": [],
355
+ "dependents": [
356
+ "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"
357
+ ],
358
+ "percent": 1.51,
359
+ "reduction": 0
360
+ },
361
+ {
362
+ "id": "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
363
+ "size": 1233,
364
+ "origSize": 1608,
365
+ "renderedExports": [
366
+ "getHTTPStatusCode",
367
+ "getHTTPStatusCodeFromError"
368
+ ],
369
+ "removedExports": [],
370
+ "dependents": [
371
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
372
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts"
373
+ ],
374
+ "percent": 1.34,
375
+ "reduction": 23.32
376
+ },
377
+ {
378
+ "id": "/src/adapters/node-http/content-type/json/getPostBody.ts",
379
+ "size": 1118,
380
+ "origSize": 1151,
381
+ "renderedExports": [
382
+ "getPostBody"
383
+ ],
384
+ "removedExports": [],
385
+ "dependents": [
386
+ "/src/adapters/node-http/content-type/json/index.ts"
387
+ ],
388
+ "percent": 1.21,
389
+ "reduction": 2.87
390
+ },
391
+ {
392
+ "id": "/src/unstable-core-do-not-import/rpc/codes.ts",
393
+ "size": 1020,
394
+ "origSize": 1325,
395
+ "renderedExports": [
396
+ "TRPC_ERROR_CODES_BY_KEY",
397
+ "TRPC_ERROR_CODES_BY_NUMBER"
398
+ ],
399
+ "removedExports": [],
400
+ "dependents": [],
401
+ "percent": 1.11,
402
+ "reduction": 23.02
403
+ },
404
+ {
405
+ "id": "/src/unstable-core-do-not-import/utils.ts",
406
+ "size": 1006,
407
+ "origSize": 1566,
408
+ "renderedExports": [
409
+ "invert",
410
+ "mergeWithoutOverrides",
411
+ "isObject",
412
+ "omitPrototype"
413
+ ],
414
+ "removedExports": [],
415
+ "dependents": [
416
+ "/src/unstable-core-do-not-import.ts",
417
+ "/src/unstable-core-do-not-import/rpc/codes.ts",
418
+ "/src/unstable-core-do-not-import/error/TRPCError.ts",
419
+ "/src/unstable-core-do-not-import/router.ts",
420
+ "/src/unstable-core-do-not-import/transformer.ts",
421
+ "/src/unstable-core-do-not-import/middleware.ts",
422
+ "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
423
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
424
+ ],
425
+ "percent": 1.09,
426
+ "reduction": 35.76
427
+ },
428
+ {
429
+ "id": "/src/unstable-core-do-not-import/parser.ts",
430
+ "size": 998,
431
+ "origSize": 2272,
432
+ "renderedExports": [
433
+ "getParseFn"
434
+ ],
435
+ "removedExports": [],
436
+ "dependents": [
437
+ "/src/unstable-core-do-not-import.ts",
438
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
439
+ ],
440
+ "percent": 1.08,
441
+ "reduction": 56.07
442
+ },
443
+ {
444
+ "id": "/src/adapters/node-http/content-type/form-data/uploadHandler.ts",
445
+ "size": 726,
446
+ "origSize": 2235,
447
+ "renderedExports": [
448
+ "composeUploadHandlers",
449
+ "MaxPartSizeExceededError",
450
+ "MaxBodySizeExceededError"
451
+ ],
452
+ "removedExports": [
453
+ "createMemoryUploadHandler"
454
+ ],
455
+ "dependents": [
456
+ "/src/adapters/node-http/content-type/form-data/index.ts",
457
+ "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
458
+ "/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts"
459
+ ],
460
+ "percent": 0.79,
461
+ "reduction": 67.52
462
+ },
463
+ {
464
+ "id": "/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts",
465
+ "size": 699,
466
+ "origSize": 2428,
467
+ "renderedExports": [
468
+ "createMemoryUploadHandler"
469
+ ],
470
+ "removedExports": [],
471
+ "dependents": [
472
+ "/src/adapters/node-http/content-type/form-data/index.ts"
473
+ ],
474
+ "percent": 0.76,
475
+ "reduction": 71.21
476
+ },
477
+ {
478
+ "id": "/src/unstable-core-do-not-import/http/batchStreamFormatter.ts",
479
+ "size": 667,
480
+ "origSize": 671,
481
+ "renderedExports": [
482
+ "getBatchStreamFormatter"
483
+ ],
484
+ "removedExports": [],
485
+ "dependents": [],
486
+ "percent": 0.72,
487
+ "reduction": 0.6
488
+ },
489
+ {
490
+ "id": "/src/unstable-core-do-not-import/error/getErrorShape.ts",
491
+ "size": 625,
492
+ "origSize": 1106,
493
+ "renderedExports": [
494
+ "getErrorShape"
495
+ ],
496
+ "removedExports": [],
497
+ "dependents": [
498
+ "/src/unstable-core-do-not-import.ts",
499
+ "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
500
+ ],
501
+ "percent": 0.68,
502
+ "reduction": 43.49
503
+ },
504
+ {
505
+ "id": "/src/adapters/standalone.ts",
506
+ "size": 600,
507
+ "origSize": 1689,
508
+ "renderedExports": [
509
+ "createHTTPHandler",
510
+ "createHTTPServer"
511
+ ],
512
+ "removedExports": [],
513
+ "dependents": [],
514
+ "percent": 0.65,
515
+ "reduction": 64.48
516
+ },
517
+ {
518
+ "id": "/src/unstable-core-do-not-import/rootConfig.ts",
519
+ "size": 343,
520
+ "origSize": 2140,
521
+ "renderedExports": [
522
+ "isServerDefault"
523
+ ],
524
+ "removedExports": [],
525
+ "dependents": [
526
+ "/src/unstable-core-do-not-import.ts",
527
+ "/src/unstable-core-do-not-import/initTRPC.ts"
528
+ ],
529
+ "percent": 0.37,
530
+ "reduction": 83.97
531
+ },
532
+ {
533
+ "id": "/src/adapters/express.ts",
534
+ "size": 339,
535
+ "origSize": 1184,
536
+ "renderedExports": [
537
+ "createExpressMiddleware"
538
+ ],
539
+ "removedExports": [],
540
+ "dependents": [],
541
+ "percent": 0.37,
542
+ "reduction": 71.37
543
+ },
544
+ {
545
+ "id": "/src/adapters/node-http/content-type/json/index.ts",
546
+ "size": 292,
547
+ "origSize": 450,
548
+ "renderedExports": [
549
+ "nodeHTTPJSONContentTypeHandler"
550
+ ],
551
+ "removedExports": [],
552
+ "dependents": [
553
+ "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
554
+ ],
555
+ "percent": 0.32,
556
+ "reduction": 35.11
557
+ },
558
+ {
559
+ "id": "/src/unstable-core-do-not-import/types.ts",
560
+ "size": 221,
561
+ "origSize": 4055,
562
+ "renderedExports": [
563
+ "ERROR_SYMBOL"
564
+ ],
565
+ "removedExports": [],
566
+ "dependents": [
567
+ "/src/unstable-core-do-not-import.ts"
568
+ ],
569
+ "percent": 0.24,
570
+ "reduction": 94.55
571
+ },
572
+ {
573
+ "id": "/src/unstable-core-do-not-import/http/toURL.ts",
574
+ "size": 158,
575
+ "origSize": 184,
576
+ "renderedExports": [
577
+ "toURL"
578
+ ],
579
+ "removedExports": [],
580
+ "dependents": [],
581
+ "percent": 0.17,
582
+ "reduction": 14.13
583
+ },
584
+ {
585
+ "id": "/src/adapters/node-http/internals/contentType.ts",
586
+ "size": 116,
587
+ "origSize": 871,
588
+ "renderedExports": [
589
+ "createNodeHTTPContentTypeHandler"
590
+ ],
591
+ "removedExports": [],
592
+ "dependents": [
593
+ "/src/adapters/node-http/content-type/form-data/index.ts",
594
+ "/src/adapters/node-http/content-type/json/index.ts"
595
+ ],
596
+ "percent": 0.13,
597
+ "reduction": 86.68
598
+ },
599
+ {
600
+ "id": "/src/unstable-core-do-not-import/procedure.ts",
601
+ "size": 75,
602
+ "origSize": 1956,
603
+ "renderedExports": [
604
+ "procedureTypes"
605
+ ],
606
+ "removedExports": [],
607
+ "dependents": [
608
+ "/src/unstable-core-do-not-import.ts",
609
+ "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts"
610
+ ],
611
+ "percent": 0.08,
612
+ "reduction": 96.17
613
+ },
614
+ {
615
+ "id": "/src/unstable-core-do-not-import/error/formatter.ts",
616
+ "size": 61,
617
+ "origSize": 984,
618
+ "renderedExports": [
619
+ "defaultFormatter"
620
+ ],
621
+ "removedExports": [],
622
+ "dependents": [
623
+ "/src/unstable-core-do-not-import.ts",
624
+ "/src/unstable-core-do-not-import/router.ts",
625
+ "/src/unstable-core-do-not-import/initTRPC.ts"
626
+ ],
627
+ "percent": 0.07,
628
+ "reduction": 93.8
629
+ },
630
+ {
631
+ "id": "/src/http.ts",
632
+ "size": 0,
633
+ "origSize": 37,
634
+ "renderedExports": [],
635
+ "removedExports": [],
636
+ "dependents": [],
637
+ "percent": 0,
638
+ "reduction": 100
639
+ },
640
+ {
641
+ "id": "/src/index.ts",
642
+ "size": 0,
643
+ "origSize": 32,
644
+ "renderedExports": [],
645
+ "removedExports": [],
646
+ "dependents": [],
647
+ "percent": 0,
648
+ "reduction": 100
649
+ },
650
+ {
651
+ "id": "/src/rpc.ts",
652
+ "size": 0,
653
+ "origSize": 36,
654
+ "renderedExports": [],
655
+ "removedExports": [],
656
+ "dependents": [],
657
+ "percent": 0,
658
+ "reduction": 100
659
+ },
660
+ {
661
+ "id": "/src/shared.ts",
662
+ "size": 0,
663
+ "origSize": 653,
664
+ "renderedExports": [],
665
+ "removedExports": [],
666
+ "dependents": [],
667
+ "percent": 0,
668
+ "reduction": 100
669
+ },
670
+ {
671
+ "id": "/src/unstable-core-do-not-import.ts",
672
+ "size": 0,
673
+ "origSize": 1552,
674
+ "renderedExports": [],
675
+ "removedExports": [],
676
+ "dependents": [],
677
+ "percent": 0,
678
+ "reduction": 100
679
+ },
680
+ {
681
+ "id": "/src/observable/index.ts",
682
+ "size": 0,
683
+ "origSize": 293,
684
+ "renderedExports": [],
685
+ "removedExports": [],
686
+ "dependents": [
687
+ "/src/adapters/ws.ts"
688
+ ],
689
+ "percent": 0,
690
+ "reduction": 100
691
+ },
692
+ {
693
+ "id": "/src/adapters/fastify/index.ts",
694
+ "size": 0,
695
+ "origSize": 78,
696
+ "renderedExports": [],
697
+ "removedExports": [],
698
+ "dependents": [],
699
+ "percent": 0,
700
+ "reduction": 100
701
+ },
702
+ {
703
+ "id": "/src/adapters/fetch/index.ts",
704
+ "size": 0,
705
+ "origSize": 64,
706
+ "renderedExports": [],
707
+ "removedExports": [],
708
+ "dependents": [],
709
+ "percent": 0,
710
+ "reduction": 100
711
+ },
712
+ {
713
+ "id": "/src/adapters/node-http/index.ts",
714
+ "size": 0,
715
+ "origSize": 67,
716
+ "renderedExports": [],
717
+ "removedExports": [],
718
+ "dependents": [
719
+ "/src/adapters/express.ts",
720
+ "/src/adapters/next.ts",
721
+ "/src/adapters/standalone.ts"
722
+ ],
723
+ "percent": 0,
724
+ "reduction": 100
725
+ }
726
+ ],
727
+ "moduleCount": 50
728
+ }
@@ -21,20 +21,28 @@ type ProcedureBuilderDef<TMeta> = {
21
21
  };
22
22
  type AnyProcedureBuilderDef = ProcedureBuilderDef<any>;
23
23
  /**
24
- * Procedure resolver options
24
+ * Procedure resolver options (what the `.query()`, `.mutation()`, and `.subscription()` functions receive)
25
25
  * @internal
26
26
  */
27
- interface ResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
27
+ export interface ProcedureResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
28
28
  ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
29
29
  input: TInputOut extends UnsetMarker ? undefined : TInputOut;
30
30
  }
31
31
  /**
32
32
  * A procedure resolver
33
33
  */
34
- type ProcedureResolver<TContext, _TMeta, TContextOverrides, TInputOut, TOutputParserIn, $Output> = (opts: {
35
- ctx: Simplify<Overwrite<TContext, TContextOverrides>>;
36
- input: TInputOut extends UnsetMarker ? undefined : TInputOut;
37
- }) => MaybePromise<DefaultValue<TOutputParserIn, $Output>>;
34
+ type ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputParserIn, $Output> = (opts: ProcedureResolverOptions<TContext, TMeta, TContextOverrides, TInputOut>) => MaybePromise<DefaultValue<TOutputParserIn, $Output>>;
35
+ export type AnyProcedureBuilder = ProcedureBuilder<any, any, any, any, any, any, any>;
36
+ /**
37
+ * Infer the context type from a procedure builder
38
+ * Useful to create common helper functions for different procedures
39
+ */
40
+ export type inferProcedureBuilderResolverOptions<TProcedureBuilder extends AnyProcedureBuilder> = TProcedureBuilder extends ProcedureBuilder<infer TContext, infer TMeta, infer TContextOverrides, infer _TInputIn, infer TInputOut, infer _TOutputIn, infer _TOutputOut> ? ProcedureResolverOptions<TContext, TMeta, TContextOverrides, TInputOut extends UnsetMarker ? unknown : TInputOut extends object ? Simplify<TInputOut & {
41
+ /**
42
+ * Extra input params might have been added by a `.input()` further down the chain
43
+ */
44
+ [keyAddedByInputCallFurtherDown: string]: unknown;
45
+ }> : TInputOut> : never;
38
46
  export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut> {
39
47
  /**
40
48
  * Add an input parser to the procedure.
@@ -85,7 +93,7 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
85
93
  */
86
94
  _def: ProcedureBuilderDef<TMeta>;
87
95
  }
88
- type ProcedureBuilderResolver = (opts: ResolverOptions<any, any, any, any>) => Promise<unknown>;
96
+ type ProcedureBuilderResolver = (opts: ProcedureResolverOptions<any, any, any, any>) => Promise<unknown>;
89
97
  export declare function createBuilder<TContext, TMeta>(initDef?: Partial<AnyProcedureBuilderDef>): ProcedureBuilder<TContext, TMeta, object, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker>;
90
98
  /**
91
99
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"procedureBuilder.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedureBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,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EG;IACH,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CAClC;AAED,KAAK,wBAAwB,GAAG,CAC9B,IAAI,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAC/C,OAAO,CAAC,OAAO,CAAC,CAAC;AAiBtB,wBAAgB,aAAa,CAAC,QAAQ,EAAE,KAAK,EAC3C,OAAO,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC5C,gBAAgB,CACjB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,CACZ,CA6DA;AAwBD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-next-beta.281+66d7db60e",
3
+ "version": "11.0.0-next-beta.284+1960156a1",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -133,7 +133,7 @@
133
133
  "@web3-storage/multipart-parser": "^1.0.0",
134
134
  "aws-lambda": "^1.0.7",
135
135
  "devalue": "^4.0.0",
136
- "eslint": "^8.40.0",
136
+ "eslint": "^8.56.0",
137
137
  "express": "^4.17.1",
138
138
  "fastify": "^4.13.0",
139
139
  "fastify-plugin": "^4.5.0",
@@ -157,5 +157,5 @@
157
157
  "funding": [
158
158
  "https://trpc.io/sponsor"
159
159
  ],
160
- "gitHead": "66d7db60e59b7c758709175a53765c9db0563dc0"
160
+ "gitHead": "1960156a1b30fe76a3828cbf8096e78f85593f11"
161
161
  }
@@ -13,6 +13,7 @@ export {
13
13
  createFlatProxy as createTRPCFlatProxy,
14
14
  type inferProcedureInput,
15
15
  type inferProcedureOutput,
16
+ type inferProcedureBuilderResolverOptions,
16
17
  type inferRouterError,
17
18
  type inferRouterInputs,
18
19
  type inferRouterOutputs,
@@ -58,10 +58,15 @@ type ProcedureBuilderDef<TMeta> = {
58
58
  type AnyProcedureBuilderDef = ProcedureBuilderDef<any>;
59
59
 
60
60
  /**
61
- * Procedure resolver options
61
+ * Procedure resolver options (what the `.query()`, `.mutation()`, and `.subscription()` functions receive)
62
62
  * @internal
63
63
  */
64
- interface ResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
64
+ export interface ProcedureResolverOptions<
65
+ TContext,
66
+ _TMeta,
67
+ TContextOverridesIn,
68
+ TInputOut,
69
+ > {
65
70
  ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
66
71
  input: TInputOut extends UnsetMarker ? undefined : TInputOut;
67
72
  }
@@ -71,20 +76,64 @@ interface ResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
71
76
  */
72
77
  type ProcedureResolver<
73
78
  TContext,
74
- _TMeta,
79
+ TMeta,
75
80
  TContextOverrides,
76
81
  TInputOut,
77
82
  TOutputParserIn,
78
83
  $Output,
79
- > = (opts: {
80
- ctx: Simplify<Overwrite<TContext, TContextOverrides>>;
81
- input: TInputOut extends UnsetMarker ? undefined : TInputOut;
82
- }) => MaybePromise<
84
+ > = (
85
+ opts: ProcedureResolverOptions<TContext, TMeta, TContextOverrides, TInputOut>,
86
+ ) => MaybePromise<
83
87
  // If an output parser is defined, we need to return what the parser expects, otherwise we return the inferred type
84
88
  DefaultValue<TOutputParserIn, $Output>
85
89
  >;
86
90
 
87
91
  type AnyResolver = ProcedureResolver<any, any, any, any, any, any>;
92
+ export type AnyProcedureBuilder = ProcedureBuilder<
93
+ any,
94
+ any,
95
+ any,
96
+ any,
97
+ any,
98
+ any,
99
+ any
100
+ >;
101
+
102
+ /**
103
+ * Infer the context type from a procedure builder
104
+ * Useful to create common helper functions for different procedures
105
+ */
106
+ export type inferProcedureBuilderResolverOptions<
107
+ TProcedureBuilder extends AnyProcedureBuilder,
108
+ > = TProcedureBuilder extends ProcedureBuilder<
109
+ infer TContext,
110
+ infer TMeta,
111
+ infer TContextOverrides,
112
+ infer _TInputIn,
113
+ infer TInputOut,
114
+ infer _TOutputIn,
115
+ infer _TOutputOut
116
+ >
117
+ ? ProcedureResolverOptions<
118
+ TContext,
119
+ TMeta,
120
+ TContextOverrides,
121
+ TInputOut extends UnsetMarker
122
+ ? // if input is not set, we don't want to infer it as `undefined` since a procedure further down the chain might have set an input
123
+ unknown
124
+ : TInputOut extends object
125
+ ? Simplify<
126
+ TInputOut & {
127
+ /**
128
+ * Extra input params might have been added by a `.input()` further down the chain
129
+ */
130
+ [keyAddedByInputCallFurtherDown: string]: unknown;
131
+ }
132
+ >
133
+ : TInputOut
134
+ >
135
+ : never;
136
+
88
137
  export interface ProcedureBuilder<
89
138
  TContext,
90
139
  TMeta,
@@ -236,9 +285,8 @@ export interface ProcedureBuilder<
236
285
  _def: ProcedureBuilderDef<TMeta>;
237
286
  }
238
287
 
239
- type AnyProcedureBuilder = ProcedureBuilder<any, any, any, any, any, any, any>;
240
288
  type ProcedureBuilderResolver = (
241
- opts: ResolverOptions<any, any, any, any>,
289
+ opts: ProcedureResolverOptions<any, any, any, any>,
242
290
  ) => Promise<unknown>;
243
291
 
244
292
  function createNewBuilder(
@@ -274,16 +322,6 @@ export function createBuilder<TContext, TMeta>(
274
322
  ...initDef,
275
323
  };
276
324
 
277
- type AnyProcedureBuilder = ProcedureBuilder<
278
- any,
279
- any,
280
- any,
281
- any,
282
- any,
283
- any,
284
- any
285
- >;
286
-
287
325
  const builder: AnyProcedureBuilder = {
288
326
  _def,
289
327
  input(input) {
@@ -1 +0,0 @@
1
- export * from '../../../dist/adapters/node-http/_export';
@@ -1 +0,0 @@
1
- module.exports = require('../../../dist/adapters/node-http/_export');
@@ -1 +0,0 @@
1
- export * from '../../dist/adapters/zodFileSchema';
@@ -1 +0,0 @@
1
- module.exports = require('../../dist/adapters/zodFileSchema');