@trpc/server 11.0.0-rc.401 → 11.0.0-rc.403
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/adapters/node-http/types.d.ts +2 -5
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/bundle-analysis.json +35 -35
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.js +3 -0
- package/dist/unstable-core-do-not-import/router.mjs +3 -0
- package/package.json +3 -3
- package/src/adapters/node-http/types.ts +2 -6
- package/src/unstable-core-do-not-import/router.ts +4 -0
|
@@ -12,12 +12,9 @@ import type * as http from 'http';
|
|
|
12
12
|
import type { AnyRouter, CreateContextCallback, inferRouterContext } from '../../@trpc/server';
|
|
13
13
|
import type { HTTPBaseHandlerOptions, TRPCRequestInfo } from '../../@trpc/server/http';
|
|
14
14
|
import type { MaybePromise } from '../../unstable-core-do-not-import';
|
|
15
|
-
interface ParsedQs {
|
|
16
|
-
[key: string]: ParsedQs | ParsedQs[] | string[] | string | undefined;
|
|
17
|
-
}
|
|
18
15
|
export type NodeHTTPRequest = http.IncomingMessage & {
|
|
19
|
-
query?: ParsedQs;
|
|
20
16
|
body?: unknown;
|
|
17
|
+
query?: unknown;
|
|
21
18
|
};
|
|
22
19
|
export type NodeHTTPResponse = http.ServerResponse & {
|
|
23
20
|
/**
|
|
@@ -52,7 +49,7 @@ export type NodeHTTPHandlerOptions<TRouter extends AnyRouter, TRequest extends N
|
|
|
52
49
|
* You can also use it for other needs which a connect/node.js compatible middleware can solve,
|
|
53
50
|
* though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
|
|
54
51
|
*/
|
|
55
|
-
middleware?: ConnectMiddleware
|
|
52
|
+
middleware?: ConnectMiddleware<TRequest, TResponse>;
|
|
56
53
|
maxBodySize?: number;
|
|
57
54
|
};
|
|
58
55
|
export type NodeHTTPRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,GAAG;IACnD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,GAAG;IACnD;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,2BAA2B,CACrC,OAAO,SAAS,SAAS,EACzB,QAAQ,EACR,SAAS,IACP,qBAAqB,CACvB,kBAAkB,CAAC,OAAO,CAAC,EAC3B,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,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C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 31.
|
|
2
|
+
"bundleSize": 105615,
|
|
3
|
+
"bundleOrigSize": 154297,
|
|
4
|
+
"bundleReduction": 31.55,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/stream/stream.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"/src/unstable-core-do-not-import.ts",
|
|
18
18
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
19
19
|
],
|
|
20
|
-
"percent": 14.
|
|
20
|
+
"percent": 14.13,
|
|
21
21
|
"reduction": 8.44
|
|
22
22
|
},
|
|
23
23
|
{
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependents": [
|
|
33
33
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
34
34
|
],
|
|
35
|
-
"percent": 10.
|
|
35
|
+
"percent": 10.64,
|
|
36
36
|
"reduction": 0
|
|
37
37
|
},
|
|
38
38
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependents": [
|
|
47
47
|
"/src/unstable-core-do-not-import.ts"
|
|
48
48
|
],
|
|
49
|
-
"percent": 10.
|
|
49
|
+
"percent": 10.27,
|
|
50
50
|
"reduction": 3.08
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
"/src/unstable-core-do-not-import.ts",
|
|
62
62
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
63
63
|
],
|
|
64
|
-
"percent":
|
|
64
|
+
"percent": 5.99,
|
|
65
65
|
"reduction": 59.52
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
69
|
-
"size":
|
|
70
|
-
"origSize":
|
|
69
|
+
"size": 6102,
|
|
70
|
+
"origSize": 10247,
|
|
71
71
|
"renderedExports": [
|
|
72
72
|
"createRouterFactory",
|
|
73
73
|
"callProcedure",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
81
81
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
82
82
|
],
|
|
83
|
-
"percent": 5.
|
|
84
|
-
"reduction":
|
|
83
|
+
"percent": 5.78,
|
|
84
|
+
"reduction": 40.45
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"id": "/src/unstable-core-do-not-import/http/contentType.ts",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"/src/unstable-core-do-not-import.ts",
|
|
96
96
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
97
97
|
],
|
|
98
|
-
"percent": 5.
|
|
98
|
+
"percent": 5.25,
|
|
99
99
|
"reduction": 0
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"dependents": [
|
|
110
110
|
"/src/adapters/aws-lambda/index.ts"
|
|
111
111
|
],
|
|
112
|
-
"percent": 4.
|
|
112
|
+
"percent": 4.59,
|
|
113
113
|
"reduction": 13.62
|
|
114
114
|
},
|
|
115
115
|
{
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"/src/observable/index.ts",
|
|
141
141
|
"/src/observable/operators.ts"
|
|
142
142
|
],
|
|
143
|
-
"percent": 2.
|
|
143
|
+
"percent": 2.96,
|
|
144
144
|
"reduction": 0.67
|
|
145
145
|
},
|
|
146
146
|
{
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
"/src/unstable-core-do-not-import.ts",
|
|
270
270
|
"/src/unstable-core-do-not-import/router.ts"
|
|
271
271
|
],
|
|
272
|
-
"percent": 1.
|
|
272
|
+
"percent": 1.89,
|
|
273
273
|
"reduction": 0
|
|
274
274
|
},
|
|
275
275
|
{
|
|
@@ -391,11 +391,11 @@
|
|
|
391
391
|
"dependents": [
|
|
392
392
|
"/src/unstable-core-do-not-import.ts",
|
|
393
393
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
394
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
394
395
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
395
396
|
"/src/unstable-core-do-not-import/router.ts",
|
|
396
397
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
397
398
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
398
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
399
399
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
400
400
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
401
401
|
"/src/unstable-core-do-not-import/stream/stream.ts"
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
448
448
|
"/src/adapters/next-app-dir/rethrowNextErrors.ts"
|
|
449
449
|
],
|
|
450
|
-
"percent": 0.
|
|
450
|
+
"percent": 0.93,
|
|
451
451
|
"reduction": 13.65
|
|
452
452
|
},
|
|
453
453
|
{
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
"dependents": [
|
|
462
462
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
463
463
|
],
|
|
464
|
-
"percent": 0.
|
|
464
|
+
"percent": 0.77,
|
|
465
465
|
"reduction": 0.97
|
|
466
466
|
},
|
|
467
467
|
{
|
|
@@ -530,7 +530,7 @@
|
|
|
530
530
|
"/src/unstable-core-do-not-import.ts",
|
|
531
531
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
532
532
|
],
|
|
533
|
-
"percent": 0.
|
|
533
|
+
"percent": 0.32,
|
|
534
534
|
"reduction": 87.96
|
|
535
535
|
},
|
|
536
536
|
{
|
|
@@ -643,9 +643,9 @@
|
|
|
643
643
|
"reduction": 100
|
|
644
644
|
},
|
|
645
645
|
{
|
|
646
|
-
"id": "/src/
|
|
646
|
+
"id": "/src/rpc.ts",
|
|
647
647
|
"size": 0,
|
|
648
|
-
"origSize":
|
|
648
|
+
"origSize": 36,
|
|
649
649
|
"renderedExports": [],
|
|
650
650
|
"removedExports": [],
|
|
651
651
|
"dependents": [],
|
|
@@ -653,9 +653,9 @@
|
|
|
653
653
|
"reduction": 100
|
|
654
654
|
},
|
|
655
655
|
{
|
|
656
|
-
"id": "/src/
|
|
656
|
+
"id": "/src/shared.ts",
|
|
657
657
|
"size": 0,
|
|
658
|
-
"origSize":
|
|
658
|
+
"origSize": 653,
|
|
659
659
|
"renderedExports": [],
|
|
660
660
|
"removedExports": [],
|
|
661
661
|
"dependents": [],
|
|
@@ -663,9 +663,9 @@
|
|
|
663
663
|
"reduction": 100
|
|
664
664
|
},
|
|
665
665
|
{
|
|
666
|
-
"id": "/src/
|
|
666
|
+
"id": "/src/index.ts",
|
|
667
667
|
"size": 0,
|
|
668
|
-
"origSize":
|
|
668
|
+
"origSize": 32,
|
|
669
669
|
"renderedExports": [],
|
|
670
670
|
"removedExports": [],
|
|
671
671
|
"dependents": [],
|
|
@@ -714,16 +714,6 @@
|
|
|
714
714
|
"percent": 0,
|
|
715
715
|
"reduction": 100
|
|
716
716
|
},
|
|
717
|
-
{
|
|
718
|
-
"id": "/src/adapters/fetch/index.ts",
|
|
719
|
-
"size": 0,
|
|
720
|
-
"origSize": 64,
|
|
721
|
-
"renderedExports": [],
|
|
722
|
-
"removedExports": [],
|
|
723
|
-
"dependents": [],
|
|
724
|
-
"percent": 0,
|
|
725
|
-
"reduction": 100
|
|
726
|
-
},
|
|
727
717
|
{
|
|
728
718
|
"id": "/src/adapters/node-http/index.ts",
|
|
729
719
|
"size": 0,
|
|
@@ -738,6 +728,16 @@
|
|
|
738
728
|
],
|
|
739
729
|
"percent": 0,
|
|
740
730
|
"reduction": 100
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"id": "/src/adapters/fetch/index.ts",
|
|
734
|
+
"size": 0,
|
|
735
|
+
"origSize": 64,
|
|
736
|
+
"renderedExports": [],
|
|
737
|
+
"removedExports": [],
|
|
738
|
+
"dependents": [],
|
|
739
|
+
"percent": 0,
|
|
740
|
+
"reduction": 100
|
|
741
741
|
}
|
|
742
742
|
],
|
|
743
743
|
"moduleCount": 51
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAA2B,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAGrD,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;CAC5C;AAED,KAAK,iBAAiB,CAAC,UAAU,SAAS,YAAY,IAAI,CACxD,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,KACnC,OAAO,CACV,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,cAAc,GAC7C,UAAU,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,GACvD,oBAAoB,CAAC,UAAU,CAAC,CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,YAAY,IAAI;KAC9D,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,YAAY,GACvD,iBAAiB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AED,gBAAgB;AAChB,KAAK,YAAY,CACf,QAAQ,SAAS,SAAS,EAAE,EAC5B,KAAK,SAAS,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAErE,OAAO,SAAS,YAAY,GAAG,EAAE,IAC/B,QAAQ,SAAS;IACnB,MAAM,IAAI,SAAS,SAAS;IAC5B,GAAG,MAAM,IAAI,SAAS,SAAS,EAAE;CAClC,GACG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAC3D,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAEhC,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,EACvD,GAAG,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,GAC3B,YAAY,CAAC,QAAQ,CAAC,CAoDxB"}
|
|
@@ -110,6 +110,9 @@ function createCallerFactory() {
|
|
|
110
110
|
return function createCaller(ctxOrCallback, options) {
|
|
111
111
|
const proxy = createProxy.createRecursiveProxy(async ({ path , args })=>{
|
|
112
112
|
const fullPath = path.join('.');
|
|
113
|
+
if (path.length === 1 && path[0] === '_def') {
|
|
114
|
+
return _def;
|
|
115
|
+
}
|
|
113
116
|
const procedure = _def.procedures[fullPath];
|
|
114
117
|
let ctx = undefined;
|
|
115
118
|
try {
|
|
@@ -108,6 +108,9 @@ function createCallerFactory() {
|
|
|
108
108
|
return function createCaller(ctxOrCallback, options) {
|
|
109
109
|
const proxy = createRecursiveProxy(async ({ path , args })=>{
|
|
110
110
|
const fullPath = path.join('.');
|
|
111
|
+
if (path.length === 1 && path[0] === '_def') {
|
|
112
|
+
return _def;
|
|
113
|
+
}
|
|
111
114
|
const procedure = _def.procedures[fullPath];
|
|
112
115
|
let ctx = undefined;
|
|
113
116
|
try {
|
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.403+ab71a1be6",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@fastify/websocket": "^10.0.1",
|
|
120
|
-
"@tanstack/react-query": "^5.
|
|
120
|
+
"@tanstack/react-query": "^5.45.0",
|
|
121
121
|
"@types/aws-lambda": "^8.10.137",
|
|
122
122
|
"@types/express": "^4.17.17",
|
|
123
123
|
"@types/hash-sum": "^1.0.0",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"funding": [
|
|
150
150
|
"https://trpc.io/sponsor"
|
|
151
151
|
],
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "ab71a1be689e84b7503c6adbcd98c3c424217920"
|
|
153
153
|
}
|
|
@@ -22,13 +22,9 @@ import type {
|
|
|
22
22
|
// eslint-disable-next-line no-restricted-imports
|
|
23
23
|
import type { MaybePromise } from '../../unstable-core-do-not-import';
|
|
24
24
|
|
|
25
|
-
interface ParsedQs {
|
|
26
|
-
[key: string]: ParsedQs | ParsedQs[] | string[] | string | undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
25
|
export type NodeHTTPRequest = http.IncomingMessage & {
|
|
30
|
-
query?: ParsedQs;
|
|
31
26
|
body?: unknown;
|
|
27
|
+
query?: unknown;
|
|
32
28
|
};
|
|
33
29
|
export type NodeHTTPResponse = http.ServerResponse & {
|
|
34
30
|
/**
|
|
@@ -81,7 +77,7 @@ export type NodeHTTPHandlerOptions<
|
|
|
81
77
|
* You can also use it for other needs which a connect/node.js compatible middleware can solve,
|
|
82
78
|
* though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
|
|
83
79
|
*/
|
|
84
|
-
middleware?: ConnectMiddleware
|
|
80
|
+
middleware?: ConnectMiddleware<TRequest, TResponse>;
|
|
85
81
|
maxBodySize?: number;
|
|
86
82
|
};
|
|
87
83
|
|
|
@@ -267,6 +267,10 @@ export function createCallerFactory<TRoot extends AnyRootTypes>() {
|
|
|
267
267
|
const proxy = createRecursiveProxy(async ({ path, args }) => {
|
|
268
268
|
const fullPath = path.join('.');
|
|
269
269
|
|
|
270
|
+
if (path.length === 1 && path[0] === '_def') {
|
|
271
|
+
return _def;
|
|
272
|
+
}
|
|
273
|
+
|
|
270
274
|
const procedure = _def.procedures[fullPath] as AnyProcedure;
|
|
271
275
|
|
|
272
276
|
let ctx: Context | undefined = undefined;
|