@trpc/server 11.0.0-alpha-tmp-workflow-merge.250 → 11.0.0-alpha-tmp-01-26-rootconfigtypes.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@trpc/server/http.d.ts +7 -0
- package/dist/@trpc/server/http.d.ts.map +1 -0
- package/dist/{@trpc-server.d.ts → @trpc/server/index.d.ts} +4 -8
- package/dist/@trpc/server/index.d.ts.map +1 -0
- package/dist/@trpc/server/rpc.d.ts +3 -0
- package/dist/@trpc/server/rpc.d.ts.map +1 -0
- package/dist/adapters/aws-lambda/index.d.ts +1 -2
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +6 -5
- package/dist/adapters/aws-lambda/index.mjs +4 -3
- package/dist/adapters/aws-lambda/utils.d.ts +2 -3
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.js +5 -4
- package/dist/adapters/aws-lambda/utils.mjs +3 -2
- package/dist/adapters/express.d.ts +1 -2
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +6 -3
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +4 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -2
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +6 -4
- package/dist/adapters/fetch/fetchRequestHandler.mjs +4 -2
- package/dist/adapters/fetch/types.d.ts +2 -3
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/next.d.ts +4 -2
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +6 -4
- package/dist/adapters/next.mjs +4 -2
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +3 -5
- package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.js +4 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.mjs +3 -1
- package/dist/adapters/node-http/content-type/json/index.js +4 -2
- package/dist/adapters/node-http/content-type/json/index.mjs +3 -1
- package/dist/adapters/node-http/internals/contentType.d.ts +2 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +6 -4
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +4 -2
- package/dist/adapters/node-http/types.d.ts +3 -4
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +1 -2
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +1 -0
- package/dist/adapters/standalone.mjs +1 -0
- package/dist/adapters/ws.d.ts +3 -3
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +30 -25
- package/dist/adapters/ws.mjs +8 -3
- package/dist/bundle-analysis.json +434 -92
- package/dist/http.d.ts +1 -1
- package/dist/http.js +11 -7
- package/dist/http.mjs +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -41
- package/dist/index.mjs +9 -1
- package/dist/observable/index.d.ts +5 -0
- package/dist/observable/index.d.ts.map +1 -0
- package/dist/observable/index.js +13 -0
- package/dist/observable/index.mjs +2 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/observable.d.ts.map +1 -0
- package/dist/observable/observable.js +126 -0
- package/dist/observable/observable.mjs +122 -0
- package/dist/observable/operators.d.ts +8 -0
- package/dist/observable/operators.d.ts.map +1 -0
- package/dist/observable/operators.js +103 -0
- package/dist/observable/operators.mjs +99 -0
- package/dist/observable/types.d.ts +26 -0
- package/dist/observable/types.d.ts.map +1 -0
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +6 -7
- package/dist/rpc.mjs +3 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +6 -9
- package/dist/shared.mjs +4 -1
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +6 -0
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts +19 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.js +52 -0
- package/dist/unstable-core-do-not-import/createProxy.mjs +49 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +13 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.js +67 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +63 -0
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +33 -0
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/formatter.js +7 -0
- package/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +15 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +31 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +24 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +32 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +30 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +29 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/contentType.js +54 -0
- package/dist/unstable-core-do-not-import/http/contentType.mjs +52 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +5 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +51 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +48 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts +7 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +51 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +295 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +293 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts +96 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.d.ts +38 -0
- package/dist/unstable-core-do-not-import/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.js +52 -0
- package/dist/unstable-core-do-not-import/index.mjs +17 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +87 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/initTRPC.js +86 -0
- package/dist/unstable-core-do-not-import/initTRPC.mjs +84 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts +105 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/middleware.js +95 -0
- package/dist/unstable-core-do-not-import/middleware.mjs +89 -0
- package/dist/unstable-core-do-not-import/parser.d.ts +30 -0
- package/dist/unstable-core-do-not-import/parser.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/parser.js +37 -0
- package/dist/unstable-core-do-not-import/parser.mjs +35 -0
- package/dist/unstable-core-do-not-import/procedure.d.ts +66 -0
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedure.js +9 -0
- package/dist/unstable-core-do-not-import/procedure.mjs +7 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +100 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.js +176 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +173 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +70 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rootConfig.js +8 -0
- package/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
- package/dist/unstable-core-do-not-import/router.d.ts +85 -0
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/router.js +156 -0
- package/dist/unstable-core-do-not-import/router.mjs +151 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +51 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/codes.js +38 -0
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +35 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +97 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +5 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +5 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +59 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +57 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts +62 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts +101 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.js +106 -0
- package/dist/unstable-core-do-not-import/transformer.mjs +101 -0
- package/dist/unstable-core-do-not-import/types.d.ts +103 -0
- package/dist/unstable-core-do-not-import/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.d.ts +27 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.js +44 -0
- package/dist/unstable-core-do-not-import/utils.mjs +39 -0
- package/package.json +12 -9
- package/src/@trpc/server/http.ts +26 -0
- package/src/{@trpc-server.ts → @trpc/server/index.ts} +4 -8
- package/src/@trpc/server/rpc.ts +26 -0
- package/src/adapters/aws-lambda/index.ts +4 -5
- package/src/adapters/aws-lambda/utils.ts +3 -4
- package/src/adapters/express.ts +1 -3
- package/src/adapters/fastify/fastifyRequestHandler.ts +6 -4
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -2
- package/src/adapters/fetch/fetchRequestHandler.ts +6 -4
- package/src/adapters/fetch/types.ts +2 -3
- package/src/adapters/next.ts +6 -3
- package/src/adapters/node-http/content-type/form-data/index.ts +10 -10
- package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -2
- package/src/adapters/node-http/content-type/json/index.ts +1 -1
- package/src/adapters/node-http/internals/contentType.ts +2 -2
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +6 -4
- package/src/adapters/node-http/types.ts +4 -5
- package/src/adapters/standalone.ts +2 -2
- package/src/adapters/ws.ts +15 -14
- package/src/http.ts +1 -1
- package/src/index.ts +1 -1
- package/src/observable/index.ts +10 -0
- package/src/observable/observable.ts +158 -0
- package/src/observable/operators.ts +119 -0
- package/src/observable/types.ts +76 -0
- package/src/rpc.ts +1 -2
- package/src/shared.ts +1 -1
- package/src/unstable-core-do-not-import/TRPCInferrable.ts +13 -0
- package/src/unstable-core-do-not-import/createProxy.ts +59 -0
- package/src/unstable-core-do-not-import/error/TRPCError.ts +82 -0
- package/src/unstable-core-do-not-import/error/formatter.ts +51 -0
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +36 -0
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +29 -0
- package/src/unstable-core-do-not-import/http/contentType.ts +99 -0
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +57 -0
- package/src/unstable-core-do-not-import/http/index.ts +23 -0
- package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +458 -0
- package/src/unstable-core-do-not-import/http/types.ts +111 -0
- package/src/unstable-core-do-not-import/index.ts +109 -0
- package/src/unstable-core-do-not-import/initTRPC.ts +159 -0
- package/src/unstable-core-do-not-import/middleware.ts +237 -0
- package/src/unstable-core-do-not-import/parser.ts +94 -0
- package/src/unstable-core-do-not-import/procedure.ts +95 -0
- package/src/unstable-core-do-not-import/procedureBuilder.ts +462 -0
- package/src/unstable-core-do-not-import/rootConfig.ts +82 -0
- package/src/unstable-core-do-not-import/router.ts +364 -0
- package/src/unstable-core-do-not-import/rpc/codes.ts +44 -0
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +136 -0
- package/src/unstable-core-do-not-import/rpc/index.ts +21 -0
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +85 -0
- package/src/unstable-core-do-not-import/serialize.ts +122 -0
- package/src/unstable-core-do-not-import/transformer.ts +194 -0
- package/src/unstable-core-do-not-import/types.ts +156 -0
- package/src/unstable-core-do-not-import/utils.ts +59 -0
- package/unstable-core-do-not-import/index.d.ts +1 -0
- package/unstable-core-do-not-import/index.js +1 -0
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts +0 -9
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +0 -1
- package/dist/@trpc-server/http.d.ts +0 -2
- package/dist/@trpc-server/http.d.ts.map +0 -1
- package/dist/@trpc-server.d.ts.map +0 -1
- package/dist/observable.d.ts +0 -2
- package/dist/observable.d.ts.map +0 -1
- package/dist/observable.js +0 -12
- package/dist/observable.mjs +0 -1
- package/src/@trpc-core-unstable-do-not-import-this-please.ts +0 -9
- package/src/@trpc-server/http.ts +0 -2
- package/src/observable.ts +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { AnyMiddlewareFunction, MiddlewareBuilder, MiddlewareFunction } from './middleware';
|
|
2
|
+
import type { inferParser, Parser } from './parser';
|
|
3
|
+
import type { MutationProcedure, ProcedureType, QueryProcedure, SubscriptionProcedure } from './procedure';
|
|
4
|
+
import type { GetRawInputFn, MaybePromise, Overwrite, Simplify, TypeError } from './types';
|
|
5
|
+
type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : Simplify<TType & TWith>;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const unsetMarker: unique symbol;
|
|
8
|
+
type UnsetMarker = typeof unsetMarker;
|
|
9
|
+
type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
|
|
10
|
+
type ProcedureBuilderDef<TMeta> = {
|
|
11
|
+
procedure: true;
|
|
12
|
+
inputs: Parser[];
|
|
13
|
+
output?: Parser;
|
|
14
|
+
meta?: TMeta;
|
|
15
|
+
resolver?: ProcedureBuilderResolver;
|
|
16
|
+
middlewares: AnyMiddlewareFunction[];
|
|
17
|
+
mutation?: boolean;
|
|
18
|
+
query?: boolean;
|
|
19
|
+
subscription?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type AnyProcedureBuilderDef = ProcedureBuilderDef<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Procedure resolver options
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
interface ResolverOptions<TContext, _TMeta, TContextOverridesIn, TInputOut> {
|
|
27
|
+
ctx: Simplify<Overwrite<TContext, TContextOverridesIn>>;
|
|
28
|
+
input: TInputOut extends UnsetMarker ? undefined : TInputOut;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A procedure resolver
|
|
32
|
+
*/
|
|
33
|
+
type ProcedureResolver<TContext, _TMeta, TContextOverrides, TInputOut, TOutputIn, TOutputOut> = (opts: {
|
|
34
|
+
ctx: Simplify<Overwrite<TContext, TContextOverrides>>;
|
|
35
|
+
input: TInputOut extends UnsetMarker ? undefined : TInputOut;
|
|
36
|
+
}) => MaybePromise<DefaultValue<TOutputIn, TOutputOut>>;
|
|
37
|
+
export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut> {
|
|
38
|
+
/**
|
|
39
|
+
* Add an input parser to the procedure.
|
|
40
|
+
* @link https://trpc.io/docs/v11/server/validators
|
|
41
|
+
*/
|
|
42
|
+
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>;
|
|
43
|
+
/**
|
|
44
|
+
* Add an output parser to the procedure.
|
|
45
|
+
* @link https://trpc.io/docs/v11/server/validators
|
|
46
|
+
*/
|
|
47
|
+
output<$Parser extends Parser>(schema: $Parser): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, IntersectIfDefined<TOutputIn, inferParser<$Parser>['in']>, IntersectIfDefined<TOutputOut, inferParser<$Parser>['out']>>;
|
|
48
|
+
/**
|
|
49
|
+
* Add a meta data to the procedure.
|
|
50
|
+
* @link https://trpc.io/docs/v11/server/metadata
|
|
51
|
+
*/
|
|
52
|
+
meta(meta: TMeta): ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn, TInputOut, TOutputIn, TOutputOut>;
|
|
53
|
+
/**
|
|
54
|
+
* Add a middleware to the procedure.
|
|
55
|
+
* @link https://trpc.io/docs/v11/server/middlewares
|
|
56
|
+
*/
|
|
57
|
+
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>;
|
|
58
|
+
/**
|
|
59
|
+
* Query procedure
|
|
60
|
+
* @link https://trpc.io/docs/v11/concepts#vocabulary
|
|
61
|
+
*/
|
|
62
|
+
query<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): QueryProcedure<{
|
|
63
|
+
input: DefaultValue<TInputIn, void>;
|
|
64
|
+
output: DefaultValue<TOutputOut, $Output>;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Mutation procedure
|
|
68
|
+
* @link https://trpc.io/docs/v11/concepts#vocabulary
|
|
69
|
+
*/
|
|
70
|
+
mutation<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): MutationProcedure<{
|
|
71
|
+
input: DefaultValue<TInputIn, void>;
|
|
72
|
+
output: DefaultValue<TOutputOut, $Output>;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Subscription procedure
|
|
76
|
+
* @link https://trpc.io/docs/v11/concepts#vocabulary
|
|
77
|
+
*/
|
|
78
|
+
subscription<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): SubscriptionProcedure<{
|
|
79
|
+
input: DefaultValue<TInputIn, void>;
|
|
80
|
+
output: DefaultValue<TOutputOut, $Output>;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
_def: ProcedureBuilderDef<TMeta>;
|
|
86
|
+
}
|
|
87
|
+
type ProcedureBuilderResolver = (opts: ResolverOptions<any, any, any, any>) => Promise<unknown>;
|
|
88
|
+
export declare function createBuilder<TContext, TMeta>(initDef?: Partial<AnyProcedureBuilderDef>): ProcedureBuilder<TContext, TMeta, object, UnsetMarker, UnsetMarker, UnsetMarker, UnsetMarker>;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export interface ProcedureCallOptions {
|
|
93
|
+
ctx: unknown;
|
|
94
|
+
getRawInput: GetRawInputFn;
|
|
95
|
+
input?: unknown;
|
|
96
|
+
path: string;
|
|
97
|
+
type: ProcedureType;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=procedureBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedureBuilder.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedureBuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAKV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACV,MAAM,SAAS,CAAC;AAGjB,K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,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,OAAO,CACR,GACA,qBAAqB,CAAC;QACvB,KAAK,EAAE,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpC,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CAClC;AAGD,KAAK,wBAAwB,GAAG,CAC9B,IAAI,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KACtC,OAAO,CAAC,OAAO,CAAC,CAAC;AAiBtB,wBAAgB,aAAa,CAAC,QAAQ,EAAE,KAAK,EAC3C,OAAO,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC5C,gBAAgB,CACjB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,CACZ,CAuEA;AAwBD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACrB"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var TRPCError = require('./error/TRPCError.js');
|
|
4
|
+
var middleware = require('./middleware.js');
|
|
5
|
+
var parser = require('./parser.js');
|
|
6
|
+
var utils = require('./utils.js');
|
|
7
|
+
|
|
8
|
+
/** @internal */ const unsetMarker = Symbol('unsetMarker');
|
|
9
|
+
function createNewBuilder(def1, def2) {
|
|
10
|
+
const { middlewares =[] , inputs , meta , ...rest } = def2;
|
|
11
|
+
// TODO: maybe have a fn here to warn about calls
|
|
12
|
+
return createBuilder({
|
|
13
|
+
...utils.mergeWithoutOverrides(def1, rest),
|
|
14
|
+
inputs: [
|
|
15
|
+
...def1.inputs,
|
|
16
|
+
...inputs ?? []
|
|
17
|
+
],
|
|
18
|
+
middlewares: [
|
|
19
|
+
...def1.middlewares,
|
|
20
|
+
...middlewares
|
|
21
|
+
],
|
|
22
|
+
meta: def1.meta && meta ? {
|
|
23
|
+
...def1.meta,
|
|
24
|
+
...meta
|
|
25
|
+
} : meta ?? def1.meta
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function createBuilder(initDef = {}) {
|
|
29
|
+
const _def = {
|
|
30
|
+
procedure: true,
|
|
31
|
+
inputs: [],
|
|
32
|
+
middlewares: [],
|
|
33
|
+
...initDef
|
|
34
|
+
};
|
|
35
|
+
const builder = {
|
|
36
|
+
_def,
|
|
37
|
+
input (input) {
|
|
38
|
+
const parser$1 = parser.getParseFn(input);
|
|
39
|
+
return createNewBuilder(_def, {
|
|
40
|
+
inputs: [
|
|
41
|
+
input
|
|
42
|
+
],
|
|
43
|
+
middlewares: [
|
|
44
|
+
middleware.createInputMiddleware(parser$1)
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
output (output) {
|
|
49
|
+
const parser$1 = parser.getParseFn(output);
|
|
50
|
+
return createNewBuilder(_def, {
|
|
51
|
+
output,
|
|
52
|
+
middlewares: [
|
|
53
|
+
middleware.createOutputMiddleware(parser$1)
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
meta (meta) {
|
|
58
|
+
return createNewBuilder(_def, {
|
|
59
|
+
meta
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
use (middlewareBuilderOrFn) {
|
|
63
|
+
// Distinguish between a middleware builder and a middleware function
|
|
64
|
+
const middlewares = '_middlewares' in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [
|
|
65
|
+
middlewareBuilderOrFn
|
|
66
|
+
];
|
|
67
|
+
return createNewBuilder(_def, {
|
|
68
|
+
middlewares: middlewares
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
query (resolver) {
|
|
72
|
+
return createResolver({
|
|
73
|
+
..._def,
|
|
74
|
+
type: 'query'
|
|
75
|
+
}, resolver);
|
|
76
|
+
},
|
|
77
|
+
mutation (resolver) {
|
|
78
|
+
return createResolver({
|
|
79
|
+
..._def,
|
|
80
|
+
type: 'mutation'
|
|
81
|
+
}, resolver);
|
|
82
|
+
},
|
|
83
|
+
subscription (resolver) {
|
|
84
|
+
return createResolver({
|
|
85
|
+
..._def,
|
|
86
|
+
type: 'subscription'
|
|
87
|
+
}, resolver);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return builder;
|
|
91
|
+
}
|
|
92
|
+
function createResolver(_def, resolver) {
|
|
93
|
+
const finalBuilder = createNewBuilder(_def, {
|
|
94
|
+
resolver,
|
|
95
|
+
middlewares: [
|
|
96
|
+
async function resolveMiddleware(opts) {
|
|
97
|
+
const data = await resolver(opts);
|
|
98
|
+
return {
|
|
99
|
+
marker: middleware.middlewareMarker,
|
|
100
|
+
ok: true,
|
|
101
|
+
data,
|
|
102
|
+
ctx: opts.ctx
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
return createProcedureCaller(finalBuilder._def);
|
|
108
|
+
}
|
|
109
|
+
const codeblock = `
|
|
110
|
+
This is a client-only function.
|
|
111
|
+
If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
|
|
112
|
+
`.trim();
|
|
113
|
+
function createProcedureCaller(_def) {
|
|
114
|
+
async function procedure(opts) {
|
|
115
|
+
// is direct server-side call
|
|
116
|
+
if (!opts || !('getRawInput' in opts)) {
|
|
117
|
+
throw new Error(codeblock);
|
|
118
|
+
}
|
|
119
|
+
// run the middlewares recursively with the resolver as the last one
|
|
120
|
+
async function callRecursive(callOpts = {
|
|
121
|
+
index: 0,
|
|
122
|
+
ctx: opts.ctx
|
|
123
|
+
}) {
|
|
124
|
+
try {
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
126
|
+
const middleware = _def.middlewares[callOpts.index];
|
|
127
|
+
const result = await middleware({
|
|
128
|
+
ctx: callOpts.ctx,
|
|
129
|
+
type: opts.type,
|
|
130
|
+
path: opts.path,
|
|
131
|
+
getRawInput: callOpts.getRawInput ?? opts.getRawInput,
|
|
132
|
+
meta: _def.meta,
|
|
133
|
+
input: callOpts.input,
|
|
134
|
+
next (_nextOpts) {
|
|
135
|
+
const nextOpts = _nextOpts;
|
|
136
|
+
return callRecursive({
|
|
137
|
+
index: callOpts.index + 1,
|
|
138
|
+
ctx: nextOpts && 'ctx' in nextOpts ? {
|
|
139
|
+
...callOpts.ctx,
|
|
140
|
+
...nextOpts.ctx
|
|
141
|
+
} : callOpts.ctx,
|
|
142
|
+
input: nextOpts && 'input' in nextOpts ? nextOpts.input : callOpts.input,
|
|
143
|
+
getRawInput: nextOpts && 'getRawInput' in nextOpts ? nextOpts.getRawInput : callOpts.getRawInput
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return result;
|
|
148
|
+
} catch (cause) {
|
|
149
|
+
return {
|
|
150
|
+
ok: false,
|
|
151
|
+
error: TRPCError.getTRPCErrorFromUnknown(cause),
|
|
152
|
+
marker: middleware.middlewareMarker
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// there's always at least one "next" since we wrap this.resolver in a middleware
|
|
157
|
+
const result = await callRecursive();
|
|
158
|
+
if (!result) {
|
|
159
|
+
throw new TRPCError.TRPCError({
|
|
160
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
161
|
+
message: 'No result from middlewares - did you forget to `return next()`?'
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (!result.ok) {
|
|
165
|
+
// re-throw original error
|
|
166
|
+
throw result.error;
|
|
167
|
+
}
|
|
168
|
+
return result.data;
|
|
169
|
+
}
|
|
170
|
+
procedure._def = _def;
|
|
171
|
+
// FIXME typecast shouldn't be needed - fixittt
|
|
172
|
+
return procedure;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
exports.createBuilder = createBuilder;
|
|
176
|
+
exports.unsetMarker = unsetMarker;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { TRPCError, getTRPCErrorFromUnknown } from './error/TRPCError.mjs';
|
|
2
|
+
import { createInputMiddleware, createOutputMiddleware, middlewareMarker } from './middleware.mjs';
|
|
3
|
+
import { getParseFn } from './parser.mjs';
|
|
4
|
+
import { mergeWithoutOverrides } from './utils.mjs';
|
|
5
|
+
|
|
6
|
+
/** @internal */ const unsetMarker = Symbol('unsetMarker');
|
|
7
|
+
function createNewBuilder(def1, def2) {
|
|
8
|
+
const { middlewares =[] , inputs , meta , ...rest } = def2;
|
|
9
|
+
// TODO: maybe have a fn here to warn about calls
|
|
10
|
+
return createBuilder({
|
|
11
|
+
...mergeWithoutOverrides(def1, rest),
|
|
12
|
+
inputs: [
|
|
13
|
+
...def1.inputs,
|
|
14
|
+
...inputs ?? []
|
|
15
|
+
],
|
|
16
|
+
middlewares: [
|
|
17
|
+
...def1.middlewares,
|
|
18
|
+
...middlewares
|
|
19
|
+
],
|
|
20
|
+
meta: def1.meta && meta ? {
|
|
21
|
+
...def1.meta,
|
|
22
|
+
...meta
|
|
23
|
+
} : meta ?? def1.meta
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function createBuilder(initDef = {}) {
|
|
27
|
+
const _def = {
|
|
28
|
+
procedure: true,
|
|
29
|
+
inputs: [],
|
|
30
|
+
middlewares: [],
|
|
31
|
+
...initDef
|
|
32
|
+
};
|
|
33
|
+
const builder = {
|
|
34
|
+
_def,
|
|
35
|
+
input (input) {
|
|
36
|
+
const parser = getParseFn(input);
|
|
37
|
+
return createNewBuilder(_def, {
|
|
38
|
+
inputs: [
|
|
39
|
+
input
|
|
40
|
+
],
|
|
41
|
+
middlewares: [
|
|
42
|
+
createInputMiddleware(parser)
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
output (output) {
|
|
47
|
+
const parser = getParseFn(output);
|
|
48
|
+
return createNewBuilder(_def, {
|
|
49
|
+
output,
|
|
50
|
+
middlewares: [
|
|
51
|
+
createOutputMiddleware(parser)
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
meta (meta) {
|
|
56
|
+
return createNewBuilder(_def, {
|
|
57
|
+
meta
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
use (middlewareBuilderOrFn) {
|
|
61
|
+
// Distinguish between a middleware builder and a middleware function
|
|
62
|
+
const middlewares = '_middlewares' in middlewareBuilderOrFn ? middlewareBuilderOrFn._middlewares : [
|
|
63
|
+
middlewareBuilderOrFn
|
|
64
|
+
];
|
|
65
|
+
return createNewBuilder(_def, {
|
|
66
|
+
middlewares: middlewares
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
query (resolver) {
|
|
70
|
+
return createResolver({
|
|
71
|
+
..._def,
|
|
72
|
+
type: 'query'
|
|
73
|
+
}, resolver);
|
|
74
|
+
},
|
|
75
|
+
mutation (resolver) {
|
|
76
|
+
return createResolver({
|
|
77
|
+
..._def,
|
|
78
|
+
type: 'mutation'
|
|
79
|
+
}, resolver);
|
|
80
|
+
},
|
|
81
|
+
subscription (resolver) {
|
|
82
|
+
return createResolver({
|
|
83
|
+
..._def,
|
|
84
|
+
type: 'subscription'
|
|
85
|
+
}, resolver);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return builder;
|
|
89
|
+
}
|
|
90
|
+
function createResolver(_def, resolver) {
|
|
91
|
+
const finalBuilder = createNewBuilder(_def, {
|
|
92
|
+
resolver,
|
|
93
|
+
middlewares: [
|
|
94
|
+
async function resolveMiddleware(opts) {
|
|
95
|
+
const data = await resolver(opts);
|
|
96
|
+
return {
|
|
97
|
+
marker: middlewareMarker,
|
|
98
|
+
ok: true,
|
|
99
|
+
data,
|
|
100
|
+
ctx: opts.ctx
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
return createProcedureCaller(finalBuilder._def);
|
|
106
|
+
}
|
|
107
|
+
const codeblock = `
|
|
108
|
+
This is a client-only function.
|
|
109
|
+
If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
|
|
110
|
+
`.trim();
|
|
111
|
+
function createProcedureCaller(_def) {
|
|
112
|
+
async function procedure(opts) {
|
|
113
|
+
// is direct server-side call
|
|
114
|
+
if (!opts || !('getRawInput' in opts)) {
|
|
115
|
+
throw new Error(codeblock);
|
|
116
|
+
}
|
|
117
|
+
// run the middlewares recursively with the resolver as the last one
|
|
118
|
+
async function callRecursive(callOpts = {
|
|
119
|
+
index: 0,
|
|
120
|
+
ctx: opts.ctx
|
|
121
|
+
}) {
|
|
122
|
+
try {
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
124
|
+
const middleware = _def.middlewares[callOpts.index];
|
|
125
|
+
const result = await middleware({
|
|
126
|
+
ctx: callOpts.ctx,
|
|
127
|
+
type: opts.type,
|
|
128
|
+
path: opts.path,
|
|
129
|
+
getRawInput: callOpts.getRawInput ?? opts.getRawInput,
|
|
130
|
+
meta: _def.meta,
|
|
131
|
+
input: callOpts.input,
|
|
132
|
+
next (_nextOpts) {
|
|
133
|
+
const nextOpts = _nextOpts;
|
|
134
|
+
return callRecursive({
|
|
135
|
+
index: callOpts.index + 1,
|
|
136
|
+
ctx: nextOpts && 'ctx' in nextOpts ? {
|
|
137
|
+
...callOpts.ctx,
|
|
138
|
+
...nextOpts.ctx
|
|
139
|
+
} : callOpts.ctx,
|
|
140
|
+
input: nextOpts && 'input' in nextOpts ? nextOpts.input : callOpts.input,
|
|
141
|
+
getRawInput: nextOpts && 'getRawInput' in nextOpts ? nextOpts.getRawInput : callOpts.getRawInput
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return result;
|
|
146
|
+
} catch (cause) {
|
|
147
|
+
return {
|
|
148
|
+
ok: false,
|
|
149
|
+
error: getTRPCErrorFromUnknown(cause),
|
|
150
|
+
marker: middlewareMarker
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// there's always at least one "next" since we wrap this.resolver in a middleware
|
|
155
|
+
const result = await callRecursive();
|
|
156
|
+
if (!result) {
|
|
157
|
+
throw new TRPCError({
|
|
158
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
159
|
+
message: 'No result from middlewares - did you forget to `return next()`?'
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (!result.ok) {
|
|
163
|
+
// re-throw original error
|
|
164
|
+
throw result.error;
|
|
165
|
+
}
|
|
166
|
+
return result.data;
|
|
167
|
+
}
|
|
168
|
+
procedure._def = _def;
|
|
169
|
+
// FIXME typecast shouldn't be needed - fixittt
|
|
170
|
+
return procedure;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export { createBuilder, unsetMarker };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { CombinedDataTransformer } from '.';
|
|
2
|
+
import type { ErrorFormatter } from './error/formatter';
|
|
3
|
+
import type { TRPCErrorShape } from './rpc';
|
|
4
|
+
/**
|
|
5
|
+
* The initial generics that are used in the init function
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface RootTypes {
|
|
9
|
+
ctx: object;
|
|
10
|
+
meta: object;
|
|
11
|
+
errorShape: unknown;
|
|
12
|
+
transformer: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The default check to see if we're in a server
|
|
16
|
+
*/
|
|
17
|
+
export declare const isServerDefault: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The tRPC root config
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export interface RootConfig<TTypes extends RootTypes> {
|
|
23
|
+
/**
|
|
24
|
+
* The types that are used in the config
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
$types: TTypes;
|
|
28
|
+
/**
|
|
29
|
+
* Use a data transformer
|
|
30
|
+
* @link https://trpc.io/docs/v11/data-transformers
|
|
31
|
+
*/
|
|
32
|
+
transformer: CombinedDataTransformer;
|
|
33
|
+
/**
|
|
34
|
+
* Use custom error formatting
|
|
35
|
+
* @link https://trpc.io/docs/v11/error-formatting
|
|
36
|
+
*/
|
|
37
|
+
errorFormatter: ErrorFormatter<TTypes['ctx'], TRPCErrorShape<number> & {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Allow `@trpc/server` to run in non-server environments
|
|
42
|
+
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
allowOutsideOfServer: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Is this a server environment?
|
|
48
|
+
* @warning **Use with caution**, this should likely mainly be used within testing.
|
|
49
|
+
* @default typeof window === 'undefined' || 'Deno' in window || process.env.NODE_ENV === 'test'
|
|
50
|
+
*/
|
|
51
|
+
isServer: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Is this development?
|
|
54
|
+
* Will be used to decide if the API should return stack traces
|
|
55
|
+
* @default process.env.NODE_ENV !== 'production'
|
|
56
|
+
*/
|
|
57
|
+
isDev: boolean;
|
|
58
|
+
defaultMeta?: TTypes['meta'] extends object ? TTypes['meta'] : never;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export type CreateRootTypes<TGenerics extends RootTypes> = TGenerics;
|
|
64
|
+
export type AnyRootTypes = CreateRootTypes<{
|
|
65
|
+
ctx: any;
|
|
66
|
+
meta: any;
|
|
67
|
+
errorShape: any;
|
|
68
|
+
transformer: any;
|
|
69
|
+
}>;
|
|
70
|
+
//# sourceMappingURL=rootConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
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ACV,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The default check to see if we're in a server
|
|
5
|
+
*/ const isServerDefault = typeof window === 'undefined' || 'Deno' in window || // eslint-disable-next-line @typescript-eslint/dot-notation
|
|
6
|
+
globalThis.process?.env?.['NODE_ENV'] === 'test' || !!globalThis.process?.env?.['JEST_WORKER_ID'] || !!globalThis.process?.env?.['VITEST_WORKER_ID'];
|
|
7
|
+
|
|
8
|
+
exports.isServerDefault = isServerDefault;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default check to see if we're in a server
|
|
3
|
+
*/ const isServerDefault = typeof window === 'undefined' || 'Deno' in window || // eslint-disable-next-line @typescript-eslint/dot-notation
|
|
4
|
+
globalThis.process?.env?.['NODE_ENV'] === 'test' || !!globalThis.process?.env?.['JEST_WORKER_ID'] || !!globalThis.process?.env?.['VITEST_WORKER_ID'];
|
|
5
|
+
|
|
6
|
+
export { isServerDefault };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { AnyProcedure, inferProcedureInput, inferTransformedProcedureOutput } from './procedure';
|
|
2
|
+
import type { ProcedureCallOptions } from './procedureBuilder';
|
|
3
|
+
import type { AnyRootTypes, RootConfig } from './rootConfig';
|
|
4
|
+
import type { MaybePromise } from './types';
|
|
5
|
+
/** @internal **/
|
|
6
|
+
export type ProcedureRecord = Record<string, AnyProcedure>;
|
|
7
|
+
export interface ProcedureRouterRecord {
|
|
8
|
+
[key: string]: AnyProcedure | AnyRouter;
|
|
9
|
+
}
|
|
10
|
+
export interface RouterDef<TRoot extends AnyRootTypes, TRecord extends ProcedureRouterRecord> {
|
|
11
|
+
_config: RootConfig<TRoot>;
|
|
12
|
+
router: true;
|
|
13
|
+
procedure?: never;
|
|
14
|
+
procedures: TRecord;
|
|
15
|
+
record: TRecord;
|
|
16
|
+
}
|
|
17
|
+
export type AnyRouterDef = RouterDef<any, any>;
|
|
18
|
+
type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedureInput<TProcedure>) => Promise<TProcedure['_def']['_output_out']>;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
type DecoratedProcedureRecord<TProcedures extends ProcedureRouterRecord> = {
|
|
23
|
+
[TKey in keyof TProcedures]: TProcedures[TKey] extends AnyRouter ? DecoratedProcedureRecord<TProcedures[TKey]['_def']['record']> : TProcedures[TKey] extends AnyProcedure ? DecorateProcedure<TProcedures[TKey]> : never;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export type RouterCaller<TDef extends AnyRouterDef> = (
|
|
29
|
+
/**
|
|
30
|
+
* @note
|
|
31
|
+
* If passing a function, we recommend it's a cached function
|
|
32
|
+
* e.g. wrapped in `React.cache` to avoid unnecessary computations
|
|
33
|
+
*/
|
|
34
|
+
ctx: TDef['_config']['$types']['ctx'] | (() => MaybePromise<TDef['_config']['$types']['ctx']>)) => DecoratedProcedureRecord<TDef['record']>;
|
|
35
|
+
export interface Router<TDef extends AnyRouterDef> {
|
|
36
|
+
_def: TDef;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated use `t.createCallerFactory(router)` instead
|
|
39
|
+
* @link https://trpc.io/docs/v11/server/server-side-calls
|
|
40
|
+
*/
|
|
41
|
+
createCaller: RouterCaller<TDef>;
|
|
42
|
+
}
|
|
43
|
+
export type AnyRouter = Router<AnyRouterDef>;
|
|
44
|
+
type inferRouterDef<TRouter extends AnyRouter> = TRouter extends Router<infer TParams> ? TParams extends AnyRouterDef ? TParams : never : never;
|
|
45
|
+
type inferRouterConfig<TRouter extends AnyRouter> = inferRouterDef<TRouter>['_config'];
|
|
46
|
+
export type inferRouterContext<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['ctx'];
|
|
47
|
+
export type inferRouterError<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['errorShape'];
|
|
48
|
+
export type inferRouterMeta<TRouter extends AnyRouter> = inferRouterConfig<TRouter>['$types']['meta'];
|
|
49
|
+
type GetInferenceHelpers<TType extends 'input' | 'output', TRouter extends AnyRouter> = {
|
|
50
|
+
[TKey in keyof TRouter['_def']['record']]: TRouter['_def']['record'][TKey] extends infer TRouterOrProcedure ? TRouterOrProcedure extends AnyRouter ? GetInferenceHelpers<TType, TRouterOrProcedure> : TRouterOrProcedure extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<TRouterOrProcedure> : inferTransformedProcedureOutput<TRouter, TRouterOrProcedure> : never : never;
|
|
51
|
+
};
|
|
52
|
+
export type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter>;
|
|
53
|
+
export type inferRouterOutputs<TRouter extends AnyRouter> = GetInferenceHelpers<'output', TRouter>;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export type CreateRouterInner<TRoot extends AnyRootTypes, TProcRouterRecord extends ProcedureRouterRecord> = Router<RouterDef<TRoot, TProcRouterRecord>> &
|
|
58
|
+
/**
|
|
59
|
+
* This adds ability to call procedures directly but is primarily used for quick access in type inference
|
|
60
|
+
*/
|
|
61
|
+
TProcRouterRecord;
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export declare function createRouterFactory<TRoot extends AnyRootTypes>(config: RootConfig<TRoot>): <TProcRouterRecord extends ProcedureRouterRecord>(procedures: TProcRouterRecord) => CreateRouterInner<TRoot, TProcRouterRecord>;
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export declare function callProcedure(opts: ProcedureCallOptions & {
|
|
70
|
+
procedures: ProcedureRouterRecord;
|
|
71
|
+
}): Promise<unknown>;
|
|
72
|
+
export declare function createCallerFactory<TRoot extends AnyRootTypes>(): <TRouter extends Router<RouterDef<TRoot, any>>>(router: TRouter) => RouterCaller<TRouter["_def"]>;
|
|
73
|
+
/** @internal */
|
|
74
|
+
type MergeRouters<TRouters extends AnyRouter[], TRouterDef extends AnyRouterDef = RouterDef<TRouters[0]['_def']['_config']['$types'], {}>> = TRouters extends [
|
|
75
|
+
infer Head extends AnyRouter,
|
|
76
|
+
...infer Tail extends AnyRouter[]
|
|
77
|
+
] ? MergeRouters<Tail, {
|
|
78
|
+
_config: TRouterDef['_config'];
|
|
79
|
+
router: true;
|
|
80
|
+
procedures: Head['_def']['procedures'] & TRouterDef['procedures'];
|
|
81
|
+
record: Head['_def']['record'] & TRouterDef['record'];
|
|
82
|
+
}> : Router<TRouterDef> & TRouterDef['record'];
|
|
83
|
+
export declare function mergeRouters<TRouters extends AnyRouter[]>(...routerList: [...TRouters]): MergeRouters<TRouters>;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,iBAAiB;AACjB,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,SAAS,CACxB,KAAK,SAAS,YAAY,EAC1B,OAAO,SAA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