@trpc/server 9.18.0 → 10.0.0-alpha.3
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/adapters/express/index.d.ts +1 -0
- package/adapters/express/index.js +1 -0
- package/adapters/next/index.d.ts +1 -0
- package/adapters/next/index.js +1 -0
- package/adapters/node-http/index.d.ts +1 -0
- package/adapters/node-http/index.js +1 -0
- package/adapters/standalone/index.d.ts +1 -0
- package/adapters/standalone/index.js +1 -0
- package/adapters/ws/index.d.ts +1 -0
- package/adapters/ws/index.js +1 -0
- package/dist/{declarations/src/TRPCError.d.ts → TRPCError.d.ts} +18 -18
- package/dist/TRPCError.d.ts.map +1 -0
- package/dist/{declarations/src/adapters → adapters}/express.d.ts +5 -5
- package/dist/adapters/express.d.ts.map +1 -0
- package/dist/adapters/express.js +22 -0
- package/dist/adapters/express.mjs +18 -0
- package/dist/adapters/express.ts.js +1 -0
- package/dist/{declarations/src/adapters → adapters}/next.d.ts +5 -5
- package/dist/adapters/next.d.ts.map +1 -0
- package/dist/adapters/next.js +55 -0
- package/dist/adapters/next.mjs +51 -0
- package/dist/adapters/next.ts.js +1 -0
- package/dist/{declarations/src/adapters → adapters}/node-http/index.d.ts +2 -2
- package/dist/adapters/node-http/index.d.ts.map +1 -0
- package/dist/adapters/node-http/index.js +12 -0
- package/dist/adapters/node-http/index.mjs +4 -0
- package/dist/adapters/node-http/index.ts.js +1 -0
- package/dist/{declarations/src/adapters → adapters}/node-http/internals/getPostBody.d.ts +12 -12
- package/dist/adapters/node-http/internals/getPostBody.d.ts.map +1 -0
- package/dist/{declarations/src/adapters → adapters}/node-http/nodeHTTPRequestHandler.d.ts +9 -9
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -0
- package/dist/{declarations/src/adapters → adapters}/node-http/types.d.ts +32 -32
- package/dist/adapters/node-http/types.d.ts.map +1 -0
- package/dist/{declarations/src/adapters → adapters}/standalone.d.ts +13 -13
- package/dist/adapters/standalone.d.ts.map +1 -0
- package/dist/adapters/standalone.js +45 -0
- package/dist/adapters/standalone.mjs +35 -0
- package/dist/adapters/standalone.ts.js +1 -0
- package/dist/{declarations/src/adapters → adapters}/ws.d.ts +16 -16
- package/dist/adapters/ws.d.ts.map +1 -0
- package/dist/adapters/ws.js +346 -0
- package/dist/adapters/ws.mjs +342 -0
- package/dist/adapters/ws.ts.js +1 -0
- package/dist/{declarations/src/assertNotBrowser.d.ts → assertNotBrowser.d.ts} +1 -1
- package/dist/assertNotBrowser.d.ts.map +1 -0
- package/dist/{codes-fe07bf82.esm.js → codes-7a3d4f65.mjs} +0 -0
- package/dist/{codes-33cef953.cjs.dev.js → codes-7f46544e.js} +0 -0
- package/dist/{declarations/src/deprecated → deprecated}/LegacyRouter.d.ts +2 -2
- package/dist/deprecated/LegacyRouter.d.ts.map +1 -0
- package/dist/{declarations/src/deprecated → deprecated}/createHttpServer.d.ts +18 -18
- package/dist/deprecated/createHttpServer.d.ts.map +1 -0
- package/dist/{declarations/src/deprecated → deprecated}/requestHandler.d.ts +14 -14
- package/dist/deprecated/requestHandler.d.ts.map +1 -0
- package/dist/{declarations/src/http → http}/ResponseMeta.d.ts +4 -4
- package/dist/http/ResponseMeta.d.ts.map +1 -0
- package/dist/{declarations/src/http → http}/index.d.ts +2 -2
- package/dist/http/index.d.ts.map +1 -0
- package/dist/{declarations/src/http → http}/internals/getHTTPStatusCode.d.ts +20 -20
- package/dist/http/internals/getHTTPStatusCode.d.ts.map +1 -0
- package/dist/{declarations/src/http → http}/internals/types.d.ts +39 -39
- package/dist/http/internals/types.d.ts.map +1 -0
- package/dist/{declarations/src/http → http}/resolveHTTPResponse.d.ts +12 -12
- package/dist/http/resolveHTTPResponse.d.ts.map +1 -0
- package/dist/{declarations/src/index.d.ts → index.d.ts} +9 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/{trpc-server.cjs.dev.js → index.js} +7 -7
- package/dist/{trpc-server.esm.js → index.mjs} +7 -7
- package/dist/index.ts.js +1 -0
- package/dist/{declarations/src/internals → internals}/BaseHandlerOptions.d.ts +12 -12
- package/dist/internals/BaseHandlerOptions.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/OnErrorFunction.d.ts +10 -10
- package/dist/internals/OnErrorFunction.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/callProcedure.d.ts +9 -9
- package/dist/internals/callProcedure.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/errors.d.ts +3 -3
- package/dist/internals/errors.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/invert.d.ts +8 -8
- package/dist/internals/invert.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/middlewares.d.ts +33 -33
- package/dist/internals/middlewares.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/procedure.d.ts +73 -73
- package/dist/internals/procedure.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/transformTRPCResponse.d.ts +6 -6
- package/dist/internals/transformTRPCResponse.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/wrapCallSafe.d.ts +15 -15
- package/dist/internals/wrapCallSafe.d.ts.map +1 -0
- package/dist/{nodeHTTPRequestHandler-2e6cc2d7.esm.js → nodeHTTPRequestHandler-10e6d2f9.mjs} +2 -2
- package/dist/{nodeHTTPRequestHandler-b7ff366e.cjs.dev.js → nodeHTTPRequestHandler-d7c307d3.js} +2 -2
- package/dist/{declarations/src/router.d.ts → router.d.ts} +175 -175
- package/dist/router.d.ts.map +1 -0
- package/dist/{declarations/src/rpc → rpc}/codes.d.ts +46 -46
- package/dist/rpc/codes.d.ts.map +1 -0
- package/dist/{declarations/src/rpc → rpc}/envelopes.d.ts +71 -71
- package/dist/rpc/envelopes.d.ts.map +1 -0
- package/dist/{declarations/src/rpc → rpc}/index.d.ts +2 -2
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/index.js +10 -0
- package/dist/rpc/index.mjs +1 -0
- package/dist/rpc/index.ts.js +1 -0
- package/dist/{subscription-b8831081.cjs.dev.js → subscription-5b7e1eba.js} +1 -1
- package/dist/{subscription-fbda2888.esm.js → subscription-e1d42e69.mjs} +1 -1
- package/dist/{declarations/src/subscription.d.ts → subscription.d.ts} +57 -57
- package/dist/subscription.d.ts.map +1 -0
- package/dist/{transformTRPCResponse-f73dc4a2.esm.js → transformTRPCResponse-76e0c91e.mjs} +0 -0
- package/dist/{transformTRPCResponse-8248515e.cjs.dev.js → transformTRPCResponse-bd24f548.js} +0 -0
- package/dist/{declarations/src/transformer.d.ts → transformer.d.ts} +29 -29
- package/dist/transformer.d.ts.map +1 -0
- package/dist/{declarations/src/types.d.ts → types.d.ts} +40 -40
- package/dist/types.d.ts.map +1 -0
- package/dist/{declarations/src/ws → ws}/index.d.ts +6 -6
- package/dist/ws/index.d.ts.map +1 -0
- package/dist/ws/index.js +15 -0
- package/dist/ws/index.mjs +11 -0
- package/dist/ws/index.ts.js +1 -0
- package/package.json +49 -18
- package/rpc/index.d.ts +1 -0
- package/rpc/index.js +1 -0
- package/ws/index.d.ts +1 -0
- package/ws/index.js +1 -0
- package/adapters/express/package.json +0 -4
- package/adapters/next/package.json +0 -4
- package/adapters/node-http/package.json +0 -4
- package/adapters/standalone/package.json +0 -4
- package/adapters/ws/package.json +0 -4
- package/dist/codes-e0df67c4.cjs.prod.js +0 -60
- package/dist/declarations/src/TRPCError.d.ts.map +0 -1
- package/dist/declarations/src/adapters/express.d.ts.map +0 -1
- package/dist/declarations/src/adapters/next.d.ts.map +0 -1
- package/dist/declarations/src/adapters/node-http/index.d.ts.map +0 -1
- package/dist/declarations/src/adapters/node-http/internals/getPostBody.d.ts.map +0 -1
- package/dist/declarations/src/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +0 -1
- package/dist/declarations/src/adapters/node-http/types.d.ts.map +0 -1
- package/dist/declarations/src/adapters/standalone.d.ts.map +0 -1
- package/dist/declarations/src/adapters/ws.d.ts.map +0 -1
- package/dist/declarations/src/assertNotBrowser.d.ts.map +0 -1
- package/dist/declarations/src/deprecated/LegacyRouter.d.ts.map +0 -1
- package/dist/declarations/src/deprecated/createHttpServer.d.ts.map +0 -1
- package/dist/declarations/src/deprecated/requestHandler.d.ts.map +0 -1
- package/dist/declarations/src/http/ResponseMeta.d.ts.map +0 -1
- package/dist/declarations/src/http/index.d.ts.map +0 -1
- package/dist/declarations/src/http/internals/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/declarations/src/http/internals/types.d.ts.map +0 -1
- package/dist/declarations/src/http/resolveHTTPResponse.d.ts.map +0 -1
- package/dist/declarations/src/index.d.ts.map +0 -1
- package/dist/declarations/src/internals/BaseHandlerOptions.d.ts.map +0 -1
- package/dist/declarations/src/internals/OnErrorFunction.d.ts.map +0 -1
- package/dist/declarations/src/internals/callProcedure.d.ts.map +0 -1
- package/dist/declarations/src/internals/errors.d.ts.map +0 -1
- package/dist/declarations/src/internals/invert.d.ts.map +0 -1
- package/dist/declarations/src/internals/middlewares.d.ts.map +0 -1
- package/dist/declarations/src/internals/procedure.d.ts.map +0 -1
- package/dist/declarations/src/internals/transformTRPCResponse.d.ts.map +0 -1
- package/dist/declarations/src/internals/wrapCallSafe.d.ts.map +0 -1
- package/dist/declarations/src/router.d.ts.map +0 -1
- package/dist/declarations/src/rpc/codes.d.ts.map +0 -1
- package/dist/declarations/src/rpc/envelopes.d.ts.map +0 -1
- package/dist/declarations/src/rpc/index.d.ts.map +0 -1
- package/dist/declarations/src/subscription.d.ts.map +0 -1
- package/dist/declarations/src/transformer.d.ts.map +0 -1
- package/dist/declarations/src/types.d.ts.map +0 -1
- package/dist/declarations/src/ws/index.d.ts.map +0 -1
- package/dist/nodeHTTPRequestHandler-7325b53f.cjs.prod.js +0 -399
- package/dist/subscription-c2e0bfbc.cjs.prod.js +0 -136
- package/dist/transformTRPCResponse-dcbf66c5.cjs.prod.js +0 -114
- package/dist/trpc-server.cjs.d.ts +0 -1
- package/dist/trpc-server.cjs.js +0 -7
- package/dist/trpc-server.cjs.prod.js +0 -528
- package/rpc/package.json +0 -4
- package/ws/package.json +0 -4
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { ProcedureType } from '../router';
|
|
2
|
-
import { MiddlewareFunction } from './middlewares';
|
|
3
|
-
export declare type ProcedureInputParserZodEsque<TInput, TParsedInput> = {
|
|
4
|
-
_input: TInput;
|
|
5
|
-
_output: TParsedInput;
|
|
6
|
-
};
|
|
7
|
-
export declare type ProcedureInputParserMyZodEsque<TInput> = {
|
|
8
|
-
parse: (input: any) => TInput;
|
|
9
|
-
};
|
|
10
|
-
export declare type ProcedureInputParserSuperstructEsque<TInput> = {
|
|
11
|
-
create: (input: unknown) => TInput;
|
|
12
|
-
};
|
|
13
|
-
export declare type ProcedureInputParserCustomValidatorEsque<TInput> = (input: unknown) => TInput | Promise<TInput>;
|
|
14
|
-
export declare type ProcedureInputParserYupEsque<TInput> = {
|
|
15
|
-
validateSync: (input: unknown) => TInput;
|
|
16
|
-
};
|
|
17
|
-
export declare type ProcedureInputParser<TInput> = ProcedureInputParserYupEsque<TInput> | ProcedureInputParserSuperstructEsque<TInput> | ProcedureInputParserCustomValidatorEsque<TInput> | ProcedureInputParserMyZodEsque<TInput>;
|
|
18
|
-
export declare type ProcedureInputParserWithInputOutput<TInput, TParsedInput> = ProcedureInputParserZodEsque<TInput, TParsedInput>;
|
|
19
|
-
export declare type ProcedureResolver<TContext, TParsedInput, TOutput> = (opts: {
|
|
20
|
-
ctx: TContext;
|
|
21
|
-
input: TParsedInput;
|
|
22
|
-
type: ProcedureType;
|
|
23
|
-
}) => Promise<TOutput> | TOutput;
|
|
24
|
-
interface ProcedureOptions<TContext, TParsedInput, TOutput> {
|
|
25
|
-
middlewares: Array<MiddlewareFunction<any, any>>;
|
|
26
|
-
resolver: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
27
|
-
inputParser: ProcedureInputParser<TParsedInput>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
export interface ProcedureCallOptions<TContext> {
|
|
33
|
-
ctx: TContext;
|
|
34
|
-
rawInput: unknown;
|
|
35
|
-
path: string;
|
|
36
|
-
type: ProcedureType;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
|
|
42
|
-
private middlewares;
|
|
43
|
-
private resolver;
|
|
44
|
-
private readonly inputParser;
|
|
45
|
-
private parse;
|
|
46
|
-
constructor(opts: ProcedureOptions<TContext, TParsedInput, TOutput>);
|
|
47
|
-
private parseInput;
|
|
48
|
-
/**
|
|
49
|
-
* Trigger middlewares in order, parse raw input & call resolver
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
call(opts: ProcedureCallOptions<TInputContext>): Promise<TOutput>;
|
|
53
|
-
/**
|
|
54
|
-
* Create new procedure with passed middlewares
|
|
55
|
-
* @param middlewares
|
|
56
|
-
*/
|
|
57
|
-
inheritMiddlewares(middlewares: MiddlewareFunction<TInputContext, TContext>[]): this;
|
|
58
|
-
}
|
|
59
|
-
export declare type CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput> = {
|
|
60
|
-
input: ProcedureInputParser<TInput>;
|
|
61
|
-
resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
62
|
-
};
|
|
63
|
-
export declare type CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput> = {
|
|
64
|
-
input: ProcedureInputParserWithInputOutput<TInput, TParsedInput>;
|
|
65
|
-
resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
66
|
-
};
|
|
67
|
-
export declare type CreateProcedureWithoutInput<TContext, TOutput> = {
|
|
68
|
-
resolve: ProcedureResolver<TContext, undefined, TOutput>;
|
|
69
|
-
};
|
|
70
|
-
export declare type CreateProcedureOptions<TContext, TInput = undefined, TParsedInput = undefined, TOutput = undefined> = CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput> | CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput> | CreateProcedureWithoutInput<TContext, TOutput>;
|
|
71
|
-
export declare function createProcedure<TContext, TInput, TParsedInput, TOutput>(opts: CreateProcedureOptions<TContext, TInput, TParsedInput, TOutput>): Procedure<unknown, TContext, TInput, TParsedInput, TOutput>;
|
|
72
|
-
export declare type inferProcedureFromOptions<TInputContext, TOptions extends CreateProcedureOptions<any, any, any, any>> = TOptions extends CreateProcedureOptions<infer TContext, infer TInput, infer TParsedInput, infer TOutput> ? Procedure<TInputContext, TContext, unknown extends TInput ? undefined : TInput, unknown extends TParsedInput ? undefined : TParsedInput, TOutput> : never;
|
|
73
|
-
export {};
|
|
1
|
+
import { ProcedureType } from '../router';
|
|
2
|
+
import { MiddlewareFunction } from './middlewares';
|
|
3
|
+
export declare type ProcedureInputParserZodEsque<TInput, TParsedInput> = {
|
|
4
|
+
_input: TInput;
|
|
5
|
+
_output: TParsedInput;
|
|
6
|
+
};
|
|
7
|
+
export declare type ProcedureInputParserMyZodEsque<TInput> = {
|
|
8
|
+
parse: (input: any) => TInput;
|
|
9
|
+
};
|
|
10
|
+
export declare type ProcedureInputParserSuperstructEsque<TInput> = {
|
|
11
|
+
create: (input: unknown) => TInput;
|
|
12
|
+
};
|
|
13
|
+
export declare type ProcedureInputParserCustomValidatorEsque<TInput> = (input: unknown) => TInput | Promise<TInput>;
|
|
14
|
+
export declare type ProcedureInputParserYupEsque<TInput> = {
|
|
15
|
+
validateSync: (input: unknown) => TInput;
|
|
16
|
+
};
|
|
17
|
+
export declare type ProcedureInputParser<TInput> = ProcedureInputParserYupEsque<TInput> | ProcedureInputParserSuperstructEsque<TInput> | ProcedureInputParserCustomValidatorEsque<TInput> | ProcedureInputParserMyZodEsque<TInput>;
|
|
18
|
+
export declare type ProcedureInputParserWithInputOutput<TInput, TParsedInput> = ProcedureInputParserZodEsque<TInput, TParsedInput>;
|
|
19
|
+
export declare type ProcedureResolver<TContext, TParsedInput, TOutput> = (opts: {
|
|
20
|
+
ctx: TContext;
|
|
21
|
+
input: TParsedInput;
|
|
22
|
+
type: ProcedureType;
|
|
23
|
+
}) => Promise<TOutput> | TOutput;
|
|
24
|
+
interface ProcedureOptions<TContext, TParsedInput, TOutput> {
|
|
25
|
+
middlewares: Array<MiddlewareFunction<any, any>>;
|
|
26
|
+
resolver: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
27
|
+
inputParser: ProcedureInputParser<TParsedInput>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface ProcedureCallOptions<TContext> {
|
|
33
|
+
ctx: TContext;
|
|
34
|
+
rawInput: unknown;
|
|
35
|
+
path: string;
|
|
36
|
+
type: ProcedureType;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare class Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput> {
|
|
42
|
+
private middlewares;
|
|
43
|
+
private resolver;
|
|
44
|
+
private readonly inputParser;
|
|
45
|
+
private parse;
|
|
46
|
+
constructor(opts: ProcedureOptions<TContext, TParsedInput, TOutput>);
|
|
47
|
+
private parseInput;
|
|
48
|
+
/**
|
|
49
|
+
* Trigger middlewares in order, parse raw input & call resolver
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
call(opts: ProcedureCallOptions<TInputContext>): Promise<TOutput>;
|
|
53
|
+
/**
|
|
54
|
+
* Create new procedure with passed middlewares
|
|
55
|
+
* @param middlewares
|
|
56
|
+
*/
|
|
57
|
+
inheritMiddlewares(middlewares: MiddlewareFunction<TInputContext, TContext>[]): this;
|
|
58
|
+
}
|
|
59
|
+
export declare type CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput> = {
|
|
60
|
+
input: ProcedureInputParser<TInput>;
|
|
61
|
+
resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
62
|
+
};
|
|
63
|
+
export declare type CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput> = {
|
|
64
|
+
input: ProcedureInputParserWithInputOutput<TInput, TParsedInput>;
|
|
65
|
+
resolve: ProcedureResolver<TContext, TParsedInput, TOutput>;
|
|
66
|
+
};
|
|
67
|
+
export declare type CreateProcedureWithoutInput<TContext, TOutput> = {
|
|
68
|
+
resolve: ProcedureResolver<TContext, undefined, TOutput>;
|
|
69
|
+
};
|
|
70
|
+
export declare type CreateProcedureOptions<TContext, TInput = undefined, TParsedInput = undefined, TOutput = undefined> = CreateProcedureWithInput<TContext, TInput, TParsedInput, TOutput> | CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput> | CreateProcedureWithoutInput<TContext, TOutput>;
|
|
71
|
+
export declare function createProcedure<TContext, TInput, TParsedInput, TOutput>(opts: CreateProcedureOptions<TContext, TInput, TParsedInput, TOutput>): Procedure<unknown, TContext, TInput, TParsedInput, TOutput>;
|
|
72
|
+
export declare type inferProcedureFromOptions<TInputContext, TOptions extends CreateProcedureOptions<any, any, any, any>> = TOptions extends CreateProcedureOptions<infer TContext, infer TInput, infer TParsedInput, infer TOutput> ? Procedure<TInputContext, TContext, unknown extends TInput ? undefined : TInput, unknown extends TParsedInput ? undefined : TParsedInput, TOutput> : never;
|
|
73
|
+
export {};
|
|
74
74
|
//# sourceMappingURL=procedure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/internals/procedure.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAoB,MAAM,eAAe,CAAC;AAIrE,oBAAY,4BAA4B,CAAC,MAAM,EAAE,YAAY,IAAI;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,oBAAY,8BAA8B,CAAC,MAAM,IAAI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C1D,CAAC;AAEF,oBAAY,sBAAsB,CAChC,QAAQ,EACR,MAAM,GAAG,SAAS,EAClB,YAAY,GAAG,SAAS,EACxB,OAAO,GAAG,SAAS,IAEjB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,GACjE,oCAAoC,CAClC,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,OAAO,CACR,GACD,2BAA2B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEnD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EACrE,IAAI,EAAE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,GACpE,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAmB7D;AAED,oBAAY,yBAAyB,CACnC,aAAa,EACb,QAAQ,SAAS,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IACzD,QAAQ,SAAS,sBAAsB,CACzC,MAAM,QAAQ,EACd,MAAM,MAAM,EACZ,MAAM,YAAY,EAClB,MAAM,OAAO,CACd,GACG,SAAS,CACP,aAAa,EACb,QAAQ,EACR,OAAO,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EAC3C,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,EACvD,OAAO,CACR,GACD,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyRouter } from '../router';
|
|
2
|
-
import { TRPCResponse } from '../rpc';
|
|
3
|
-
/**
|
|
4
|
-
* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers
|
|
5
|
-
**/
|
|
6
|
-
export declare function transformTRPCResponse<TResponse extends TRPCResponse | TRPCResponse[]>(router: AnyRouter, itemOrItems: TResponse): TRPCResponse<unknown, import("../rpc").TRPCErrorShape<import("../rpc").TRPC_ERROR_CODE_NUMBER, Record<string, unknown>>> | TRPCResponse<unknown, import("../rpc").TRPCErrorShape<import("../rpc").TRPC_ERROR_CODE_NUMBER, Record<string, unknown>>>[];
|
|
1
|
+
import { AnyRouter } from '../router';
|
|
2
|
+
import { TRPCResponse } from '../rpc';
|
|
3
|
+
/**
|
|
4
|
+
* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers
|
|
5
|
+
**/
|
|
6
|
+
export declare function transformTRPCResponse<TResponse extends TRPCResponse | TRPCResponse[]>(router: AnyRouter, itemOrItems: TResponse): TRPCResponse<unknown, import("../rpc").TRPCErrorShape<import("../rpc").TRPC_ERROR_CODE_NUMBER, Record<string, unknown>>> | TRPCResponse<unknown, import("../rpc").TRPCErrorShape<import("../rpc").TRPC_ERROR_CODE_NUMBER, Record<string, unknown>>>[];
|
|
7
7
|
//# sourceMappingURL=transformTRPCResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformTRPCResponse.d.ts","sourceRoot":"","sources":["../../src/internals/transformTRPCResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAwBtC;;IAEI;AACJ,wBAAgB,qBAAqB,CACnC,SAAS,SAAS,YAAY,GAAG,YAAY,EAAE,EAC/C,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,yPAI1C"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
declare type AsyncFn<T> = () => Promise<T> | T;
|
|
2
|
-
/**
|
|
3
|
-
* Wrap a function in a safe wrapper that never throws
|
|
4
|
-
* Returns a discriminated union
|
|
5
|
-
*/
|
|
6
|
-
export declare function wrapCallSafe<T>(fn: AsyncFn<T>): Promise<{
|
|
7
|
-
ok: true;
|
|
8
|
-
data: T;
|
|
9
|
-
error?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
ok: false;
|
|
12
|
-
error: unknown;
|
|
13
|
-
data?: undefined;
|
|
14
|
-
}>;
|
|
15
|
-
export {};
|
|
1
|
+
declare type AsyncFn<T> = () => Promise<T> | T;
|
|
2
|
+
/**
|
|
3
|
+
* Wrap a function in a safe wrapper that never throws
|
|
4
|
+
* Returns a discriminated union
|
|
5
|
+
*/
|
|
6
|
+
export declare function wrapCallSafe<T>(fn: AsyncFn<T>): Promise<{
|
|
7
|
+
ok: true;
|
|
8
|
+
data: T;
|
|
9
|
+
error?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: unknown;
|
|
13
|
+
data?: undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
16
16
|
//# sourceMappingURL=wrapCallSafe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapCallSafe.d.ts","sourceRoot":"","sources":["../../src/internals/wrapCallSafe.ts"],"names":[],"mappings":"AAAA,aAAK,OAAO,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACvC;;;GAGG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;GAanD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URLSearchParams } from 'url';
|
|
2
|
-
import { T as TRPCError, c as callProcedure, g as getErrorFromUnknown, t as transformTRPCResponse } from './transformTRPCResponse-
|
|
3
|
-
import { i as invert, T as TRPC_ERROR_CODES_BY_KEY } from './codes-
|
|
2
|
+
import { T as TRPCError, c as callProcedure, g as getErrorFromUnknown, t as transformTRPCResponse } from './transformTRPCResponse-76e0c91e.mjs';
|
|
3
|
+
import { i as invert, T as TRPC_ERROR_CODES_BY_KEY } from './codes-7a3d4f65.mjs';
|
|
4
4
|
|
|
5
5
|
/* istanbul ignore file */
|
|
6
6
|
function assertNotBrowser() {
|
package/dist/{nodeHTTPRequestHandler-b7ff366e.cjs.dev.js → nodeHTTPRequestHandler-d7c307d3.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var url = require('url');
|
|
4
|
-
var transformTRPCResponse = require('./transformTRPCResponse-
|
|
5
|
-
var codes = require('./codes-
|
|
4
|
+
var transformTRPCResponse = require('./transformTRPCResponse-bd24f548.js');
|
|
5
|
+
var codes = require('./codes-7f46544e.js');
|
|
6
6
|
|
|
7
7
|
/* istanbul ignore file */
|
|
8
8
|
function assertNotBrowser() {
|
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
import { MiddlewareFunction } from './internals/middlewares';
|
|
2
|
-
import { CreateProcedureWithInput, CreateProcedureWithInputOutputParser, CreateProcedureWithoutInput, inferProcedureFromOptions, Procedure } from './internals/procedure';
|
|
3
|
-
import { TRPCErrorShape, TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER } from './rpc';
|
|
4
|
-
import { Subscription } from './subscription';
|
|
5
|
-
import { CombinedDataTransformer, DataTransformerOptions } from './transformer';
|
|
6
|
-
import { TRPCError } from './TRPCError';
|
|
7
|
-
import { flatten, Prefixer, ThenArg } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare type ProcedureType = 'query' | 'mutation' | 'subscription';
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare type ProcedureRecord<TInputContext = any, TContext = any, TInput = any, TParsedInput = any, TOutput = any> = Record<string, Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput>>;
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare type inferProcedureInput<TProcedure extends Procedure<any, any, any, any, any>> = TProcedure extends Procedure<any, any, infer Input, any, any> ? undefined extends Input ? Input | null | void : Input : undefined;
|
|
20
|
-
/**
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export declare type inferAsyncReturnType<TFunction extends (...args: any) => any> = ThenArg<ReturnType<TFunction>>;
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export declare type inferProcedureOutput<TProcedure extends Procedure<any, any, any, any, any>> = inferAsyncReturnType<TProcedure['call']>;
|
|
28
|
-
/**
|
|
29
|
-
* @public
|
|
30
|
-
* @beta
|
|
31
|
-
*/
|
|
32
|
-
export declare type inferSubscriptionOutput<TRouter extends AnyRouter, TPath extends keyof TRouter['_def']['subscriptions']> = ReturnType<inferAsyncReturnType<TRouter['_def']['subscriptions'][TPath]['call']>['output']>;
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
export declare type inferHandlerInput<TProcedure extends Procedure<any, any, any, any, any>> = TProcedure extends Procedure<any, any, infer TInput, any, any> ? undefined extends TInput ? unknown extends TInput ? [(null | undefined)?] : [(TInput | null | undefined)?] : [TInput] : [(undefined | null)?];
|
|
37
|
-
declare type inferHandlerFn<TProcedures extends ProcedureRecord> = <TProcedure extends TProcedures[TPath], TPath extends keyof TProcedures & string>(path: TPath, ...args: inferHandlerInput<TProcedure>) => Promise<inferProcedureOutput<TProcedures[TPath]>>;
|
|
38
|
-
/**
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare type inferRouterContext<TRouter extends AnyRouter> = Parameters<TRouter['createCaller']>[0];
|
|
42
|
-
/**
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
export declare type AnyRouter<TContext = any> = Router<any, TContext, any, any, any, any>;
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
export declare type inferRouterError<TRouter extends AnyRouter> = ReturnType<TRouter['getErrorShape']>;
|
|
50
|
-
/**
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
export declare type ErrorFormatter<TContext, TShape extends TRPCErrorShape<number>> = ({ error, }: {
|
|
54
|
-
error: TRPCError;
|
|
55
|
-
type: ProcedureType | 'unknown';
|
|
56
|
-
path: string | undefined;
|
|
57
|
-
input: unknown;
|
|
58
|
-
ctx: undefined | TContext;
|
|
59
|
-
shape: DefaultErrorShape;
|
|
60
|
-
}) => TShape;
|
|
61
|
-
declare type DefaultErrorData = {
|
|
62
|
-
code: TRPC_ERROR_CODE_KEY;
|
|
63
|
-
httpStatus: number;
|
|
64
|
-
path?: string;
|
|
65
|
-
stack?: string;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export interface DefaultErrorShape extends TRPCErrorShape<TRPC_ERROR_CODE_NUMBER, DefaultErrorData> {
|
|
71
|
-
message: string;
|
|
72
|
-
code: TRPC_ERROR_CODE_NUMBER;
|
|
73
|
-
}
|
|
74
|
-
declare type SwapProcedureContext<TProcedure extends Procedure<any, any, any, any, any>, TNewContext> = TProcedure extends Procedure<infer TInputContext, infer _TOldContext, infer TInput, infer TParsedInput, infer TOutput> ? Procedure<TInputContext, TNewContext, TInput, TParsedInput, TOutput> : never;
|
|
75
|
-
declare type SwapContext<TObj extends ProcedureRecord<any, any, any, any>, TNewContext> = {
|
|
76
|
-
[P in keyof TObj]: SwapProcedureContext<TObj[P], TNewContext>;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* @internal The type signature of this class may change without warning.
|
|
80
|
-
*/
|
|
81
|
-
export declare class Router<TInputContext, TContext, TQueries extends ProcedureRecord<TInputContext, TContext>, TMutations extends ProcedureRecord<TInputContext, TContext>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, Subscription<unknown>>, TErrorShape extends TRPCErrorShape<number>> {
|
|
82
|
-
readonly _def: {
|
|
83
|
-
queries: TQueries;
|
|
84
|
-
mutations: TMutations;
|
|
85
|
-
subscriptions: TSubscriptions;
|
|
86
|
-
middlewares: MiddlewareFunction<TInputContext, TContext>[];
|
|
87
|
-
errorFormatter: ErrorFormatter<TContext, TErrorShape>;
|
|
88
|
-
transformer: CombinedDataTransformer;
|
|
89
|
-
};
|
|
90
|
-
constructor(def?: {
|
|
91
|
-
queries?: TQueries;
|
|
92
|
-
mutations?: TMutations;
|
|
93
|
-
subscriptions?: TSubscriptions;
|
|
94
|
-
middlewares?: MiddlewareFunction<TInputContext, TContext>[];
|
|
95
|
-
errorFormatter?: ErrorFormatter<TContext, TErrorShape>;
|
|
96
|
-
transformer?: CombinedDataTransformer;
|
|
97
|
-
});
|
|
98
|
-
private static prefixProcedures;
|
|
99
|
-
query<TPath extends string, TInput, TParsedInput, TOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
100
|
-
query<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
101
|
-
query<TPath extends string, TOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
102
|
-
mutation<TPath extends string, TInput, TParsedInput, TOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
103
|
-
mutation<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
104
|
-
mutation<TPath extends string, TOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
105
|
-
/**
|
|
106
|
-
* @beta Might change without a major version bump
|
|
107
|
-
*/
|
|
108
|
-
subscription<TPath extends string, TInput, TParsedInput, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
109
|
-
/**
|
|
110
|
-
* @beta Might change without a major version bump
|
|
111
|
-
*/
|
|
112
|
-
subscription<TPath extends string, TInput, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
113
|
-
/**
|
|
114
|
-
* @beta Might change without a major version bump
|
|
115
|
-
*/
|
|
116
|
-
subscription<TPath extends string, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
117
|
-
/**
|
|
118
|
-
* Merge router with other router
|
|
119
|
-
* @param router
|
|
120
|
-
*/
|
|
121
|
-
merge<TChildRouter extends Router<TContext, any, any, any, any, any>>(router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TQueries & TChildRouter['_def']['queries'], TMutations & TChildRouter['_def']['mutations'], TSubscriptions & TChildRouter['_def']['subscriptions'], TErrorShape>;
|
|
122
|
-
/**
|
|
123
|
-
* Merge router with other router
|
|
124
|
-
* @param prefix Prefix that this router should live under
|
|
125
|
-
* @param router
|
|
126
|
-
*/
|
|
127
|
-
merge<TPath extends string, TChildRouter extends Router<TContext, any, any, any, any, any>>(prefix: TPath, router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TQueries & Prefixer<TChildRouter['_def']['queries'], `${TPath}`>, TMutations & Prefixer<TChildRouter['_def']['mutations'], `${TPath}`>, TSubscriptions & Prefixer<TChildRouter['_def']['subscriptions'], `${TPath}`>, TErrorShape>;
|
|
128
|
-
/**
|
|
129
|
-
* Invoke procedure. Only for internal use within library.
|
|
130
|
-
*/
|
|
131
|
-
private call;
|
|
132
|
-
createCaller(ctx: TInputContext): {
|
|
133
|
-
query: inferHandlerFn<TQueries>;
|
|
134
|
-
mutation: inferHandlerFn<TMutations>;
|
|
135
|
-
subscription: inferHandlerFn<TSubscriptions>;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Function to be called before any procedure is invoked
|
|
139
|
-
* @link https://trpc.io/docs/middlewares
|
|
140
|
-
*/
|
|
141
|
-
middleware<TNewContext>(middleware: MiddlewareFunction<TContext, TNewContext>): Router<TInputContext, TNewContext, SwapContext<TQueries, TNewContext>, SwapContext<TMutations, TNewContext>, SwapContext<TSubscriptions, TNewContext>, TErrorShape>;
|
|
142
|
-
/**
|
|
143
|
-
* Format errors
|
|
144
|
-
* @link https://trpc.io/docs/error-formatting
|
|
145
|
-
*/
|
|
146
|
-
formatError<TErrorFormatter extends ErrorFormatter<TContext, TRPCErrorShape<number>>>(errorFormatter: TErrorFormatter): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions, ReturnType<TErrorFormatter>>;
|
|
147
|
-
getErrorShape(opts: {
|
|
148
|
-
error: TRPCError;
|
|
149
|
-
type: ProcedureType | 'unknown';
|
|
150
|
-
path: string | undefined;
|
|
151
|
-
input: unknown;
|
|
152
|
-
ctx: undefined | TContext;
|
|
153
|
-
}): TErrorShape;
|
|
154
|
-
/**
|
|
155
|
-
* Add data transformer to serialize/deserialize input args + output
|
|
156
|
-
* @link https://trpc.io/docs/data-transformers
|
|
157
|
-
*/
|
|
158
|
-
transformer(_transformer: DataTransformerOptions): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions, TErrorShape>;
|
|
159
|
-
/**
|
|
160
|
-
* Flattens the generics of TQueries/TMutations/TSubscriptions.
|
|
161
|
-
* ⚠️ Experimental - might disappear. ⚠️
|
|
162
|
-
*
|
|
163
|
-
* @alpha
|
|
164
|
-
*/
|
|
165
|
-
flat(): Router<TInputContext, TContext, flatten<{}, TQueries>, flatten<{}, TMutations>, flatten<{}, TSubscriptions>, TErrorShape>;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Subclass of `VNextRouter` with `TInputContext` and `TContext` set to the same type, for backcompat.
|
|
169
|
-
*
|
|
170
|
-
* @deprecated
|
|
171
|
-
*/
|
|
172
|
-
export declare class LegacyRouter<TContext, TQueries extends ProcedureRecord<TContext, TContext>, TMutations extends ProcedureRecord<TContext, TContext>, TSubscriptions extends ProcedureRecord<TContext, TContext, unknown, Subscription<unknown>>, TErrorShape extends TRPCErrorShape<number>> extends Router<TContext, TContext, TQueries, TMutations, TSubscriptions, TErrorShape> {
|
|
173
|
-
}
|
|
174
|
-
export declare function router<TContext>(): Router<TContext, TContext, {}, {}, {}, DefaultErrorShape>;
|
|
175
|
-
export {};
|
|
1
|
+
import { MiddlewareFunction } from './internals/middlewares';
|
|
2
|
+
import { CreateProcedureWithInput, CreateProcedureWithInputOutputParser, CreateProcedureWithoutInput, inferProcedureFromOptions, Procedure } from './internals/procedure';
|
|
3
|
+
import { TRPCErrorShape, TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER } from './rpc';
|
|
4
|
+
import { Subscription } from './subscription';
|
|
5
|
+
import { CombinedDataTransformer, DataTransformerOptions } from './transformer';
|
|
6
|
+
import { TRPCError } from './TRPCError';
|
|
7
|
+
import { flatten, Prefixer, ThenArg } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare type ProcedureType = 'query' | 'mutation' | 'subscription';
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare type ProcedureRecord<TInputContext = any, TContext = any, TInput = any, TParsedInput = any, TOutput = any> = Record<string, Procedure<TInputContext, TContext, TInput, TParsedInput, TOutput>>;
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export declare type inferProcedureInput<TProcedure extends Procedure<any, any, any, any, any>> = TProcedure extends Procedure<any, any, infer Input, any, any> ? undefined extends Input ? Input | null | void : Input : undefined;
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare type inferAsyncReturnType<TFunction extends (...args: any) => any> = ThenArg<ReturnType<TFunction>>;
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare type inferProcedureOutput<TProcedure extends Procedure<any, any, any, any, any>> = inferAsyncReturnType<TProcedure['call']>;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
32
|
+
export declare type inferSubscriptionOutput<TRouter extends AnyRouter, TPath extends keyof TRouter['_def']['subscriptions']> = ReturnType<inferAsyncReturnType<TRouter['_def']['subscriptions'][TPath]['call']>['output']>;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare type inferHandlerInput<TProcedure extends Procedure<any, any, any, any, any>> = TProcedure extends Procedure<any, any, infer TInput, any, any> ? undefined extends TInput ? unknown extends TInput ? [(null | undefined)?] : [(TInput | null | undefined)?] : [TInput] : [(undefined | null)?];
|
|
37
|
+
declare type inferHandlerFn<TProcedures extends ProcedureRecord> = <TProcedure extends TProcedures[TPath], TPath extends keyof TProcedures & string>(path: TPath, ...args: inferHandlerInput<TProcedure>) => Promise<inferProcedureOutput<TProcedures[TPath]>>;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare type inferRouterContext<TRouter extends AnyRouter> = Parameters<TRouter['createCaller']>[0];
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare type AnyRouter<TContext = any> = Router<any, TContext, any, any, any, any>;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare type inferRouterError<TRouter extends AnyRouter> = ReturnType<TRouter['getErrorShape']>;
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare type ErrorFormatter<TContext, TShape extends TRPCErrorShape<number>> = ({ error, }: {
|
|
54
|
+
error: TRPCError;
|
|
55
|
+
type: ProcedureType | 'unknown';
|
|
56
|
+
path: string | undefined;
|
|
57
|
+
input: unknown;
|
|
58
|
+
ctx: undefined | TContext;
|
|
59
|
+
shape: DefaultErrorShape;
|
|
60
|
+
}) => TShape;
|
|
61
|
+
declare type DefaultErrorData = {
|
|
62
|
+
code: TRPC_ERROR_CODE_KEY;
|
|
63
|
+
httpStatus: number;
|
|
64
|
+
path?: string;
|
|
65
|
+
stack?: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export interface DefaultErrorShape extends TRPCErrorShape<TRPC_ERROR_CODE_NUMBER, DefaultErrorData> {
|
|
71
|
+
message: string;
|
|
72
|
+
code: TRPC_ERROR_CODE_NUMBER;
|
|
73
|
+
}
|
|
74
|
+
declare type SwapProcedureContext<TProcedure extends Procedure<any, any, any, any, any>, TNewContext> = TProcedure extends Procedure<infer TInputContext, infer _TOldContext, infer TInput, infer TParsedInput, infer TOutput> ? Procedure<TInputContext, TNewContext, TInput, TParsedInput, TOutput> : never;
|
|
75
|
+
declare type SwapContext<TObj extends ProcedureRecord<any, any, any, any>, TNewContext> = {
|
|
76
|
+
[P in keyof TObj]: SwapProcedureContext<TObj[P], TNewContext>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* @internal The type signature of this class may change without warning.
|
|
80
|
+
*/
|
|
81
|
+
export declare class Router<TInputContext, TContext, TQueries extends ProcedureRecord<TInputContext, TContext>, TMutations extends ProcedureRecord<TInputContext, TContext>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, Subscription<unknown>>, TErrorShape extends TRPCErrorShape<number>> {
|
|
82
|
+
readonly _def: {
|
|
83
|
+
queries: TQueries;
|
|
84
|
+
mutations: TMutations;
|
|
85
|
+
subscriptions: TSubscriptions;
|
|
86
|
+
middlewares: MiddlewareFunction<TInputContext, TContext>[];
|
|
87
|
+
errorFormatter: ErrorFormatter<TContext, TErrorShape>;
|
|
88
|
+
transformer: CombinedDataTransformer;
|
|
89
|
+
};
|
|
90
|
+
constructor(def?: {
|
|
91
|
+
queries?: TQueries;
|
|
92
|
+
mutations?: TMutations;
|
|
93
|
+
subscriptions?: TSubscriptions;
|
|
94
|
+
middlewares?: MiddlewareFunction<TInputContext, TContext>[];
|
|
95
|
+
errorFormatter?: ErrorFormatter<TContext, TErrorShape>;
|
|
96
|
+
transformer?: CombinedDataTransformer;
|
|
97
|
+
});
|
|
98
|
+
private static prefixProcedures;
|
|
99
|
+
query<TPath extends string, TInput, TParsedInput, TOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
100
|
+
query<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
101
|
+
query<TPath extends string, TOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
102
|
+
mutation<TPath extends string, TInput, TParsedInput, TOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
103
|
+
mutation<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
104
|
+
mutation<TPath extends string, TOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
105
|
+
/**
|
|
106
|
+
* @beta Might change without a major version bump
|
|
107
|
+
*/
|
|
108
|
+
subscription<TPath extends string, TInput, TParsedInput, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TInput, TParsedInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
109
|
+
/**
|
|
110
|
+
* @beta Might change without a major version bump
|
|
111
|
+
*/
|
|
112
|
+
subscription<TPath extends string, TInput, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithInput<TContext, TInput, TInput, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
113
|
+
/**
|
|
114
|
+
* @beta Might change without a major version bump
|
|
115
|
+
*/
|
|
116
|
+
subscription<TPath extends string, TOutput extends Subscription<unknown>>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TOutput>): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
117
|
+
/**
|
|
118
|
+
* Merge router with other router
|
|
119
|
+
* @param router
|
|
120
|
+
*/
|
|
121
|
+
merge<TChildRouter extends Router<TContext, any, any, any, any, any>>(router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TQueries & TChildRouter['_def']['queries'], TMutations & TChildRouter['_def']['mutations'], TSubscriptions & TChildRouter['_def']['subscriptions'], TErrorShape>;
|
|
122
|
+
/**
|
|
123
|
+
* Merge router with other router
|
|
124
|
+
* @param prefix Prefix that this router should live under
|
|
125
|
+
* @param router
|
|
126
|
+
*/
|
|
127
|
+
merge<TPath extends string, TChildRouter extends Router<TContext, any, any, any, any, any>>(prefix: TPath, router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TQueries & Prefixer<TChildRouter['_def']['queries'], `${TPath}`>, TMutations & Prefixer<TChildRouter['_def']['mutations'], `${TPath}`>, TSubscriptions & Prefixer<TChildRouter['_def']['subscriptions'], `${TPath}`>, TErrorShape>;
|
|
128
|
+
/**
|
|
129
|
+
* Invoke procedure. Only for internal use within library.
|
|
130
|
+
*/
|
|
131
|
+
private call;
|
|
132
|
+
createCaller(ctx: TInputContext): {
|
|
133
|
+
query: inferHandlerFn<TQueries>;
|
|
134
|
+
mutation: inferHandlerFn<TMutations>;
|
|
135
|
+
subscription: inferHandlerFn<TSubscriptions>;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Function to be called before any procedure is invoked
|
|
139
|
+
* @link https://trpc.io/docs/middlewares
|
|
140
|
+
*/
|
|
141
|
+
middleware<TNewContext>(middleware: MiddlewareFunction<TContext, TNewContext>): Router<TInputContext, TNewContext, SwapContext<TQueries, TNewContext>, SwapContext<TMutations, TNewContext>, SwapContext<TSubscriptions, TNewContext>, TErrorShape>;
|
|
142
|
+
/**
|
|
143
|
+
* Format errors
|
|
144
|
+
* @link https://trpc.io/docs/error-formatting
|
|
145
|
+
*/
|
|
146
|
+
formatError<TErrorFormatter extends ErrorFormatter<TContext, TRPCErrorShape<number>>>(errorFormatter: TErrorFormatter): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions, ReturnType<TErrorFormatter>>;
|
|
147
|
+
getErrorShape(opts: {
|
|
148
|
+
error: TRPCError;
|
|
149
|
+
type: ProcedureType | 'unknown';
|
|
150
|
+
path: string | undefined;
|
|
151
|
+
input: unknown;
|
|
152
|
+
ctx: undefined | TContext;
|
|
153
|
+
}): TErrorShape;
|
|
154
|
+
/**
|
|
155
|
+
* Add data transformer to serialize/deserialize input args + output
|
|
156
|
+
* @link https://trpc.io/docs/data-transformers
|
|
157
|
+
*/
|
|
158
|
+
transformer(_transformer: DataTransformerOptions): Router<TInputContext, TContext, TQueries, TMutations, TSubscriptions, TErrorShape>;
|
|
159
|
+
/**
|
|
160
|
+
* Flattens the generics of TQueries/TMutations/TSubscriptions.
|
|
161
|
+
* ⚠️ Experimental - might disappear. ⚠️
|
|
162
|
+
*
|
|
163
|
+
* @alpha
|
|
164
|
+
*/
|
|
165
|
+
flat(): Router<TInputContext, TContext, flatten<{}, TQueries>, flatten<{}, TMutations>, flatten<{}, TSubscriptions>, TErrorShape>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Subclass of `VNextRouter` with `TInputContext` and `TContext` set to the same type, for backcompat.
|
|
169
|
+
*
|
|
170
|
+
* @deprecated
|
|
171
|
+
*/
|
|
172
|
+
export declare class LegacyRouter<TContext, TQueries extends ProcedureRecord<TContext, TContext>, TMutations extends ProcedureRecord<TContext, TContext>, TSubscriptions extends ProcedureRecord<TContext, TContext, unknown, Subscription<unknown>>, TErrorShape extends TRPCErrorShape<number>> extends Router<TContext, TContext, TQueries, TMutations, TSubscriptions, TErrorShape> {
|
|
173
|
+
}
|
|
174
|
+
export declare function router<TContext>(): Router<TContext, TContext, {}, {}, {}, DefaultErrorShape>;
|
|
175
|
+
export {};
|
|
176
176
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAGL,wBAAwB,EACxB,oCAAoC,EACpC,2BAA2B,EAC3B,yBAAyB,EACzB,SAAS,EAEV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EAEd,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIrD;;GAEG;AACH,oBAAY,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;AAElE;;GAEG;AACH,oBAAY,eAAe,CACzB,aAAa,GAAG,GAAG,EACnB,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,GAAG,EACZ,YAAY,GAAG,GAAG,EAClB,OAAO,GAAG,GAAG,IACX,MAAM,CACR,MAAM,EACN,SAAS,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAClE,CAAC;AAEF;;GAEG;AACH,oBAAY,mBAAmB,CAC7B,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IACnD,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,GAC7D,SAAS,SAAS,KAAK,GACrB,KAAK,GAAG,I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