@trpc/server 11.0.0-rc.532 → 11.0.0-rc.544
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/ws.js +1 -1
- package/dist/adapters/ws.mjs +1 -1
- package/dist/bundle-analysis.json +38 -38
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts +1 -1
- package/dist/unstable-core-do-not-import/http/types.d.ts +1 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +10 -10
- package/dist/unstable-core-do-not-import/initTRPC.js +9 -9
- package/dist/unstable-core-do-not-import/initTRPC.mjs +9 -9
- package/dist/unstable-core-do-not-import/middleware.d.ts +1 -1
- package/dist/unstable-core-do-not-import/middleware.js +1 -1
- package/dist/unstable-core-do-not-import/middleware.mjs +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +7 -7
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +3 -3
- package/dist/unstable-core-do-not-import/router.d.ts +1 -1
- package/dist/unstable-core-do-not-import/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/adapters/ws.ts +1 -1
- package/src/unstable-core-do-not-import/clientish/serialize.ts +1 -1
- package/src/unstable-core-do-not-import/http/types.ts +1 -1
- package/src/unstable-core-do-not-import/initTRPC.ts +10 -10
- package/src/unstable-core-do-not-import/middleware.ts +1 -1
- package/src/unstable-core-do-not-import/procedureBuilder.ts +7 -7
- package/src/unstable-core-do-not-import/rootConfig.ts +3 -3
- package/src/unstable-core-do-not-import/router.ts +1 -1
- package/src/unstable-core-do-not-import/types.ts +1 -1
package/dist/adapters/ws.js
CHANGED
|
@@ -14,7 +14,7 @@ var router = require('../unstable-core-do-not-import/router.js');
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Importing ws causes a build error
|
|
17
|
-
* @
|
|
17
|
+
* @see https://github.com/trpc/trpc/pull/5279
|
|
18
18
|
*/ const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
19
19
|
const unsetContextPromiseSymbol = Symbol('unsetContextPromise');
|
|
20
20
|
function getWSConnectionHandler(opts) {
|
package/dist/adapters/ws.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { callProcedure } from '../unstable-core-do-not-import/router.mjs';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Importing ws causes a build error
|
|
15
|
-
* @
|
|
15
|
+
* @see https://github.com/trpc/trpc/pull/5279
|
|
16
16
|
*/ const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
17
17
|
const unsetContextPromiseSymbol = Symbol('unsetContextPromise');
|
|
18
18
|
function getWSConnectionHandler(opts) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 26.
|
|
2
|
+
"bundleSize": 136140,
|
|
3
|
+
"bundleOrigSize": 185893,
|
|
4
|
+
"bundleReduction": 26.76,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"id": "/src/adapters/ws.ts",
|
|
39
|
-
"size":
|
|
40
|
-
"origSize":
|
|
39
|
+
"size": 16285,
|
|
40
|
+
"origSize": 15255,
|
|
41
41
|
"renderedExports": [
|
|
42
42
|
"getWSConnectionHandler",
|
|
43
43
|
"handleKeepAlive",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
{
|
|
69
69
|
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
70
70
|
"size": 6421,
|
|
71
|
-
"origSize":
|
|
71
|
+
"origSize": 10733,
|
|
72
72
|
"renderedExports": [
|
|
73
73
|
"createRouterFactory",
|
|
74
74
|
"callProcedure",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
{
|
|
104
104
|
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
105
105
|
"size": 5795,
|
|
106
|
-
"origSize":
|
|
106
|
+
"origSize": 15676,
|
|
107
107
|
"renderedExports": [
|
|
108
108
|
"createBuilder"
|
|
109
109
|
],
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
114
114
|
],
|
|
115
115
|
"percent": 4.26,
|
|
116
|
-
"reduction": 63.
|
|
116
|
+
"reduction": 63.03
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"id": "/src/adapters/aws-lambda/getPlanner.ts",
|
|
@@ -206,17 +206,17 @@
|
|
|
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",
|
|
210
209
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
211
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
210
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
211
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
212
212
|
],
|
|
213
213
|
"percent": 2.02,
|
|
214
214
|
"reduction": 45.94
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
"id": "/src/unstable-core-do-not-import/initTRPC.ts",
|
|
218
|
-
"size":
|
|
219
|
-
"origSize":
|
|
218
|
+
"size": 2695,
|
|
219
|
+
"origSize": 4566,
|
|
220
220
|
"renderedExports": [
|
|
221
221
|
"initTRPC"
|
|
222
222
|
],
|
|
@@ -224,13 +224,13 @@
|
|
|
224
224
|
"dependents": [
|
|
225
225
|
"/src/unstable-core-do-not-import.ts"
|
|
226
226
|
],
|
|
227
|
-
"percent": 1.
|
|
228
|
-
"reduction": 40.
|
|
227
|
+
"percent": 1.98,
|
|
228
|
+
"reduction": 40.98
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
"id": "/src/unstable-core-do-not-import/middleware.ts",
|
|
232
|
-
"size":
|
|
233
|
-
"origSize":
|
|
232
|
+
"size": 2626,
|
|
233
|
+
"origSize": 5939,
|
|
234
234
|
"renderedExports": [
|
|
235
235
|
"middlewareMarker",
|
|
236
236
|
"createMiddlewareFactory",
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
246
246
|
],
|
|
247
247
|
"percent": 1.93,
|
|
248
|
-
"reduction": 55.
|
|
248
|
+
"reduction": 55.78
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
"id": "/src/unstable-core-do-not-import/createProxy.ts",
|
|
@@ -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/http/parseConnectionParams.ts",
|
|
336
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
337
335
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
338
336
|
"/src/unstable-core-do-not-import/router.ts",
|
|
337
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
338
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.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",
|
|
@@ -392,8 +392,8 @@
|
|
|
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/error/getErrorShape.ts",
|
|
396
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
397
397
|
],
|
|
398
398
|
"percent": 1.06,
|
|
399
399
|
"reduction": 16.73
|
|
@@ -429,14 +429,14 @@
|
|
|
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",
|
|
435
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
436
432
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
437
433
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
438
434
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
439
435
|
"/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
|
+
"/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",
|
|
442
442
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
{
|
|
616
616
|
"id": "/src/unstable-core-do-not-import/rootConfig.ts",
|
|
617
617
|
"size": 343,
|
|
618
|
-
"origSize":
|
|
618
|
+
"origSize": 3267,
|
|
619
619
|
"renderedExports": [
|
|
620
620
|
"isServerDefault"
|
|
621
621
|
],
|
|
@@ -625,7 +625,7 @@
|
|
|
625
625
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
626
626
|
],
|
|
627
627
|
"percent": 0.25,
|
|
628
|
-
"reduction": 89.
|
|
628
|
+
"reduction": 89.5
|
|
629
629
|
},
|
|
630
630
|
{
|
|
631
631
|
"id": "/src/adapters/express.ts",
|
|
@@ -656,7 +656,7 @@
|
|
|
656
656
|
{
|
|
657
657
|
"id": "/src/unstable-core-do-not-import/types.ts",
|
|
658
658
|
"size": 221,
|
|
659
|
-
"origSize":
|
|
659
|
+
"origSize": 4054,
|
|
660
660
|
"renderedExports": [
|
|
661
661
|
"ERROR_SYMBOL"
|
|
662
662
|
],
|
|
@@ -727,31 +727,31 @@
|
|
|
727
727
|
"reduction": 93.8
|
|
728
728
|
},
|
|
729
729
|
{
|
|
730
|
-
"id": "/src/
|
|
730
|
+
"id": "/src/index.ts",
|
|
731
731
|
"size": 0,
|
|
732
|
-
"origSize":
|
|
732
|
+
"origSize": 32,
|
|
733
733
|
"renderedExports": [],
|
|
734
734
|
"removedExports": [],
|
|
735
|
-
"dependents": [
|
|
736
|
-
"/src/adapters/ws.ts"
|
|
737
|
-
],
|
|
735
|
+
"dependents": [],
|
|
738
736
|
"percent": 0,
|
|
739
737
|
"reduction": 100
|
|
740
738
|
},
|
|
741
739
|
{
|
|
742
|
-
"id": "/src/
|
|
740
|
+
"id": "/src/http.ts",
|
|
743
741
|
"size": 0,
|
|
744
|
-
"origSize":
|
|
742
|
+
"origSize": 37,
|
|
745
743
|
"renderedExports": [],
|
|
746
744
|
"removedExports": [],
|
|
747
|
-
"dependents": [
|
|
745
|
+
"dependents": [
|
|
746
|
+
"/src/adapters/ws.ts"
|
|
747
|
+
],
|
|
748
748
|
"percent": 0,
|
|
749
749
|
"reduction": 100
|
|
750
750
|
},
|
|
751
751
|
{
|
|
752
|
-
"id": "/src/
|
|
752
|
+
"id": "/src/rpc.ts",
|
|
753
753
|
"size": 0,
|
|
754
|
-
"origSize":
|
|
754
|
+
"origSize": 36,
|
|
755
755
|
"renderedExports": [],
|
|
756
756
|
"removedExports": [],
|
|
757
757
|
"dependents": [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Simplify, WithoutIndexSignature } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @see https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
4
4
|
*/
|
|
5
5
|
type JsonPrimitive = boolean | number | string | null;
|
|
6
6
|
type NonJsonPrimitive = Function | symbol | undefined;
|
|
@@ -37,7 +37,7 @@ export interface HTTPBaseHandlerOptions<TRouter extends AnyRouter, TRequest> ext
|
|
|
37
37
|
/**
|
|
38
38
|
* Add handler to be called before response is sent to the user
|
|
39
39
|
* Useful for setting cache headers
|
|
40
|
-
* @
|
|
40
|
+
* @see https://trpc.io/docs/v11/caching
|
|
41
41
|
*/
|
|
42
42
|
responseMeta?: ResponseMetaFn<TRouter>;
|
|
43
43
|
}
|
|
@@ -12,7 +12,7 @@ interface RuntimeConfigOptions<TContext extends object, TMeta extends object> ex
|
|
|
12
12
|
}>, '$types' | 'transformer'>> {
|
|
13
13
|
/**
|
|
14
14
|
* Use a data transformer
|
|
15
|
-
* @
|
|
15
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
16
16
|
*/
|
|
17
17
|
transformer?: DataTransformerOptions;
|
|
18
18
|
}
|
|
@@ -20,17 +20,17 @@ type ContextCallback = (...args: any[]) => object | Promise<object>;
|
|
|
20
20
|
declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
21
21
|
/**
|
|
22
22
|
* Add a context shape as a generic to the root object
|
|
23
|
-
* @
|
|
23
|
+
* @see https://trpc.io/docs/v11/server/context
|
|
24
24
|
*/
|
|
25
25
|
context<TNewContext extends object | ContextCallback>(): TRPCBuilder<TNewContext extends ContextCallback ? Unwrap<TNewContext> : TNewContext, TMeta>;
|
|
26
26
|
/**
|
|
27
27
|
* Add a meta shape as a generic to the root object
|
|
28
|
-
* @
|
|
28
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
29
29
|
*/
|
|
30
30
|
meta<TNewMeta extends object>(): TRPCBuilder<TContext, TNewMeta>;
|
|
31
31
|
/**
|
|
32
32
|
* Create the root object
|
|
33
|
-
* @
|
|
33
|
+
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
34
34
|
*/
|
|
35
35
|
create<TOptions extends RuntimeConfigOptions<TContext, TMeta>>(opts?: ValidateShape<TOptions, RuntimeConfigOptions<TContext, TMeta>> | undefined): {
|
|
36
36
|
/**
|
|
@@ -45,17 +45,17 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
45
45
|
}>;
|
|
46
46
|
/**
|
|
47
47
|
* Builder object for creating procedures
|
|
48
|
-
* @
|
|
48
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
49
49
|
*/
|
|
50
50
|
procedure: import("./procedureBuilder").ProcedureBuilder<TContext, TMeta, object, typeof import("./utils").unsetMarker, typeof import("./utils").unsetMarker, typeof import("./utils").unsetMarker, typeof import("./utils").unsetMarker, false>;
|
|
51
51
|
/**
|
|
52
52
|
* Create reusable middlewares
|
|
53
|
-
* @
|
|
53
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
54
54
|
*/
|
|
55
55
|
middleware: <$ContextOverrides>(fn: import("./middleware").MiddlewareFunction<TContext, TMeta, object, $ContextOverrides, unknown>) => import("./middleware").MiddlewareBuilder<TContext, TMeta, $ContextOverrides, unknown>;
|
|
56
56
|
/**
|
|
57
57
|
* Create a router
|
|
58
|
-
* @
|
|
58
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
59
59
|
*/
|
|
60
60
|
router: {
|
|
61
61
|
<TInput extends import("./router").RouterRecord>(input: TInput): import("./router").BuiltRouter<{
|
|
@@ -73,12 +73,12 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
75
|
* Merge Routers
|
|
76
|
-
* @
|
|
76
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
77
77
|
*/
|
|
78
78
|
mergeRouters: typeof mergeRouters;
|
|
79
79
|
/**
|
|
80
80
|
* Create a server-side caller for a router
|
|
81
|
-
* @
|
|
81
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
82
82
|
*/
|
|
83
83
|
createCallerFactory: <TRecord extends import("./router").RouterRecord>(router: Pick<import("./router").Router<{
|
|
84
84
|
ctx: TContext;
|
|
@@ -95,7 +95,7 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
98
|
-
* @
|
|
98
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
99
99
|
*/
|
|
100
100
|
export declare const initTRPC: TRPCBuilder<object, object>;
|
|
101
101
|
export type { TRPCBuilder };
|
|
@@ -10,19 +10,19 @@ var transformer = require('./transformer.js');
|
|
|
10
10
|
class TRPCBuilder {
|
|
11
11
|
/**
|
|
12
12
|
* Add a context shape as a generic to the root object
|
|
13
|
-
* @
|
|
13
|
+
* @see https://trpc.io/docs/v11/server/context
|
|
14
14
|
*/ context() {
|
|
15
15
|
return new TRPCBuilder();
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Add a meta shape as a generic to the root object
|
|
19
|
-
* @
|
|
19
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
20
20
|
*/ meta() {
|
|
21
21
|
return new TRPCBuilder();
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Create the root object
|
|
25
|
-
* @
|
|
25
|
+
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
26
26
|
*/ create(opts) {
|
|
27
27
|
const config = {
|
|
28
28
|
transformer: transformer.getDataTransformer(opts?.transformer ?? transformer.defaultTransformer),
|
|
@@ -51,32 +51,32 @@ class TRPCBuilder {
|
|
|
51
51
|
*/ _config: config,
|
|
52
52
|
/**
|
|
53
53
|
* Builder object for creating procedures
|
|
54
|
-
* @
|
|
54
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
55
55
|
*/ procedure: procedureBuilder.createBuilder({
|
|
56
56
|
meta: opts?.defaultMeta
|
|
57
57
|
}),
|
|
58
58
|
/**
|
|
59
59
|
* Create reusable middlewares
|
|
60
|
-
* @
|
|
60
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
61
61
|
*/ middleware: middleware.createMiddlewareFactory(),
|
|
62
62
|
/**
|
|
63
63
|
* Create a router
|
|
64
|
-
* @
|
|
64
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
65
65
|
*/ router: router.createRouterFactory(config),
|
|
66
66
|
/**
|
|
67
67
|
* Merge Routers
|
|
68
|
-
* @
|
|
68
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
69
69
|
*/ mergeRouters: router.mergeRouters,
|
|
70
70
|
/**
|
|
71
71
|
* Create a server-side caller for a router
|
|
72
|
-
* @
|
|
72
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
73
73
|
*/ createCallerFactory: router.createCallerFactory()
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
79
|
-
* @
|
|
79
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
80
80
|
*/ const initTRPC = new TRPCBuilder();
|
|
81
81
|
|
|
82
82
|
exports.initTRPC = initTRPC;
|
|
@@ -8,19 +8,19 @@ import { getDataTransformer, defaultTransformer } from './transformer.mjs';
|
|
|
8
8
|
class TRPCBuilder {
|
|
9
9
|
/**
|
|
10
10
|
* Add a context shape as a generic to the root object
|
|
11
|
-
* @
|
|
11
|
+
* @see https://trpc.io/docs/v11/server/context
|
|
12
12
|
*/ context() {
|
|
13
13
|
return new TRPCBuilder();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Add a meta shape as a generic to the root object
|
|
17
|
-
* @
|
|
17
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
18
18
|
*/ meta() {
|
|
19
19
|
return new TRPCBuilder();
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Create the root object
|
|
23
|
-
* @
|
|
23
|
+
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
24
24
|
*/ create(opts) {
|
|
25
25
|
const config = {
|
|
26
26
|
transformer: getDataTransformer(opts?.transformer ?? defaultTransformer),
|
|
@@ -49,32 +49,32 @@ class TRPCBuilder {
|
|
|
49
49
|
*/ _config: config,
|
|
50
50
|
/**
|
|
51
51
|
* Builder object for creating procedures
|
|
52
|
-
* @
|
|
52
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
53
53
|
*/ procedure: createBuilder({
|
|
54
54
|
meta: opts?.defaultMeta
|
|
55
55
|
}),
|
|
56
56
|
/**
|
|
57
57
|
* Create reusable middlewares
|
|
58
|
-
* @
|
|
58
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
59
59
|
*/ middleware: createMiddlewareFactory(),
|
|
60
60
|
/**
|
|
61
61
|
* Create a router
|
|
62
|
-
* @
|
|
62
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
63
63
|
*/ router: createRouterFactory(config),
|
|
64
64
|
/**
|
|
65
65
|
* Merge Routers
|
|
66
|
-
* @
|
|
66
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
67
67
|
*/ mergeRouters,
|
|
68
68
|
/**
|
|
69
69
|
* Create a server-side caller for a router
|
|
70
|
-
* @
|
|
70
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
71
71
|
*/ createCallerFactory: createCallerFactory()
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
77
|
-
* @
|
|
77
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
78
78
|
*/ const initTRPC = new TRPCBuilder();
|
|
79
79
|
|
|
80
80
|
export { initTRPC };
|
|
@@ -72,7 +72,7 @@ export type AnyMiddlewareBuilder = MiddlewareBuilder<any, any, any, any>;
|
|
|
72
72
|
export declare function createMiddlewareFactory<TContext, TMeta, TInputOut = unknown>(): <$ContextOverrides>(fn: MiddlewareFunction<TContext, TMeta, object, $ContextOverrides, TInputOut>) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, TInputOut>;
|
|
73
73
|
/**
|
|
74
74
|
* Create a standalone middleware
|
|
75
|
-
* @
|
|
75
|
+
* @see https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares
|
|
76
76
|
* @deprecated use `.unstable_concat()` instead
|
|
77
77
|
*/
|
|
78
78
|
export declare const experimental_standaloneMiddleware: <TCtx extends {
|
|
@@ -30,7 +30,7 @@ var utils = require('./utils.js');
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Create a standalone middleware
|
|
33
|
-
* @
|
|
33
|
+
* @see https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares
|
|
34
34
|
* @deprecated use `.unstable_concat()` instead
|
|
35
35
|
*/ const experimental_standaloneMiddleware = ()=>({
|
|
36
36
|
create: createMiddlewareFactory()
|
|
@@ -28,7 +28,7 @@ import { isObject } from './utils.mjs';
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Create a standalone middleware
|
|
31
|
-
* @
|
|
31
|
+
* @see https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares
|
|
32
32
|
* @deprecated use `.unstable_concat()` instead
|
|
33
33
|
*/ const experimental_standaloneMiddleware = ()=>({
|
|
34
34
|
create: createMiddlewareFactory()
|
|
@@ -73,22 +73,22 @@ export type inferProcedureBuilderResolverOptions<TProcedureBuilder extends AnyPr
|
|
|
73
73
|
export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller extends boolean> {
|
|
74
74
|
/**
|
|
75
75
|
* Add an input parser to the procedure.
|
|
76
|
-
* @
|
|
76
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
77
77
|
*/
|
|
78
78
|
input<$Parser extends Parser>(schema: TInputOut extends UnsetMarker ? $Parser : inferParser<$Parser>['out'] extends Record<string, unknown> | undefined ? TInputOut extends Record<string, unknown> | undefined ? undefined extends inferParser<$Parser>['out'] ? undefined extends TInputOut ? $Parser : TypeError<'Cannot chain an optional parser to a required parser'> : $Parser : TypeError<'All input parsers did not resolve to an object'> : TypeError<'All input parsers did not resolve to an object'>): ProcedureBuilder<TContext, TMeta, TContextOverrides, IntersectIfDefined<TInputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TInputOut, inferParser<$Parser>['out']>, TOutputIn, TOutputOut, TCaller>;
|
|
79
79
|
/**
|
|
80
80
|
* Add an output parser to the procedure.
|
|
81
|
-
* @
|
|
81
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
82
82
|
*/
|
|
83
83
|
output<$Parser extends Parser>(schema: $Parser): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, IntersectIfDefined<TOutputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TOutputOut, inferParser<$Parser>['out']>, TCaller>;
|
|
84
84
|
/**
|
|
85
85
|
* Add a meta data to the procedure.
|
|
86
|
-
* @
|
|
86
|
+
* @see https://trpc.io/docs/v11/server/metadata
|
|
87
87
|
*/
|
|
88
88
|
meta(meta: TMeta): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller>;
|
|
89
89
|
/**
|
|
90
90
|
* Add a middleware to the procedure.
|
|
91
|
-
* @
|
|
91
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
92
92
|
*/
|
|
93
93
|
use<$ContextOverridesOut>(fn: MiddlewareBuilder<Overwrite<TContext, TContextOverrides>, TMeta, $ContextOverridesOut, TInputOut> | MiddlewareFunction<TContext, TMeta, TContextOverrides, $ContextOverridesOut, TInputOut>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverridesOut>, TInputIn, TInputOut, TOutputIn, TOutputOut, TCaller>;
|
|
94
94
|
/**
|
|
@@ -97,7 +97,7 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
|
|
|
97
97
|
unstable_concat<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut>(builder: Overwrite<TContext, TContextOverrides> extends $Context ? TMeta extends $Meta ? ProcedureBuilder<$Context, $Meta, $ContextOverrides, $InputIn, $InputOut, $OutputIn, $OutputOut, TCaller> : TypeError<'Meta mismatch'> : TypeError<'Context mismatch'>): ProcedureBuilder<TContext, TMeta, Overwrite<TContextOverrides, $ContextOverrides>, IntersectIfDefined<TInputIn, $InputIn>, IntersectIfDefined<TInputIn, $InputOut>, IntersectIfDefined<TOutputIn, $OutputIn>, IntersectIfDefined<TOutputOut, $OutputOut>, TCaller>;
|
|
98
98
|
/**
|
|
99
99
|
* Query procedure
|
|
100
|
-
* @
|
|
100
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
101
101
|
*/
|
|
102
102
|
query<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? (input: DefaultValue<TInputIn, void>) => Promise<DefaultValue<TOutputOut, $Output>> : QueryProcedure<{
|
|
103
103
|
input: DefaultValue<TInputIn, void>;
|
|
@@ -105,7 +105,7 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
|
|
|
105
105
|
}>;
|
|
106
106
|
/**
|
|
107
107
|
* Mutation procedure
|
|
108
|
-
* @
|
|
108
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
109
109
|
*/
|
|
110
110
|
mutation<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? (input: DefaultValue<TInputIn, void>) => Promise<DefaultValue<TOutputOut, $Output>> : MutationProcedure<{
|
|
111
111
|
input: DefaultValue<TInputIn, void>;
|
|
@@ -113,7 +113,7 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
|
|
|
113
113
|
}>;
|
|
114
114
|
/**
|
|
115
115
|
* Subscription procedure
|
|
116
|
-
* @
|
|
116
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
117
117
|
*/
|
|
118
118
|
subscription<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? TypeError<'Not implemented'> : inferSubscriptionProcedure<TInputIn, TOutputOut, $Output>;
|
|
119
119
|
/**
|
|
@@ -27,12 +27,12 @@ export interface RootConfig<TTypes extends RootTypes> {
|
|
|
27
27
|
$types: TTypes;
|
|
28
28
|
/**
|
|
29
29
|
* Use a data transformer
|
|
30
|
-
* @
|
|
30
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
31
31
|
*/
|
|
32
32
|
transformer: CombinedDataTransformer;
|
|
33
33
|
/**
|
|
34
34
|
* Use custom error formatting
|
|
35
|
-
* @
|
|
35
|
+
* @see https://trpc.io/docs/v11/error-formatting
|
|
36
36
|
*/
|
|
37
37
|
errorFormatter: ErrorFormatter<TTypes['ctx'], TTypes['errorShape']>;
|
|
38
38
|
/**
|
|
@@ -89,7 +89,7 @@ type PartialIf<TCondition extends boolean, TType> = TCondition extends true ? Pa
|
|
|
89
89
|
*/
|
|
90
90
|
export type CreateContextCallback<TContext, TFunction extends (...args: any[]) => any> = PartialIf<object extends TContext ? true : false, {
|
|
91
91
|
/**
|
|
92
|
-
* @
|
|
92
|
+
* @see https://trpc.io/docs/v11/context
|
|
93
93
|
**/
|
|
94
94
|
createContext: TFunction;
|
|
95
95
|
}>;
|
|
@@ -41,7 +41,7 @@ export interface Router<TRoot extends AnyRootTypes, TRecord extends RouterRecord
|
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* @deprecated use `t.createCallerFactory(router)` instead
|
|
44
|
-
* @
|
|
44
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
45
45
|
*/
|
|
46
46
|
createCaller: RouterCaller<TRoot, TRecord>;
|
|
47
47
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export type Maybe<TType> = TType | null | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
|
-
* @
|
|
12
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
13
13
|
*/
|
|
14
14
|
export type Simplify<TType> = TType extends any[] | Date ? TType : {
|
|
15
15
|
[K in keyof TType]: TType[K];
|
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.544+f8e8d1715",
|
|
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": "f8e8d1715c164357239170fc6668de9f2b579b7d"
|
|
153
153
|
}
|
package/src/adapters/ws.ts
CHANGED
|
@@ -38,7 +38,7 @@ import type { NodeHTTPCreateContextFnOptions } from './node-http';
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Importing ws causes a build error
|
|
41
|
-
* @
|
|
41
|
+
* @see https://github.com/trpc/trpc/pull/5279
|
|
42
42
|
*/
|
|
43
43
|
const WEBSOCKET_OPEN = 1; /* ws.WebSocket.OPEN */
|
|
44
44
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Simplify, WithoutIndexSignature } from '../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @see https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
6
6
|
*/
|
|
7
7
|
type JsonPrimitive = boolean | number | string | null;
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -50,7 +50,7 @@ export interface HTTPBaseHandlerOptions<TRouter extends AnyRouter, TRequest>
|
|
|
50
50
|
/**
|
|
51
51
|
* Add handler to be called before response is sent to the user
|
|
52
52
|
* Useful for setting cache headers
|
|
53
|
-
* @
|
|
53
|
+
* @see https://trpc.io/docs/v11/caching
|
|
54
54
|
*/
|
|
55
55
|
responseMeta?: ResponseMetaFn<TRouter>;
|
|
56
56
|
}
|
|
@@ -36,7 +36,7 @@ interface RuntimeConfigOptions<TContext extends object, TMeta extends object>
|
|
|
36
36
|
> {
|
|
37
37
|
/**
|
|
38
38
|
* Use a data transformer
|
|
39
|
-
* @
|
|
39
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
40
40
|
*/
|
|
41
41
|
transformer?: DataTransformerOptions;
|
|
42
42
|
}
|
|
@@ -46,7 +46,7 @@ type ContextCallback = (...args: any[]) => object | Promise<object>;
|
|
|
46
46
|
class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
47
47
|
/**
|
|
48
48
|
* Add a context shape as a generic to the root object
|
|
49
|
-
* @
|
|
49
|
+
* @see https://trpc.io/docs/v11/server/context
|
|
50
50
|
*/
|
|
51
51
|
context<TNewContext extends object | ContextCallback>() {
|
|
52
52
|
return new TRPCBuilder<
|
|
@@ -57,7 +57,7 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Add a meta shape as a generic to the root object
|
|
60
|
-
* @
|
|
60
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
61
61
|
*/
|
|
62
62
|
meta<TNewMeta extends object>() {
|
|
63
63
|
return new TRPCBuilder<TContext, TNewMeta>();
|
|
@@ -65,7 +65,7 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Create the root object
|
|
68
|
-
* @
|
|
68
|
+
* @see https://trpc.io/docs/v11/server/routers#initialize-trpc
|
|
69
69
|
*/
|
|
70
70
|
create<TOptions extends RuntimeConfigOptions<TContext, TMeta>>(
|
|
71
71
|
opts?:
|
|
@@ -116,29 +116,29 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
116
116
|
_config: config,
|
|
117
117
|
/**
|
|
118
118
|
* Builder object for creating procedures
|
|
119
|
-
* @
|
|
119
|
+
* @see https://trpc.io/docs/v11/server/procedures
|
|
120
120
|
*/
|
|
121
121
|
procedure: createBuilder<$Root['ctx'], $Root['meta']>({
|
|
122
122
|
meta: opts?.defaultMeta,
|
|
123
123
|
}),
|
|
124
124
|
/**
|
|
125
125
|
* Create reusable middlewares
|
|
126
|
-
* @
|
|
126
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
127
127
|
*/
|
|
128
128
|
middleware: createMiddlewareFactory<$Root['ctx'], $Root['meta']>(),
|
|
129
129
|
/**
|
|
130
130
|
* Create a router
|
|
131
|
-
* @
|
|
131
|
+
* @see https://trpc.io/docs/v11/server/routers
|
|
132
132
|
*/
|
|
133
133
|
router: createRouterFactory<$Root>(config),
|
|
134
134
|
/**
|
|
135
135
|
* Merge Routers
|
|
136
|
-
* @
|
|
136
|
+
* @see https://trpc.io/docs/v11/server/merging-routers
|
|
137
137
|
*/
|
|
138
138
|
mergeRouters,
|
|
139
139
|
/**
|
|
140
140
|
* Create a server-side caller for a router
|
|
141
|
-
* @
|
|
141
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
142
142
|
*/
|
|
143
143
|
createCallerFactory: createCallerFactory<$Root>(),
|
|
144
144
|
};
|
|
@@ -147,7 +147,7 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
|
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* Builder to initialize the tRPC root object - use this exactly once per backend
|
|
150
|
-
* @
|
|
150
|
+
* @see https://trpc.io/docs/v11/quickstart
|
|
151
151
|
*/
|
|
152
152
|
export const initTRPC = new TRPCBuilder();
|
|
153
153
|
export type { TRPCBuilder };
|
|
@@ -158,7 +158,7 @@ export function createMiddlewareFactory<
|
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* Create a standalone middleware
|
|
161
|
-
* @
|
|
161
|
+
* @see https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares
|
|
162
162
|
* @deprecated use `.unstable_concat()` instead
|
|
163
163
|
*/
|
|
164
164
|
export const experimental_standaloneMiddleware = <
|
|
@@ -186,7 +186,7 @@ export interface ProcedureBuilder<
|
|
|
186
186
|
> {
|
|
187
187
|
/**
|
|
188
188
|
* Add an input parser to the procedure.
|
|
189
|
-
* @
|
|
189
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
190
190
|
*/
|
|
191
191
|
input<$Parser extends Parser>(
|
|
192
192
|
schema: TInputOut extends UnsetMarker
|
|
@@ -212,7 +212,7 @@ export interface ProcedureBuilder<
|
|
|
212
212
|
>;
|
|
213
213
|
/**
|
|
214
214
|
* Add an output parser to the procedure.
|
|
215
|
-
* @
|
|
215
|
+
* @see https://trpc.io/docs/v11/server/validators
|
|
216
216
|
*/
|
|
217
217
|
output<$Parser extends Parser>(
|
|
218
218
|
schema: $Parser,
|
|
@@ -228,7 +228,7 @@ export interface ProcedureBuilder<
|
|
|
228
228
|
>;
|
|
229
229
|
/**
|
|
230
230
|
* Add a meta data to the procedure.
|
|
231
|
-
* @
|
|
231
|
+
* @see https://trpc.io/docs/v11/server/metadata
|
|
232
232
|
*/
|
|
233
233
|
meta(
|
|
234
234
|
meta: TMeta,
|
|
@@ -244,7 +244,7 @@ export interface ProcedureBuilder<
|
|
|
244
244
|
>;
|
|
245
245
|
/**
|
|
246
246
|
* Add a middleware to the procedure.
|
|
247
|
-
* @
|
|
247
|
+
* @see https://trpc.io/docs/v11/server/middlewares
|
|
248
248
|
*/
|
|
249
249
|
use<$ContextOverridesOut>(
|
|
250
250
|
fn:
|
|
@@ -310,7 +310,7 @@ export interface ProcedureBuilder<
|
|
|
310
310
|
>;
|
|
311
311
|
/**
|
|
312
312
|
* Query procedure
|
|
313
|
-
* @
|
|
313
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
314
314
|
*/
|
|
315
315
|
query<$Output>(
|
|
316
316
|
resolver: ProcedureResolver<
|
|
@@ -332,7 +332,7 @@ export interface ProcedureBuilder<
|
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
334
|
* Mutation procedure
|
|
335
|
-
* @
|
|
335
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
336
336
|
*/
|
|
337
337
|
mutation<$Output>(
|
|
338
338
|
resolver: ProcedureResolver<
|
|
@@ -354,7 +354,7 @@ export interface ProcedureBuilder<
|
|
|
354
354
|
|
|
355
355
|
/**
|
|
356
356
|
* Subscription procedure
|
|
357
|
-
* @
|
|
357
|
+
* @see https://trpc.io/docs/v11/concepts#vocabulary
|
|
358
358
|
*/
|
|
359
359
|
subscription<$Output>(
|
|
360
360
|
resolver: ProcedureResolver<
|
|
@@ -36,12 +36,12 @@ export interface RootConfig<TTypes extends RootTypes> {
|
|
|
36
36
|
$types: TTypes;
|
|
37
37
|
/**
|
|
38
38
|
* Use a data transformer
|
|
39
|
-
* @
|
|
39
|
+
* @see https://trpc.io/docs/v11/data-transformers
|
|
40
40
|
*/
|
|
41
41
|
transformer: CombinedDataTransformer;
|
|
42
42
|
/**
|
|
43
43
|
* Use custom error formatting
|
|
44
|
-
* @
|
|
44
|
+
* @see https://trpc.io/docs/v11/error-formatting
|
|
45
45
|
*/
|
|
46
46
|
errorFormatter: ErrorFormatter<TTypes['ctx'], TTypes['errorShape']>;
|
|
47
47
|
/**
|
|
@@ -114,7 +114,7 @@ export type CreateContextCallback<
|
|
|
114
114
|
object extends TContext ? true : false,
|
|
115
115
|
{
|
|
116
116
|
/**
|
|
117
|
-
* @
|
|
117
|
+
* @see https://trpc.io/docs/v11/context
|
|
118
118
|
**/
|
|
119
119
|
createContext: TFunction;
|
|
120
120
|
}
|
|
@@ -80,7 +80,7 @@ export interface Router<
|
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
82
|
* @deprecated use `t.createCallerFactory(router)` instead
|
|
83
|
-
* @
|
|
83
|
+
* @see https://trpc.io/docs/v11/server/server-side-calls
|
|
84
84
|
*/
|
|
85
85
|
createCaller: RouterCaller<TRoot, TRecord>;
|
|
86
86
|
}
|
|
@@ -11,7 +11,7 @@ export type Maybe<TType> = TType | null | undefined;
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
|
-
* @
|
|
14
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
15
15
|
*/
|
|
16
16
|
export type Simplify<TType> = TType extends any[] | Date
|
|
17
17
|
? TType
|