@trpc/server 11.0.0-next-beta.271 → 11.0.0-next-beta.272
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/bundle-analysis.json +23 -23
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +4 -4
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts +5 -6
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +2 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.d.ts +3 -1
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/clientish/inference.ts +5 -5
- package/src/unstable-core-do-not-import/clientish/inferrable.ts +6 -12
- package/src/unstable-core-do-not-import/procedureBuilder.ts +2 -1
- package/src/unstable-core-do-not-import/router.ts +6 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundleSize": 92285,
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 36.
|
|
3
|
+
"bundleOrigSize": 145552,
|
|
4
|
+
"bundleReduction": 36.6,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/adapters/ws.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
34
34
|
"size": 6040,
|
|
35
|
-
"origSize":
|
|
35
|
+
"origSize": 9792,
|
|
36
36
|
"renderedExports": [
|
|
37
37
|
"createRouterFactory",
|
|
38
38
|
"callProcedure",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"removedExports": [],
|
|
43
43
|
"dependents": [
|
|
44
44
|
"/src/unstable-core-do-not-import.ts",
|
|
45
|
-
"/src/unstable-core-do-not-import/
|
|
46
|
-
"/src/unstable-core-do-not-import/
|
|
45
|
+
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
46
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
47
47
|
],
|
|
48
48
|
"percent": 6.54,
|
|
49
|
-
"reduction":
|
|
49
|
+
"reduction": 38.32
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
53
53
|
"size": 5602,
|
|
54
|
-
"origSize":
|
|
54
|
+
"origSize": 11765,
|
|
55
55
|
"renderedExports": [
|
|
56
56
|
"unsetMarker",
|
|
57
57
|
"createBuilder"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
63
63
|
],
|
|
64
64
|
"percent": 6.07,
|
|
65
|
-
"reduction": 52.
|
|
65
|
+
"reduction": 52.38
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"id": "/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts",
|
|
@@ -200,9 +200,9 @@
|
|
|
200
200
|
"removedExports": [],
|
|
201
201
|
"dependents": [
|
|
202
202
|
"/src/unstable-core-do-not-import.ts",
|
|
203
|
-
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
204
203
|
"/src/unstable-core-do-not-import/router.ts",
|
|
205
|
-
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
204
|
+
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
205
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
206
206
|
],
|
|
207
207
|
"percent": 2.97,
|
|
208
208
|
"reduction": 45.94
|
|
@@ -266,10 +266,10 @@
|
|
|
266
266
|
"removedExports": [],
|
|
267
267
|
"dependents": [
|
|
268
268
|
"/src/unstable-core-do-not-import.ts",
|
|
269
|
-
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
270
|
-
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
271
269
|
"/src/unstable-core-do-not-import/router.ts",
|
|
272
270
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
271
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
|
|
272
|
+
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
273
273
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
274
274
|
],
|
|
275
275
|
"percent": 1.88,
|
|
@@ -368,8 +368,8 @@
|
|
|
368
368
|
],
|
|
369
369
|
"removedExports": [],
|
|
370
370
|
"dependents": [
|
|
371
|
-
"/src/unstable-core-do-not-import/
|
|
372
|
-
"/src/unstable-core-do-not-import/
|
|
371
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts",
|
|
372
|
+
"/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"
|
|
373
373
|
],
|
|
374
374
|
"percent": 1.34,
|
|
375
375
|
"reduction": 23.32
|
|
@@ -414,8 +414,8 @@
|
|
|
414
414
|
"removedExports": [],
|
|
415
415
|
"dependents": [
|
|
416
416
|
"/src/unstable-core-do-not-import.ts",
|
|
417
|
-
"/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
418
417
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
418
|
+
"/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
419
419
|
"/src/unstable-core-do-not-import/router.ts",
|
|
420
420
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
421
421
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
@@ -628,9 +628,9 @@
|
|
|
628
628
|
"reduction": 93.8
|
|
629
629
|
},
|
|
630
630
|
{
|
|
631
|
-
"id": "/src/
|
|
631
|
+
"id": "/src/index.ts",
|
|
632
632
|
"size": 0,
|
|
633
|
-
"origSize":
|
|
633
|
+
"origSize": 32,
|
|
634
634
|
"renderedExports": [],
|
|
635
635
|
"removedExports": [],
|
|
636
636
|
"dependents": [],
|
|
@@ -638,9 +638,9 @@
|
|
|
638
638
|
"reduction": 100
|
|
639
639
|
},
|
|
640
640
|
{
|
|
641
|
-
"id": "/src/
|
|
641
|
+
"id": "/src/http.ts",
|
|
642
642
|
"size": 0,
|
|
643
|
-
"origSize":
|
|
643
|
+
"origSize": 37,
|
|
644
644
|
"renderedExports": [],
|
|
645
645
|
"removedExports": [],
|
|
646
646
|
"dependents": [],
|
|
@@ -658,9 +658,9 @@
|
|
|
658
658
|
"reduction": 100
|
|
659
659
|
},
|
|
660
660
|
{
|
|
661
|
-
"id": "/src/
|
|
661
|
+
"id": "/src/unstable-core-do-not-import.ts",
|
|
662
662
|
"size": 0,
|
|
663
|
-
"origSize":
|
|
663
|
+
"origSize": 1552,
|
|
664
664
|
"renderedExports": [],
|
|
665
665
|
"removedExports": [],
|
|
666
666
|
"dependents": [],
|
|
@@ -668,9 +668,9 @@
|
|
|
668
668
|
"reduction": 100
|
|
669
669
|
},
|
|
670
670
|
{
|
|
671
|
-
"id": "/src/
|
|
671
|
+
"id": "/src/shared.ts",
|
|
672
672
|
"size": 0,
|
|
673
|
-
"origSize":
|
|
673
|
+
"origSize": 653,
|
|
674
674
|
"renderedExports": [],
|
|
675
675
|
"removedExports": [],
|
|
676
676
|
"dependents": [],
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { inferObservableValue } from '../../observable';
|
|
2
2
|
import type { AnyProcedure, inferProcedureInput } from '../procedure';
|
|
3
3
|
import type { AnyRouter, RouterRecord } from '../router';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AnyClientTypes, inferClientTypes, InferrableClientTypes } from './inferrable';
|
|
5
5
|
import type { Serialize } from './serialize';
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export type inferTransformedProcedureOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> =
|
|
9
|
+
export type inferTransformedProcedureOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<TProcedure['_def']['_output_out']> : TProcedure['_def']['_output_out'];
|
|
10
10
|
/** @internal */
|
|
11
|
-
export type inferTransformedSubscriptionOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> =
|
|
12
|
-
export type GetInferenceHelpers<TType extends 'input' | 'output', TRoot extends
|
|
11
|
+
export type inferTransformedSubscriptionOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<inferObservableValue<TProcedure['_def']['_output_out']>> : inferObservableValue<TProcedure['_def']['_output_out']>;
|
|
12
|
+
export type GetInferenceHelpers<TType extends 'input' | 'output', TRoot extends AnyClientTypes, TRecord extends RouterRecord> = {
|
|
13
13
|
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends RouterRecord ? GetInferenceHelpers<TType, TRoot, $Value> : $Value extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<$Value> : inferTransformedProcedureOutput<TRoot, $Value> : never : never;
|
|
14
14
|
};
|
|
15
15
|
export type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAo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,mBAAmB,CAAC,MAAM,CAAC,GAC3B,+BAA+B,CAAC,KAAK,EAAE,MAAM,CAAC,GAChD,KAAK,GACP,KAAK;CACV,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC5E,OAAO,EACP,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC7E,QAAQ,EACR,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AnyRootTypes } from '../rootConfig';
|
|
2
|
-
export type
|
|
2
|
+
export type AnyClientTypes = Pick<AnyRootTypes, 'errorShape' | 'transformer'>;
|
|
3
3
|
/**
|
|
4
4
|
* Result of `initTRPC.create()`
|
|
5
5
|
*/
|
|
6
6
|
type InitLike = {
|
|
7
7
|
_config: {
|
|
8
|
-
$types:
|
|
8
|
+
$types: AnyClientTypes;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
@@ -18,16 +18,15 @@ type RouterLike = {
|
|
|
18
18
|
* Result of `initTRPC.create()._config`
|
|
19
19
|
*/
|
|
20
20
|
type RootConfigLike = {
|
|
21
|
-
$types:
|
|
21
|
+
$types: AnyClientTypes;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Anything that can be inferred to the root config types needed for a TRPC client
|
|
25
25
|
*/
|
|
26
|
-
export type InferrableClientTypes = RouterLike | InitLike | RootConfigLike |
|
|
26
|
+
export type InferrableClientTypes = RouterLike | InitLike | RootConfigLike | AnyClientTypes;
|
|
27
27
|
/**
|
|
28
28
|
* Infer the root types from a InferrableClientTypes
|
|
29
29
|
*/
|
|
30
|
-
export type
|
|
31
|
-
export type inferErrorShape<TInferrable extends InferrableClientTypes> = inferRootTypes<TInferrable>['errorShape'];
|
|
30
|
+
export type inferClientTypes<TInferrable extends InferrableClientTypes> = TInferrable extends AnyClientTypes ? TInferrable : TInferrable extends RootConfigLike ? TInferrable['$types'] : TInferrable extends InitLike ? TInferrable['_config']['$types'] : TInferrable extends RouterLike ? TInferrable['_def']['_config']['$types'] : never;
|
|
32
31
|
export {};
|
|
33
32
|
//# sourceMappingURL=inferrable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferrable.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inferrable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"inferrable.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inferrable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;AAE9E;;GAEG;AACH,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE;QACP,MAAM,EAAE,cAAc,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,QAAQ,GACR,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,WAAW,SAAS,qBAAqB,IACpE,WAAW,SAAS,cAAc,GAC9B,WAAW,GACX,WAAW,SAAS,cAAc,GAClC,WAAW,CAAC,QAAQ,CAAC,GACrB,WAAW,SAAS,QAAQ,GAC5B,WAAW,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAChC,WAAW,SAAS,UAAU,GAC9B,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GACxC,KAAK,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { inferObservableValue } from '../observable';
|
|
1
2
|
import type { AnyMiddlewareFunction, MiddlewareBuilder, MiddlewareFunction } from './middleware';
|
|
2
3
|
import type { inferParser, Parser } from './parser';
|
|
3
4
|
import type { MutationProcedure, ProcedureType, QueryProcedure, SubscriptionProcedure } from './procedure';
|
|
@@ -77,7 +78,7 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
|
|
|
77
78
|
*/
|
|
78
79
|
subscription<$Output>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): SubscriptionProcedure<{
|
|
79
80
|
input: DefaultValue<TInputIn, void>;
|
|
80
|
-
output: DefaultValue<TOutputOut,
|
|
81
|
+
output: DefaultValue<TOutputOut, inferObservableValue<$Output>>;
|
|
81
82
|
}>;
|
|
82
83
|
/**
|
|
83
84
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedureBuilder.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedureBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"procedureBuilder.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/procedureBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAOtB,O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EACT,OAAO,CACR,GACA,iBAAiB,CAAC;QACnB,KAAK,EAAE,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpC,MAAM,EAAE,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KAC3C,CAAC,CAAC;IAEH;;;OAGG;IACH,YAAY,CAAC,OAAO,EAClB,QAAQ,EAAE,iBAAiB,CACzB,QAAQ,EACR,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,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;KACjE,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"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Observable } from '../observable';
|
|
2
|
+
import { TRPCError } from './error/TRPCError';
|
|
1
3
|
import type { AnyProcedure, inferProcedureInput } from './procedure';
|
|
2
4
|
import type { ProcedureCallOptions } from './procedureBuilder';
|
|
3
5
|
import type { AnyRootTypes, RootConfig } from './rootConfig';
|
|
@@ -5,7 +7,7 @@ import type { MaybePromise } from './types';
|
|
|
5
7
|
export interface RouterRecord {
|
|
6
8
|
[key: string]: AnyProcedure | RouterRecord;
|
|
7
9
|
}
|
|
8
|
-
type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedureInput<TProcedure>) => Promise<TProcedure['_def']['_output_out']>;
|
|
10
|
+
type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedureInput<TProcedure>) => Promise<TProcedure['_def']['type'] extends 'subscription' ? Observable<TProcedure['_def']['_output_out'], TRPCError> : TProcedure['_def']['_output_out']>;
|
|
9
11
|
/**
|
|
10
12
|
* @internal
|
|
11
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,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,EAAW,MAAM,SAAS,CAAC;AAGrD,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;CAC5C;AAED,KAAK,iBAAiB,CAAC,UAAU,SAAS,YAAY,IAAI,CACxD,KAAK,EA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AAE,YAAY,CAAA;CAAE,oBAY1D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,YAAY,oGAmC7D;AAED,gBAAgB;AAChB,KAAK,YAAY,CACf,QAAQ,SAAS,SAAS,EAAE,EAC5B,KAAK,SAAS,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAErE,OAAO,SAAS,YAAY,GAAG,EAAE,IAC/B,QAAQ,SAAS;IACnB,MAAM,IAAI,SAAS,SAAS;IAC5B,GAAG,MAAM,IAAI,SAAS,SAAS,EAAE;CAClC,GACG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAC3D,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAEhC,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,EACvD,GAAG,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,GAC3B,YAAY,CAAC,QAAQ,CAAC,CAoDxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-next-beta.
|
|
3
|
+
"version": "11.0.0-next-beta.272+765a5e71a",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"funding": [
|
|
158
158
|
"https://trpc.io/sponsor"
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "765a5e71a5b84d54d6275ec93e4314d43feb10cf"
|
|
161
161
|
}
|
|
@@ -2,9 +2,9 @@ import type { inferObservableValue } from '../../observable';
|
|
|
2
2
|
import type { AnyProcedure, inferProcedureInput } from '../procedure';
|
|
3
3
|
import type { AnyRouter, RouterRecord } from '../router';
|
|
4
4
|
import type {
|
|
5
|
-
|
|
5
|
+
AnyClientTypes,
|
|
6
|
+
inferClientTypes,
|
|
6
7
|
InferrableClientTypes,
|
|
7
|
-
inferRootTypes,
|
|
8
8
|
} from './inferrable';
|
|
9
9
|
import type { Serialize } from './serialize';
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ import type { Serialize } from './serialize';
|
|
|
15
15
|
export type inferTransformedProcedureOutput<
|
|
16
16
|
TInferrable extends InferrableClientTypes,
|
|
17
17
|
TProcedure extends AnyProcedure,
|
|
18
|
-
> =
|
|
18
|
+
> = inferClientTypes<TInferrable>['transformer'] extends false
|
|
19
19
|
? Serialize<TProcedure['_def']['_output_out']>
|
|
20
20
|
: TProcedure['_def']['_output_out'];
|
|
21
21
|
/** @internal */
|
|
@@ -23,13 +23,13 @@ export type inferTransformedProcedureOutput<
|
|
|
23
23
|
export type inferTransformedSubscriptionOutput<
|
|
24
24
|
TInferrable extends InferrableClientTypes,
|
|
25
25
|
TProcedure extends AnyProcedure,
|
|
26
|
-
> =
|
|
26
|
+
> = inferClientTypes<TInferrable>['transformer'] extends false
|
|
27
27
|
? Serialize<inferObservableValue<TProcedure['_def']['_output_out']>>
|
|
28
28
|
: inferObservableValue<TProcedure['_def']['_output_out']>;
|
|
29
29
|
|
|
30
30
|
export type GetInferenceHelpers<
|
|
31
31
|
TType extends 'input' | 'output',
|
|
32
|
-
TRoot extends
|
|
32
|
+
TRoot extends AnyClientTypes,
|
|
33
33
|
TRecord extends RouterRecord,
|
|
34
34
|
> = {
|
|
35
35
|
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { AnyRootTypes } from '../rootConfig';
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
AnyRootTypes,
|
|
5
|
-
'errorShape' | 'transformer'
|
|
6
|
-
>;
|
|
3
|
+
export type AnyClientTypes = Pick<AnyRootTypes, 'errorShape' | 'transformer'>;
|
|
7
4
|
|
|
8
5
|
/**
|
|
9
6
|
* Result of `initTRPC.create()`
|
|
10
7
|
*/
|
|
11
8
|
type InitLike = {
|
|
12
9
|
_config: {
|
|
13
|
-
$types:
|
|
10
|
+
$types: AnyClientTypes;
|
|
14
11
|
};
|
|
15
12
|
};
|
|
16
13
|
|
|
@@ -25,7 +22,7 @@ type RouterLike = {
|
|
|
25
22
|
* Result of `initTRPC.create()._config`
|
|
26
23
|
*/
|
|
27
24
|
type RootConfigLike = {
|
|
28
|
-
$types:
|
|
25
|
+
$types: AnyClientTypes;
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
/**
|
|
@@ -35,13 +32,13 @@ export type InferrableClientTypes =
|
|
|
35
32
|
| RouterLike
|
|
36
33
|
| InitLike
|
|
37
34
|
| RootConfigLike
|
|
38
|
-
|
|
|
35
|
+
| AnyClientTypes;
|
|
39
36
|
|
|
40
37
|
/**
|
|
41
38
|
* Infer the root types from a InferrableClientTypes
|
|
42
39
|
*/
|
|
43
|
-
export type
|
|
44
|
-
TInferrable extends
|
|
40
|
+
export type inferClientTypes<TInferrable extends InferrableClientTypes> =
|
|
41
|
+
TInferrable extends AnyClientTypes
|
|
45
42
|
? TInferrable
|
|
46
43
|
: TInferrable extends RootConfigLike
|
|
47
44
|
? TInferrable['$types']
|
|
@@ -50,6 +47,3 @@ export type inferRootTypes<TInferrable extends InferrableClientTypes> =
|
|
|
50
47
|
: TInferrable extends RouterLike
|
|
51
48
|
? TInferrable['_def']['_config']['$types']
|
|
52
49
|
: never;
|
|
53
|
-
|
|
54
|
-
export type inferErrorShape<TInferrable extends InferrableClientTypes> =
|
|
55
|
-
inferRootTypes<TInferrable>['errorShape'];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { inferObservableValue } from '../observable';
|
|
1
2
|
import { getTRPCErrorFromUnknown, TRPCError } from './error/TRPCError';
|
|
2
3
|
import type {
|
|
3
4
|
AnyMiddlewareFunction,
|
|
@@ -227,7 +228,7 @@ export interface ProcedureBuilder<
|
|
|
227
228
|
>,
|
|
228
229
|
): SubscriptionProcedure<{
|
|
229
230
|
input: DefaultValue<TInputIn, void>;
|
|
230
|
-
output: DefaultValue<TOutputOut,
|
|
231
|
+
output: DefaultValue<TOutputOut, inferObservableValue<$Output>>;
|
|
231
232
|
}>;
|
|
232
233
|
/**
|
|
233
234
|
* @internal
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Observable } from '../observable';
|
|
1
2
|
import { createRecursiveProxy } from './createProxy';
|
|
2
3
|
import { defaultFormatter } from './error/formatter';
|
|
3
4
|
import { TRPCError } from './error/TRPCError';
|
|
@@ -14,7 +15,11 @@ export interface RouterRecord {
|
|
|
14
15
|
|
|
15
16
|
type DecorateProcedure<TProcedure extends AnyProcedure> = (
|
|
16
17
|
input: inferProcedureInput<TProcedure>,
|
|
17
|
-
) => Promise<
|
|
18
|
+
) => Promise<
|
|
19
|
+
TProcedure['_def']['type'] extends 'subscription'
|
|
20
|
+
? Observable<TProcedure['_def']['_output_out'], TRPCError>
|
|
21
|
+
: TProcedure['_def']['_output_out']
|
|
22
|
+
>;
|
|
18
23
|
|
|
19
24
|
/**
|
|
20
25
|
* @internal
|