@trpc/server 11.0.0-rc.551 → 11.0.0-rc.552
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": 136668,
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 26.
|
|
3
|
+
"bundleOrigSize": 186605,
|
|
4
|
+
"bundleReduction": 26.76,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
{
|
|
104
104
|
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
105
105
|
"size": 5795,
|
|
106
|
-
"origSize":
|
|
106
|
+
"origSize": 16084,
|
|
107
107
|
"renderedExports": [
|
|
108
108
|
"createBuilder"
|
|
109
109
|
],
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
114
114
|
],
|
|
115
115
|
"percent": 4.24,
|
|
116
|
-
"reduction": 63.
|
|
116
|
+
"reduction": 63.97
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"id": "/src/adapters/aws-lambda/getPlanner.ts",
|
|
@@ -206,9 +206,9 @@
|
|
|
206
206
|
"removedExports": [],
|
|
207
207
|
"dependents": [
|
|
208
208
|
"/src/unstable-core-do-not-import.ts",
|
|
209
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
210
209
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
211
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
210
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
211
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
212
212
|
],
|
|
213
213
|
"percent": 2.01,
|
|
214
214
|
"reduction": 45.94
|
|
@@ -332,10 +332,10 @@
|
|
|
332
332
|
"removedExports": [],
|
|
333
333
|
"dependents": [
|
|
334
334
|
"/src/unstable-core-do-not-import.ts",
|
|
335
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
336
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
337
335
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
338
336
|
"/src/unstable-core-do-not-import/router.ts",
|
|
337
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
338
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
339
339
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
340
340
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
341
341
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
@@ -392,8 +392,8 @@
|
|
|
392
392
|
"removedExports": [],
|
|
393
393
|
"dependents": [
|
|
394
394
|
"/src/unstable-core-do-not-import.ts",
|
|
395
|
-
"/src/unstable-core-do-not-import/
|
|
396
|
-
"/src/unstable-core-do-not-import/
|
|
395
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts",
|
|
396
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
397
397
|
],
|
|
398
398
|
"percent": 1.05,
|
|
399
399
|
"reduction": 16.73
|
|
@@ -429,13 +429,13 @@
|
|
|
429
429
|
"removedExports": [],
|
|
430
430
|
"dependents": [
|
|
431
431
|
"/src/unstable-core-do-not-import.ts",
|
|
432
|
-
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
433
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
434
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
435
432
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
436
433
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
437
434
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
438
435
|
"/src/unstable-core-do-not-import/router.ts",
|
|
436
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
437
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
438
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
439
439
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
440
440
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
441
441
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
@@ -727,31 +727,31 @@
|
|
|
727
727
|
"reduction": 93.8
|
|
728
728
|
},
|
|
729
729
|
{
|
|
730
|
-
"id": "/src/
|
|
730
|
+
"id": "/src/index.ts",
|
|
731
731
|
"size": 0,
|
|
732
|
-
"origSize":
|
|
732
|
+
"origSize": 32,
|
|
733
733
|
"renderedExports": [],
|
|
734
734
|
"removedExports": [],
|
|
735
|
-
"dependents": [
|
|
736
|
-
"/src/adapters/ws.ts"
|
|
737
|
-
],
|
|
735
|
+
"dependents": [],
|
|
738
736
|
"percent": 0,
|
|
739
737
|
"reduction": 100
|
|
740
738
|
},
|
|
741
739
|
{
|
|
742
|
-
"id": "/src/
|
|
740
|
+
"id": "/src/http.ts",
|
|
743
741
|
"size": 0,
|
|
744
|
-
"origSize":
|
|
742
|
+
"origSize": 37,
|
|
745
743
|
"renderedExports": [],
|
|
746
744
|
"removedExports": [],
|
|
747
|
-
"dependents": [
|
|
745
|
+
"dependents": [
|
|
746
|
+
"/src/adapters/ws.ts"
|
|
747
|
+
],
|
|
748
748
|
"percent": 0,
|
|
749
749
|
"reduction": 100
|
|
750
750
|
},
|
|
751
751
|
{
|
|
752
|
-
"id": "/src/
|
|
752
|
+
"id": "/src/rpc.ts",
|
|
753
753
|
"size": 0,
|
|
754
|
-
"origSize":
|
|
754
|
+
"origSize": 36,
|
|
755
755
|
"renderedExports": [],
|
|
756
756
|
"removedExports": [],
|
|
757
757
|
"dependents": [],
|
|
@@ -759,9 +759,9 @@
|
|
|
759
759
|
"reduction": 100
|
|
760
760
|
},
|
|
761
761
|
{
|
|
762
|
-
"id": "/src/
|
|
762
|
+
"id": "/src/shared.ts",
|
|
763
763
|
"size": 0,
|
|
764
|
-
"origSize":
|
|
764
|
+
"origSize": 653,
|
|
765
765
|
"renderedExports": [],
|
|
766
766
|
"removedExports": [],
|
|
767
767
|
"dependents": [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { inferObservableValue } from '../observable';
|
|
1
|
+
import type { inferObservableValue, Observable } from '../observable';
|
|
2
2
|
import type { AnyMiddlewareFunction, MiddlewareBuilder, MiddlewareFunction } from './middleware';
|
|
3
3
|
import type { inferParser, Parser } from './parser';
|
|
4
4
|
import type { AnyProcedure, LegacyObservableSubscriptionProcedure, MutationProcedure, ProcedureType, QueryProcedure, SubscriptionProcedure } from './procedure';
|
|
@@ -8,13 +8,6 @@ import type { UnsetMarker } from './utils';
|
|
|
8
8
|
type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : TWith extends UnsetMarker ? TType : Simplify<TType & TWith>;
|
|
9
9
|
type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
|
|
10
10
|
type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<infer $Output> ? inferTrackedOutput<$Output> : inferObservableValue<TOutput>;
|
|
11
|
-
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> = DefaultValue<TOutputOut, $Output> extends AsyncIterable<any> ? SubscriptionProcedure<{
|
|
12
|
-
input: DefaultValue<TInputIn, void>;
|
|
13
|
-
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
14
|
-
}> : LegacyObservableSubscriptionProcedure<{
|
|
15
|
-
input: DefaultValue<TInputIn, void>;
|
|
16
|
-
output: DefaultValue<TOutputOut, inferSubscriptionOutput<$Output>>;
|
|
17
|
-
}>;
|
|
18
11
|
export type CallerOverride<TContext> = (opts: {
|
|
19
12
|
args: unknown[];
|
|
20
13
|
invoke: (opts: ProcedureCallOptions<TContext>) => Promise<unknown>;
|
|
@@ -113,9 +106,21 @@ export interface ProcedureBuilder<TContext, TMeta, TContextOverrides, TInputIn,
|
|
|
113
106
|
}>;
|
|
114
107
|
/**
|
|
115
108
|
* Subscription procedure
|
|
116
|
-
* @see https://trpc.io/docs/v11/
|
|
109
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
117
110
|
*/
|
|
118
|
-
subscription<$Output
|
|
111
|
+
subscription<$Output extends AsyncGenerator<any, void, any>>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? TypeError<'Not implemented'> : SubscriptionProcedure<{
|
|
112
|
+
input: DefaultValue<TInputIn, void>;
|
|
113
|
+
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Using subscriptions with an observable is deprecated. Use an async generator instead.
|
|
117
|
+
* This feature will be removed in v12 of tRPC.
|
|
118
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
119
|
+
*/
|
|
120
|
+
subscription<$Output extends Observable<any, any>>(resolver: ProcedureResolver<TContext, TMeta, TContextOverrides, TInputOut, TOutputIn, $Output>): TCaller extends true ? TypeError<'Not implemented'> : LegacyObservableSubscriptionProcedure<{
|
|
121
|
+
input: DefaultValue<TInputIn, void>;
|
|
122
|
+
output: inferObservableValue<DefaultValue<TOutputOut, $Output>>;
|
|
123
|
+
}>;
|
|
119
124
|
/**
|
|
120
125
|
* Overrides the way a procedure is invoked
|
|
121
126
|
* Do not use this unless you know what you're doing - this is an experimental API
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"procedureBuilder.d.ts","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T,UAAU,EACV,IAAI,CACL,CAAC;IACF;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CAClC;AAED,KAAK,wBAAwB,GAAG,CAC9B,IAAI,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAC/C,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,EACX,KAAK,CACN,CAkEA;AA6CD;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,QAAQ;IAC5C,GAAG,EAAE,QAAQ,CAAC;IACd,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.552+268308497",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"funding": [
|
|
150
150
|
"https://trpc.io/sponsor"
|
|
151
151
|
],
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "268308497fef646ca5e322b49d1503cd47392871"
|
|
153
153
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { inferObservableValue } from '../observable';
|
|
1
|
+
import type { inferObservableValue, Observable } from '../observable';
|
|
2
2
|
import { getTRPCErrorFromUnknown, TRPCError } from './error/TRPCError';
|
|
3
3
|
import type {
|
|
4
4
|
AnyMiddlewareFunction,
|
|
@@ -50,19 +50,6 @@ type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<
|
|
|
50
50
|
? inferTrackedOutput<$Output>
|
|
51
51
|
: inferObservableValue<TOutput>;
|
|
52
52
|
|
|
53
|
-
type inferSubscriptionProcedure<TInputIn, TOutputOut, $Output> = DefaultValue<
|
|
54
|
-
TOutputOut,
|
|
55
|
-
$Output
|
|
56
|
-
> extends AsyncIterable<any>
|
|
57
|
-
? SubscriptionProcedure<{
|
|
58
|
-
input: DefaultValue<TInputIn, void>;
|
|
59
|
-
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
60
|
-
}>
|
|
61
|
-
: LegacyObservableSubscriptionProcedure<{
|
|
62
|
-
input: DefaultValue<TInputIn, void>;
|
|
63
|
-
output: DefaultValue<TOutputOut, inferSubscriptionOutput<$Output>>;
|
|
64
|
-
}>;
|
|
65
|
-
|
|
66
53
|
export type CallerOverride<TContext> = (opts: {
|
|
67
54
|
args: unknown[];
|
|
68
55
|
invoke: (opts: ProcedureCallOptions<TContext>) => Promise<unknown>;
|
|
@@ -356,9 +343,9 @@ export interface ProcedureBuilder<
|
|
|
356
343
|
|
|
357
344
|
/**
|
|
358
345
|
* Subscription procedure
|
|
359
|
-
* @see https://trpc.io/docs/v11/
|
|
346
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
360
347
|
*/
|
|
361
|
-
subscription<$Output
|
|
348
|
+
subscription<$Output extends AsyncGenerator<any, void, any>>(
|
|
362
349
|
resolver: ProcedureResolver<
|
|
363
350
|
TContext,
|
|
364
351
|
TMeta,
|
|
@@ -369,8 +356,30 @@ export interface ProcedureBuilder<
|
|
|
369
356
|
>,
|
|
370
357
|
): TCaller extends true
|
|
371
358
|
? TypeError<'Not implemented'>
|
|
372
|
-
:
|
|
373
|
-
|
|
359
|
+
: SubscriptionProcedure<{
|
|
360
|
+
input: DefaultValue<TInputIn, void>;
|
|
361
|
+
output: inferSubscriptionOutput<DefaultValue<TOutputOut, $Output>>;
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated Using subscriptions with an observable is deprecated. Use an async generator instead.
|
|
365
|
+
* This feature will be removed in v12 of tRPC.
|
|
366
|
+
* @see https://trpc.io/docs/v11/server/subscriptions
|
|
367
|
+
*/
|
|
368
|
+
subscription<$Output extends Observable<any, any>>(
|
|
369
|
+
resolver: ProcedureResolver<
|
|
370
|
+
TContext,
|
|
371
|
+
TMeta,
|
|
372
|
+
TContextOverrides,
|
|
373
|
+
TInputOut,
|
|
374
|
+
TOutputIn,
|
|
375
|
+
$Output
|
|
376
|
+
>,
|
|
377
|
+
): TCaller extends true
|
|
378
|
+
? TypeError<'Not implemented'>
|
|
379
|
+
: LegacyObservableSubscriptionProcedure<{
|
|
380
|
+
input: DefaultValue<TInputIn, void>;
|
|
381
|
+
output: inferObservableValue<DefaultValue<TOutputOut, $Output>>;
|
|
382
|
+
}>;
|
|
374
383
|
/**
|
|
375
384
|
* Overrides the way a procedure is invoked
|
|
376
385
|
* Do not use this unless you know what you're doing - this is an experimental API
|
|
@@ -478,7 +487,7 @@ export function createBuilder<TContext, TMeta>(
|
|
|
478
487
|
resolver,
|
|
479
488
|
) as AnyMutationProcedure;
|
|
480
489
|
},
|
|
481
|
-
subscription(resolver) {
|
|
490
|
+
subscription(resolver: ProcedureResolver<any, any, any, any, any, any>) {
|
|
482
491
|
return createResolver({ ..._def, type: 'subscription' }, resolver) as any;
|
|
483
492
|
},
|
|
484
493
|
experimental_caller(caller) {
|