@trpc/client 11.0.0-next-beta.242 → 11.0.0-next-beta.248
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundleSize": 46875,
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 26.
|
|
3
|
+
"bundleOrigSize": 64117,
|
|
4
|
+
"bundleReduction": 26.89,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/links/wsLink.ts",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
{
|
|
160
160
|
"id": "/src/createTRPCClient.ts",
|
|
161
161
|
"size": 1206,
|
|
162
|
-
"origSize":
|
|
162
|
+
"origSize": 4350,
|
|
163
163
|
"renderedExports": [
|
|
164
164
|
"clientCallTypeToProcedureType",
|
|
165
165
|
"createTRPCClientProxy",
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"/src/index.ts"
|
|
172
172
|
],
|
|
173
173
|
"percent": 2.57,
|
|
174
|
-
"reduction": 72.
|
|
174
|
+
"reduction": 72.28
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"id": "/src/links/httpBatchLink.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Unsubscribable } from '@trpc/server/observable';
|
|
2
|
-
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, AnySubscriptionProcedure, inferProcedureInput, inferTransformedProcedureOutput, inferTransformedSubscriptionOutput, IntersectionError, ProcedureOptions,
|
|
2
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, AnySubscriptionProcedure, inferProcedureInput, inferTransformedProcedureOutput, inferTransformedSubscriptionOutput, IntersectionError, ProcedureOptions, ProcedureType, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { CreateTRPCClientOptions } from './createTRPCUntypedClient';
|
|
4
4
|
import type { TRPCSubscriptionObserver, UntypedClientProperties } from './internals/TRPCUntypedClient';
|
|
5
5
|
import { TRPCUntypedClient } from './internals/TRPCUntypedClient';
|
|
@@ -21,15 +21,15 @@ type DecorateProcedure<TRoot extends AnyRootTypes, TProcedure extends AnyProcedu
|
|
|
21
21
|
/**
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
type DecoratedProcedureRecord<TRouter extends AnyRouter,
|
|
25
|
-
[TKey in keyof
|
|
24
|
+
type DecoratedProcedureRecord<TRouter extends AnyRouter, TRecord extends RouterRecord> = {
|
|
25
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends RouterRecord ? DecoratedProcedureRecord<TRouter, $Value> : $Value extends AnyProcedure ? DecorateProcedure<TRouter['_def']['_config']['$types'], $Value> : never : never;
|
|
26
26
|
};
|
|
27
27
|
/** @internal */
|
|
28
28
|
export declare const clientCallTypeToProcedureType: (clientCallType: string) => ProcedureType;
|
|
29
29
|
/**
|
|
30
30
|
* Creates a proxy client and shows type errors if you have query names that collide with built-in properties
|
|
31
31
|
*/
|
|
32
|
-
export type CreateTRPCClient<TRouter extends AnyRouter> = inferRouterClient<TRouter> extends infer $
|
|
32
|
+
export type CreateTRPCClient<TRouter extends AnyRouter> = inferRouterClient<TRouter> extends infer $Value ? UntypedClientProperties & keyof $Value extends never ? inferRouterClient<TRouter> : IntersectionError<UntypedClientProperties & keyof $Value> : never;
|
|
33
33
|
/**
|
|
34
34
|
* @internal
|
|
35
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCClient.d.ts","sourceRoot":"","sources":["../src/createTRPCClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT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,GAC3D,KAAK,CAAC;AAEZ;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,SAAS,EAC7D,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,gBAAgB,CAAC,OAAO,CAAC,CAiB3B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC,GACrC,gBAAgB,CAAC,OAAO,CAAC,CAI3B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,iBAAiB,CAAC,OAAO,CAAC,CAE5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/client",
|
|
3
|
-
"version": "11.0.0-next-beta.
|
|
3
|
+
"version": "11.0.0-next-beta.248+05798dd78",
|
|
4
4
|
"description": "The tRPC client library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"!**/*.test.*"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@trpc/server": "11.0.0-next-beta.
|
|
47
|
+
"@trpc/server": "11.0.0-next-beta.248+05798dd78"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@testing-library/dom": "^9.0.0",
|
|
51
|
-
"@trpc/server": "11.0.0-next-beta.
|
|
51
|
+
"@trpc/server": "11.0.0-next-beta.248+05798dd78",
|
|
52
52
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
53
53
|
"@types/node": "^20.10.0",
|
|
54
54
|
"eslint": "^8.40.0",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"funding": [
|
|
66
66
|
"https://trpc.io/sponsor"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "05798dd78fd304612172fcccb622559954a0f578"
|
|
69
69
|
}
|
package/src/createTRPCClient.ts
CHANGED
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
inferTransformedSubscriptionOutput,
|
|
13
13
|
IntersectionError,
|
|
14
14
|
ProcedureOptions,
|
|
15
|
-
ProcedureRouterRecord,
|
|
16
15
|
ProcedureType,
|
|
16
|
+
RouterRecord,
|
|
17
17
|
} from '@trpc/server/unstable-core-do-not-import';
|
|
18
18
|
import {
|
|
19
19
|
createFlatProxy,
|
|
@@ -78,12 +78,14 @@ type DecorateProcedure<
|
|
|
78
78
|
*/
|
|
79
79
|
type DecoratedProcedureRecord<
|
|
80
80
|
TRouter extends AnyRouter,
|
|
81
|
-
|
|
81
|
+
TRecord extends RouterRecord,
|
|
82
82
|
> = {
|
|
83
|
-
[TKey in keyof
|
|
84
|
-
?
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value
|
|
84
|
+
? $Value extends RouterRecord
|
|
85
|
+
? DecoratedProcedureRecord<TRouter, $Value>
|
|
86
|
+
: $Value extends AnyProcedure
|
|
87
|
+
? DecorateProcedure<TRouter['_def']['_config']['$types'], $Value>
|
|
88
|
+
: never
|
|
87
89
|
: never;
|
|
88
90
|
};
|
|
89
91
|
|
|
@@ -107,10 +109,10 @@ export const clientCallTypeToProcedureType = (
|
|
|
107
109
|
* Creates a proxy client and shows type errors if you have query names that collide with built-in properties
|
|
108
110
|
*/
|
|
109
111
|
export type CreateTRPCClient<TRouter extends AnyRouter> =
|
|
110
|
-
inferRouterClient<TRouter> extends infer $
|
|
111
|
-
? UntypedClientProperties & keyof $
|
|
112
|
+
inferRouterClient<TRouter> extends infer $Value
|
|
113
|
+
? UntypedClientProperties & keyof $Value extends never
|
|
112
114
|
? inferRouterClient<TRouter>
|
|
113
|
-
: IntersectionError<UntypedClientProperties & keyof $
|
|
115
|
+
: IntersectionError<UntypedClientProperties & keyof $Value>
|
|
114
116
|
: never;
|
|
115
117
|
|
|
116
118
|
/**
|