@trpc/server 11.0.0-next.320 → 11.0.0-next.323
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.
- package/dist/bundle-analysis.json +71 -70
- package/dist/unstable-core-do-not-import/http/index.d.ts +5 -1
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/types.d.ts +7 -10
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +3 -3
- package/dist/unstable-core-do-not-import/procedure.d.ts +13 -1
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +46 -13
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.js +20 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +20 -1
- package/dist/unstable-core-do-not-import/router.d.ts +10 -4
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.js +18 -23
- package/dist/unstable-core-do-not-import/router.mjs +20 -25
- package/dist/unstable-core-do-not-import/utils.d.ts +3 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/utils.js +4 -0
- package/dist/unstable-core-do-not-import/utils.mjs +4 -1
- package/dist/unstable-core-do-not-import.js +1 -0
- package/dist/unstable-core-do-not-import.mjs +1 -1
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/http/index.ts +5 -1
- package/src/unstable-core-do-not-import/http/types.ts +9 -10
- package/src/unstable-core-do-not-import/procedure.ts +21 -1
- package/src/unstable-core-do-not-import/procedureBuilder.ts +107 -21
- package/src/unstable-core-do-not-import/router.ts +45 -32
- package/src/unstable-core-do-not-import/utils.ts +5 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction":
|
|
2
|
+
"bundleSize": 92876,
|
|
3
|
+
"bundleOrigSize": 150623,
|
|
4
|
+
"bundleReduction": 38.34,
|
|
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.
|
|
18
|
+
"percent": 10.95,
|
|
19
19
|
"reduction": 0
|
|
20
20
|
},
|
|
21
21
|
{
|
|
@@ -27,43 +27,43 @@
|
|
|
27
27
|
],
|
|
28
28
|
"removedExports": [],
|
|
29
29
|
"dependents": [],
|
|
30
|
-
"percent": 10.
|
|
30
|
+
"percent": 10.2,
|
|
31
31
|
"reduction": 20.86
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"id": "/src/unstable-core-do-not-import/
|
|
35
|
-
"size":
|
|
36
|
-
"origSize":
|
|
34
|
+
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
35
|
+
"size": 6215,
|
|
36
|
+
"origSize": 15774,
|
|
37
37
|
"renderedExports": [
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"createCallerFactory",
|
|
41
|
-
"mergeRouters"
|
|
38
|
+
"unsetMarker",
|
|
39
|
+
"createBuilder"
|
|
42
40
|
],
|
|
43
41
|
"removedExports": [],
|
|
44
42
|
"dependents": [
|
|
45
43
|
"/src/unstable-core-do-not-import.ts",
|
|
46
|
-
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
47
|
-
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
44
|
+
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
48
45
|
],
|
|
49
|
-
"percent": 6.
|
|
50
|
-
"reduction":
|
|
46
|
+
"percent": 6.69,
|
|
47
|
+
"reduction": 60.6
|
|
51
48
|
},
|
|
52
49
|
{
|
|
53
|
-
"id": "/src/unstable-core-do-not-import/
|
|
54
|
-
"size":
|
|
55
|
-
"origSize":
|
|
50
|
+
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
51
|
+
"size": 5831,
|
|
52
|
+
"origSize": 9972,
|
|
56
53
|
"renderedExports": [
|
|
57
|
-
"
|
|
58
|
-
"
|
|
54
|
+
"createRouterFactory",
|
|
55
|
+
"callProcedure",
|
|
56
|
+
"createCallerFactory",
|
|
57
|
+
"mergeRouters"
|
|
59
58
|
],
|
|
60
59
|
"removedExports": [],
|
|
61
60
|
"dependents": [
|
|
62
61
|
"/src/unstable-core-do-not-import.ts",
|
|
62
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
63
63
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
64
64
|
],
|
|
65
|
-
"percent": 6.
|
|
66
|
-
"reduction":
|
|
65
|
+
"percent": 6.28,
|
|
66
|
+
"reduction": 41.53
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"id": "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependents": [
|
|
79
79
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
80
80
|
],
|
|
81
|
-
"percent": 5.
|
|
81
|
+
"percent": 5.36,
|
|
82
82
|
"reduction": 38
|
|
83
83
|
},
|
|
84
84
|
{
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
],
|
|
93
93
|
"removedExports": [],
|
|
94
94
|
"dependents": [],
|
|
95
|
-
"percent": 4.
|
|
95
|
+
"percent": 4.76,
|
|
96
96
|
"reduction": 32.71
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"dependents": [
|
|
107
107
|
"/src/adapters/node-http/index.ts"
|
|
108
108
|
],
|
|
109
|
-
"percent": 4.
|
|
109
|
+
"percent": 4.23,
|
|
110
110
|
"reduction": 13.56
|
|
111
111
|
},
|
|
112
112
|
{
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"dependents": [
|
|
121
121
|
"/src/adapters/fetch/index.ts"
|
|
122
122
|
],
|
|
123
|
-
"percent": 3.
|
|
123
|
+
"percent": 3.73,
|
|
124
124
|
"reduction": 9.9
|
|
125
125
|
},
|
|
126
126
|
{
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"dependents": [
|
|
140
140
|
"/src/adapters/aws-lambda/index.ts"
|
|
141
141
|
],
|
|
142
|
-
"percent": 3.
|
|
142
|
+
"percent": 3.56,
|
|
143
143
|
"reduction": 34.98
|
|
144
144
|
},
|
|
145
145
|
{
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"/src/observable/index.ts",
|
|
157
157
|
"/src/observable/operators.ts"
|
|
158
158
|
],
|
|
159
|
-
"percent": 3.
|
|
159
|
+
"percent": 3.37,
|
|
160
160
|
"reduction": 0.67
|
|
161
161
|
},
|
|
162
162
|
{
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"dependents": [
|
|
171
171
|
"/src/unstable-core-do-not-import.ts"
|
|
172
172
|
],
|
|
173
|
-
"percent": 3.
|
|
173
|
+
"percent": 3.02,
|
|
174
174
|
"reduction": 40.26
|
|
175
175
|
},
|
|
176
176
|
{
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"dependents": [
|
|
187
187
|
"/src/observable/index.ts"
|
|
188
188
|
],
|
|
189
|
-
"percent": 2.
|
|
189
|
+
"percent": 2.97,
|
|
190
190
|
"reduction": 0
|
|
191
191
|
},
|
|
192
192
|
{
|
|
@@ -202,11 +202,11 @@
|
|
|
202
202
|
"removedExports": [],
|
|
203
203
|
"dependents": [
|
|
204
204
|
"/src/unstable-core-do-not-import.ts",
|
|
205
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
205
206
|
"/src/unstable-core-do-not-import/router.ts",
|
|
206
|
-
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
207
|
-
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
207
|
+
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
208
208
|
],
|
|
209
|
-
"percent": 2.
|
|
209
|
+
"percent": 2.95,
|
|
210
210
|
"reduction": 45.94
|
|
211
211
|
},
|
|
212
212
|
{
|
|
@@ -226,7 +226,7 @@
|
|
|
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.
|
|
229
|
+
"percent": 2.83,
|
|
230
230
|
"reduction": 55.5
|
|
231
231
|
},
|
|
232
232
|
{
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
"/src/adapters/fastify/index.ts",
|
|
242
242
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
243
243
|
],
|
|
244
|
-
"percent": 2.
|
|
244
|
+
"percent": 2.67,
|
|
245
245
|
"reduction": 36.53
|
|
246
246
|
},
|
|
247
247
|
{
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
],
|
|
254
254
|
"removedExports": [],
|
|
255
255
|
"dependents": [],
|
|
256
|
-
"percent": 2.
|
|
256
|
+
"percent": 2.63,
|
|
257
257
|
"reduction": 32.42
|
|
258
258
|
},
|
|
259
259
|
{
|
|
@@ -268,10 +268,10 @@
|
|
|
268
268
|
"removedExports": [],
|
|
269
269
|
"dependents": [
|
|
270
270
|
"/src/unstable-core-do-not-import.ts",
|
|
271
|
-
"/src/unstable-core-do-not-import/router.ts",
|
|
272
|
-
"/src/unstable-core-do-not-import/middleware.ts",
|
|
273
271
|
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
274
272
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
273
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
274
|
+
"/src/unstable-core-do-not-import/middleware.ts",
|
|
275
275
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
276
276
|
],
|
|
277
277
|
"percent": 1.87,
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
],
|
|
301
301
|
"removedExports": [],
|
|
302
302
|
"dependents": [],
|
|
303
|
-
"percent": 1.
|
|
303
|
+
"percent": 1.72,
|
|
304
304
|
"reduction": 29.12
|
|
305
305
|
},
|
|
306
306
|
{
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"dependents": [
|
|
315
315
|
"/src/adapters/node-http/content-type/json/index.ts"
|
|
316
316
|
],
|
|
317
|
-
"percent": 1.
|
|
317
|
+
"percent": 1.71,
|
|
318
318
|
"reduction": 0.19
|
|
319
319
|
},
|
|
320
320
|
{
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
],
|
|
327
327
|
"removedExports": [],
|
|
328
328
|
"dependents": [],
|
|
329
|
-
"percent": 1.
|
|
329
|
+
"percent": 1.7,
|
|
330
330
|
"reduction": 21.04
|
|
331
331
|
},
|
|
332
332
|
{
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
],
|
|
340
340
|
"removedExports": [],
|
|
341
341
|
"dependents": [],
|
|
342
|
-
"percent": 1.
|
|
342
|
+
"percent": 1.64,
|
|
343
343
|
"reduction": 27.6
|
|
344
344
|
},
|
|
345
345
|
{
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
"/src/unstable-core-do-not-import/router.ts",
|
|
357
357
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
358
358
|
],
|
|
359
|
-
"percent": 1.
|
|
359
|
+
"percent": 1.62,
|
|
360
360
|
"reduction": 5.58
|
|
361
361
|
},
|
|
362
362
|
{
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"dependents": [
|
|
371
371
|
"/src/adapters/fastify/index.ts"
|
|
372
372
|
],
|
|
373
|
-
"percent": 1.
|
|
373
|
+
"percent": 1.6,
|
|
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.
|
|
387
|
+
"percent": 1.5,
|
|
388
388
|
"reduction": 0
|
|
389
389
|
},
|
|
390
390
|
{
|
|
@@ -397,10 +397,10 @@
|
|
|
397
397
|
],
|
|
398
398
|
"removedExports": [],
|
|
399
399
|
"dependents": [
|
|
400
|
-
"/src/unstable-core-do-not-import/
|
|
401
|
-
"/src/unstable-core-do-not-import/
|
|
400
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
401
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts"
|
|
402
402
|
],
|
|
403
|
-
"percent": 1.
|
|
403
|
+
"percent": 1.36,
|
|
404
404
|
"reduction": 22.76
|
|
405
405
|
},
|
|
406
406
|
{
|
|
@@ -420,11 +420,12 @@
|
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
"id": "/src/unstable-core-do-not-import/utils.ts",
|
|
423
|
-
"size":
|
|
424
|
-
"origSize":
|
|
423
|
+
"size": 880,
|
|
424
|
+
"origSize": 1151,
|
|
425
425
|
"renderedExports": [
|
|
426
426
|
"mergeWithoutOverrides",
|
|
427
427
|
"isObject",
|
|
428
|
+
"isFunction",
|
|
428
429
|
"omitPrototype"
|
|
429
430
|
],
|
|
430
431
|
"removedExports": [],
|
|
@@ -437,8 +438,8 @@
|
|
|
437
438
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
438
439
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
439
440
|
],
|
|
440
|
-
"percent": 0.
|
|
441
|
-
"reduction":
|
|
441
|
+
"percent": 0.95,
|
|
442
|
+
"reduction": 23.54
|
|
442
443
|
},
|
|
443
444
|
{
|
|
444
445
|
"id": "/src/adapters/node-http/content-type/form-data/uploadHandler.ts",
|
|
@@ -471,7 +472,7 @@
|
|
|
471
472
|
"dependents": [
|
|
472
473
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
473
474
|
],
|
|
474
|
-
"percent": 0.
|
|
475
|
+
"percent": 0.75,
|
|
475
476
|
"reduction": 71.21
|
|
476
477
|
},
|
|
477
478
|
{
|
|
@@ -498,7 +499,7 @@
|
|
|
498
499
|
"/src/unstable-core-do-not-import.ts",
|
|
499
500
|
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
500
501
|
],
|
|
501
|
-
"percent": 0.
|
|
502
|
+
"percent": 0.67,
|
|
502
503
|
"reduction": 43.49
|
|
503
504
|
},
|
|
504
505
|
{
|
|
@@ -511,7 +512,7 @@
|
|
|
511
512
|
],
|
|
512
513
|
"removedExports": [],
|
|
513
514
|
"dependents": [],
|
|
514
|
-
"percent": 0.
|
|
515
|
+
"percent": 0.62,
|
|
515
516
|
"reduction": 65.23
|
|
516
517
|
},
|
|
517
518
|
{
|
|
@@ -552,7 +553,7 @@
|
|
|
552
553
|
"dependents": [
|
|
553
554
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts"
|
|
554
555
|
],
|
|
555
|
-
"percent": 0.
|
|
556
|
+
"percent": 0.31,
|
|
556
557
|
"reduction": 35.11
|
|
557
558
|
},
|
|
558
559
|
{
|
|
@@ -593,13 +594,13 @@
|
|
|
593
594
|
"/src/adapters/node-http/content-type/json/index.ts",
|
|
594
595
|
"/src/adapters/node-http/content-type/form-data/index.ts"
|
|
595
596
|
],
|
|
596
|
-
"percent": 0.
|
|
597
|
+
"percent": 0.12,
|
|
597
598
|
"reduction": 86.68
|
|
598
599
|
},
|
|
599
600
|
{
|
|
600
601
|
"id": "/src/unstable-core-do-not-import/procedure.ts",
|
|
601
602
|
"size": 75,
|
|
602
|
-
"origSize":
|
|
603
|
+
"origSize": 2390,
|
|
603
604
|
"renderedExports": [
|
|
604
605
|
"procedureTypes"
|
|
605
606
|
],
|
|
@@ -609,7 +610,7 @@
|
|
|
609
610
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts"
|
|
610
611
|
],
|
|
611
612
|
"percent": 0.08,
|
|
612
|
-
"reduction": 96.
|
|
613
|
+
"reduction": 96.86
|
|
613
614
|
},
|
|
614
615
|
{
|
|
615
616
|
"id": "/src/unstable-core-do-not-import/error/formatter.ts",
|
|
@@ -628,9 +629,9 @@
|
|
|
628
629
|
"reduction": 93.8
|
|
629
630
|
},
|
|
630
631
|
{
|
|
631
|
-
"id": "/src/
|
|
632
|
+
"id": "/src/http.ts",
|
|
632
633
|
"size": 0,
|
|
633
|
-
"origSize":
|
|
634
|
+
"origSize": 37,
|
|
634
635
|
"renderedExports": [],
|
|
635
636
|
"removedExports": [],
|
|
636
637
|
"dependents": [],
|
|
@@ -638,9 +639,9 @@
|
|
|
638
639
|
"reduction": 100
|
|
639
640
|
},
|
|
640
641
|
{
|
|
641
|
-
"id": "/src/
|
|
642
|
+
"id": "/src/index.ts",
|
|
642
643
|
"size": 0,
|
|
643
|
-
"origSize":
|
|
644
|
+
"origSize": 32,
|
|
644
645
|
"renderedExports": [],
|
|
645
646
|
"removedExports": [],
|
|
646
647
|
"dependents": [],
|
|
@@ -658,9 +659,9 @@
|
|
|
658
659
|
"reduction": 100
|
|
659
660
|
},
|
|
660
661
|
{
|
|
661
|
-
"id": "/src/
|
|
662
|
+
"id": "/src/unstable-core-do-not-import.ts",
|
|
662
663
|
"size": 0,
|
|
663
|
-
"origSize":
|
|
664
|
+
"origSize": 1552,
|
|
664
665
|
"renderedExports": [],
|
|
665
666
|
"removedExports": [],
|
|
666
667
|
"dependents": [],
|
|
@@ -668,9 +669,9 @@
|
|
|
668
669
|
"reduction": 100
|
|
669
670
|
},
|
|
670
671
|
{
|
|
671
|
-
"id": "/src/
|
|
672
|
+
"id": "/src/shared.ts",
|
|
672
673
|
"size": 0,
|
|
673
|
-
"origSize":
|
|
674
|
+
"origSize": 653,
|
|
674
675
|
"renderedExports": [],
|
|
675
676
|
"removedExports": [],
|
|
676
677
|
"dependents": [],
|
|
@@ -717,8 +718,8 @@
|
|
|
717
718
|
"removedExports": [],
|
|
718
719
|
"dependents": [
|
|
719
720
|
"/src/adapters/express.ts",
|
|
720
|
-
"/src/adapters/
|
|
721
|
-
"/src/adapters/
|
|
721
|
+
"/src/adapters/next.ts",
|
|
722
|
+
"/src/adapters/standalone.ts"
|
|
722
723
|
],
|
|
723
724
|
"percent": 0,
|
|
724
725
|
"reduction": 100
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { getHTTPStatusCode, getHTTPStatusCodeFromError, } from './getHTTPStatusCode';
|
|
2
2
|
export { resolveHTTPResponse } from './resolveHTTPResponse';
|
|
3
|
-
export type { BaseHandlerOptions, HTTPBaseHandlerOptions, HTTPHeaders, HTTPRequest, HTTPResponse,
|
|
3
|
+
export type { BaseHandlerOptions, HTTPBaseHandlerOptions, HTTPHeaders, HTTPRequest, HTTPResponse,
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `HTTPErrorHandler` instead
|
|
6
|
+
*/
|
|
7
|
+
HTTPErrorHandler as OnErrorFunction, HTTPErrorHandler, ProcedureCall, ResolveHTTPRequestOptionsContextFn, ResponseChunk, ResponseMeta, ResponseMetaFn, TRPCRequestInfo, } from './types';
|
|
4
8
|
export { getBatchStreamFormatter } from './batchStreamFormatter';
|
|
5
9
|
export type { BaseContentTypeHandler, BodyResult } from './contentType';
|
|
6
10
|
export { getJsonContentTypeInputs } from './contentType';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY;AACZ;;GAEG;AACH,gBAAgB,IAAI,eAAe,EACnC,gBAAgB,EAChB,aAAa,EACb,kCAAkC,EAClC,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRPCError } from '../error/TRPCError';
|
|
2
|
-
import type { ProcedureType } from '../procedure';
|
|
2
|
+
import type { ErrorHandlerOptions, ProcedureType } from '../procedure';
|
|
3
3
|
import type { AnyRouter, inferRouterContext, inferRouterError } from '../router';
|
|
4
4
|
import type { TRPCResponse } from '../rpc';
|
|
5
5
|
import type { Dict } from '../types';
|
|
@@ -71,23 +71,19 @@ export type TRPCRequestInfo = {
|
|
|
71
71
|
export type ResolveHTTPRequestOptionsContextFn<TRouter extends AnyRouter> = (opts: {
|
|
72
72
|
info: TRPCRequestInfo;
|
|
73
73
|
}) => Promise<inferRouterContext<TRouter>>;
|
|
74
|
+
interface HTTPErrorHandlerOptions<TRouter extends AnyRouter, TRequest> extends ErrorHandlerOptions<inferRouterContext<TRouter>> {
|
|
75
|
+
req: TRequest;
|
|
76
|
+
}
|
|
74
77
|
/**
|
|
75
78
|
* @internal
|
|
76
79
|
*/
|
|
77
|
-
export type
|
|
78
|
-
error: TRPCError;
|
|
79
|
-
type: ProcedureType | 'unknown';
|
|
80
|
-
path: string | undefined;
|
|
81
|
-
req: TRequest;
|
|
82
|
-
input: unknown;
|
|
83
|
-
ctx: inferRouterContext<TRouter> | undefined;
|
|
84
|
-
}) => void;
|
|
80
|
+
export type HTTPErrorHandler<TRouter extends AnyRouter, TRequest> = (opts: HTTPErrorHandlerOptions<TRouter, TRequest>) => void;
|
|
85
81
|
/**
|
|
86
82
|
* Base interface for any response handler
|
|
87
83
|
* @internal
|
|
88
84
|
*/
|
|
89
85
|
export interface BaseHandlerOptions<TRouter extends AnyRouter, TRequest> {
|
|
90
|
-
onError?:
|
|
86
|
+
onError?: HTTPErrorHandler<TRouter, TRequest>;
|
|
91
87
|
/**
|
|
92
88
|
* @deprecated use `allowBatching` instead, this will be removed in v12
|
|
93
89
|
*/
|
|
@@ -109,4 +105,5 @@ export interface BaseHandlerOptions<TRouter extends AnyRouter, TRequest> {
|
|
|
109
105
|
*/
|
|
110
106
|
allowBatching?: boolean;
|
|
111
107
|
}
|
|
108
|
+
export {};
|
|
112
109
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EACV,SA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H,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -47,7 +47,7 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
47
47
|
* Builder object for creating procedures
|
|
48
48
|
* @link https://trpc.io/docs/v11/server/procedures
|
|
49
49
|
*/
|
|
50
|
-
procedure: import("./procedureBuilder").ProcedureBuilder<TContext, TMeta, object, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker>;
|
|
50
|
+
procedure: import("./procedureBuilder").ProcedureBuilder<TContext, TMeta, object, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker, typeof import("./procedureBuilder").unsetMarker, false>;
|
|
51
51
|
/**
|
|
52
52
|
* Create reusable middlewares
|
|
53
53
|
* @link https://trpc.io/docs/v11/server/middlewares
|
|
@@ -80,12 +80,12 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
80
80
|
* Create a server-side caller for a router
|
|
81
81
|
* @link https://trpc.io/docs/v11/server/server-side-calls
|
|
82
82
|
*/
|
|
83
|
-
createCallerFactory: <TRecord extends import("./router").RouterRecord>(router: import("./router").Router<{
|
|
83
|
+
createCallerFactory: <TRecord extends import("./router").RouterRecord>(router: Pick<import("./router").Router<{
|
|
84
84
|
ctx: TContext;
|
|
85
85
|
meta: TMeta;
|
|
86
86
|
errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
|
|
87
87
|
transformer: undefined extends TOptions['transformer'] ? false : true;
|
|
88
|
-
}, TRecord>) => import("./router").RouterCaller<{
|
|
88
|
+
}, TRecord>, "_def">) => import("./router").RouterCaller<{
|
|
89
89
|
ctx: TContext;
|
|
90
90
|
meta: TMeta;
|
|
91
91
|
errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TRPCError } from './error/TRPCError';
|
|
1
2
|
import type { ProcedureCallOptions } from './procedureBuilder';
|
|
2
3
|
export declare const procedureTypes: readonly ["query", "mutation", "subscription"];
|
|
3
4
|
/**
|
|
@@ -18,6 +19,7 @@ export interface ProcedureOptions {
|
|
|
18
19
|
interface BuiltProcedureDef {
|
|
19
20
|
input: unknown;
|
|
20
21
|
output: unknown;
|
|
22
|
+
experimental_caller?: true;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
*
|
|
@@ -38,7 +40,7 @@ export interface Procedure<TType extends ProcedureType, TDef extends BuiltProced
|
|
|
38
40
|
/**
|
|
39
41
|
* @internal
|
|
40
42
|
*/
|
|
41
|
-
(opts: ProcedureCallOptions): Promise<unknown>;
|
|
43
|
+
(opts: TDef['experimental_caller'] extends true ? TDef['input'] : ProcedureCallOptions): Promise<TDef['experimental_caller'] extends true ? TDef['output'] : unknown>;
|
|
42
44
|
}
|
|
43
45
|
export interface QueryProcedure<TDef extends BuiltProcedureDef> extends Procedure<'query', TDef> {
|
|
44
46
|
}
|
|
@@ -53,5 +55,15 @@ export type AnyProcedure = Procedure<ProcedureType, any>;
|
|
|
53
55
|
export type inferProcedureInput<TProcedure extends AnyProcedure> = undefined extends inferProcedureParams<TProcedure>['_input_in'] ? void | inferProcedureParams<TProcedure>['_input_in'] : inferProcedureParams<TProcedure>['_input_in'];
|
|
54
56
|
export type inferProcedureParams<TProcedure> = TProcedure extends AnyProcedure ? TProcedure['_def'] : never;
|
|
55
57
|
export type inferProcedureOutput<TProcedure> = inferProcedureParams<TProcedure>['_output_out'];
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export interface ErrorHandlerOptions<TContext> {
|
|
62
|
+
error: TRPCError;
|
|
63
|
+
type: ProcedureType | 'unknown';
|
|
64
|
+
path: string | undefined;
|
|
65
|
+
input: unknown;
|
|
66
|
+
ctx: TContext | undefined;
|
|
67
|
+
}
|
|
56
68
|
export {};
|
|
57
69
|
//# sourceMappingURL=procedure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAC7E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAC7E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,iBA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