@trpc/server 10.0.0 → 10.2.0
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/core/types.d.ts +3 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/deprecated/interop.d.ts +8 -7
- package/dist/deprecated/interop.d.ts.map +1 -1
- package/dist/deprecated/router.d.ts +21 -21
- package/dist/deprecated/router.d.ts.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/internal/serialize.d.ts +27 -0
- package/dist/shared/internal/serialize.d.ts.map +1 -0
- package/dist/shared/jsonify.d.ts +10 -0
- package/dist/shared/jsonify.d.ts.map +1 -0
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/core/types.ts +3 -0
- package/src/deprecated/interop.ts +11 -8
- package/src/deprecated/router.ts +79 -35
- package/src/shared/index.ts +1 -0
- package/src/shared/internal/serialize.ts +62 -0
- package/src/shared/jsonify.ts +18 -0
- package/src/types.ts +1 -1
package/dist/core/types.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export declare type inferHandlerInput<TProcedure extends AnyProcedure> = Procedu
|
|
|
14
14
|
export declare type inferProcedureInput<TProcedure extends AnyProcedure> = inferHandlerInput<TProcedure>[0];
|
|
15
15
|
export declare type inferProcedureParams<TProcedure> = TProcedure extends AnyProcedure ? TProcedure['_def'] : never;
|
|
16
16
|
export declare type inferProcedureOutput<TProcedure> = inferProcedureParams<TProcedure>['_output_out'];
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated will be removed in next major as it's v9 stuff
|
|
19
|
+
*/
|
|
17
20
|
export declare type inferSubscriptionOutput<TRouter extends AnyRouter, TPath extends keyof TRouter['_def']['subscriptions'] & string> = inferObservableValue<inferProcedureOutput<TRouter['_def']['subscriptions'][TPath]>>;
|
|
18
21
|
export declare type inferProcedureClientError<TProcedure extends AnyProcedure> = inferProcedureParams<TProcedure>['_config']['errorShape'];
|
|
19
22
|
declare type GetInferenceHelpers<TType extends 'input' | 'output', TRouter extends AnyRouter> = {
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE3D,oBAAY,cAAc,CAAC,OAAO,SAAS,SAAS,IAAI,OAAO,SAAS,MAAM,CAC5E,MAAM,OAAO,CACd,GACG,OAAO,SAAS,YAAY,CAAC,GAAG,CAAC,GAC/B,OAAO,GACP,KAAK,GACP,KAAK,CAAC;AAEV,oBAAY,kBAAkB,CAAC,OAAO,SAAS,SAAS,IACtD,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AACtD,oBAAY,gBAAgB,CAAC,OAAO,SAAS,SAAS,IACpD,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AAC7D,oBAAY,eAAe,CAAC,OAAO,SAAS,SAAS,IACnD,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAC7E;;GAEG;AACH,oBAAY,aAAa,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAE1D,oBAAY,iBAAiB,CAAC,UAAU,SAAS,YAAY,IAAI,aAAa,CAC5E,oBAAoB,CAAC,UAAU,CAAC,CACjC,CAAC;AAEF,oBAAY,mBAAmB,CAAC,UAAU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
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProcedureParams, ProcedureType } from '..';
|
|
2
2
|
import { AnyRootConfig, RootConfig } from '../core/internals/config';
|
|
3
3
|
import { Procedure } from '../core/procedure';
|
|
4
4
|
import { Router as NewRouter, RouterDef } from '../core/router';
|
|
5
5
|
import { AnyRouter as AnyOldRouter, Router as OldRouter } from '../deprecated/router';
|
|
6
6
|
import { TRPCErrorShape } from '../rpc';
|
|
7
|
+
import { CombinedDataTransformer } from '../transformer';
|
|
7
8
|
import { Procedure as OldProcedure } from './internals/procedure';
|
|
8
9
|
import { ProcedureRecord } from './router';
|
|
9
10
|
declare type AnyOldProcedure = OldProcedure<any, any, any, any, any, any, any, any>;
|
|
@@ -12,32 +13,32 @@ declare type MigrateProcedure<TConfig extends AnyRootConfig, TProcedure extends
|
|
|
12
13
|
export declare type MigrateProcedureRecord<TConfig extends AnyRootConfig, TProcedureRecord extends ProcedureRecord<any>, TType extends ProcedureType> = {
|
|
13
14
|
[K in keyof TProcedureRecord]: MigrateProcedure<TConfig, TProcedureRecord[K], TType>;
|
|
14
15
|
};
|
|
15
|
-
export declare type MigrateRouter<TInputContext extends Record<string, any>, TContext, TMeta extends Record<string, any>, TQueries extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TMutations extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, unknown, any, unknown, unknown>, TErrorShape extends TRPCErrorShape<any
|
|
16
|
+
export declare type MigrateRouter<TInputContext extends Record<string, any>, TContext, TMeta extends Record<string, any>, TQueries extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TMutations extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, unknown, any, unknown, unknown>, TErrorShape extends TRPCErrorShape<any>, TTransformer extends CombinedDataTransformer> = NewRouter<RouterDef<RootConfig<{
|
|
16
17
|
ctx: TInputContext;
|
|
17
18
|
errorShape: TErrorShape;
|
|
18
19
|
meta: TMeta;
|
|
19
|
-
transformer:
|
|
20
|
+
transformer: TTransformer;
|
|
20
21
|
}>, {}, {
|
|
21
22
|
queries: MigrateProcedureRecord<RootConfig<{
|
|
22
23
|
ctx: TInputContext;
|
|
23
24
|
errorShape: TErrorShape;
|
|
24
25
|
meta: TMeta;
|
|
25
|
-
transformer:
|
|
26
|
+
transformer: TTransformer;
|
|
26
27
|
}>, TQueries, 'query'>;
|
|
27
28
|
mutations: MigrateProcedureRecord<RootConfig<{
|
|
28
29
|
ctx: TInputContext;
|
|
29
30
|
errorShape: TErrorShape;
|
|
30
31
|
meta: TMeta;
|
|
31
|
-
transformer:
|
|
32
|
+
transformer: TTransformer;
|
|
32
33
|
}>, TMutations, 'mutation'>;
|
|
33
34
|
subscriptions: MigrateProcedureRecord<RootConfig<{
|
|
34
35
|
ctx: TInputContext;
|
|
35
36
|
errorShape: TErrorShape;
|
|
36
37
|
meta: TMeta;
|
|
37
|
-
transformer:
|
|
38
|
+
transformer: TTransformer;
|
|
38
39
|
}>, TSubscriptions, 'subscription'>;
|
|
39
40
|
}>>;
|
|
40
|
-
export declare type MigrateOldRouter<TRouter extends AnyOldRouter> = TRouter extends OldRouter<infer TInputContext, infer TContext, infer TMeta, infer TQueries, infer TMutations, infer TSubscriptions, infer TErrorShape> ? MigrateRouter<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape> : never;
|
|
41
|
+
export declare type MigrateOldRouter<TRouter extends AnyOldRouter> = TRouter extends OldRouter<infer TInputContext, infer TContext, infer TMeta, infer TQueries, infer TMutations, infer TSubscriptions, infer TErrorShape, infer Transformer> ? MigrateRouter<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape, Transformer> : never;
|
|
41
42
|
export declare function migrateRouter<TOldRouter extends AnyOldRouter>(oldRouter: TOldRouter): MigrateOldRouter<TOldRouter>;
|
|
42
43
|
export {};
|
|
43
44
|
//# sourceMappingURL=interop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../src/deprecated/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../../src/deprecated/interop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQrE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAEL,MAAM,IAAI,SAAS,EACnB,SAAS,EAEV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,IAAI,YAAY,EACzB,MAAM,IAAI,SAAS,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,aAAK,eAAe,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE5E,aAAK,sBAAsB,CACzB,OAAO,SAAS,aAAa,EAC7B,UAAU,SAAS,eAAe,IAChC,UAAU,SAAS,YAAY,CACjC,MAAM,cAAc,EACpB,MAAM,QAAQ,EACd,MAAM,KAAK,EACX,MAAM,MAAM,EACZ,MAAM,YAAY,EAClB,MAAM,OAAO,EACb,MAAM,cAAc,EACpB,MAAM,WAAW,CAClB,GACG,eAAe,CACb,OAAO,EACP,QAAQ,EACR,MAAM,EACN,YAAY,EACZ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T,GAAG,EAAE,aAAa,CAAC;QACnB,UAAU,EAAE,WAAW,CAAC;QACxB,IAAI,EAAE,KAAK,CAAC;QACZ,WAAW,EAAE,YAAY,CAAC;KAC3B,CAAC,EACF,QAAQ,EACR,OAAO,CACR,CAAC;IACF,SAAS,EAAE,sBAAsB,CAC/B,UAAU,CAAC;QACT,GAAG,EAAE,aAAa,CAAC;QACnB,UAAU,EAAE,WAAW,CAAC;QACxB,IAAI,EAAE,KAAK,CAAC;QACZ,WAAW,EAAE,YAAY,CAAC;KAC3B,CAAC,EACF,UAAU,EACV,UAAU,CACX,CAAC;IACF,aAAa,EAAE,sBAAsB,CACnC,UAAU,CAAC;QACT,GAAG,EAAE,aAAa,CAAC;QACnB,UAAU,EAAE,WAAW,CAAC;QACxB,IAAI,EAAE,KAAK,CAAC;QACZ,WAAW,EAAE,YAAY,CAAC;KAC3B,CAAC,EACF,cAAc,EACd,cAAc,CACf,CAAC;CACH,CACF,CACF,CAAC;AAEF,oBAAY,gBAAgB,CAAC,OAAO,SAAS,YAAY,IACvD,OAAO,SAAS,SAAS,CACvB,MAAM,aAAa,EACnB,MAAM,QAAQ,EACd,MAAM,KAAK,EACX,MAAM,QAAQ,EACd,MAAM,UAAU,EAChB,MAAM,cAAc,EACpB,MAAM,WAAW,EACjB,MAAM,WAAW,CAClB,GACG,aAAa,CACX,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,cAAc,EACd,WAAW,EACX,WAAW,CACZ,GACD,KAAK,CAAC;AA+BZ,wBAAgB,aAAa,CAAC,UAAU,SAAS,YAAY,EAC3D,SAAS,EAAE,UAAU,GACpB,gBAAgB,CAAC,UAAU,CAAC,CA8B9B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TRPCError } from '../error/TRPCError';
|
|
2
2
|
import { Observable, inferObservableValue } from '../observable';
|
|
3
3
|
import { TRPCErrorShape, TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER } from '../rpc';
|
|
4
|
-
import { CombinedDataTransformer, DataTransformerOptions } from '../transformer';
|
|
4
|
+
import { CombinedDataTransformer, DataTransformerOptions, DefaultDataTransformer } from '../transformer';
|
|
5
5
|
import { FlatOverwrite, ThenArg } from '../types';
|
|
6
6
|
import { MiddlewareFunction } from './internals/middlewares';
|
|
7
7
|
import { CreateProcedureWithInput, CreateProcedureWithInputOutputParser, CreateProcedureWithoutInput, Procedure, inferProcedureFromOptions } from './internals/procedure';
|
|
@@ -62,12 +62,12 @@ export declare type inferRouterContext<TRouter extends AnyRouter> = Parameters<T
|
|
|
62
62
|
/**
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
|
-
export declare type inferRouterMeta<TRouter extends AnyRouter> = TRouter extends Router<any, any, infer TMeta, any, any, any, any> ? TMeta : {};
|
|
65
|
+
export declare type inferRouterMeta<TRouter extends AnyRouter> = TRouter extends Router<any, any, infer TMeta, any, any, any, any, any> ? TMeta : {};
|
|
66
66
|
/**
|
|
67
67
|
* @public
|
|
68
68
|
* @deprecated
|
|
69
69
|
*/
|
|
70
|
-
export declare type AnyRouter<TContext extends Record<string, any> = any> = Router<any, TContext, any, any, any, any, any>;
|
|
70
|
+
export declare type AnyRouter<TContext extends Record<string, any> = any> = Router<any, TContext, any, any, any, any, any, any>;
|
|
71
71
|
/**
|
|
72
72
|
* @internal
|
|
73
73
|
* @deprecated
|
|
@@ -107,7 +107,7 @@ declare type SwapContext<TObj extends ProcedureRecord<any, any, any, any, any, a
|
|
|
107
107
|
* @internal The type signature of this class may change without warning.
|
|
108
108
|
* @deprecated
|
|
109
109
|
*/
|
|
110
|
-
export declare class Router<TInputContext extends Record<string, any>, TContext extends Record<string, any>, TMeta extends Record<string, any>, TQueries extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TMutations extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, unknown, Observable<unknown, unknown>, unknown, unknown>, TErrorShape extends TRPCErrorShape<number
|
|
110
|
+
export declare class Router<TInputContext extends Record<string, any>, TContext extends Record<string, any>, TMeta extends Record<string, any>, TQueries extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TMutations extends ProcedureRecord<TInputContext, TContext, any, any, any, any, any>, TSubscriptions extends ProcedureRecord<TInputContext, TContext, unknown, unknown, Observable<unknown, unknown>, unknown, unknown>, TErrorShape extends TRPCErrorShape<number>, TTransformer extends CombinedDataTransformer = DefaultDataTransformer> {
|
|
111
111
|
readonly _def: {
|
|
112
112
|
queries: TQueries;
|
|
113
113
|
mutations: TMutations;
|
|
@@ -125,35 +125,35 @@ export declare class Router<TInputContext extends Record<string, any>, TContext
|
|
|
125
125
|
transformer?: CombinedDataTransformer;
|
|
126
126
|
});
|
|
127
127
|
private static prefixProcedures;
|
|
128
|
-
query<TPath extends string, TInput, TParsedInput, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
129
|
-
query<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
130
|
-
query<TPath extends string, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TMeta, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape>;
|
|
131
|
-
mutation<TPath extends string, TInput, TParsedInput, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
132
|
-
mutation<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
133
|
-
mutation<TPath extends string, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TMeta, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape>;
|
|
128
|
+
query<TPath extends string, TInput, TParsedInput, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape, TTransformer>;
|
|
129
|
+
query<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape, TTransformer>;
|
|
130
|
+
query<TPath extends string, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TMeta, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TMutations, TSubscriptions, TErrorShape, TTransformer>;
|
|
131
|
+
mutation<TPath extends string, TInput, TParsedInput, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape, TTransformer>;
|
|
132
|
+
mutation<TPath extends string, TInput, TOutput>(path: TPath, procedure: CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape, TTransformer>;
|
|
133
|
+
mutation<TPath extends string, TOutput, TParsedOutput>(path: TPath, procedure: CreateProcedureWithoutInput<TContext, TMeta, TOutput, TParsedOutput>): Router<TInputContext, TContext, TMeta, TQueries, TMutations & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TSubscriptions, TErrorShape, TTransformer>;
|
|
134
134
|
/**
|
|
135
135
|
* @beta Might change without a major version bump
|
|
136
136
|
*/
|
|
137
|
-
subscription<TPath extends string, TInput, TParsedInput, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, unknown>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
137
|
+
subscription<TPath extends string, TInput, TParsedInput, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithInputOutputParser<TContext, TMeta, TInput, TParsedInput, TOutput, unknown>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape, TTransformer>;
|
|
138
138
|
/**
|
|
139
139
|
* @beta Might change without a major version bump
|
|
140
140
|
*/
|
|
141
|
-
subscription<TPath extends string, TInput, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
141
|
+
subscription<TPath extends string, TInput, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithInput<TContext, TMeta, TInput, TOutput>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape, TTransformer>;
|
|
142
142
|
/**
|
|
143
143
|
* @beta Might change without a major version bump
|
|
144
144
|
*/
|
|
145
|
-
subscription<TPath extends string, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithoutInput<TContext, TMeta, TOutput, unknown>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape>;
|
|
145
|
+
subscription<TPath extends string, TOutput extends Observable<unknown, unknown>>(path: TPath, procedure: Omit<CreateProcedureWithoutInput<TContext, TMeta, TOutput, unknown>, 'output'>): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions & Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>, TErrorShape, TTransformer>;
|
|
146
146
|
/**
|
|
147
147
|
* Merge router with other router
|
|
148
148
|
* @param router
|
|
149
149
|
*/
|
|
150
|
-
merge<TChildRouter extends Router<TContext, any, TMeta, any, any, any, any>>(router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TMeta, TQueries & TChildRouter['_def']['queries'], TMutations & TChildRouter['_def']['mutations'], TSubscriptions & TChildRouter['_def']['subscriptions'], TErrorShape>;
|
|
150
|
+
merge<TChildRouter extends Router<TContext, any, TMeta, any, any, any, any, any>>(router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TMeta, TQueries & TChildRouter['_def']['queries'], TMutations & TChildRouter['_def']['mutations'], TSubscriptions & TChildRouter['_def']['subscriptions'], TErrorShape, TTransformer>;
|
|
151
151
|
/**
|
|
152
152
|
* Merge router with other router
|
|
153
153
|
* @param prefix Prefix that this router should live under
|
|
154
154
|
* @param router
|
|
155
155
|
*/
|
|
156
|
-
merge<TPath extends string, TChildRouter extends Router<TContext, any, TMeta, any, any, any, any>>(prefix: TPath, router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TMeta, TQueries & Prefixer<TChildRouter['_def']['queries'], `${TPath}`>, TMutations & Prefixer<TChildRouter['_def']['mutations'], `${TPath}`>, TSubscriptions & Prefixer<TChildRouter['_def']['subscriptions'], `${TPath}`>, TErrorShape>;
|
|
156
|
+
merge<TPath extends string, TChildRouter extends Router<TContext, any, TMeta, any, any, any, any, any>>(prefix: TPath, router: TChildRouter): Router<TInputContext, inferRouterContext<TChildRouter>, TMeta, TQueries & Prefixer<TChildRouter['_def']['queries'], `${TPath}`>, TMutations & Prefixer<TChildRouter['_def']['mutations'], `${TPath}`>, TSubscriptions & Prefixer<TChildRouter['_def']['subscriptions'], `${TPath}`>, TErrorShape, TTransformer>;
|
|
157
157
|
/**
|
|
158
158
|
* Invoke procedure. Only for internal use within library.
|
|
159
159
|
*/
|
|
@@ -167,12 +167,12 @@ export declare class Router<TInputContext extends Record<string, any>, TContext
|
|
|
167
167
|
* Function to be called before any procedure is invoked
|
|
168
168
|
* @link https://trpc.io/docs/middlewares
|
|
169
169
|
*/
|
|
170
|
-
middleware<TNewContext extends Record<string, any>>(middleware: MiddlewareFunction<TContext, TNewContext, TMeta>): Router<TInputContext, TNewContext, TMeta, SwapContext<TQueries, TNewContext>, SwapContext<TMutations, TNewContext>, SwapContext<TSubscriptions, TNewContext>, TErrorShape>;
|
|
170
|
+
middleware<TNewContext extends Record<string, any>>(middleware: MiddlewareFunction<TContext, TNewContext, TMeta>): Router<TInputContext, TNewContext, TMeta, SwapContext<TQueries, TNewContext>, SwapContext<TMutations, TNewContext>, SwapContext<TSubscriptions, TNewContext>, TErrorShape, TTransformer>;
|
|
171
171
|
/**
|
|
172
172
|
* Format errors
|
|
173
173
|
* @link https://trpc.io/docs/error-formatting
|
|
174
174
|
*/
|
|
175
|
-
formatError<TErrorFormatter extends ErrorFormatter<TContext, TRPCErrorShape<number>>>(errorFormatter: TErrorFormatter): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, ReturnType<TErrorFormatter
|
|
175
|
+
formatError<TErrorFormatter extends ErrorFormatter<TContext, TRPCErrorShape<number>>>(errorFormatter: TErrorFormatter): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, ReturnType<TErrorFormatter>, TTransformer>;
|
|
176
176
|
getErrorShape(opts: {
|
|
177
177
|
error: TRPCError;
|
|
178
178
|
type: ProcedureType | 'unknown';
|
|
@@ -184,21 +184,21 @@ export declare class Router<TInputContext extends Record<string, any>, TContext
|
|
|
184
184
|
* Add data transformer to serialize/deserialize input args + output
|
|
185
185
|
* @link https://trpc.io/docs/data-transformers
|
|
186
186
|
*/
|
|
187
|
-
transformer(_transformer: DataTransformerOptions): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape>;
|
|
187
|
+
transformer(_transformer: DataTransformerOptions): Router<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape, CombinedDataTransformer>;
|
|
188
188
|
/**
|
|
189
189
|
* Flattens the generics of TQueries/TMutations/TSubscriptions.
|
|
190
190
|
* ⚠️ Experimental - might disappear. ⚠️
|
|
191
191
|
*
|
|
192
192
|
* @alpha
|
|
193
193
|
*/
|
|
194
|
-
flat(): Router<TInputContext, TContext, TMeta, FlatOverwrite<{}, TQueries>, FlatOverwrite<{}, TMutations>, FlatOverwrite<{}, TSubscriptions>, TErrorShape>;
|
|
194
|
+
flat(): Router<TInputContext, TContext, TMeta, FlatOverwrite<{}, TQueries>, FlatOverwrite<{}, TMutations>, FlatOverwrite<{}, TSubscriptions>, TErrorShape, TTransformer>;
|
|
195
195
|
/**
|
|
196
196
|
* Interop mode for v9.x -> v10.x
|
|
197
197
|
*/
|
|
198
|
-
interop(): MigrateRouter<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape>;
|
|
198
|
+
interop(): MigrateRouter<TInputContext, TContext, TMeta, TQueries, TMutations, TSubscriptions, TErrorShape, TTransformer>;
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
201
|
* @deprecated
|
|
202
202
|
*/
|
|
203
|
-
export declare function router<TContext extends Record<string, any> = {}, TMeta extends Record<string, any> = {}>(): Router<TContext, TContext, TMeta, {}, {}, {}, DefaultErrorShape>;
|
|
203
|
+
export declare function router<TContext extends Record<string, any> = {}, TMeta extends Record<string, any> = {}>(): Router<TContext, TContext, TMeta, {}, {}, {}, DefaultErrorShape, DefaultDataTransformer>;
|
|
204
204
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/deprecated/router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,cAAc,EAEd,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAEL,wBAAwB,EACxB,oCAAoC,EACpC,2BAA2B,EAC3B,SAAS,EAGT,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAiB,MAAM,WAAW,CAAC;AAEzD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,aAAK,MAAM,CACT,OAAO,SAAS,MAAM,EACtB,OAAO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cAAc,EAAE,WAAW,CAAC,EACxC,WAAW,EACX,YAAY,CACb;IAOD;;;OAGG;IACI,WAAW,CAChB,eAAe,SAAS,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,EACxE,cAAc,EAAE,eAAe;IAqB1B,aAAa,CAAC,IAAI,EAAE;QACzB,KAAK,EAAE,SAAS,CAAC;QACjB,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;QAChC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC;QACf,GAAG,EAAE,SAAS,GAAG,QAAQ,CAAC;KAC3B,GAAG,WAAW;IAuBf;;;OAGG;IACH,WAAW,CAAC,YAAY,EAAE,sBAAsB;IAuBhD;;;;;OAKG;IACI,IAAI,IAAI,MAAM,CACnB,aAAa,EACb,QAAQ,EACR,KAAK,EACL,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,EAC3B,aAAa,CAAC,EAAE,EAAE,UAAU,CAAC,EAC7B,aAAa,CAAC,EAAE,EAAE,cAAc,CAAC,EACjC,WAAW,EACX,YAAY,CACb;IAID;;OAEG;IACI,OAAO,IAAI,aAAa,CAC7B,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,CACb;CAGF;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACzC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,8FAYvC"}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
3
|
+
*/
|
|
4
|
+
declare type JsonPrimitive = string | number | boolean | String | Number | Boolean | null;
|
|
5
|
+
declare type NonJsonPrimitive = undefined | Function | symbol;
|
|
6
|
+
declare type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
7
|
+
export declare type Serialize<T> = IsAny<T> extends true ? any : T extends JsonPrimitive ? T : T extends Map<any, any> | Set<any> ? {} : T extends NonJsonPrimitive ? never : T extends {
|
|
8
|
+
toJSON(): infer U;
|
|
9
|
+
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? SerializeObject<UndefinedToOptional<T>> : never;
|
|
10
|
+
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
|
|
11
|
+
declare type SerializeTuple<T extends [unknown, ...unknown[]]> = {
|
|
12
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>;
|
|
13
|
+
};
|
|
14
|
+
/** JSON serialize objects (not including arrays) and classes */
|
|
15
|
+
declare type SerializeObject<T extends object> = {
|
|
16
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? never : Serialize<T[k]>;
|
|
17
|
+
};
|
|
18
|
+
declare type FilterDefinedKeys<TObj extends object> = {
|
|
19
|
+
[TKey in keyof TObj]: undefined extends TObj[TKey] ? never : TKey;
|
|
20
|
+
}[keyof TObj];
|
|
21
|
+
declare type UndefinedToOptional<T extends object> = {
|
|
22
|
+
[k in keyof Pick<T, FilterDefinedKeys<T>>]: T[k];
|
|
23
|
+
} & {
|
|
24
|
+
[k in keyof Omit<T, FilterDefinedKeys<T>>]?: Exclude<T[k], undefined>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/shared/internal/serialize.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,aAAK,aAAa,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,CAAC;AACT,aAAK,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAMtD,aAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAG/C,oBAAY,SAAS,CAAC,CAAC,IACtB,KAAK,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,GAAG,GAC3B,CAAC,SAAS,aAAa,GAAG,CAAC,GAC3B,CAAC,SAAS,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GACtC,CAAC,SAAS,gBAAgB,GAAG,KAAK,GAClC,CAAC,SAAS;IAAE,MAAM,IAAI,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GACnC,CAAC,SAAS,EAAE,GAAG,EAAE,GACjB,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GACrD,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,GACvF,CAAC,SAAS,MAAM,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC1D,KAAK,CAAC;AAEP,uGAAuG;AACvG,aAAK,cAAc,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI;KACtD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvE,CAAC;AAEF,gEAAgE;AAChE,aAAK,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI;KACtC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,gBAAgB,GAAG,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC;AASF,aAAK,iBAAiB,CAAC,IAAI,SAAS,MAAM,IAAI;KAC3C,IAAI,IAAI,MAAM,IAAI,GAAG,SAAS,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI;CAClE,CAAC,MAAM,IAAI,CAAC,CAAC;AAEd,aAAK,mBAAmB,CAAC,CAAC,SAAS,MAAM,IAAI;KAE1C,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjD,GAAG;KAED,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;CACtE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyProcedure } from '../core';
|
|
2
|
+
import { inferObservableValue } from '../observable';
|
|
3
|
+
import { DefaultDataTransformer } from '../transformer';
|
|
4
|
+
import type { Serialize } from './internal/serialize';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare type inferTransformedProcedureOutput<TProcedure extends AnyProcedure> = TProcedure['_def']['_config']['transformer'] extends DefaultDataTransformer ? Serialize<TProcedure['_def']['_output_out']> : TProcedure['_def']['_output_out'];
|
|
9
|
+
export declare type inferTransformedSubscriptionOutput<TProcedure extends AnyProcedure> = TProcedure['_def']['_config']['transformer'] extends DefaultDataTransformer ? Serialize<inferObservableValue<TProcedure['_def']['_output_out']>> : inferObservableValue<TProcedure['_def']['_output_out']>;
|
|
10
|
+
//# sourceMappingURL=jsonify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonify.d.ts","sourceRoot":"","sources":["../../src/shared/jsonify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,oBAAY,+BAA+B,CAAC,UAAU,SAAS,YAAY,IACzE,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,GACvE,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,GAC5C,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC;AAExC,oBAAY,kCAAkC,CAC5C,UAAU,SAAS,YAAY,IAC7B,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,GAC3E,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAClE,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -48,12 +48,11 @@ export declare type InferLast<TType> = TType & {
|
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
50
|
export declare type inferAsyncReturnType<TFunction extends (...args: any) => any> = ThenArg<ReturnType<TFunction>>;
|
|
51
|
-
declare type FilterKeys<TObj extends object, TFilter> = {
|
|
51
|
+
export declare type FilterKeys<TObj extends object, TFilter> = {
|
|
52
52
|
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
53
53
|
}[keyof TObj];
|
|
54
54
|
/**
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
export declare type Filter<TObj extends object, TFilter> = Pick<TObj, FilterKeys<TObj, TFilter>>;
|
|
58
|
-
export {};
|
|
59
58
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,QAAQ,CAAC,KAAK,IAAI,KAAK,CAAC;AAEpC,oBAAY,aAAa,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,KAAK,IAAI,OAAO,CACnE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CACnB,GACC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAErB,oBAAY,aAAa,CAAC,KAAK,IAAI;KAChC,CAAC,IAAI,MAAM,KAAK,GAAG,SAAS,SAAS,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAC3D,CAAC,MAAM,KAAK,CAAC,CAAC;AAEf;;GAEG;AACH,oBAAY,aAAa,CAAC,KAAK,EAAE,KAAK,IAAI,aAAa,CACrD;KACG,IAAI,IAAI,MAAM,KAAK,GAAG,MAAM,KAAK,GAAG,IAAI,SAAS,MAAM,KAAK,GACzD,KAAK,CAAC,IAAI,CAAC,GACX,IAAI,SAAS,MAAM,KAAK,GACxB,KAAK,CAAC,IAAI,CAAC,GACX,KAAK;CACV,EACD,aAAa,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,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AC;CACzC,CAAC;AAEF;;GAEG;AACH,oBAAY,oBAAoB,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IACtE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAEjC,oBAAY,UAAU,CAAC,IAAI,SAAS,MAAM,EAAE,OAAO,IAAI;KACpD,IAAI,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,GAAG,KAAK;CAChE,CAAC,MAAM,IAAI,CAAC,CAAC;AAEd;;GAEG;AACH,oBAAY,MAAM,CAAC,IAAI,SAAS,MAAM,EAAE,OAAO,IAAI,IAAI,CACrD,IAAI,EACJ,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "tRPC Server",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"yup": "^0.32.8",
|
|
159
159
|
"zod": "^3.0.0"
|
|
160
160
|
},
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "c4039504c5c170a6ef8a64c964f0593fafdb52ea"
|
|
162
162
|
}
|
package/src/core/types.ts
CHANGED
|
@@ -36,6 +36,9 @@ export type inferProcedureParams<TProcedure> = TProcedure extends AnyProcedure
|
|
|
36
36
|
export type inferProcedureOutput<TProcedure> =
|
|
37
37
|
inferProcedureParams<TProcedure>['_output_out'];
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated will be removed in next major as it's v9 stuff
|
|
41
|
+
*/
|
|
39
42
|
export type inferSubscriptionOutput<
|
|
40
43
|
TRouter extends AnyRouter,
|
|
41
44
|
TPath extends keyof TRouter['_def']['subscriptions'] & string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProcedureParams, ProcedureType } from '..';
|
|
2
2
|
import { AnyRootConfig, RootConfig } from '../core/internals/config';
|
|
3
3
|
import { getParseFnOrPassThrough } from '../core/internals/getParseFn';
|
|
4
4
|
import { mergeWithoutOverrides } from '../core/internals/mergeWithoutOverrides';
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
Router as OldRouter,
|
|
20
20
|
} from '../deprecated/router';
|
|
21
21
|
import { TRPCErrorShape } from '../rpc';
|
|
22
|
+
import { CombinedDataTransformer } from '../transformer';
|
|
22
23
|
import { Procedure as OldProcedure } from './internals/procedure';
|
|
23
24
|
import { ProcedureRecord } from './router';
|
|
24
25
|
|
|
@@ -98,13 +99,14 @@ export type MigrateRouter<
|
|
|
98
99
|
unknown
|
|
99
100
|
>,
|
|
100
101
|
TErrorShape extends TRPCErrorShape<any>,
|
|
102
|
+
TTransformer extends CombinedDataTransformer,
|
|
101
103
|
> = NewRouter<
|
|
102
104
|
RouterDef<
|
|
103
105
|
RootConfig<{
|
|
104
106
|
ctx: TInputContext;
|
|
105
107
|
errorShape: TErrorShape;
|
|
106
108
|
meta: TMeta;
|
|
107
|
-
transformer:
|
|
109
|
+
transformer: TTransformer;
|
|
108
110
|
}>,
|
|
109
111
|
{},
|
|
110
112
|
{
|
|
@@ -113,8 +115,7 @@ export type MigrateRouter<
|
|
|
113
115
|
ctx: TInputContext;
|
|
114
116
|
errorShape: TErrorShape;
|
|
115
117
|
meta: TMeta;
|
|
116
|
-
|
|
117
|
-
transformer: DefaultDataTransformer;
|
|
118
|
+
transformer: TTransformer;
|
|
118
119
|
}>,
|
|
119
120
|
TQueries,
|
|
120
121
|
'query'
|
|
@@ -124,7 +125,7 @@ export type MigrateRouter<
|
|
|
124
125
|
ctx: TInputContext;
|
|
125
126
|
errorShape: TErrorShape;
|
|
126
127
|
meta: TMeta;
|
|
127
|
-
transformer:
|
|
128
|
+
transformer: TTransformer;
|
|
128
129
|
}>,
|
|
129
130
|
TMutations,
|
|
130
131
|
'mutation'
|
|
@@ -134,7 +135,7 @@ export type MigrateRouter<
|
|
|
134
135
|
ctx: TInputContext;
|
|
135
136
|
errorShape: TErrorShape;
|
|
136
137
|
meta: TMeta;
|
|
137
|
-
transformer:
|
|
138
|
+
transformer: TTransformer;
|
|
138
139
|
}>,
|
|
139
140
|
TSubscriptions,
|
|
140
141
|
'subscription'
|
|
@@ -151,7 +152,8 @@ export type MigrateOldRouter<TRouter extends AnyOldRouter> =
|
|
|
151
152
|
infer TQueries,
|
|
152
153
|
infer TMutations,
|
|
153
154
|
infer TSubscriptions,
|
|
154
|
-
infer TErrorShape
|
|
155
|
+
infer TErrorShape,
|
|
156
|
+
infer Transformer
|
|
155
157
|
>
|
|
156
158
|
? MigrateRouter<
|
|
157
159
|
TInputContext,
|
|
@@ -160,7 +162,8 @@ export type MigrateOldRouter<TRouter extends AnyOldRouter> =
|
|
|
160
162
|
TQueries,
|
|
161
163
|
TMutations,
|
|
162
164
|
TSubscriptions,
|
|
163
|
-
TErrorShape
|
|
165
|
+
TErrorShape,
|
|
166
|
+
Transformer
|
|
164
167
|
>
|
|
165
168
|
: never;
|
|
166
169
|
|
package/src/deprecated/router.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
CombinedDataTransformer,
|
|
14
14
|
DataTransformerOptions,
|
|
15
|
+
DefaultDataTransformer,
|
|
15
16
|
defaultTransformer,
|
|
16
17
|
} from '../transformer';
|
|
17
18
|
import { FlatOverwrite, ThenArg } from '../types';
|
|
@@ -163,6 +164,7 @@ export type inferRouterMeta<TRouter extends AnyRouter> = TRouter extends Router<
|
|
|
163
164
|
any,
|
|
164
165
|
any,
|
|
165
166
|
any,
|
|
167
|
+
any,
|
|
166
168
|
any
|
|
167
169
|
>
|
|
168
170
|
? TMeta
|
|
@@ -179,6 +181,7 @@ export type AnyRouter<TContext extends Record<string, any> = any> = Router<
|
|
|
179
181
|
any,
|
|
180
182
|
any,
|
|
181
183
|
any,
|
|
184
|
+
any,
|
|
182
185
|
any
|
|
183
186
|
>;
|
|
184
187
|
|
|
@@ -314,6 +317,7 @@ export class Router<
|
|
|
314
317
|
unknown
|
|
315
318
|
>,
|
|
316
319
|
TErrorShape extends TRPCErrorShape<number>,
|
|
320
|
+
TTransformer extends CombinedDataTransformer = DefaultDataTransformer,
|
|
317
321
|
> {
|
|
318
322
|
readonly _def: {
|
|
319
323
|
queries: TQueries;
|
|
@@ -377,7 +381,8 @@ export class Router<
|
|
|
377
381
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
378
382
|
TMutations,
|
|
379
383
|
TSubscriptions,
|
|
380
|
-
TErrorShape
|
|
384
|
+
TErrorShape,
|
|
385
|
+
TTransformer
|
|
381
386
|
>;
|
|
382
387
|
|
|
383
388
|
public query<TPath extends string, TInput, TOutput>(
|
|
@@ -391,7 +396,8 @@ export class Router<
|
|
|
391
396
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
392
397
|
TMutations,
|
|
393
398
|
TSubscriptions,
|
|
394
|
-
TErrorShape
|
|
399
|
+
TErrorShape,
|
|
400
|
+
TTransformer
|
|
395
401
|
>;
|
|
396
402
|
|
|
397
403
|
public query<TPath extends string, TOutput, TParsedOutput>(
|
|
@@ -410,18 +416,21 @@ export class Router<
|
|
|
410
416
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
411
417
|
TMutations,
|
|
412
418
|
TSubscriptions,
|
|
413
|
-
TErrorShape
|
|
419
|
+
TErrorShape,
|
|
420
|
+
TTransformer
|
|
414
421
|
>;
|
|
415
422
|
|
|
416
423
|
query(
|
|
417
424
|
path: string,
|
|
418
425
|
procedure: CreateProcedureOptions<TContext, TMeta, any, any, any, any>,
|
|
419
426
|
) {
|
|
420
|
-
const router = new Router<TContext, TContext, TMeta, any, {}, {}, any>(
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
427
|
+
const router = new Router<TContext, TContext, TMeta, any, {}, {}, any, any>(
|
|
428
|
+
{
|
|
429
|
+
queries: safeObject({
|
|
430
|
+
[path]: createProcedure(procedure),
|
|
431
|
+
}),
|
|
432
|
+
},
|
|
433
|
+
);
|
|
425
434
|
|
|
426
435
|
return this.merge(router);
|
|
427
436
|
}
|
|
@@ -450,7 +459,8 @@ export class Router<
|
|
|
450
459
|
TMutations &
|
|
451
460
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
452
461
|
TSubscriptions,
|
|
453
|
-
TErrorShape
|
|
462
|
+
TErrorShape,
|
|
463
|
+
TTransformer
|
|
454
464
|
>;
|
|
455
465
|
|
|
456
466
|
public mutation<TPath extends string, TInput, TOutput>(
|
|
@@ -464,7 +474,8 @@ export class Router<
|
|
|
464
474
|
TMutations &
|
|
465
475
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
466
476
|
TSubscriptions,
|
|
467
|
-
TErrorShape
|
|
477
|
+
TErrorShape,
|
|
478
|
+
TTransformer
|
|
468
479
|
>;
|
|
469
480
|
|
|
470
481
|
public mutation<TPath extends string, TOutput, TParsedOutput>(
|
|
@@ -483,18 +494,21 @@ export class Router<
|
|
|
483
494
|
TMutations &
|
|
484
495
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
485
496
|
TSubscriptions,
|
|
486
|
-
TErrorShape
|
|
497
|
+
TErrorShape,
|
|
498
|
+
TTransformer
|
|
487
499
|
>;
|
|
488
500
|
|
|
489
501
|
public mutation(
|
|
490
502
|
path: string,
|
|
491
503
|
procedure: CreateProcedureOptions<TContext, TMeta, any, any, any, any>,
|
|
492
504
|
) {
|
|
493
|
-
const router = new Router<TContext, TContext, TMeta, {}, any, {}, any>(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
505
|
+
const router = new Router<TContext, TContext, TMeta, {}, any, {}, any, any>(
|
|
506
|
+
{
|
|
507
|
+
mutations: safeObject({
|
|
508
|
+
[path]: createProcedure(procedure),
|
|
509
|
+
}),
|
|
510
|
+
},
|
|
511
|
+
);
|
|
498
512
|
|
|
499
513
|
return this.merge(router);
|
|
500
514
|
}
|
|
@@ -528,7 +542,8 @@ export class Router<
|
|
|
528
542
|
TMutations,
|
|
529
543
|
TSubscriptions &
|
|
530
544
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
531
|
-
TErrorShape
|
|
545
|
+
TErrorShape,
|
|
546
|
+
TTransformer
|
|
532
547
|
>;
|
|
533
548
|
|
|
534
549
|
/**
|
|
@@ -552,7 +567,8 @@ export class Router<
|
|
|
552
567
|
TMutations,
|
|
553
568
|
TSubscriptions &
|
|
554
569
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
555
|
-
TErrorShape
|
|
570
|
+
TErrorShape,
|
|
571
|
+
TTransformer
|
|
556
572
|
>;
|
|
557
573
|
|
|
558
574
|
/**
|
|
@@ -575,7 +591,8 @@ export class Router<
|
|
|
575
591
|
TMutations,
|
|
576
592
|
TSubscriptions &
|
|
577
593
|
Record<TPath, inferProcedureFromOptions<TInputContext, typeof procedure>>,
|
|
578
|
-
TErrorShape
|
|
594
|
+
TErrorShape,
|
|
595
|
+
TTransformer
|
|
579
596
|
>;
|
|
580
597
|
|
|
581
598
|
public subscription(
|
|
@@ -585,11 +602,13 @@ export class Router<
|
|
|
585
602
|
'output'
|
|
586
603
|
>,
|
|
587
604
|
) {
|
|
588
|
-
const router = new Router<TContext, TContext, TMeta, {}, {}, any, any>(
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
605
|
+
const router = new Router<TContext, TContext, TMeta, {}, {}, any, any, any>(
|
|
606
|
+
{
|
|
607
|
+
subscriptions: safeObject({
|
|
608
|
+
[path]: createProcedure(procedure),
|
|
609
|
+
}),
|
|
610
|
+
},
|
|
611
|
+
);
|
|
593
612
|
|
|
594
613
|
return this.merge(router) as any;
|
|
595
614
|
}
|
|
@@ -599,7 +618,7 @@ export class Router<
|
|
|
599
618
|
* @param router
|
|
600
619
|
*/
|
|
601
620
|
public merge<
|
|
602
|
-
TChildRouter extends Router<TContext, any, TMeta, any, any, any, any>,
|
|
621
|
+
TChildRouter extends Router<TContext, any, TMeta, any, any, any, any, any>,
|
|
603
622
|
>(
|
|
604
623
|
router: TChildRouter,
|
|
605
624
|
): Router<
|
|
@@ -609,7 +628,8 @@ export class Router<
|
|
|
609
628
|
TQueries & TChildRouter['_def']['queries'],
|
|
610
629
|
TMutations & TChildRouter['_def']['mutations'],
|
|
611
630
|
TSubscriptions & TChildRouter['_def']['subscriptions'],
|
|
612
|
-
TErrorShape
|
|
631
|
+
TErrorShape,
|
|
632
|
+
TTransformer
|
|
613
633
|
>;
|
|
614
634
|
|
|
615
635
|
/**
|
|
@@ -619,7 +639,7 @@ export class Router<
|
|
|
619
639
|
*/
|
|
620
640
|
public merge<
|
|
621
641
|
TPath extends string,
|
|
622
|
-
TChildRouter extends Router<TContext, any, TMeta, any, any, any, any>,
|
|
642
|
+
TChildRouter extends Router<TContext, any, TMeta, any, any, any, any, any>,
|
|
623
643
|
>(
|
|
624
644
|
prefix: TPath,
|
|
625
645
|
router: TChildRouter,
|
|
@@ -631,7 +651,8 @@ export class Router<
|
|
|
631
651
|
TMutations & Prefixer<TChildRouter['_def']['mutations'], `${TPath}`>,
|
|
632
652
|
TSubscriptions &
|
|
633
653
|
Prefixer<TChildRouter['_def']['subscriptions'], `${TPath}`>,
|
|
634
|
-
TErrorShape
|
|
654
|
+
TErrorShape,
|
|
655
|
+
TTransformer
|
|
635
656
|
>;
|
|
636
657
|
|
|
637
658
|
public merge(prefixOrRouter: unknown, maybeRouter?: unknown) {
|
|
@@ -678,7 +699,16 @@ export class Router<
|
|
|
678
699
|
return Router.prefixProcedures(newDefs, prefix);
|
|
679
700
|
};
|
|
680
701
|
|
|
681
|
-
return new Router<
|
|
702
|
+
return new Router<
|
|
703
|
+
TInputContext,
|
|
704
|
+
any,
|
|
705
|
+
TMeta,
|
|
706
|
+
any,
|
|
707
|
+
any,
|
|
708
|
+
any,
|
|
709
|
+
TErrorShape,
|
|
710
|
+
any
|
|
711
|
+
>({
|
|
682
712
|
...this._def,
|
|
683
713
|
queries: safeObject(
|
|
684
714
|
this._def.queries,
|
|
@@ -764,7 +794,8 @@ export class Router<
|
|
|
764
794
|
SwapContext<TQueries, TNewContext>,
|
|
765
795
|
SwapContext<TMutations, TNewContext>,
|
|
766
796
|
SwapContext<TSubscriptions, TNewContext>,
|
|
767
|
-
TErrorShape
|
|
797
|
+
TErrorShape,
|
|
798
|
+
TTransformer
|
|
768
799
|
> {
|
|
769
800
|
return new Router({
|
|
770
801
|
...this._def,
|
|
@@ -791,7 +822,8 @@ export class Router<
|
|
|
791
822
|
TQueries,
|
|
792
823
|
TMutations,
|
|
793
824
|
TSubscriptions,
|
|
794
|
-
ReturnType<TErrorFormatter
|
|
825
|
+
ReturnType<TErrorFormatter>,
|
|
826
|
+
TTransformer
|
|
795
827
|
>({
|
|
796
828
|
...this._def,
|
|
797
829
|
errorFormatter: errorFormatter as any,
|
|
@@ -846,7 +878,8 @@ export class Router<
|
|
|
846
878
|
TQueries,
|
|
847
879
|
TMutations,
|
|
848
880
|
TSubscriptions,
|
|
849
|
-
TErrorShape
|
|
881
|
+
TErrorShape,
|
|
882
|
+
CombinedDataTransformer
|
|
850
883
|
>({
|
|
851
884
|
...this._def,
|
|
852
885
|
transformer,
|
|
@@ -866,7 +899,8 @@ export class Router<
|
|
|
866
899
|
FlatOverwrite<{}, TQueries>,
|
|
867
900
|
FlatOverwrite<{}, TMutations>,
|
|
868
901
|
FlatOverwrite<{}, TSubscriptions>,
|
|
869
|
-
TErrorShape
|
|
902
|
+
TErrorShape,
|
|
903
|
+
TTransformer
|
|
870
904
|
> {
|
|
871
905
|
return this as any;
|
|
872
906
|
}
|
|
@@ -881,7 +915,8 @@ export class Router<
|
|
|
881
915
|
TQueries,
|
|
882
916
|
TMutations,
|
|
883
917
|
TSubscriptions,
|
|
884
|
-
TErrorShape
|
|
918
|
+
TErrorShape,
|
|
919
|
+
TTransformer
|
|
885
920
|
> {
|
|
886
921
|
return migrateRouter(this);
|
|
887
922
|
}
|
|
@@ -894,5 +929,14 @@ export function router<
|
|
|
894
929
|
TContext extends Record<string, any> = {},
|
|
895
930
|
TMeta extends Record<string, any> = {},
|
|
896
931
|
>() {
|
|
897
|
-
return new Router<
|
|
932
|
+
return new Router<
|
|
933
|
+
TContext,
|
|
934
|
+
TContext,
|
|
935
|
+
TMeta,
|
|
936
|
+
{},
|
|
937
|
+
{},
|
|
938
|
+
{},
|
|
939
|
+
DefaultErrorShape,
|
|
940
|
+
DefaultDataTransformer
|
|
941
|
+
>();
|
|
898
942
|
}
|
package/src/shared/index.ts
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
5
|
+
*/
|
|
6
|
+
type JsonPrimitive =
|
|
7
|
+
| string
|
|
8
|
+
| number
|
|
9
|
+
| boolean
|
|
10
|
+
| String
|
|
11
|
+
| Number
|
|
12
|
+
| Boolean
|
|
13
|
+
| null;
|
|
14
|
+
type NonJsonPrimitive = undefined | Function | symbol;
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* `any` is the only type that can let you equate `0` with `1`
|
|
18
|
+
* See https://stackoverflow.com/a/49928360/1490091
|
|
19
|
+
*/
|
|
20
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
21
|
+
|
|
22
|
+
// prettier-ignore
|
|
23
|
+
export type Serialize<T> =
|
|
24
|
+
IsAny<T> extends true ? any :
|
|
25
|
+
T extends JsonPrimitive ? T :
|
|
26
|
+
T extends Map<any,any> | Set<any> ? {} :
|
|
27
|
+
T extends NonJsonPrimitive ? never :
|
|
28
|
+
T extends { toJSON(): infer U } ? U :
|
|
29
|
+
T extends [] ? [] :
|
|
30
|
+
T extends [unknown, ...unknown[]] ? SerializeTuple<T> :
|
|
31
|
+
T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] :
|
|
32
|
+
T extends object ? SerializeObject<UndefinedToOptional<T>> :
|
|
33
|
+
never;
|
|
34
|
+
|
|
35
|
+
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
|
|
36
|
+
type SerializeTuple<T extends [unknown, ...unknown[]]> = {
|
|
37
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** JSON serialize objects (not including arrays) and classes */
|
|
41
|
+
type SerializeObject<T extends object> = {
|
|
42
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? never : Serialize<T[k]>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* For an object T, if it has any properties that are a union with `undefined`,
|
|
47
|
+
* make those into optional properties instead.
|
|
48
|
+
*
|
|
49
|
+
* Example: { a: string | undefined} --> { a?: string}
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
type FilterDefinedKeys<TObj extends object> = {
|
|
53
|
+
[TKey in keyof TObj]: undefined extends TObj[TKey] ? never : TKey;
|
|
54
|
+
}[keyof TObj];
|
|
55
|
+
|
|
56
|
+
type UndefinedToOptional<T extends object> = {
|
|
57
|
+
// Property is not a union with `undefined`, keep as-is
|
|
58
|
+
[k in keyof Pick<T, FilterDefinedKeys<T>>]: T[k];
|
|
59
|
+
} & {
|
|
60
|
+
// Property _is_ a union with `defined`. Set as optional (via `?`) and remove `undefined` from the union
|
|
61
|
+
[k in keyof Omit<T, FilterDefinedKeys<T>>]?: Exclude<T[k], undefined>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnyProcedure } from '../core';
|
|
2
|
+
import { inferObservableValue } from '../observable';
|
|
3
|
+
import { DefaultDataTransformer } from '../transformer';
|
|
4
|
+
import type { Serialize } from './internal/serialize';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type inferTransformedProcedureOutput<TProcedure extends AnyProcedure> =
|
|
10
|
+
TProcedure['_def']['_config']['transformer'] extends DefaultDataTransformer
|
|
11
|
+
? Serialize<TProcedure['_def']['_output_out']>
|
|
12
|
+
: TProcedure['_def']['_output_out'];
|
|
13
|
+
|
|
14
|
+
export type inferTransformedSubscriptionOutput<
|
|
15
|
+
TProcedure extends AnyProcedure,
|
|
16
|
+
> = TProcedure['_def']['_config']['transformer'] extends DefaultDataTransformer
|
|
17
|
+
? Serialize<inferObservableValue<TProcedure['_def']['_output_out']>>
|
|
18
|
+
: inferObservableValue<TProcedure['_def']['_output_out']>;
|
package/src/types.ts
CHANGED
|
@@ -73,7 +73,7 @@ export type InferLast<TType> = TType & {
|
|
|
73
73
|
export type inferAsyncReturnType<TFunction extends (...args: any) => any> =
|
|
74
74
|
ThenArg<ReturnType<TFunction>>;
|
|
75
75
|
|
|
76
|
-
type FilterKeys<TObj extends object, TFilter> = {
|
|
76
|
+
export type FilterKeys<TObj extends object, TFilter> = {
|
|
77
77
|
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
78
78
|
}[keyof TObj];
|
|
79
79
|
|