@trpc/server 11.0.0-rc.711 → 11.0.0-rc.716
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/express.js +1 -1
- package/dist/adapters/express.mjs +1 -1
- package/dist/bundle-analysis.json +42 -42
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +2 -2
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +6 -14
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.d.ts +2 -6
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.js +2 -1
- package/dist/unstable-core-do-not-import/router.mjs +2 -1
- package/package.json +2 -2
- package/src/adapters/express.ts +1 -1
- package/src/unstable-core-do-not-import/clientish/inference.ts +3 -3
- package/src/unstable-core-do-not-import/router.ts +11 -16
package/dist/adapters/express.js
CHANGED
|
@@ -19,7 +19,7 @@ function createExpressMiddleware(opts) {
|
|
|
19
19
|
return (req, res)=>{
|
|
20
20
|
let path = '';
|
|
21
21
|
utils.run(async ()=>{
|
|
22
|
-
path = req.path.slice(1);
|
|
22
|
+
path = req.path.slice(req.path.lastIndexOf('/') + 1);
|
|
23
23
|
await nodeHTTPRequestHandler.nodeHTTPRequestHandler({
|
|
24
24
|
...opts,
|
|
25
25
|
req,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 13.
|
|
2
|
+
"bundleSize": 193532,
|
|
3
|
+
"bundleOrigSize": 224005,
|
|
4
|
+
"bundleReduction": 13.6,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependents": [
|
|
31
31
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
32
32
|
],
|
|
33
|
-
"percent": 10.
|
|
33
|
+
"percent": 10.4,
|
|
34
34
|
"reduction": 0
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"/src/unstable-core-do-not-import.ts",
|
|
48
48
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
49
49
|
],
|
|
50
|
-
"percent": 10.
|
|
50
|
+
"percent": 10.34,
|
|
51
51
|
"reduction": 0
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"/src/unstable-core-do-not-import.ts",
|
|
65
65
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
66
66
|
],
|
|
67
|
-
"percent": 6.
|
|
67
|
+
"percent": 6.52,
|
|
68
68
|
"reduction": 0
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
114
|
-
"size":
|
|
115
|
-
"origSize":
|
|
114
|
+
"size": 6448,
|
|
115
|
+
"origSize": 10642,
|
|
116
116
|
"renderedExports": [
|
|
117
117
|
"createRouterFactory",
|
|
118
118
|
"callProcedure",
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
"/src/unstable-core-do-not-import.ts",
|
|
125
125
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
126
126
|
],
|
|
127
|
-
"percent": 3.
|
|
128
|
-
"reduction":
|
|
127
|
+
"percent": 3.33,
|
|
128
|
+
"reduction": 39.41
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"id": "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"dependents": [
|
|
208
208
|
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
209
209
|
],
|
|
210
|
-
"percent": 2.
|
|
210
|
+
"percent": 2.29,
|
|
211
211
|
"reduction": 0
|
|
212
212
|
},
|
|
213
213
|
{
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"/src/adapters/node-http/index.ts",
|
|
224
224
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts"
|
|
225
225
|
],
|
|
226
|
-
"percent": 2.
|
|
226
|
+
"percent": 2.02,
|
|
227
227
|
"reduction": 17.53
|
|
228
228
|
},
|
|
229
229
|
{
|
|
@@ -351,11 +351,11 @@
|
|
|
351
351
|
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
352
352
|
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
353
353
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
354
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
355
354
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
356
355
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
357
356
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
358
357
|
"/src/unstable-core-do-not-import/router.ts",
|
|
358
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
359
359
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
360
360
|
"/src/unstable-core-do-not-import/http/isAbortError.ts",
|
|
361
361
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
@@ -632,15 +632,15 @@
|
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
"id": "/src/adapters/express.ts",
|
|
635
|
-
"size":
|
|
636
|
-
"origSize":
|
|
635
|
+
"size": 887,
|
|
636
|
+
"origSize": 1344,
|
|
637
637
|
"renderedExports": [
|
|
638
638
|
"createExpressMiddleware"
|
|
639
639
|
],
|
|
640
640
|
"removedExports": [],
|
|
641
641
|
"dependents": [],
|
|
642
|
-
"percent": 0.
|
|
643
|
-
"reduction": 34
|
|
642
|
+
"percent": 0.46,
|
|
643
|
+
"reduction": 34
|
|
644
644
|
},
|
|
645
645
|
{
|
|
646
646
|
"id": "/src/unstable-core-do-not-import/stream/tracked.ts",
|
|
@@ -848,16 +848,6 @@
|
|
|
848
848
|
"percent": 0,
|
|
849
849
|
"reduction": 100
|
|
850
850
|
},
|
|
851
|
-
{
|
|
852
|
-
"id": "/src/rpc.ts",
|
|
853
|
-
"size": 0,
|
|
854
|
-
"origSize": 36,
|
|
855
|
-
"renderedExports": [],
|
|
856
|
-
"removedExports": [],
|
|
857
|
-
"dependents": [],
|
|
858
|
-
"percent": 0,
|
|
859
|
-
"reduction": 100
|
|
860
|
-
},
|
|
861
851
|
{
|
|
862
852
|
"id": "/src/index.ts",
|
|
863
853
|
"size": 0,
|
|
@@ -869,9 +859,9 @@
|
|
|
869
859
|
"reduction": 100
|
|
870
860
|
},
|
|
871
861
|
{
|
|
872
|
-
"id": "/src/
|
|
862
|
+
"id": "/src/rpc.ts",
|
|
873
863
|
"size": 0,
|
|
874
|
-
"origSize":
|
|
864
|
+
"origSize": 36,
|
|
875
865
|
"renderedExports": [],
|
|
876
866
|
"removedExports": [],
|
|
877
867
|
"dependents": [],
|
|
@@ -886,8 +876,8 @@
|
|
|
886
876
|
"removedExports": [],
|
|
887
877
|
"dependents": [
|
|
888
878
|
"/src/adapters/express.ts",
|
|
889
|
-
"/src/adapters/next.ts",
|
|
890
879
|
"/src/adapters/standalone.ts",
|
|
880
|
+
"/src/adapters/next.ts",
|
|
891
881
|
"/src/adapters/ws.ts",
|
|
892
882
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
893
883
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
@@ -896,6 +886,16 @@
|
|
|
896
886
|
"percent": 0,
|
|
897
887
|
"reduction": 100
|
|
898
888
|
},
|
|
889
|
+
{
|
|
890
|
+
"id": "/src/shared.ts",
|
|
891
|
+
"size": 0,
|
|
892
|
+
"origSize": 653,
|
|
893
|
+
"renderedExports": [],
|
|
894
|
+
"removedExports": [],
|
|
895
|
+
"dependents": [],
|
|
896
|
+
"percent": 0,
|
|
897
|
+
"reduction": 100
|
|
898
|
+
},
|
|
899
899
|
{
|
|
900
900
|
"id": "/src/adapters/next-app-dir.ts",
|
|
901
901
|
"size": 0,
|
|
@@ -919,18 +919,12 @@
|
|
|
919
919
|
"reduction": 100
|
|
920
920
|
},
|
|
921
921
|
{
|
|
922
|
-
"id": "/src/adapters/
|
|
922
|
+
"id": "/src/adapters/fastify/index.ts",
|
|
923
923
|
"size": 0,
|
|
924
|
-
"origSize":
|
|
924
|
+
"origSize": 78,
|
|
925
925
|
"renderedExports": [],
|
|
926
926
|
"removedExports": [],
|
|
927
|
-
"dependents": [
|
|
928
|
-
"/src/adapters/express.ts",
|
|
929
|
-
"/src/adapters/next.ts",
|
|
930
|
-
"/src/adapters/standalone.ts",
|
|
931
|
-
"/src/adapters/ws.ts",
|
|
932
|
-
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
933
|
-
],
|
|
927
|
+
"dependents": [],
|
|
934
928
|
"percent": 0,
|
|
935
929
|
"reduction": 100
|
|
936
930
|
},
|
|
@@ -945,12 +939,18 @@
|
|
|
945
939
|
"reduction": 100
|
|
946
940
|
},
|
|
947
941
|
{
|
|
948
|
-
"id": "/src/adapters/
|
|
942
|
+
"id": "/src/adapters/node-http/index.ts",
|
|
949
943
|
"size": 0,
|
|
950
|
-
"origSize":
|
|
944
|
+
"origSize": 111,
|
|
951
945
|
"renderedExports": [],
|
|
952
946
|
"removedExports": [],
|
|
953
|
-
"dependents": [
|
|
947
|
+
"dependents": [
|
|
948
|
+
"/src/adapters/express.ts",
|
|
949
|
+
"/src/adapters/standalone.ts",
|
|
950
|
+
"/src/adapters/next.ts",
|
|
951
|
+
"/src/adapters/ws.ts",
|
|
952
|
+
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
953
|
+
],
|
|
954
954
|
"percent": 0,
|
|
955
955
|
"reduction": 100
|
|
956
956
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { inferObservableValue } from '../../observable';
|
|
2
2
|
import type { AnyProcedure, inferProcedureInput, inferProcedureOutput } from '../procedure';
|
|
3
|
-
import type { AnyRouter,
|
|
3
|
+
import type { AnyRouter, RouterRecord } from '../router';
|
|
4
4
|
import type { AnyClientTypes, inferClientTypes, InferrableClientTypes } from './inferrable';
|
|
5
5
|
import type { Serialize } from './serialize';
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ export type inferTransformedProcedureOutput<TInferrable extends InferrableClient
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
export type inferTransformedSubscriptionOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<inferObservableValue<inferProcedureOutput<TProcedure>>> : inferObservableValue<inferProcedureOutput<TProcedure>>;
|
|
12
12
|
export type GetInferenceHelpers<TType extends 'input' | 'output', TRoot extends AnyClientTypes, TRecord extends RouterRecord> = {
|
|
13
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<$Value> : inferTransformedProcedureOutput<TRoot, $Value> : $Value extends RouterRecord
|
|
13
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<$Value> : inferTransformedProcedureOutput<TRoot, $Value> : $Value extends RouterRecord ? GetInferenceHelpers<TType, TRoot, $Value> : never : never;
|
|
14
14
|
};
|
|
15
15
|
export type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
16
16
|
export type inferRouterOutputs<TRouter extends AnyRouter> = GetInferenceHelpers<'output', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AAEH,MAAM,MAAM,+BAA+B,CACzC,WAAW,SAAS,qBAAqB,EACzC,UAAU,SAAS,YAAY,IAC7B,gBAAgB,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,GAC1D,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,GAC3C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AACrC,gBAAgB;AAEhB,MAAM,MAAM,kCAAkC,CAC5C,WAAW,SAAS,qBAAqB,EACzC,UAAU,SAAS,YAAY,IAC7B,gBAAgB,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,GAC1D,SAAS,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,GACjE,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,CAC7B,KAAK,SAAS,OAAO,GAAG,QAAQ,EAChC,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,YAAY,IAC1B;KACD,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GACvD,MAAM,SAAS,YAAY,GACzB,KAAK,SAAS,OAAO,GACnB,mBAAmB,CAAC,MAAM,CAAC,GAC3B,+BAA+B,CAAC,KAAK,EAAE,MAAM,CAAC,GAChD,MAAM,SAAS,YAAY,GACzB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,GACzC,KAAK,GACT,KAAK;CACV,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC5E,OAAO,EACP,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC7E,QAAQ,EACR,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC"}
|
|
@@ -57,20 +57,12 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
57
57
|
* Create a router
|
|
58
58
|
* @see https://trpc.io/docs/v11/server/routers
|
|
59
59
|
*/
|
|
60
|
-
router: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, TInput>;
|
|
67
|
-
<TInput extends import("./router").CreateRouterOptions>(input: TInput): import("./router").BuiltRouter<{
|
|
68
|
-
ctx: TContext;
|
|
69
|
-
meta: TMeta;
|
|
70
|
-
errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
|
|
71
|
-
transformer: undefined extends TOptions["transformer"] ? false : true;
|
|
72
|
-
}, import("./router").DecorateCreateRouterOptions<TInput>>;
|
|
73
|
-
};
|
|
60
|
+
router: <TInput extends import("./router").CreateRouterOptions>(input: TInput) => import("./router").BuiltRouter<{
|
|
61
|
+
ctx: TContext;
|
|
62
|
+
meta: TMeta;
|
|
63
|
+
errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
|
|
64
|
+
transformer: undefined extends TOptions["transformer"] ? false : true;
|
|
65
|
+
}, import("./router").DecorateCreateRouterOptions<TInput>>;
|
|
74
66
|
/**
|
|
75
67
|
* Merge Routers
|
|
76
68
|
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTRPC.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/initTRPC.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAGL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAErD,KAAK,wBAAwB,CAAC,KAAK,IACjC,KAAK,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAC/E,UAAU,oBAAoB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,CAC1E,SAAQ,OAAO,CACb,IAAI,CACF,UAAU,CAAC;IACT,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,KAAK,CAAC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AG,KAAK,GAAG,IAAI;;QAoCrE;;;WAGG;;QAIH;;;WAGG;;QAEH;;;WAGG;;iBAxDE,QAAQ;kBACP,KAAK;wBACC,SAAS,SAAS,QAAQ,CAAC,gBAAgB,CAAC,GACpD,iBAAiB,GACjB,wBAAwB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;yBAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;QAqDrE;;;WAGG;;QAEH;;;WAGG;;iBAlEE,QAAQ;kBACP,KAAK;wBACC,SAAS,SAAS,QAAQ,CAAC,gBAAgB,CAAC,GACpD,iBAAiB,GACjB,wBAAwB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;yBAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;iBALhE,QAAQ;kBACP,KAAK;wBACC,SAAS,SAAS,QAAQ,CAAC,gBAAgB,CAAC,GACpD,iBAAiB,GACjB,wBAAwB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;yBAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;;CAiE1E;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,6BAAoB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -12,7 +12,7 @@ type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedure
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export type DecorateRouterRecord<TRecord extends RouterRecord> = {
|
|
15
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends AnyProcedure ? DecorateProcedure
|
|
15
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? DecorateProcedure<$Value> : $Value extends RouterRecord ? DecorateRouterRecord<$Value> : never : never;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
@@ -60,10 +60,7 @@ export type DecorateCreateRouterOptions<TRouterOptions extends CreateRouterOptio
|
|
|
60
60
|
/**
|
|
61
61
|
* @internal
|
|
62
62
|
*/
|
|
63
|
-
export declare function createRouterFactory<TRoot extends AnyRootTypes>(config: RootConfig<TRoot>):
|
|
64
|
-
<TInput extends RouterRecord>(input: TInput): BuiltRouter<TRoot, TInput>;
|
|
65
|
-
<TInput extends CreateRouterOptions>(input: TInput): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
|
|
66
|
-
};
|
|
63
|
+
export declare function createRouterFactory<TRoot extends AnyRootTypes>(config: RootConfig<TRoot>): <TInput extends CreateRouterOptions>(input: TInput) => BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
|
|
67
64
|
/**
|
|
68
65
|
* @internal
|
|
69
66
|
*/
|
|
@@ -78,6 +75,5 @@ type MergeRouters<TRouters extends AnyRouter[], TRoot extends AnyRootTypes = TRo
|
|
|
78
75
|
...infer Tail extends AnyRouter[]
|
|
79
76
|
] ? MergeRouters<Tail, TRoot, Head['_def']['record'] & TRecord> : BuiltRouter<TRoot, TRecord>;
|
|
80
77
|
export declare function mergeRouters<TRouters extends AnyRouter[]>(...routerList: [...TRouters]): MergeRouters<TRouters>;
|
|
81
|
-
export type coerceToRouterRecord<T> = T extends AnyRouter ? T['_def']['record'] : T;
|
|
82
78
|
export {};
|
|
83
79
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -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,EACpB,qCAAqC,EACtC,MAAM,aAAa,CAAC;AACrB,OAA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,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"}
|
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.716+77c939a3d",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"peerDependencies": {
|
|
153
153
|
"typescript": ">=5.7.2"
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "77c939a3d0dd5ede02a3e216fdad35b2ad6ae2e5"
|
|
156
156
|
}
|
package/src/adapters/express.ts
CHANGED
|
@@ -28,7 +28,7 @@ export function createExpressMiddleware<TRouter extends AnyRouter>(
|
|
|
28
28
|
return (req, res) => {
|
|
29
29
|
let path = '';
|
|
30
30
|
run(async () => {
|
|
31
|
-
path = req.path.slice(1);
|
|
31
|
+
path = req.path.slice(req.path.lastIndexOf('/') + 1);
|
|
32
32
|
|
|
33
33
|
await nodeHTTPRequestHandler({
|
|
34
34
|
...(opts as any),
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
inferProcedureInput,
|
|
5
5
|
inferProcedureOutput,
|
|
6
6
|
} from '../procedure';
|
|
7
|
-
import type { AnyRouter,
|
|
7
|
+
import type { AnyRouter, RouterRecord } from '../router';
|
|
8
8
|
import type {
|
|
9
9
|
AnyClientTypes,
|
|
10
10
|
inferClientTypes,
|
|
@@ -41,8 +41,8 @@ export type GetInferenceHelpers<
|
|
|
41
41
|
? TType extends 'input'
|
|
42
42
|
? inferProcedureInput<$Value>
|
|
43
43
|
: inferTransformedProcedureOutput<TRoot, $Value>
|
|
44
|
-
: $Value extends RouterRecord
|
|
45
|
-
? GetInferenceHelpers<TType, TRoot,
|
|
44
|
+
: $Value extends RouterRecord
|
|
45
|
+
? GetInferenceHelpers<TType, TRoot, $Value>
|
|
46
46
|
: never
|
|
47
47
|
: never;
|
|
48
48
|
};
|
|
@@ -33,11 +33,13 @@ type DecorateProcedure<TProcedure extends AnyProcedure> = (
|
|
|
33
33
|
* @internal
|
|
34
34
|
*/
|
|
35
35
|
export type DecorateRouterRecord<TRecord extends RouterRecord> = {
|
|
36
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends
|
|
37
|
-
?
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value
|
|
37
|
+
? $Value extends AnyProcedure
|
|
38
|
+
? DecorateProcedure<$Value>
|
|
39
|
+
: $Value extends RouterRecord
|
|
40
|
+
? DecorateRouterRecord<$Value>
|
|
41
|
+
: never
|
|
42
|
+
: never;
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
/**
|
|
@@ -159,13 +161,9 @@ export type DecorateCreateRouterOptions<
|
|
|
159
161
|
export function createRouterFactory<TRoot extends AnyRootTypes>(
|
|
160
162
|
config: RootConfig<TRoot>,
|
|
161
163
|
) {
|
|
162
|
-
function createRouterInner<TInput extends RouterRecord>(
|
|
163
|
-
input: TInput,
|
|
164
|
-
): BuiltRouter<TRoot, TInput>;
|
|
165
164
|
function createRouterInner<TInput extends CreateRouterOptions>(
|
|
166
165
|
input: TInput,
|
|
167
|
-
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput
|
|
168
|
-
function createRouterInner(input: RouterRecord | CreateRouterOptions) {
|
|
166
|
+
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>> {
|
|
169
167
|
const reservedWordsUsed = new Set(
|
|
170
168
|
Object.keys(input).filter((v) => reservedWords.includes(v)),
|
|
171
169
|
);
|
|
@@ -213,13 +211,14 @@ export function createRouterFactory<TRoot extends AnyRootTypes>(
|
|
|
213
211
|
record,
|
|
214
212
|
};
|
|
215
213
|
|
|
216
|
-
|
|
217
|
-
...record,
|
|
214
|
+
const router: BuiltRouter<TRoot, {}> = {
|
|
215
|
+
...(record as {}),
|
|
218
216
|
_def,
|
|
219
217
|
createCaller: createCallerFactory<TRoot>()({
|
|
220
218
|
_def,
|
|
221
219
|
}),
|
|
222
220
|
};
|
|
221
|
+
return router as BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
return createRouterInner;
|
|
@@ -381,7 +380,3 @@ export function mergeRouters<TRouters extends AnyRouter[]>(
|
|
|
381
380
|
|
|
382
381
|
return router as MergeRouters<TRouters>;
|
|
383
382
|
}
|
|
384
|
-
|
|
385
|
-
export type coerceToRouterRecord<T> = T extends AnyRouter
|
|
386
|
-
? T['_def']['record']
|
|
387
|
-
: T;
|