@trpc/server 11.0.0-alpha-tmp-export-from-main-nuke-core.215 → 11.0.0-alpha-tmp-export-from-main.211
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/@trpc-core-unstable-do-not-import-this-please.d.ts +9 -0
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +1 -0
- package/dist/@trpc-server/http.d.ts +1 -1
- package/dist/@trpc-server/http.d.ts.map +1 -1
- package/dist/@trpc-server.d.ts +3 -3
- package/dist/@trpc-server.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.d.ts +1 -1
- package/dist/adapters/aws-lambda/index.js +7 -12
- package/dist/adapters/aws-lambda/index.mjs +3 -8
- package/dist/adapters/aws-lambda/utils.d.ts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/express.js +2 -8
- package/dist/adapters/express.mjs +2 -8
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -1
- package/dist/adapters/fastify/index.js +4 -12
- package/dist/adapters/fastify/index.mjs +2 -10
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -1
- package/dist/adapters/fetch/index.js +4 -10
- package/dist/adapters/fetch/index.mjs +2 -8
- package/dist/adapters/fetch/types.d.ts +1 -1
- package/dist/adapters/next.d.ts +1 -1
- package/dist/adapters/next.js +5 -11
- package/dist/adapters/next.mjs +3 -9
- package/dist/adapters/node-http/content-type/json/index.js +3 -5
- package/dist/adapters/node-http/content-type/json/index.mjs +1 -3
- package/dist/adapters/node-http/index.js +2 -8
- package/dist/adapters/node-http/index.mjs +2 -8
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -1
- package/dist/adapters/node-http/types.d.ts +2 -2
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +1 -1
- package/dist/adapters/standalone.js +2 -8
- package/dist/adapters/standalone.mjs +2 -8
- package/dist/adapters/ws.d.ts +1 -2
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +26 -31
- package/dist/adapters/ws.mjs +1 -6
- package/dist/http.d.ts +6 -6
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +21 -12
- package/dist/http.mjs +1 -7
- package/dist/index.js +41 -15
- package/dist/index.mjs +1 -5
- package/dist/{nodeHTTPRequestHandler-257a3b5f.mjs → nodeHTTPRequestHandler-2d5c8791.mjs} +2 -4
- package/dist/{nodeHTTPRequestHandler-f4b7e374.js → nodeHTTPRequestHandler-55f05150.js} +4 -6
- package/dist/{nodeHTTPRequestHandler-29178135.js → nodeHTTPRequestHandler-7691fc79.js} +1 -3
- package/dist/observable.d.ts +2 -2
- package/dist/observable.d.ts.map +1 -1
- package/dist/observable.js +25 -9
- package/dist/observable.mjs +1 -3
- package/dist/rpc.d.ts +2 -2
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +13 -5
- package/dist/rpc.mjs +1 -2
- package/dist/shared.js +9 -4
- package/dist/shared.mjs +1 -2
- package/package.json +125 -53
- package/src/@trpc-core-unstable-do-not-import-this-please.ts +9 -0
- package/src/@trpc-server/http.ts +1 -2
- package/src/@trpc-server.ts +3 -3
- package/src/adapters/aws-lambda/index.ts +1 -1
- package/src/adapters/aws-lambda/utils.ts +1 -1
- package/src/adapters/express.ts +2 -1
- package/src/adapters/fastify/fastifyRequestHandler.ts +1 -1
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -1
- package/src/adapters/fetch/fetchRequestHandler.ts +1 -1
- package/src/adapters/fetch/types.ts +1 -1
- package/src/adapters/next.ts +1 -1
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +1 -1
- package/src/adapters/node-http/types.ts +3 -2
- package/src/adapters/standalone.ts +1 -1
- package/src/adapters/ws.ts +10 -9
- package/src/http.ts +6 -6
- package/src/observable.ts +2 -2
- package/src/rpc.ts +2 -2
- package/dist/TRPCError-10da405a.js +0 -61
- package/dist/TRPCError-14edcf88.mjs +0 -63
- package/dist/TRPCError-e2c8eb77.js +0 -67
- package/dist/batchStreamFormatter-1971db27.js +0 -32
- package/dist/batchStreamFormatter-378277dc.mjs +0 -30
- package/dist/batchStreamFormatter-4375dc8b.js +0 -31
- package/dist/bundle-analysis.json +0 -767
- package/dist/contentType-2ed02bef.mjs +0 -52
- package/dist/contentType-3a829011.js +0 -54
- package/dist/contentType-e4a2373e.js +0 -59
- package/dist/createProxy-0306dcaa.mjs +0 -121
- package/dist/createProxy-7e413449.js +0 -127
- package/dist/createProxy-dce0c414.js +0 -116
- package/dist/initTRPC-2cef03ab.js +0 -384
- package/dist/initTRPC-38faa18f.js +0 -371
- package/dist/initTRPC-fa1b3d57.mjs +0 -376
- package/dist/observable-2a5a96d5.js +0 -125
- package/dist/observable-62674916.js +0 -125
- package/dist/observable-6d025a37.mjs +0 -121
- package/dist/operators-0cc4956a.js +0 -99
- package/dist/operators-b08617cb.js +0 -103
- package/dist/operators-d0c3e794.mjs +0 -99
- package/dist/parseTRPCMessage-6e6c204e.js +0 -65
- package/dist/parseTRPCMessage-8eb0bbe9.mjs +0 -62
- package/dist/parseTRPCMessage-ebdfe3ca.js +0 -67
- package/dist/resolveHTTPResponse-833ca2b8.js +0 -265
- package/dist/resolveHTTPResponse-9322334c.mjs +0 -291
- package/dist/resolveHTTPResponse-d64c48e1.js +0 -293
- package/dist/rootConfig-3371c473.js +0 -89
- package/dist/rootConfig-571c9267.js +0 -94
- package/dist/rootConfig-6b04a6b8.mjs +0 -81
- package/dist/router-3344b52a.js +0 -262
- package/dist/router-919c37eb.js +0 -259
- package/dist/router-d6789e4b.mjs +0 -252
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +0 -6
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -33
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +0 -24
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -29
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -5
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/index.d.ts +0 -7
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +0 -51
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/types.d.ts +0 -96
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/index.d.ts +0 -35
- package/dist/unstable-core-do-not-import/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/index.js +0 -51
- package/dist/unstable-core-do-not-import/index.mjs +0 -11
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -96
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/middleware.d.ts +0 -105
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/observable/index.d.ts +0 -5
- package/dist/unstable-core-do-not-import/observable/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/observable/observable.d.ts +0 -13
- package/dist/unstable-core-do-not-import/observable/observable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/observable/operators.d.ts +0 -8
- package/dist/unstable-core-do-not-import/observable/operators.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/observable/types.d.ts +0 -26
- package/dist/unstable-core-do-not-import/observable/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/parser.d.ts +0 -30
- package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedure.d.ts +0 -72
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -101
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -75
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/router.d.ts +0 -85
- package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -51
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -97
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/serialize.d.ts +0 -62
- package/dist/unstable-core-do-not-import/serialize.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/transformer.d.ts +0 -107
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/types.d.ts +0 -98
- package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.d.ts +0 -31
- package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
- package/src/unstable-core-do-not-import/TRPCInferrable.ts +0 -9
- package/src/unstable-core-do-not-import/createProxy.ts +0 -59
- package/src/unstable-core-do-not-import/error/TRPCError.ts +0 -82
- package/src/unstable-core-do-not-import/error/formatter.ts +0 -51
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +0 -36
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
- package/src/unstable-core-do-not-import/http/contentType.ts +0 -99
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +0 -57
- package/src/unstable-core-do-not-import/http/index.ts +0 -23
- package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +0 -458
- package/src/unstable-core-do-not-import/http/types.ts +0 -111
- package/src/unstable-core-do-not-import/index.ts +0 -108
- package/src/unstable-core-do-not-import/initTRPC.ts +0 -206
- package/src/unstable-core-do-not-import/middleware.ts +0 -233
- package/src/unstable-core-do-not-import/observable/index.ts +0 -10
- package/src/unstable-core-do-not-import/observable/observable.ts +0 -155
- package/src/unstable-core-do-not-import/observable/operators.ts +0 -119
- package/src/unstable-core-do-not-import/observable/types.ts +0 -76
- package/src/unstable-core-do-not-import/parser.ts +0 -94
- package/src/unstable-core-do-not-import/procedure.ts +0 -108
- package/src/unstable-core-do-not-import/procedureBuilder.ts +0 -458
- package/src/unstable-core-do-not-import/rootConfig.ts +0 -90
- package/src/unstable-core-do-not-import/router.ts +0 -370
- package/src/unstable-core-do-not-import/rpc/codes.ts +0 -44
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +0 -136
- package/src/unstable-core-do-not-import/rpc/index.ts +0 -21
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +0 -85
- package/src/unstable-core-do-not-import/serialize.ts +0 -122
- package/src/unstable-core-do-not-import/transformer.ts +0 -202
- package/src/unstable-core-do-not-import/types.ts +0 -151
- package/src/unstable-core-do-not-import/utils.ts +0 -66
- package/unstable-core-do-not-import/index.d.ts +0 -1
- package/unstable-core-do-not-import/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-export-from-main
|
|
3
|
+
"version": "11.0.0-alpha-tmp-export-from-main.211+de13a9c6f",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,84 +24,154 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|
|
26
26
|
".": {
|
|
27
|
-
"import":
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
}
|
|
30
35
|
},
|
|
31
36
|
"./adapters/aws-lambda": {
|
|
32
|
-
"import":
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/adapters/aws-lambda/index.d.ts",
|
|
39
|
+
"default": "./dist/adapters/aws-lambda/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/adapters/aws-lambda/index.d.ts",
|
|
43
|
+
"default": "./dist/adapters/aws-lambda/index.js"
|
|
44
|
+
}
|
|
35
45
|
},
|
|
36
46
|
"./adapters/express": {
|
|
37
|
-
"import":
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/adapters/express.d.ts",
|
|
49
|
+
"default": "./dist/adapters/express.mjs"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/adapters/express.d.ts",
|
|
53
|
+
"default": "./dist/adapters/express.js"
|
|
54
|
+
}
|
|
40
55
|
},
|
|
41
56
|
"./adapters/fastify": {
|
|
42
|
-
"import":
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./dist/adapters/fastify/index.d.ts",
|
|
59
|
+
"default": "./dist/adapters/fastify/index.mjs"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/adapters/fastify/index.d.ts",
|
|
63
|
+
"default": "./dist/adapters/fastify/index.js"
|
|
64
|
+
}
|
|
45
65
|
},
|
|
46
66
|
"./adapters/fetch": {
|
|
47
|
-
"import":
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
"import": {
|
|
68
|
+
"types": "./dist/adapters/fetch/index.d.ts",
|
|
69
|
+
"default": "./dist/adapters/fetch/index.mjs"
|
|
70
|
+
},
|
|
71
|
+
"require": {
|
|
72
|
+
"types": "./dist/adapters/fetch/index.d.ts",
|
|
73
|
+
"default": "./dist/adapters/fetch/index.js"
|
|
74
|
+
}
|
|
50
75
|
},
|
|
51
76
|
"./adapters/next": {
|
|
52
|
-
"import":
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./dist/adapters/next.d.ts",
|
|
79
|
+
"default": "./dist/adapters/next.mjs"
|
|
80
|
+
},
|
|
81
|
+
"require": {
|
|
82
|
+
"types": "./dist/adapters/next.d.ts",
|
|
83
|
+
"default": "./dist/adapters/next.js"
|
|
84
|
+
}
|
|
55
85
|
},
|
|
56
86
|
"./adapters/node-http/content-type/form-data": {
|
|
57
|
-
"import":
|
|
58
|
-
|
|
59
|
-
|
|
87
|
+
"import": {
|
|
88
|
+
"types": "./dist/adapters/node-http/content-type/form-data/index.d.ts",
|
|
89
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.mjs"
|
|
90
|
+
},
|
|
91
|
+
"require": {
|
|
92
|
+
"types": "./dist/adapters/node-http/content-type/form-data/index.d.ts",
|
|
93
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.js"
|
|
94
|
+
}
|
|
60
95
|
},
|
|
61
96
|
"./adapters/node-http/content-type/json": {
|
|
62
|
-
"import":
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
"import": {
|
|
98
|
+
"types": "./dist/adapters/node-http/content-type/json/index.d.ts",
|
|
99
|
+
"default": "./dist/adapters/node-http/content-type/json/index.mjs"
|
|
100
|
+
},
|
|
101
|
+
"require": {
|
|
102
|
+
"types": "./dist/adapters/node-http/content-type/json/index.d.ts",
|
|
103
|
+
"default": "./dist/adapters/node-http/content-type/json/index.js"
|
|
104
|
+
}
|
|
65
105
|
},
|
|
66
106
|
"./adapters/node-http": {
|
|
67
|
-
"import":
|
|
68
|
-
|
|
69
|
-
|
|
107
|
+
"import": {
|
|
108
|
+
"types": "./dist/adapters/node-http/index.d.ts",
|
|
109
|
+
"default": "./dist/adapters/node-http/index.mjs"
|
|
110
|
+
},
|
|
111
|
+
"require": {
|
|
112
|
+
"types": "./dist/adapters/node-http/index.d.ts",
|
|
113
|
+
"default": "./dist/adapters/node-http/index.js"
|
|
114
|
+
}
|
|
70
115
|
},
|
|
71
116
|
"./adapters/standalone": {
|
|
72
|
-
"import":
|
|
73
|
-
|
|
74
|
-
|
|
117
|
+
"import": {
|
|
118
|
+
"types": "./dist/adapters/standalone.d.ts",
|
|
119
|
+
"default": "./dist/adapters/standalone.mjs"
|
|
120
|
+
},
|
|
121
|
+
"require": {
|
|
122
|
+
"types": "./dist/adapters/standalone.d.ts",
|
|
123
|
+
"default": "./dist/adapters/standalone.js"
|
|
124
|
+
}
|
|
75
125
|
},
|
|
76
126
|
"./adapters/ws": {
|
|
77
|
-
"import":
|
|
78
|
-
|
|
79
|
-
|
|
127
|
+
"import": {
|
|
128
|
+
"types": "./dist/adapters/ws.d.ts",
|
|
129
|
+
"default": "./dist/adapters/ws.mjs"
|
|
130
|
+
},
|
|
131
|
+
"require": {
|
|
132
|
+
"types": "./dist/adapters/ws.d.ts",
|
|
133
|
+
"default": "./dist/adapters/ws.js"
|
|
134
|
+
}
|
|
80
135
|
},
|
|
81
136
|
"./http": {
|
|
82
|
-
"import":
|
|
83
|
-
|
|
84
|
-
|
|
137
|
+
"import": {
|
|
138
|
+
"types": "./dist/http.d.ts",
|
|
139
|
+
"default": "./dist/http.mjs"
|
|
140
|
+
},
|
|
141
|
+
"require": {
|
|
142
|
+
"types": "./dist/http.d.ts",
|
|
143
|
+
"default": "./dist/http.js"
|
|
144
|
+
}
|
|
85
145
|
},
|
|
86
146
|
"./observable": {
|
|
87
|
-
"import":
|
|
88
|
-
|
|
89
|
-
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./dist/observable.d.ts",
|
|
149
|
+
"default": "./dist/observable.mjs"
|
|
150
|
+
},
|
|
151
|
+
"require": {
|
|
152
|
+
"types": "./dist/observable.d.ts",
|
|
153
|
+
"default": "./dist/observable.js"
|
|
154
|
+
}
|
|
90
155
|
},
|
|
91
156
|
"./rpc": {
|
|
92
|
-
"import":
|
|
93
|
-
|
|
94
|
-
|
|
157
|
+
"import": {
|
|
158
|
+
"types": "./dist/rpc.d.ts",
|
|
159
|
+
"default": "./dist/rpc.mjs"
|
|
160
|
+
},
|
|
161
|
+
"require": {
|
|
162
|
+
"types": "./dist/rpc.d.ts",
|
|
163
|
+
"default": "./dist/rpc.js"
|
|
164
|
+
}
|
|
95
165
|
},
|
|
96
166
|
"./shared": {
|
|
97
|
-
"import":
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
167
|
+
"import": {
|
|
168
|
+
"types": "./dist/shared.d.ts",
|
|
169
|
+
"default": "./dist/shared.mjs"
|
|
170
|
+
},
|
|
171
|
+
"require": {
|
|
172
|
+
"types": "./dist/shared.d.ts",
|
|
173
|
+
"default": "./dist/shared.js"
|
|
174
|
+
}
|
|
105
175
|
}
|
|
106
176
|
},
|
|
107
177
|
"files": [
|
|
@@ -114,12 +184,14 @@
|
|
|
114
184
|
"observable",
|
|
115
185
|
"rpc",
|
|
116
186
|
"shared",
|
|
117
|
-
"unstable-core-do-not-import",
|
|
118
187
|
"!**/*.test.*"
|
|
119
188
|
],
|
|
120
189
|
"publishConfig": {
|
|
121
190
|
"access": "public"
|
|
122
191
|
},
|
|
192
|
+
"dependencies": {
|
|
193
|
+
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.211+de13a9c6f"
|
|
194
|
+
},
|
|
123
195
|
"devDependencies": {
|
|
124
196
|
"@fastify/websocket": "^7.1.2",
|
|
125
197
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -157,5 +229,5 @@
|
|
|
157
229
|
"funding": [
|
|
158
230
|
"https://trpc.io/sponsor"
|
|
159
231
|
],
|
|
160
|
-
"gitHead": "
|
|
232
|
+
"gitHead": "de13a9c6f5e727386dce61ecf8e698c4901b01a7"
|
|
161
233
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is here to make TypeScript happy and prevent _"The inferred type of 'createContext' cannot be named without a reference to [...]"_.
|
|
3
|
+
*
|
|
4
|
+
* We're basically just re-exporting everything from @trpc/core here.
|
|
5
|
+
*
|
|
6
|
+
* If you need to import anything from here, please open an issue at https://github.com/trpc/trpc/issues
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from '@trpc/core';
|
package/src/@trpc-server/http.ts
CHANGED
package/src/@trpc-server.ts
CHANGED
|
@@ -29,7 +29,7 @@ export {
|
|
|
29
29
|
type ProcedureRouterRecord as TRPCProcedureRouterRecord,
|
|
30
30
|
type ProcedureArgs as TRPCProcedureArgs,
|
|
31
31
|
type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
|
|
32
|
-
} from '
|
|
32
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
33
33
|
|
|
34
34
|
export type {
|
|
35
35
|
/**
|
|
@@ -83,7 +83,7 @@ export type {
|
|
|
83
83
|
* @deprecated use `AnyTRPCSubscriptionProcedure` instead
|
|
84
84
|
*/
|
|
85
85
|
AnySubscriptionProcedure,
|
|
86
|
-
} from '
|
|
86
|
+
} from '@trpc/core';
|
|
87
87
|
|
|
88
88
|
export {
|
|
89
89
|
/**
|
|
@@ -95,7 +95,7 @@ export {
|
|
|
95
95
|
* @deprecated use `callTRPCProcedure` instead
|
|
96
96
|
*/
|
|
97
97
|
callProcedure,
|
|
98
|
-
} from '
|
|
98
|
+
} from '@trpc/core';
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* @deprecated
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
package/src/adapters/express.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
import type * as express from 'express';
|
|
12
|
+
// @trpc/server
|
|
12
13
|
import type { AnyRouter } from '../@trpc-server';
|
|
13
14
|
import type {
|
|
14
15
|
NodeHTTPCreateContextFnOptions,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
package/src/adapters/next.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
12
|
+
// eslint-disable-next-line no-restricted-imports
|
|
13
|
+
import type { MaybePromise } from '@trpc/core';
|
|
12
14
|
// @trpc/server
|
|
13
15
|
import type { AnyRouter, inferRouterContext } from '../../@trpc-server';
|
|
14
16
|
// @trpc/server/http
|
|
@@ -16,7 +18,6 @@ import type {
|
|
|
16
18
|
HTTPBaseHandlerOptions,
|
|
17
19
|
TRPCRequestInfo,
|
|
18
20
|
} from '../../@trpc-server/http';
|
|
19
|
-
import type { MaybePromise } from '../../unstable-core-do-not-import';
|
|
20
21
|
import type { NodeHTTPContentTypeHandler } from './internals/contentType';
|
|
21
22
|
|
|
22
23
|
interface ParsedQs {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
3
|
*
|
|
4
|
-
* Do **not** import from `@trpc/
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
package/src/adapters/ws.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'http';
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports
|
|
3
|
+
import type {
|
|
4
|
+
BaseHandlerOptions,
|
|
5
|
+
JSONRPC2,
|
|
6
|
+
MaybePromise,
|
|
7
|
+
TRPCClientOutgoingMessage,
|
|
8
|
+
TRPCReconnectNotification,
|
|
9
|
+
TRPCResponseMessage,
|
|
10
|
+
Unsubscribable,
|
|
11
|
+
} from '@trpc/core';
|
|
2
12
|
import type ws from 'ws';
|
|
3
13
|
import type { AnyRouter, inferRouterContext } from '../@trpc-server';
|
|
4
14
|
import {
|
|
@@ -8,17 +18,8 @@ import {
|
|
|
8
18
|
transformTRPCResponse,
|
|
9
19
|
TRPCError,
|
|
10
20
|
} from '../@trpc-server';
|
|
11
|
-
import type { BaseHandlerOptions } from '../http';
|
|
12
21
|
import { isObservable } from '../observable';
|
|
13
|
-
import type { Unsubscribable } from '../observable';
|
|
14
22
|
import { parseTRPCMessage } from '../rpc';
|
|
15
|
-
import type {
|
|
16
|
-
JSONRPC2,
|
|
17
|
-
TRPCClientOutgoingMessage,
|
|
18
|
-
TRPCReconnectNotification,
|
|
19
|
-
TRPCResponseMessage,
|
|
20
|
-
} from '../rpc';
|
|
21
|
-
import type { MaybePromise } from '../unstable-core-do-not-import';
|
|
22
23
|
import type { NodeHTTPCreateContextFnOptions } from './node-http';
|
|
23
24
|
|
|
24
25
|
/**
|
package/src/http.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export {
|
|
2
2
|
getHTTPStatusCode,
|
|
3
3
|
getHTTPStatusCodeFromError,
|
|
4
|
-
} from '
|
|
5
|
-
export { resolveHTTPResponse } from '
|
|
4
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
5
|
+
export { resolveHTTPResponse } from './@trpc-core-unstable-do-not-import-this-please';
|
|
6
6
|
export type {
|
|
7
7
|
BaseHandlerOptions,
|
|
8
8
|
HTTPBaseHandlerOptions,
|
|
@@ -16,11 +16,11 @@ export type {
|
|
|
16
16
|
ResponseMeta,
|
|
17
17
|
ResponseMetaFn,
|
|
18
18
|
TRPCRequestInfo,
|
|
19
|
-
} from '
|
|
19
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
20
20
|
|
|
21
|
-
export { getBatchStreamFormatter } from '
|
|
21
|
+
export { getBatchStreamFormatter } from './@trpc-core-unstable-do-not-import-this-please';
|
|
22
22
|
export type {
|
|
23
23
|
BaseContentTypeHandler,
|
|
24
24
|
BodyResult,
|
|
25
|
-
} from '
|
|
26
|
-
export { getJsonContentTypeInputs } from '
|
|
25
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
26
|
+
export { getJsonContentTypeInputs } from './@trpc-core-unstable-do-not-import-this-please';
|
package/src/observable.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type {
|
|
|
5
5
|
Unsubscribable,
|
|
6
6
|
UnsubscribeFn,
|
|
7
7
|
inferObservableValue,
|
|
8
|
-
} from '
|
|
8
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
9
9
|
export {
|
|
10
10
|
isObservable,
|
|
11
11
|
map,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
observableToPromise,
|
|
14
14
|
share,
|
|
15
15
|
tap,
|
|
16
|
-
} from '
|
|
16
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
package/src/rpc.ts
CHANGED
|
@@ -18,9 +18,9 @@ export type {
|
|
|
18
18
|
TRPCSuccessResponse,
|
|
19
19
|
TRPC_ERROR_CODE_KEY,
|
|
20
20
|
TRPC_ERROR_CODE_NUMBER,
|
|
21
|
-
} from '
|
|
21
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
22
22
|
export {
|
|
23
23
|
TRPC_ERROR_CODES_BY_KEY,
|
|
24
24
|
TRPC_ERROR_CODES_BY_NUMBER,
|
|
25
25
|
parseTRPCMessage,
|
|
26
|
-
} from '
|
|
26
|
+
} from './@trpc-core-unstable-do-not-import-this-please';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { i as isObject } from './rootConfig-571c9267.js';
|
|
2
|
-
|
|
3
|
-
class UnknownCauseError extends Error {
|
|
4
|
-
}
|
|
5
|
-
function getCauseFromUnknown(cause) {
|
|
6
|
-
if (cause instanceof Error) {
|
|
7
|
-
return cause;
|
|
8
|
-
}
|
|
9
|
-
const type = typeof cause;
|
|
10
|
-
if (type === 'undefined' || type === 'function' || cause === null) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
// Primitive types just get wrapped in an error
|
|
14
|
-
if (type !== 'object') {
|
|
15
|
-
return new Error(String(cause));
|
|
16
|
-
}
|
|
17
|
-
// If it's an object, we'll create a synthetic error
|
|
18
|
-
if (isObject(cause)) {
|
|
19
|
-
const err = new UnknownCauseError();
|
|
20
|
-
for (const key in cause) {
|
|
21
|
-
err[key] = cause[key];
|
|
22
|
-
}
|
|
23
|
-
return err;
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
-
if (cause instanceof TRPCError) {
|
|
29
|
-
return cause;
|
|
30
|
-
}
|
|
31
|
-
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
32
|
-
// https://github.com/trpc/trpc/pull/4848
|
|
33
|
-
return cause;
|
|
34
|
-
}
|
|
35
|
-
const trpcError = new TRPCError({
|
|
36
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
37
|
-
cause,
|
|
38
|
-
});
|
|
39
|
-
// Inherit stack from error
|
|
40
|
-
if (cause instanceof Error && cause.stack) {
|
|
41
|
-
trpcError.stack = cause.stack;
|
|
42
|
-
}
|
|
43
|
-
return trpcError;
|
|
44
|
-
}
|
|
45
|
-
class TRPCError extends Error {
|
|
46
|
-
constructor(opts) {
|
|
47
|
-
const cause = getCauseFromUnknown(opts.cause);
|
|
48
|
-
const message = opts.message ?? cause?.message ?? opts.code;
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
|
-
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
51
|
-
super(message, { cause });
|
|
52
|
-
this.code = opts.code;
|
|
53
|
-
this.name = 'TRPCError';
|
|
54
|
-
if (!this.cause) {
|
|
55
|
-
// < ES2022 / < Node 16.9.0 compatability
|
|
56
|
-
this.cause = cause;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { TRPCError as T, getCauseFromUnknown as a, getTRPCErrorFromUnknown as g };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { i as isObject } from './rootConfig-6b04a6b8.mjs';
|
|
2
|
-
|
|
3
|
-
class UnknownCauseError extends Error {
|
|
4
|
-
}
|
|
5
|
-
function getCauseFromUnknown(cause) {
|
|
6
|
-
if (cause instanceof Error) {
|
|
7
|
-
return cause;
|
|
8
|
-
}
|
|
9
|
-
const type = typeof cause;
|
|
10
|
-
if (type === 'undefined' || type === 'function' || cause === null) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
// Primitive types just get wrapped in an error
|
|
14
|
-
if (type !== 'object') {
|
|
15
|
-
return new Error(String(cause));
|
|
16
|
-
}
|
|
17
|
-
// If it's an object, we'll create a synthetic error
|
|
18
|
-
if (isObject(cause)) {
|
|
19
|
-
const err = new UnknownCauseError();
|
|
20
|
-
for(const key in cause){
|
|
21
|
-
err[key] = cause[key];
|
|
22
|
-
}
|
|
23
|
-
return err;
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
-
if (cause instanceof TRPCError) {
|
|
29
|
-
return cause;
|
|
30
|
-
}
|
|
31
|
-
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
32
|
-
// https://github.com/trpc/trpc/pull/4848
|
|
33
|
-
return cause;
|
|
34
|
-
}
|
|
35
|
-
const trpcError = new TRPCError({
|
|
36
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
37
|
-
cause
|
|
38
|
-
});
|
|
39
|
-
// Inherit stack from error
|
|
40
|
-
if (cause instanceof Error && cause.stack) {
|
|
41
|
-
trpcError.stack = cause.stack;
|
|
42
|
-
}
|
|
43
|
-
return trpcError;
|
|
44
|
-
}
|
|
45
|
-
class TRPCError extends Error {
|
|
46
|
-
constructor(opts){
|
|
47
|
-
const cause = getCauseFromUnknown(opts.cause);
|
|
48
|
-
const message = opts.message ?? cause?.message ?? opts.code;
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
|
-
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
51
|
-
super(message, {
|
|
52
|
-
cause
|
|
53
|
-
});
|
|
54
|
-
this.code = opts.code;
|
|
55
|
-
this.name = 'TRPCError';
|
|
56
|
-
if (!this.cause) {
|
|
57
|
-
// < ES2022 / < Node 16.9.0 compatability
|
|
58
|
-
this.cause = cause;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { TRPCError as T, getCauseFromUnknown as a, getTRPCErrorFromUnknown as g };
|