@trpc/server 11.0.0-rc.544 → 11.0.0-rc.551
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 +52 -52
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.js +16 -4
- package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +16 -4
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +2 -2
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/http/resolveResponse.ts +19 -4
- package/src/unstable-core-do-not-import/procedureBuilder.ts +12 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 26.
|
|
2
|
+
"bundleSize": 136668,
|
|
3
|
+
"bundleOrigSize": 186211,
|
|
4
|
+
"bundleReduction": 26.61,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
8
|
-
"size":
|
|
9
|
-
"origSize":
|
|
8
|
+
"size": 18439,
|
|
9
|
+
"origSize": 17070,
|
|
10
10
|
"renderedExports": [
|
|
11
11
|
"resolveResponse"
|
|
12
12
|
],
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/unstable-core-do-not-import.ts"
|
|
16
16
|
],
|
|
17
|
-
"percent": 13.
|
|
17
|
+
"percent": 13.49,
|
|
18
18
|
"reduction": 0
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"/src/unstable-core-do-not-import.ts",
|
|
32
32
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent": 12.
|
|
34
|
+
"percent": 12.85,
|
|
35
35
|
"reduction": 4.31
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependents": [
|
|
48
48
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
49
49
|
],
|
|
50
|
-
"percent": 11.
|
|
50
|
+
"percent": 11.92,
|
|
51
51
|
"reduction": 0
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"/src/unstable-core-do-not-import.ts",
|
|
63
63
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
64
64
|
],
|
|
65
|
-
"percent": 5.
|
|
65
|
+
"percent": 5.63,
|
|
66
66
|
"reduction": 0
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"/src/unstable-core-do-not-import.ts",
|
|
81
81
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
82
82
|
],
|
|
83
|
-
"percent": 4.
|
|
83
|
+
"percent": 4.7,
|
|
84
84
|
"reduction": 40.18
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -97,13 +97,13 @@
|
|
|
97
97
|
"/src/unstable-core-do-not-import.ts",
|
|
98
98
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
99
99
|
],
|
|
100
|
-
"percent": 4.
|
|
100
|
+
"percent": 4.32,
|
|
101
101
|
"reduction": 15.22
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
105
105
|
"size": 5795,
|
|
106
|
-
"origSize":
|
|
106
|
+
"origSize": 15690,
|
|
107
107
|
"renderedExports": [
|
|
108
108
|
"createBuilder"
|
|
109
109
|
],
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"/src/unstable-core-do-not-import.ts",
|
|
113
113
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
114
114
|
],
|
|
115
|
-
"percent": 4.
|
|
116
|
-
"reduction": 63.
|
|
115
|
+
"percent": 4.24,
|
|
116
|
+
"reduction": 63.07
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"id": "/src/adapters/aws-lambda/getPlanner.ts",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"dependents": [
|
|
127
127
|
"/src/adapters/aws-lambda/index.ts"
|
|
128
128
|
],
|
|
129
|
-
"percent": 3.
|
|
129
|
+
"percent": 3.96,
|
|
130
130
|
"reduction": 11.38
|
|
131
131
|
},
|
|
132
132
|
{
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
147
147
|
"/src/observable/operators.ts"
|
|
148
148
|
],
|
|
149
|
-
"percent": 3.
|
|
149
|
+
"percent": 3.01,
|
|
150
150
|
"reduction": 0
|
|
151
151
|
},
|
|
152
152
|
{
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"dependents": [
|
|
161
161
|
"/src/adapters/next-app-dir.ts"
|
|
162
162
|
],
|
|
163
|
-
"percent": 2.
|
|
163
|
+
"percent": 2.36,
|
|
164
164
|
"reduction": 22.57
|
|
165
165
|
},
|
|
166
166
|
{
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"dependents": [
|
|
175
175
|
"/src/adapters/node-http/index.ts"
|
|
176
176
|
],
|
|
177
|
-
"percent": 2.
|
|
177
|
+
"percent": 2.09,
|
|
178
178
|
"reduction": 6.07
|
|
179
179
|
},
|
|
180
180
|
{
|
|
@@ -206,11 +206,11 @@
|
|
|
206
206
|
"removedExports": [],
|
|
207
207
|
"dependents": [
|
|
208
208
|
"/src/unstable-core-do-not-import.ts",
|
|
209
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
209
210
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
210
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
211
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
211
|
+
"/src/unstable-core-do-not-import/router.ts"
|
|
212
212
|
],
|
|
213
|
-
"percent": 2.
|
|
213
|
+
"percent": 2.01,
|
|
214
214
|
"reduction": 45.94
|
|
215
215
|
},
|
|
216
216
|
{
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
"dependents": [
|
|
225
225
|
"/src/unstable-core-do-not-import.ts"
|
|
226
226
|
],
|
|
227
|
-
"percent": 1.
|
|
227
|
+
"percent": 1.97,
|
|
228
228
|
"reduction": 40.98
|
|
229
229
|
},
|
|
230
230
|
{
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
245
245
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
246
246
|
],
|
|
247
|
-
"percent": 1.
|
|
247
|
+
"percent": 1.92,
|
|
248
248
|
"reduction": 55.78
|
|
249
249
|
},
|
|
250
250
|
{
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
"/src/unstable-core-do-not-import.ts",
|
|
261
261
|
"/src/unstable-core-do-not-import/router.ts"
|
|
262
262
|
],
|
|
263
|
-
"percent": 1.
|
|
263
|
+
"percent": 1.7,
|
|
264
264
|
"reduction": 0
|
|
265
265
|
},
|
|
266
266
|
{
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
"dependents": [
|
|
275
275
|
"/src/adapters/fetch/index.ts"
|
|
276
276
|
],
|
|
277
|
-
"percent": 1.
|
|
277
|
+
"percent": 1.65,
|
|
278
278
|
"reduction": 2.17
|
|
279
279
|
},
|
|
280
280
|
{
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
"dependents": [
|
|
304
304
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
305
305
|
],
|
|
306
|
-
"percent": 1.
|
|
306
|
+
"percent": 1.5,
|
|
307
307
|
"reduction": 5.79
|
|
308
308
|
},
|
|
309
309
|
{
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
"dependents": [
|
|
318
318
|
"/src/adapters/fastify/index.ts"
|
|
319
319
|
],
|
|
320
|
-
"percent": 1.
|
|
320
|
+
"percent": 1.3,
|
|
321
321
|
"reduction": 29.88
|
|
322
322
|
},
|
|
323
323
|
{
|
|
@@ -332,10 +332,10 @@
|
|
|
332
332
|
"removedExports": [],
|
|
333
333
|
"dependents": [
|
|
334
334
|
"/src/unstable-core-do-not-import.ts",
|
|
335
|
-
"/src/unstable-core-do-not-import/middleware.ts",
|
|
336
|
-
"/src/unstable-core-do-not-import/router.ts",
|
|
337
335
|
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
338
336
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
337
|
+
"/src/unstable-core-do-not-import/middleware.ts",
|
|
338
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
339
339
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
340
340
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
341
341
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
],
|
|
354
354
|
"removedExports": [],
|
|
355
355
|
"dependents": [],
|
|
356
|
-
"percent": 1.
|
|
356
|
+
"percent": 1.24,
|
|
357
357
|
"reduction": 19.29
|
|
358
358
|
},
|
|
359
359
|
{
|
|
@@ -392,10 +392,10 @@
|
|
|
392
392
|
"removedExports": [],
|
|
393
393
|
"dependents": [
|
|
394
394
|
"/src/unstable-core-do-not-import.ts",
|
|
395
|
-
"/src/unstable-core-do-not-import/
|
|
396
|
-
"/src/unstable-core-do-not-import/
|
|
395
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
396
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts"
|
|
397
397
|
],
|
|
398
|
-
"percent": 1.
|
|
398
|
+
"percent": 1.05,
|
|
399
399
|
"reduction": 16.73
|
|
400
400
|
},
|
|
401
401
|
{
|
|
@@ -429,13 +429,13 @@
|
|
|
429
429
|
"removedExports": [],
|
|
430
430
|
"dependents": [
|
|
431
431
|
"/src/unstable-core-do-not-import.ts",
|
|
432
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
433
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
434
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
432
435
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
433
436
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
434
437
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
435
438
|
"/src/unstable-core-do-not-import/router.ts",
|
|
436
|
-
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
437
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
438
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
439
439
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
440
440
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
441
441
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
"/src/unstable-core-do-not-import.ts",
|
|
540
540
|
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
541
541
|
],
|
|
542
|
-
"percent": 0.
|
|
542
|
+
"percent": 0.58,
|
|
543
543
|
"reduction": 44.65
|
|
544
544
|
},
|
|
545
545
|
{
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
568
568
|
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
569
569
|
],
|
|
570
|
-
"percent": 0.
|
|
570
|
+
"percent": 0.53,
|
|
571
571
|
"reduction": 20.74
|
|
572
572
|
},
|
|
573
573
|
{
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
],
|
|
637
637
|
"removedExports": [],
|
|
638
638
|
"dependents": [],
|
|
639
|
-
"percent": 0.
|
|
639
|
+
"percent": 0.2,
|
|
640
640
|
"reduction": 72.92
|
|
641
641
|
},
|
|
642
642
|
{
|
|
@@ -707,7 +707,7 @@
|
|
|
707
707
|
"/src/unstable-core-do-not-import.ts",
|
|
708
708
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts"
|
|
709
709
|
],
|
|
710
|
-
"percent": 0.
|
|
710
|
+
"percent": 0.05,
|
|
711
711
|
"reduction": 97.19
|
|
712
712
|
},
|
|
713
713
|
{
|
|
@@ -726,16 +726,6 @@
|
|
|
726
726
|
"percent": 0.04,
|
|
727
727
|
"reduction": 93.8
|
|
728
728
|
},
|
|
729
|
-
{
|
|
730
|
-
"id": "/src/index.ts",
|
|
731
|
-
"size": 0,
|
|
732
|
-
"origSize": 32,
|
|
733
|
-
"renderedExports": [],
|
|
734
|
-
"removedExports": [],
|
|
735
|
-
"dependents": [],
|
|
736
|
-
"percent": 0,
|
|
737
|
-
"reduction": 100
|
|
738
|
-
},
|
|
739
729
|
{
|
|
740
730
|
"id": "/src/http.ts",
|
|
741
731
|
"size": 0,
|
|
@@ -749,9 +739,9 @@
|
|
|
749
739
|
"reduction": 100
|
|
750
740
|
},
|
|
751
741
|
{
|
|
752
|
-
"id": "/src/
|
|
742
|
+
"id": "/src/index.ts",
|
|
753
743
|
"size": 0,
|
|
754
|
-
"origSize":
|
|
744
|
+
"origSize": 32,
|
|
755
745
|
"renderedExports": [],
|
|
756
746
|
"removedExports": [],
|
|
757
747
|
"dependents": [],
|
|
@@ -768,6 +758,16 @@
|
|
|
768
758
|
"percent": 0,
|
|
769
759
|
"reduction": 100
|
|
770
760
|
},
|
|
761
|
+
{
|
|
762
|
+
"id": "/src/rpc.ts",
|
|
763
|
+
"size": 0,
|
|
764
|
+
"origSize": 36,
|
|
765
|
+
"renderedExports": [],
|
|
766
|
+
"removedExports": [],
|
|
767
|
+
"dependents": [],
|
|
768
|
+
"percent": 0,
|
|
769
|
+
"reduction": 100
|
|
770
|
+
},
|
|
771
771
|
{
|
|
772
772
|
"id": "/src/unstable-core-do-not-import.ts",
|
|
773
773
|
"size": 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,CAibnB"}
|
|
@@ -292,13 +292,25 @@ async function resolveResponse(opts) {
|
|
|
292
292
|
data: dataAsIterable,
|
|
293
293
|
serialize: (v)=>config.transformer.output.serialize(v),
|
|
294
294
|
formatError (errorOpts) {
|
|
295
|
+
const error = TRPCError.getTRPCErrorFromUnknown(errorOpts.error);
|
|
296
|
+
const input = call?.result();
|
|
297
|
+
const path = call?.path;
|
|
298
|
+
const type = call?.procedure?._def.type ?? 'unknown';
|
|
295
299
|
const shape = getErrorShape.getErrorShape({
|
|
296
300
|
config,
|
|
297
301
|
ctx,
|
|
298
|
-
error
|
|
299
|
-
input
|
|
300
|
-
path
|
|
301
|
-
type
|
|
302
|
+
error,
|
|
303
|
+
input,
|
|
304
|
+
path,
|
|
305
|
+
type
|
|
306
|
+
});
|
|
307
|
+
opts.onError?.({
|
|
308
|
+
error,
|
|
309
|
+
path,
|
|
310
|
+
input,
|
|
311
|
+
ctx,
|
|
312
|
+
req: opts.req,
|
|
313
|
+
type
|
|
302
314
|
});
|
|
303
315
|
return shape;
|
|
304
316
|
}
|
|
@@ -290,13 +290,25 @@ async function resolveResponse(opts) {
|
|
|
290
290
|
data: dataAsIterable,
|
|
291
291
|
serialize: (v)=>config.transformer.output.serialize(v),
|
|
292
292
|
formatError (errorOpts) {
|
|
293
|
+
const error = getTRPCErrorFromUnknown(errorOpts.error);
|
|
294
|
+
const input = call?.result();
|
|
295
|
+
const path = call?.path;
|
|
296
|
+
const type = call?.procedure?._def.type ?? 'unknown';
|
|
293
297
|
const shape = getErrorShape({
|
|
294
298
|
config,
|
|
295
299
|
ctx,
|
|
296
|
-
error
|
|
297
|
-
input
|
|
298
|
-
path
|
|
299
|
-
type
|
|
300
|
+
error,
|
|
301
|
+
input,
|
|
302
|
+
path,
|
|
303
|
+
type
|
|
304
|
+
});
|
|
305
|
+
opts.onError?.({
|
|
306
|
+
error,
|
|
307
|
+
path,
|
|
308
|
+
input,
|
|
309
|
+
ctx,
|
|
310
|
+
req: opts.req,
|
|
311
|
+
type
|
|
300
312
|
});
|
|
301
313
|
return shape;
|
|
302
314
|
}
|
|
@@ -8,9 +8,9 @@ import type { UnsetMarker } from './utils';
|
|
|
8
8
|
type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : TWith extends UnsetMarker ? TType : Simplify<TType & TWith>;
|
|
9
9
|
type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
|
|
10
10
|
type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<infer $Output> ? inferTrackedOutput<$Output> : inferObservableValue<TOutput>;
|
|
11
|
-
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> = $Output extends AsyncIterable<any> ? SubscriptionProcedure<{
|
|
11
|
+
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> = DefaultValue<TOutputOut, $Output> extends AsyncIterable<any> ? SubscriptionProcedure<{
|
|
12
12
|
input: DefaultValue<TInputIn, void>;
|
|
13
|
-
output: DefaultValue<TOutputOut,
|
|
13
|
+
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
14
14
|
}> : LegacyObservableSubscriptionProcedure<{
|
|
15
15
|
input: DefaultValue<TInputIn, void>;
|
|
16
16
|
output: DefaultValue<TOutputOut, inferSubscriptionOutput<$Output>>;
|
|
@@ -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,KAAK,EACV,qBAAqB,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M,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,KAAK,CACN,CAkEA;AA6CD;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,QAAQ;IAC5C,GAAG,EAAE,QAAQ,CAAC;IACd,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.551+33a3515c1",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"funding": [
|
|
150
150
|
"https://trpc.io/sponsor"
|
|
151
151
|
],
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "33a3515c12fbf14105362278d42d32f92ef22740"
|
|
153
153
|
}
|
|
@@ -384,18 +384,33 @@ export async function resolveResponse<TRouter extends AnyRouter>(
|
|
|
384
384
|
const dataAsIterable = isObservable(data)
|
|
385
385
|
? observableToAsyncIterable(data)
|
|
386
386
|
: data;
|
|
387
|
+
|
|
387
388
|
const stream = sseStreamProducer({
|
|
388
389
|
...config.experimental?.sseSubscriptions,
|
|
389
390
|
data: dataAsIterable,
|
|
390
391
|
serialize: (v) => config.transformer.output.serialize(v),
|
|
391
392
|
formatError(errorOpts) {
|
|
393
|
+
const error = getTRPCErrorFromUnknown(errorOpts.error);
|
|
394
|
+
const input = call?.result();
|
|
395
|
+
const path = call?.path;
|
|
396
|
+
const type = call?.procedure?._def.type ?? 'unknown';
|
|
397
|
+
|
|
392
398
|
const shape = getErrorShape({
|
|
393
399
|
config,
|
|
394
400
|
ctx,
|
|
395
|
-
error
|
|
396
|
-
input
|
|
397
|
-
path
|
|
398
|
-
type
|
|
401
|
+
error,
|
|
402
|
+
input,
|
|
403
|
+
path,
|
|
404
|
+
type,
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
opts.onError?.({
|
|
408
|
+
error,
|
|
409
|
+
path,
|
|
410
|
+
input,
|
|
411
|
+
ctx,
|
|
412
|
+
req: opts.req,
|
|
413
|
+
type,
|
|
399
414
|
});
|
|
400
415
|
|
|
401
416
|
return shape;
|
|
@@ -50,16 +50,18 @@ type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<
|
|
|
50
50
|
? inferTrackedOutput<$Output>
|
|
51
51
|
: inferObservableValue<TOutput>;
|
|
52
52
|
|
|
53
|
-
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> = DefaultValue<
|
|
54
|
+
TOutputOut,
|
|
55
|
+
$Output
|
|
56
|
+
> extends AsyncIterable<any>
|
|
57
|
+
? SubscriptionProcedure<{
|
|
58
|
+
input: DefaultValue<TInputIn, void>;
|
|
59
|
+
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
60
|
+
}>
|
|
61
|
+
: LegacyObservableSubscriptionProcedure<{
|
|
62
|
+
input: DefaultValue<TInputIn, void>;
|
|
63
|
+
output: DefaultValue<TOutputOut, inferSubscriptionOutput<$Output>>;
|
|
64
|
+
}>;
|
|
63
65
|
|
|
64
66
|
export type CallerOverride<TContext> = (opts: {
|
|
65
67
|
args: unknown[];
|