@trpc/server 11.23.0 → 11.23.1-canary.14.507382d73
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/adapters/aws-lambda/index.cjs +12 -2
- package/dist/adapters/aws-lambda/index.d.cts +24 -1
- package/dist/adapters/aws-lambda/index.d.cts.map +1 -1
- package/dist/adapters/aws-lambda/index.d.mts +24 -1
- package/dist/adapters/aws-lambda/index.d.mts.map +1 -1
- package/dist/adapters/aws-lambda/index.mjs +12 -2
- package/dist/adapters/aws-lambda/index.mjs.map +1 -1
- package/dist/adapters/express.cjs +8 -3
- package/dist/adapters/express.d.cts +12 -2
- package/dist/adapters/express.d.cts.map +1 -1
- package/dist/adapters/express.d.mts +12 -2
- package/dist/adapters/express.d.mts.map +1 -1
- package/dist/adapters/express.mjs +8 -3
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/fastify/index.cjs +20 -4
- package/dist/adapters/fastify/index.d.cts +38 -4
- package/dist/adapters/fastify/index.d.cts.map +1 -1
- package/dist/adapters/fastify/index.d.mts +38 -4
- package/dist/adapters/fastify/index.d.mts.map +1 -1
- package/dist/adapters/fastify/index.mjs +20 -4
- package/dist/adapters/fastify/index.mjs.map +1 -1
- package/dist/adapters/fetch/index.cjs +13 -2
- package/dist/adapters/fetch/index.d.cts +26 -1
- package/dist/adapters/fetch/index.d.cts.map +1 -1
- package/dist/adapters/fetch/index.d.mts +26 -1
- package/dist/adapters/fetch/index.d.mts.map +1 -1
- package/dist/adapters/fetch/index.mjs +13 -2
- package/dist/adapters/fetch/index.mjs.map +1 -1
- package/dist/adapters/next-app-dir.cjs +19 -9
- package/dist/adapters/next-app-dir.d.cts +21 -11
- package/dist/adapters/next-app-dir.d.cts.map +1 -1
- package/dist/adapters/next-app-dir.d.mts +21 -11
- package/dist/adapters/next-app-dir.d.mts.map +1 -1
- package/dist/adapters/next-app-dir.mjs +19 -9
- package/dist/adapters/next-app-dir.mjs.map +1 -1
- package/dist/adapters/next.cjs +10 -4
- package/dist/adapters/next.d.cts +13 -2
- package/dist/adapters/next.d.cts.map +1 -1
- package/dist/adapters/next.d.mts +13 -2
- package/dist/adapters/next.d.mts.map +1 -1
- package/dist/adapters/next.mjs +10 -4
- package/dist/adapters/next.mjs.map +1 -1
- package/dist/adapters/node-http/index.cjs +1 -1
- package/dist/adapters/node-http/index.d.cts +1 -1
- package/dist/adapters/node-http/index.d.mts +1 -1
- package/dist/adapters/node-http/index.mjs +1 -1
- package/dist/adapters/standalone.cjs +19 -3
- package/dist/adapters/standalone.d.cts +32 -6
- package/dist/adapters/standalone.d.cts.map +1 -1
- package/dist/adapters/standalone.d.mts +32 -6
- package/dist/adapters/standalone.d.mts.map +1 -1
- package/dist/adapters/standalone.mjs +19 -3
- package/dist/adapters/standalone.mjs.map +1 -1
- package/dist/adapters/ws.cjs +1 -1
- package/dist/adapters/ws.d.cts +2 -2
- package/dist/adapters/ws.d.mts +2 -2
- package/dist/adapters/ws.mjs +1 -1
- package/dist/{asyncGeneratorDelegate-FcEJT04i.mjs → asyncGeneratorDelegate-Bl41FGB5.mjs} +41 -8
- package/dist/asyncGeneratorDelegate-Bl41FGB5.mjs.map +1 -0
- package/dist/{asyncGeneratorDelegate-Dj-8tGhf.cjs → asyncGeneratorDelegate-CPV0O1Hn.cjs} +40 -7
- package/dist/{codes-HK4UsP07.cjs → codes-Be-DrYMh.cjs} +8 -4
- package/dist/{codes-C9N0z0an.mjs → codes-nbrm_zWY.mjs} +9 -5
- package/dist/codes-nbrm_zWY.mjs.map +1 -0
- package/dist/{contentTypeParsers-B1e2ZNvN.cjs → contentTypeParsers-BTdoZrqN.cjs} +12 -0
- package/dist/contentTypeParsers-D1EBkFFY.mjs +26 -0
- package/dist/contentTypeParsers-D1EBkFFY.mjs.map +1 -0
- package/dist/{getErrorShape-hncV8cPE.cjs → getErrorShape-8t0oLscZ.cjs} +16 -5
- package/dist/{getErrorShape-zlj81BiC.mjs → getErrorShape-B6z8u8q0.mjs} +17 -6
- package/dist/getErrorShape-B6z8u8q0.mjs.map +1 -0
- package/dist/http.cjs +3 -3
- package/dist/http.d.cts +1 -1
- package/dist/http.d.mts +1 -1
- package/dist/http.mjs +3 -3
- package/dist/{index-BI3Qi_F-.d.cts → index-BGYvuCEh.d.cts} +68 -8
- package/dist/index-BGYvuCEh.d.cts.map +1 -0
- package/dist/{index-BI3Qi_F-.d.mts → index-BGYvuCEh.d.mts} +68 -8
- package/dist/index-BGYvuCEh.d.mts.map +1 -0
- package/dist/{index-Tpw5OCTF.d.cts → index-CTfJHk7_.d.cts} +41 -29
- package/dist/index-CTfJHk7_.d.cts.map +1 -0
- package/dist/{index-CtkOmZzm.d.mts → index-DD2oXVyh.d.mts} +41 -29
- package/dist/index-DD2oXVyh.d.mts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{initTRPC-RMeQIy9H.mjs → initTRPC-JhlmAV6P.mjs} +31 -22
- package/dist/initTRPC-JhlmAV6P.mjs.map +1 -0
- package/dist/{initTRPC-DP-s8c4t.cjs → initTRPC-jn7uHFOx.cjs} +30 -21
- package/dist/{node-http-X8RiQEuH.cjs → node-http-CCpTZ1zd.cjs} +13 -6
- package/dist/{node-http-ChhZEv1k.mjs → node-http-DTcc6qM4.mjs} +14 -7
- package/dist/node-http-DTcc6qM4.mjs.map +1 -0
- package/dist/observable/index.cjs +2 -2
- package/dist/observable/index.d.cts +1 -1
- package/dist/observable/index.d.mts +1 -1
- package/dist/observable/index.mjs +2 -2
- package/dist/{observable-C-LvH26G.cjs → observable-B8nn0anr.cjs} +27 -4
- package/dist/{observable-yEyhfXUI.mjs → observable-CdPmrXKY.mjs} +28 -5
- package/dist/observable-CdPmrXKY.mjs.map +1 -0
- package/dist/{observable-CkXWrCsV.mjs → observable-F1Nt_3e4.mjs} +16 -4
- package/dist/observable-F1Nt_3e4.mjs.map +1 -0
- package/dist/{observable-xBsJ11Ns.cjs → observable-N4F1yT7s.cjs} +15 -3
- package/dist/{parseTRPCMessage-CJ4DJVBp.mjs → parseTRPCMessage-BO1-cCsX.mjs} +7 -3
- package/dist/parseTRPCMessage-BO1-cCsX.mjs.map +1 -0
- package/dist/{parseTRPCMessage-CPEfSSFx.cjs → parseTRPCMessage-BsPr5reh.cjs} +6 -2
- package/dist/{resolveResponse-DksrxZ2k.mjs → resolveResponse-B2MQmLSr.mjs} +17 -5
- package/dist/resolveResponse-B2MQmLSr.mjs.map +1 -0
- package/dist/{resolveResponse-CoGjFxK0.cjs → resolveResponse-BQcrvKyB.cjs} +16 -4
- package/dist/rpc.cjs +2 -2
- package/dist/rpc.d.cts +1 -1
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.mjs +2 -2
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/shared.mjs +1 -1
- package/dist/{unstable-core-do-not-import-B8epiErP.d.cts → unstable-core-do-not-import-DYnAWlN7.d.cts} +517 -161
- package/dist/unstable-core-do-not-import-DYnAWlN7.d.cts.map +1 -0
- package/dist/{unstable-core-do-not-import-Dbo98mkh.d.mts → unstable-core-do-not-import-hC2_7K-s.d.mts} +517 -161
- package/dist/unstable-core-do-not-import-hC2_7K-s.d.mts.map +1 -0
- package/dist/unstable-core-do-not-import.cjs +7 -7
- package/dist/unstable-core-do-not-import.d.cts +1 -1
- package/dist/unstable-core-do-not-import.d.mts +1 -1
- package/dist/unstable-core-do-not-import.mjs +7 -7
- package/dist/{ws-BYfo-HED.mjs → ws-B9v4J-4P.mjs} +30 -11
- package/dist/ws-B9v4J-4P.mjs.map +1 -0
- package/dist/ws-DVHbmgfC.d.mts +95 -0
- package/dist/ws-DVHbmgfC.d.mts.map +1 -0
- package/dist/ws-JzZs-0Zd.d.cts +95 -0
- package/dist/ws-JzZs-0Zd.d.cts.map +1 -0
- package/dist/{ws-7qWW7Uec.cjs → ws-_SClUVOu.cjs} +29 -10
- package/package.json +2 -2
- package/skills/adapter-aws-lambda/SKILL.md +1 -1
- package/skills/adapter-express/SKILL.md +1 -1
- package/skills/adapter-fastify/SKILL.md +1 -1
- package/skills/adapter-fetch/SKILL.md +1 -1
- package/skills/adapter-standalone/SKILL.md +1 -1
- package/skills/auth/SKILL.md +1 -1
- package/skills/caching/SKILL.md +2 -2
- package/skills/error-handling/SKILL.md +1 -1
- package/skills/middlewares/SKILL.md +1 -1
- package/skills/non-json-content-types/SKILL.md +13 -4
- package/skills/server-setup/SKILL.md +1 -1
- package/skills/server-side-calls/SKILL.md +1 -1
- package/skills/service-oriented-architecture/SKILL.md +1 -1
- package/skills/subscriptions/SKILL.md +1 -1
- package/skills/trpc-router/SKILL.md +1 -1
- package/skills/validators/SKILL.md +1 -1
- package/src/@trpc/server/index.ts +2 -2
- package/src/adapters/aws-lambda/index.ts +23 -0
- package/src/adapters/express.ts +10 -0
- package/src/adapters/fastify/fastifyRequestHandler.ts +5 -0
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +30 -1
- package/src/adapters/fetch/fetchRequestHandler.ts +11 -0
- package/src/adapters/fetch/types.ts +14 -0
- package/src/adapters/next-app-dir/nextAppDirCaller.ts +8 -4
- package/src/adapters/next-app-dir/notFound.ts +3 -1
- package/src/adapters/next-app-dir/redirect.ts +6 -4
- package/src/adapters/next-app-dir/rethrowNextErrors.ts +5 -1
- package/src/adapters/next.ts +13 -1
- package/src/adapters/node-http/incomingMessageToRequest.ts +6 -1
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +3 -1
- package/src/adapters/node-http/types.ts +30 -25
- package/src/adapters/standalone.ts +30 -4
- package/src/adapters/ws.ts +42 -8
- package/src/adapters/wsEncoder.ts +5 -6
- package/src/observable/behaviorSubject.ts +6 -2
- package/src/observable/observable.ts +31 -5
- package/src/observable/operators.ts +12 -0
- package/src/observable/types.ts +18 -0
- package/src/unstable-core-do-not-import/clientish/inference.ts +22 -1
- package/src/unstable-core-do-not-import/clientish/inferrable.ts +5 -2
- package/src/unstable-core-do-not-import/createProxy.ts +4 -4
- package/src/unstable-core-do-not-import/error/TRPCError.ts +19 -0
- package/src/unstable-core-do-not-import/error/formatter.ts +15 -2
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +2 -0
- package/src/unstable-core-do-not-import/http/contentTypeParsers.ts +15 -2
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +9 -0
- package/src/unstable-core-do-not-import/http/parseConnectionParams.ts +8 -0
- package/src/unstable-core-do-not-import/http/resolveResponse.ts +4 -0
- package/src/unstable-core-do-not-import/http/types.ts +55 -27
- package/src/unstable-core-do-not-import/initTRPC.ts +51 -27
- package/src/unstable-core-do-not-import/middleware.ts +25 -5
- package/src/unstable-core-do-not-import/procedure.ts +28 -2
- package/src/unstable-core-do-not-import/procedureBuilder.ts +56 -35
- package/src/unstable-core-do-not-import/rootConfig.ts +28 -19
- package/src/unstable-core-do-not-import/router.ts +71 -11
- package/src/unstable-core-do-not-import/rpc/codes.ts +13 -5
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +45 -9
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +5 -1
- package/src/unstable-core-do-not-import/stream/tracked.ts +17 -5
- package/src/unstable-core-do-not-import/transformer.ts +12 -1
- package/src/unstable-core-do-not-import/types.ts +2 -0
- package/src/unstable-core-do-not-import/utils.ts +4 -1
- package/dist/asyncGeneratorDelegate-FcEJT04i.mjs.map +0 -1
- package/dist/codes-C9N0z0an.mjs.map +0 -1
- package/dist/contentTypeParsers-Bb-9hUEf.mjs +0 -14
- package/dist/contentTypeParsers-Bb-9hUEf.mjs.map +0 -1
- package/dist/getErrorShape-zlj81BiC.mjs.map +0 -1
- package/dist/index-BI3Qi_F-.d.cts.map +0 -1
- package/dist/index-BI3Qi_F-.d.mts.map +0 -1
- package/dist/index-CtkOmZzm.d.mts.map +0 -1
- package/dist/index-Tpw5OCTF.d.cts.map +0 -1
- package/dist/initTRPC-RMeQIy9H.mjs.map +0 -1
- package/dist/node-http-ChhZEv1k.mjs.map +0 -1
- package/dist/observable-CkXWrCsV.mjs.map +0 -1
- package/dist/observable-yEyhfXUI.mjs.map +0 -1
- package/dist/parseTRPCMessage-CJ4DJVBp.mjs.map +0 -1
- package/dist/resolveResponse-DksrxZ2k.mjs.map +0 -1
- package/dist/unstable-core-do-not-import-B8epiErP.d.cts.map +0 -1
- package/dist/unstable-core-do-not-import-Dbo98mkh.d.mts.map +0 -1
- package/dist/ws-BYfo-HED.mjs.map +0 -1
- package/dist/ws-DD1ukLuC.d.cts +0 -61
- package/dist/ws-DD1ukLuC.d.cts.map +0 -1
- package/dist/ws-DT37N43e.d.mts +0 -61
- package/dist/ws-DT37N43e.d.mts.map +0 -1
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
//#region src/observable/types.d.ts
|
|
2
|
+
/** What `subscribe()` returns: call `unsubscribe()` to stop. */
|
|
2
3
|
interface Unsubscribable {
|
|
4
|
+
/** Stops the subscription and runs its teardown. */
|
|
3
5
|
unsubscribe(): void;
|
|
4
6
|
}
|
|
7
|
+
/** Stops a subscription. */
|
|
5
8
|
type UnsubscribeFn = () => void;
|
|
6
9
|
interface Subscribable<TValue, TError> {
|
|
10
|
+
/** Starts the observable, sending what it emits to `observer`. */
|
|
7
11
|
subscribe(observer: Partial<Observer<TValue, TError>>): Unsubscribable;
|
|
8
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* A stream of values, which starts when you subscribe to it. Links pass
|
|
15
|
+
* results along as observables.
|
|
16
|
+
* @see https://trpc.io/docs/client/links#creating-a-custom-link
|
|
17
|
+
*/
|
|
9
18
|
interface Observable<TValue, TError> extends Subscribable<TValue, TError> {
|
|
19
|
+
/** Returns an observable with the operators applied, in order. */
|
|
10
20
|
pipe(): Observable<TValue, TError>;
|
|
11
21
|
pipe<TValue1, TError1>(op1: OperatorFunction<TValue, TError, TValue1, TError1>): Observable<TValue1, TError1>;
|
|
12
22
|
pipe<TValue1, TError1, TValue2, TError2>(op1: OperatorFunction<TValue, TError, TValue1, TError1>, op2: OperatorFunction<TValue1, TError1, TValue2, TError2>): Observable<TValue2, TError2>;
|
|
@@ -14,50 +24,100 @@ interface Observable<TValue, TError> extends Subscribable<TValue, TError> {
|
|
|
14
24
|
pipe<TValue1, TError1, TValue2, TError2, TValue3, TError3, TValue4, TError4>(op1: OperatorFunction<TValue, TError, TValue1, TError1>, op2: OperatorFunction<TValue1, TError1, TValue2, TError2>, op3: OperatorFunction<TValue2, TError2, TValue3, TError3>, op4: OperatorFunction<TValue3, TError3, TValue4, TError4>): Observable<TValue2, TError2>;
|
|
15
25
|
pipe<TValue1, TError1, TValue2, TError2, TValue3, TError3, TValue4, TError4, TValue5, TError5>(op1: OperatorFunction<TValue, TError, TValue1, TError1>, op2: OperatorFunction<TValue1, TError1, TValue2, TError2>, op3: OperatorFunction<TValue2, TError2, TValue3, TError3>, op4: OperatorFunction<TValue3, TError3, TValue4, TError4>, op5: OperatorFunction<TValue4, TError4, TValue5, TError5>): Observable<TValue2, TError2>;
|
|
16
26
|
}
|
|
27
|
+
/** Gets an observable's values, its error, and its end. */
|
|
17
28
|
interface Observer<TValue, TError> {
|
|
29
|
+
/** Gets each value. */
|
|
18
30
|
next: (value: TValue) => void;
|
|
31
|
+
/** Gets the error the observable ends with. */
|
|
19
32
|
error: (err: TError) => void;
|
|
33
|
+
/** Called when the observable ends without an error. */
|
|
20
34
|
complete: () => void;
|
|
21
35
|
}
|
|
36
|
+
/** What the function passed to `observable()` returns to clean up on unsubscribe. */
|
|
22
37
|
type TeardownLogic = Unsubscribable | UnsubscribeFn | void;
|
|
38
|
+
/** A function of one argument. */
|
|
23
39
|
type UnaryFunction<TSource, TReturn> = (source: TSource) => TReturn;
|
|
40
|
+
/** Turns one observable into another, for `pipe()`. */
|
|
24
41
|
type OperatorFunction<TValueBefore, TErrorBefore, TValueAfter, TErrorAfter> = UnaryFunction<Subscribable<TValueBefore, TErrorBefore>, Subscribable<TValueAfter, TErrorAfter>>;
|
|
42
|
+
/** An operator that keeps the value and error types. */
|
|
25
43
|
type MonoTypeOperatorFunction<TValue, TError> = OperatorFunction<TValue, TError, TValue, TError>;
|
|
26
44
|
//#endregion
|
|
27
45
|
//#region src/observable/observable.d.ts
|
|
28
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* The type of the values an observable emits.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
29
50
|
type inferObservableValue<TObservable> = TObservable extends Observable<infer TValue, unknown> ? TValue : never;
|
|
30
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Whether a value is an observable: an object with `subscribe`.
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
31
55
|
declare function isObservable(x: unknown): x is Observable<unknown, unknown>;
|
|
32
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Creates an observable. `subscribe` runs for each subscriber, and can
|
|
58
|
+
* return a function that cleans up when it unsubscribes.
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const ticks = observable<number>((observer) => {
|
|
62
|
+
* const timer = setInterval(() => observer.next(Date.now()), 1000);
|
|
63
|
+
* return () => clearInterval(timer);
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
* @see https://trpc.io/docs/client/links#creating-a-custom-link
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
33
69
|
declare function observable<TValue, TError = unknown>(subscribe: (observer: Observer<TValue, TError>) => TeardownLogic): Observable<TValue, TError>;
|
|
34
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Resolves with an observable's first value. Rejects if it errors or
|
|
72
|
+
* completes first. It doesn't unsubscribe after the first value.
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
35
75
|
declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>): Promise<TValue>;
|
|
36
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Turns an observable into an async iterable. Aborting `signal`
|
|
78
|
+
* unsubscribes from the observable but doesn't end a pending `next()`.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
37
81
|
declare function observableToAsyncIterable<TValue>(observable: Observable<TValue, unknown>, signal: AbortSignal): AsyncIterable<TValue>;
|
|
38
82
|
//#endregion
|
|
39
83
|
//#region src/observable/operators.d.ts
|
|
84
|
+
/** Maps each value with `project`. */
|
|
40
85
|
declare function map<TValueBefore, TError, TValueAfter>(project: (value: TValueBefore, index: number) => TValueAfter): OperatorFunction<TValueBefore, TError, TValueAfter, TError>;
|
|
41
86
|
interface ShareConfig {}
|
|
87
|
+
/**
|
|
88
|
+
* Shares one subscription to the source between all subscribers. It
|
|
89
|
+
* starts with the first subscriber and ends when the last unsubscribes.
|
|
90
|
+
*/
|
|
42
91
|
declare function share<TValue, TError>(_opts?: ShareConfig): MonoTypeOperatorFunction<TValue, TError>;
|
|
92
|
+
/** Calls `observer` with each value, error and completion, and passes them on unchanged. */
|
|
43
93
|
declare function tap<TValue, TError>(observer: Partial<Observer<TValue, TError>>): MonoTypeOperatorFunction<TValue, TError>;
|
|
94
|
+
/** Skips values equal to the one before, by `compare` (`===` by default). */
|
|
44
95
|
declare function distinctUntilChanged<TValue, TError>(compare?: (a: TValue, b: TValue) => boolean): MonoTypeOperatorFunction<TValue, TError>;
|
|
96
|
+
/**
|
|
97
|
+
* Skips values equal to the one before, comparing objects and arrays by
|
|
98
|
+
* their own enumerable keys. Objects without such keys, like two `Date`s,
|
|
99
|
+
* always count as equal.
|
|
100
|
+
*/
|
|
45
101
|
declare function distinctUntilDeepChanged<TValue, TError>(): MonoTypeOperatorFunction<TValue, TError>;
|
|
46
102
|
//#endregion
|
|
47
103
|
//#region src/observable/behaviorSubject.d.ts
|
|
104
|
+
/** An observable that holds a current value. */
|
|
48
105
|
interface BehaviorSubject<TValue> extends Observable<TValue, never> {
|
|
49
106
|
observable: Observable<TValue, never>;
|
|
107
|
+
/** Sets the value and sends it to subscribers, if it changed. */
|
|
50
108
|
next: (value: TValue) => void;
|
|
109
|
+
/** The current value. */
|
|
51
110
|
get: () => TValue;
|
|
52
111
|
}
|
|
112
|
+
/** A `BehaviorSubject` that can't be set. */
|
|
53
113
|
interface ReadonlyBehaviorSubject<TValue> extends Omit<BehaviorSubject<TValue>, 'next'> {}
|
|
54
114
|
/**
|
|
115
|
+
* Creates an observable that holds a current value. New subscribers get
|
|
116
|
+
* it right away, unless it's `undefined`.
|
|
55
117
|
* @internal
|
|
56
|
-
* An observable that maintains and provides a "current value" to subscribers
|
|
57
|
-
* @see https://www.learnrxjs.io/learn-rxjs/subjects/behaviorsubject
|
|
58
118
|
*/
|
|
59
119
|
declare function behaviorSubject<TValue>(initialValue: TValue): BehaviorSubject<TValue>;
|
|
60
120
|
//#endregion
|
|
61
121
|
export { Unsubscribable as _, distinctUntilDeepChanged as a, tap as c, observable as d, observableToAsyncIterable as f, TeardownLogic as g, Observer as h, distinctUntilChanged as i, inferObservableValue as l, Observable as m, ReadonlyBehaviorSubject as n, map as o, observableToPromise as p, behaviorSubject as r, share as s, BehaviorSubject as t, isObservable as u, UnsubscribeFn as v };
|
|
62
122
|
|
|
63
|
-
//# sourceMappingURL=index-
|
|
123
|
+
//# sourceMappingURL=index-BGYvuCEh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BGYvuCEh.d.mts","names":[],"sources":["../src/observable/types.ts","../src/observable/observable.ts","../src/observable/operators.ts","../src/observable/behaviorSubject.ts"],"mappings":";;UACiB;;EAEf;;;KAGU;UACF,aAAa,QAAQ;;EAE7B,UAAU,UAAU,QAAQ,SAAS,QAAQ,WAAW;;;;;;;UAOzC,WAAW,QAAQ,gBAAgB,aAClD,QACA;;EAGA,QAAQ,WAAW,QAAQ;EAC3B,KAAK,SAAS,SACZ,KAAK,iBAAiB,QAAQ,QAAQ,SAAS,WAC9C,WAAW,SAAS;EACvB,KAAK,SAAS,SAAS,SAAS,SAC9B,KAAK,iBAAiB,QAAQ,QAAQ,SAAS,UAC/C,KAAK,iBAAiB,SAAS,SAAS,SAAS,WAChD,WAAW,SAAS;EACvB,KAAK,SAAS,SAAS,SAAS,SAAS,SAAS,SAChD,KAAK,iBAAiB,QAAQ,QAAQ,SAAS,UAC/C,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,WAChD,WAAW,SAAS;EACvB,KAAK,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,SAClE,KAAK,iBAAiB,QAAQ,QAAQ,SAAS,UAC/C,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,WAChD,WAAW,SAAS;EACvB,KACE,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SAEA,KAAK,iBAAiB,QAAQ,QAAQ,SAAS,UAC/C,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,UACjD,KAAK,iBAAiB,SAAS,SAAS,SAAS,WAChD,WAAW,SAAS;;;UAIR,SAAS,QAAQ;;EAEhC,OAAO,OAAO;;EAEd,QAAQ,KAAK;;EAEb;;;KAIU,gBAEV,iBAAiB;;KAGP,cAAc,SAAS,YAAY,QAAQ,YAAY;;KAGvD,iBACV,cACA,cACA,aACA,eACE,cACF,aAAa,cAAc,eAC3B,aAAa,aAAa;;KAIhB,yBAAyB,QAAQ,UAAU,iBACrD,QACA,QACA,QACA;;;;;;;KChFU,qBAAqB,eAC/B,oBAAoB,iBAAiB,mBAAmB;;;;;iBAM1C,aAAa,aAAa,KAAK;;;;;;;;;;;;;;iBAiB/B,WAAW,QAAQ,kBACjC,YAAY,UAAU,SAAS,QAAQ,YAAY,gBAClD,WAAW,QAAQ;;;;;;iBAwEN,oBAAoB,QAClC,YAAY,WAAW,mBAAgB,QAAA;;;;;;iBAgFzB,0BAA0B,QACxC,YAAY,WAAW,kBACvB,QAAQ,cACP,cAAc;;;;iBC3LD,IAAI,cAAc,QAAQ,aACxC,UAAU,OAAO,cAAc,kBAAkB,cAChD,iBAAiB,cAAc,QAAQ,aAAa;UAoB7C;;;;;iBAKM,MAAM,QAAQ,QAC5B,QAAQ,cACP,yBAAyB,QAAQ;;iBAqGpB,IAAI,QAAQ,QAC1B,UAAU,QAAQ,SAAS,QAAQ,WAClC,yBAAyB,QAAQ;;iBAuBpB,qBAAqB,QAAQ,QAC3C,WAAU,GAAG,QAAQ,GAAG,qBACvB,yBAAyB,QAAQ;;;;;;iBA0CpB,yBACd,QACA,WACG,yBAAyB,QAAQ;;;;UC/MrB,gBAAgB,gBAAgB,WAAW;EAC1D,YAAY,WAAW;;EAEvB,OAAO,OAAO;;EAEd,WAAW;;;UAII,wBAAwB,gBAAgB,KACvD,gBAAgB;;;;;;iBASF,gBAAgB,QAC9B,cAAc,SACb,gBAAgB"}
|
|
@@ -1,87 +1,99 @@
|
|
|
1
|
-
import { Ln as TRPCRequestInfo, fi as DistributiveOmit, jn as HTTPBaseHandlerOptions, rr as inferRouterContext, ur as CreateContextCallback, xi as MaybePromise, zn as AnyRouter } from "./unstable-core-do-not-import-
|
|
1
|
+
import { Ln as TRPCRequestInfo, fi as DistributiveOmit, jn as HTTPBaseHandlerOptions, rr as inferRouterContext, ur as CreateContextCallback, xi as MaybePromise, zn as AnyRouter } from "./unstable-core-do-not-import-DYnAWlN7.cjs";
|
|
2
2
|
import * as http$1 from "http";
|
|
3
3
|
import * as http2 from "http2";
|
|
4
4
|
//#region src/adapters/node-http/types.d.ts
|
|
5
|
+
/** A Node.js HTTP/1 or HTTP/2 request, as the Node.js adapters take it. */
|
|
5
6
|
type NodeHTTPRequest = DistributiveOmit<http$1.IncomingMessage | http2.Http2ServerRequest, 'socket'> & {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* The body, if a framework or middleware parsed it already. tRPC reads
|
|
9
|
+
* it instead of the stream.
|
|
8
10
|
*/
|
|
9
11
|
body?: unknown;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* The socket object provided in the request does not fully implement the expected Node.js Socket interface.
|
|
14
|
-
* @see https://github.com/trpc/trpc/pull/6358
|
|
13
|
+
* Optional, and maybe partial: some hosts don't give a full Node.js
|
|
14
|
+
* socket (https://github.com/trpc/trpc/issues/6341).
|
|
15
15
|
*/
|
|
16
16
|
socket?: Partial<http$1.IncomingMessage['socket']> | Partial<http2.Http2ServerRequest['socket']>;
|
|
17
17
|
};
|
|
18
|
+
/** A Node.js HTTP/1 or HTTP/2 response, as the Node.js adapters take it. */
|
|
18
19
|
type NodeHTTPResponse = DistributiveOmit<http$1.ServerResponse | http2.Http2ServerResponse, 'write'> & {
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Added by compression middleware
|
|
23
|
-
* (depending on the environment,
|
|
24
|
-
* e.g. Next 12 and below,
|
|
25
|
-
* e.g. Express w/ `compression()`)
|
|
21
|
+
* Sends what a compression middleware (such as Express's `compression()`)
|
|
22
|
+
* has buffered so far. tRPC calls it while streaming.
|
|
26
23
|
*/
|
|
27
24
|
flush?: () => void;
|
|
28
25
|
write: (chunk: string | Uint8Array) => boolean;
|
|
29
26
|
};
|
|
27
|
+
/** The Node.js adapters' `createContext` option. */
|
|
30
28
|
type NodeHTTPCreateContextOption<TRouter extends AnyRouter, TRequest, TResponse> = CreateContextCallback<inferRouterContext<TRouter>, NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>>;
|
|
31
29
|
/**
|
|
32
30
|
* @internal
|
|
33
31
|
*/
|
|
34
32
|
type ConnectMiddleware<TRequest extends NodeHTTPRequest = NodeHTTPRequest, TResponse extends NodeHTTPResponse = NodeHTTPResponse> = (req: TRequest, res: TResponse, next: (err?: any) => any) => void;
|
|
33
|
+
/** The options of the Node.js adapters. */
|
|
35
34
|
type NodeHTTPHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = HTTPBaseHandlerOptions<TRouter, TRequest> & {
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* A Connect-style middleware that runs before tRPC. tRPC doesn't answer
|
|
37
|
+
* `OPTIONS` requests or set CORS headers, so use this for `cors()`.
|
|
38
|
+
* @example
|
|
41
39
|
* ```ts
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* nodeHTTPRequestHandler({
|
|
45
|
-
* middleware: cors()
|
|
46
|
-
* })
|
|
40
|
+
* createHTTPServer({ middleware: cors(), router: appRouter });
|
|
47
41
|
* ```
|
|
48
|
-
*
|
|
49
|
-
* You can also use it for other needs which a connect/node.js compatible middleware can solve,
|
|
50
|
-
* though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
|
|
42
|
+
* @see https://trpc.io/docs/server/adapters/standalone#handling-cors--options
|
|
51
43
|
*/
|
|
52
44
|
middleware?: ConnectMiddleware<TRequest, TResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* The largest request body, in bytes. A larger one gets a
|
|
47
|
+
* `PAYLOAD_TOO_LARGE` error. It only applies to bodies tRPC reads from
|
|
48
|
+
* the stream; if a body-parsing middleware sets `req.body`, limit the
|
|
49
|
+
* size there.
|
|
50
|
+
*/
|
|
53
51
|
maxBodySize?: number;
|
|
54
52
|
} & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse>;
|
|
53
|
+
/** The options of `nodeHTTPRequestHandler`. */
|
|
55
54
|
type NodeHTTPRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = NodeHTTPHandlerOptions<TRouter, TRequest, TResponse> & {
|
|
56
55
|
req: TRequest;
|
|
57
56
|
res: TResponse;
|
|
58
57
|
/**
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
58
|
+
* The procedure path to handle, such as `post.all`, or several joined by
|
|
59
|
+
* commas for a batch.
|
|
61
60
|
*/
|
|
62
61
|
path: string;
|
|
63
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* What `createContext` gets in the Node.js adapters: `req`, `res` and the
|
|
65
|
+
* request's `info`.
|
|
66
|
+
* @see https://trpc.io/docs/server/context#creating-the-context
|
|
67
|
+
*/
|
|
64
68
|
type NodeHTTPCreateContextFnOptions<TRequest, TResponse> = {
|
|
65
69
|
req: TRequest;
|
|
66
70
|
res: TResponse;
|
|
67
71
|
info: TRPCRequestInfo;
|
|
68
72
|
};
|
|
73
|
+
/** The `createContext` function the Node.js adapters take. */
|
|
69
74
|
type NodeHTTPCreateContextFn<TRouter extends AnyRouter, TRequest, TResponse> = (opts: NodeHTTPCreateContextFnOptions<TRequest, TResponse>) => MaybePromise<inferRouterContext<TRouter>>;
|
|
70
75
|
//#endregion
|
|
71
76
|
//#region src/adapters/node-http/nodeHTTPRequestHandler.d.ts
|
|
72
77
|
/**
|
|
78
|
+
* Answers with an error response when handling a request throws.
|
|
73
79
|
* @internal
|
|
74
80
|
*/
|
|
75
81
|
declare function internal_exceptionHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): (cause: unknown) => void;
|
|
76
82
|
/**
|
|
77
|
-
*
|
|
83
|
+
* Handles a Node.js request for a router. The adapters for Express,
|
|
84
|
+
* Next.js and the standalone server use it. The promise never rejects.
|
|
78
85
|
*/
|
|
79
86
|
declare function nodeHTTPRequestHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
|
|
80
87
|
//#endregion
|
|
81
88
|
//#region src/adapters/node-http/incomingMessageToRequest.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* The full URL of a Node.js request, from its `Host` header and socket.
|
|
91
|
+
* Throws a `BAD_REQUEST` error if it isn't a valid URL.
|
|
92
|
+
*/
|
|
82
93
|
declare function createURL(req: NodeHTTPRequest): URL;
|
|
83
94
|
/**
|
|
84
|
-
*
|
|
95
|
+
* Turns a Node.js `IncomingMessage` into a Fetch API `Request`. The
|
|
96
|
+
* request's signal aborts when the client disconnects.
|
|
85
97
|
*/
|
|
86
98
|
declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPResponse, opts: {
|
|
87
99
|
/**
|
|
@@ -92,4 +104,4 @@ declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPRes
|
|
|
92
104
|
//#endregion
|
|
93
105
|
export { NodeHTTPCreateContextFn as a, NodeHTTPHandlerOptions as c, NodeHTTPResponse as d, nodeHTTPRequestHandler as i, NodeHTTPRequest as l, incomingMessageToRequest as n, NodeHTTPCreateContextFnOptions as o, internal_exceptionHandler as r, NodeHTTPCreateContextOption as s, createURL as t, NodeHTTPRequestHandlerOptions as u };
|
|
94
106
|
|
|
95
|
-
//# sourceMappingURL=index-
|
|
107
|
+
//# sourceMappingURL=index-CTfJHk7_.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CTfJHk7_.d.cts","names":[],"sources":["../src/adapters/node-http/types.ts","../src/adapters/node-http/nodeHTTPRequestHandler.ts","../src/adapters/node-http/incomingMessageToRequest.ts"],"mappings":";;;;;KA6BY,kBAAkB,iBAC5B,OAAK,kBAAkB,MAAM;;;;;EAO7B;;;;;EAKA,SACI,QAAQ,OAAK,6BACb,QAAQ,MAAM;;;KAIR,mBAAmB,iBAC7B,OAAK,iBAAiB,MAAM;;;;;EAO5B;EAEA,QAAQ,gBAAgB;;;KAGd,4BACV,gBAAgB,WAChB,UACA,aACE,sBACF,mBAAmB,UACnB,wBAAwB,SAAS,UAAU;;;;KAMxC,kBACH,iBAAiB,kBAAkB,iBACnC,kBAAkB,mBAAmB,qBAClC,KAAK,UAAU,KAAK,WAAW,OAAO;;KAO/B,uBACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS;;;;;;;;;;EAUlC,aAAa,kBAAkB,UAAU;;;;;;;EAOzC;IACE,4BAA4B,SAAS,UAAU;;KAGvC,8BACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,UAAU;EAC5C,KAAK;EACL,KAAK;;;;;EAKL;;;;;;;KAQU,+BAA+B,UAAU;EACnD,KAAK;EACL,KAAK;EACL,MAAM;;;KAGI,wBACV,gBAAgB,WAChB,UACA,cAEA,MAAM,+BAA+B,UAAU,eAC5C,aAAa,mBAAmB;;;;;;;iBC1GrB,0BACd,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,cAAU;;;;;iBAoC7C,uBACpB,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,aAAU;;;;;;;iBCoBnD,UAAU,KAAK,kBAAkB;;;;;iBAiDjC,yBACd,KAAK,iBACL,KAAK,kBACL;;;;EAIE;IAED"}
|
|
@@ -1,87 +1,99 @@
|
|
|
1
|
-
import { Ln as TRPCRequestInfo, fi as DistributiveOmit, jn as HTTPBaseHandlerOptions, rr as inferRouterContext, ur as CreateContextCallback, xi as MaybePromise, zn as AnyRouter } from "./unstable-core-do-not-import-
|
|
1
|
+
import { Ln as TRPCRequestInfo, fi as DistributiveOmit, jn as HTTPBaseHandlerOptions, rr as inferRouterContext, ur as CreateContextCallback, xi as MaybePromise, zn as AnyRouter } from "./unstable-core-do-not-import-hC2_7K-s.mjs";
|
|
2
2
|
import * as http$1 from "http";
|
|
3
3
|
import * as http2 from "http2";
|
|
4
4
|
//#region src/adapters/node-http/types.d.ts
|
|
5
|
+
/** A Node.js HTTP/1 or HTTP/2 request, as the Node.js adapters take it. */
|
|
5
6
|
type NodeHTTPRequest = DistributiveOmit<http$1.IncomingMessage | http2.Http2ServerRequest, 'socket'> & {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* The body, if a framework or middleware parsed it already. tRPC reads
|
|
9
|
+
* it instead of the stream.
|
|
8
10
|
*/
|
|
9
11
|
body?: unknown;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* The socket object provided in the request does not fully implement the expected Node.js Socket interface.
|
|
14
|
-
* @see https://github.com/trpc/trpc/pull/6358
|
|
13
|
+
* Optional, and maybe partial: some hosts don't give a full Node.js
|
|
14
|
+
* socket (https://github.com/trpc/trpc/issues/6341).
|
|
15
15
|
*/
|
|
16
16
|
socket?: Partial<http$1.IncomingMessage['socket']> | Partial<http2.Http2ServerRequest['socket']>;
|
|
17
17
|
};
|
|
18
|
+
/** A Node.js HTTP/1 or HTTP/2 response, as the Node.js adapters take it. */
|
|
18
19
|
type NodeHTTPResponse = DistributiveOmit<http$1.ServerResponse | http2.Http2ServerResponse, 'write'> & {
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Added by compression middleware
|
|
23
|
-
* (depending on the environment,
|
|
24
|
-
* e.g. Next 12 and below,
|
|
25
|
-
* e.g. Express w/ `compression()`)
|
|
21
|
+
* Sends what a compression middleware (such as Express's `compression()`)
|
|
22
|
+
* has buffered so far. tRPC calls it while streaming.
|
|
26
23
|
*/
|
|
27
24
|
flush?: () => void;
|
|
28
25
|
write: (chunk: string | Uint8Array) => boolean;
|
|
29
26
|
};
|
|
27
|
+
/** The Node.js adapters' `createContext` option. */
|
|
30
28
|
type NodeHTTPCreateContextOption<TRouter extends AnyRouter, TRequest, TResponse> = CreateContextCallback<inferRouterContext<TRouter>, NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>>;
|
|
31
29
|
/**
|
|
32
30
|
* @internal
|
|
33
31
|
*/
|
|
34
32
|
type ConnectMiddleware<TRequest extends NodeHTTPRequest = NodeHTTPRequest, TResponse extends NodeHTTPResponse = NodeHTTPResponse> = (req: TRequest, res: TResponse, next: (err?: any) => any) => void;
|
|
33
|
+
/** The options of the Node.js adapters. */
|
|
35
34
|
type NodeHTTPHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = HTTPBaseHandlerOptions<TRouter, TRequest> & {
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* A Connect-style middleware that runs before tRPC. tRPC doesn't answer
|
|
37
|
+
* `OPTIONS` requests or set CORS headers, so use this for `cors()`.
|
|
38
|
+
* @example
|
|
41
39
|
* ```ts
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* nodeHTTPRequestHandler({
|
|
45
|
-
* middleware: cors()
|
|
46
|
-
* })
|
|
40
|
+
* createHTTPServer({ middleware: cors(), router: appRouter });
|
|
47
41
|
* ```
|
|
48
|
-
*
|
|
49
|
-
* You can also use it for other needs which a connect/node.js compatible middleware can solve,
|
|
50
|
-
* though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
|
|
42
|
+
* @see https://trpc.io/docs/server/adapters/standalone#handling-cors--options
|
|
51
43
|
*/
|
|
52
44
|
middleware?: ConnectMiddleware<TRequest, TResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* The largest request body, in bytes. A larger one gets a
|
|
47
|
+
* `PAYLOAD_TOO_LARGE` error. It only applies to bodies tRPC reads from
|
|
48
|
+
* the stream; if a body-parsing middleware sets `req.body`, limit the
|
|
49
|
+
* size there.
|
|
50
|
+
*/
|
|
53
51
|
maxBodySize?: number;
|
|
54
52
|
} & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse>;
|
|
53
|
+
/** The options of `nodeHTTPRequestHandler`. */
|
|
55
54
|
type NodeHTTPRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = NodeHTTPHandlerOptions<TRouter, TRequest, TResponse> & {
|
|
56
55
|
req: TRequest;
|
|
57
56
|
res: TResponse;
|
|
58
57
|
/**
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
58
|
+
* The procedure path to handle, such as `post.all`, or several joined by
|
|
59
|
+
* commas for a batch.
|
|
61
60
|
*/
|
|
62
61
|
path: string;
|
|
63
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* What `createContext` gets in the Node.js adapters: `req`, `res` and the
|
|
65
|
+
* request's `info`.
|
|
66
|
+
* @see https://trpc.io/docs/server/context#creating-the-context
|
|
67
|
+
*/
|
|
64
68
|
type NodeHTTPCreateContextFnOptions<TRequest, TResponse> = {
|
|
65
69
|
req: TRequest;
|
|
66
70
|
res: TResponse;
|
|
67
71
|
info: TRPCRequestInfo;
|
|
68
72
|
};
|
|
73
|
+
/** The `createContext` function the Node.js adapters take. */
|
|
69
74
|
type NodeHTTPCreateContextFn<TRouter extends AnyRouter, TRequest, TResponse> = (opts: NodeHTTPCreateContextFnOptions<TRequest, TResponse>) => MaybePromise<inferRouterContext<TRouter>>;
|
|
70
75
|
//#endregion
|
|
71
76
|
//#region src/adapters/node-http/nodeHTTPRequestHandler.d.ts
|
|
72
77
|
/**
|
|
78
|
+
* Answers with an error response when handling a request throws.
|
|
73
79
|
* @internal
|
|
74
80
|
*/
|
|
75
81
|
declare function internal_exceptionHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): (cause: unknown) => void;
|
|
76
82
|
/**
|
|
77
|
-
*
|
|
83
|
+
* Handles a Node.js request for a router. The adapters for Express,
|
|
84
|
+
* Next.js and the standalone server use it. The promise never rejects.
|
|
78
85
|
*/
|
|
79
86
|
declare function nodeHTTPRequestHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
|
|
80
87
|
//#endregion
|
|
81
88
|
//#region src/adapters/node-http/incomingMessageToRequest.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* The full URL of a Node.js request, from its `Host` header and socket.
|
|
91
|
+
* Throws a `BAD_REQUEST` error if it isn't a valid URL.
|
|
92
|
+
*/
|
|
82
93
|
declare function createURL(req: NodeHTTPRequest): URL;
|
|
83
94
|
/**
|
|
84
|
-
*
|
|
95
|
+
* Turns a Node.js `IncomingMessage` into a Fetch API `Request`. The
|
|
96
|
+
* request's signal aborts when the client disconnects.
|
|
85
97
|
*/
|
|
86
98
|
declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPResponse, opts: {
|
|
87
99
|
/**
|
|
@@ -92,4 +104,4 @@ declare function incomingMessageToRequest(req: NodeHTTPRequest, res: NodeHTTPRes
|
|
|
92
104
|
//#endregion
|
|
93
105
|
export { NodeHTTPCreateContextFn as a, NodeHTTPHandlerOptions as c, NodeHTTPResponse as d, nodeHTTPRequestHandler as i, NodeHTTPRequest as l, incomingMessageToRequest as n, NodeHTTPCreateContextFnOptions as o, internal_exceptionHandler as r, NodeHTTPCreateContextOption as s, createURL as t, NodeHTTPRequestHandlerOptions as u };
|
|
94
106
|
|
|
95
|
-
//# sourceMappingURL=index-
|
|
107
|
+
//# sourceMappingURL=index-DD2oXVyh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DD2oXVyh.d.mts","names":[],"sources":["../src/adapters/node-http/types.ts","../src/adapters/node-http/nodeHTTPRequestHandler.ts","../src/adapters/node-http/incomingMessageToRequest.ts"],"mappings":";;;;;KA6BY,kBAAkB,iBAC5B,OAAK,kBAAkB,MAAM;;;;;EAO7B;;;;;EAKA,SACI,QAAQ,OAAK,6BACb,QAAQ,MAAM;;;KAIR,mBAAmB,iBAC7B,OAAK,iBAAiB,MAAM;;;;;EAO5B;EAEA,QAAQ,gBAAgB;;;KAGd,4BACV,gBAAgB,WAChB,UACA,aACE,sBACF,mBAAmB,UACnB,wBAAwB,SAAS,UAAU;;;;KAMxC,kBACH,iBAAiB,kBAAkB,iBACnC,kBAAkB,mBAAmB,qBAClC,KAAK,UAAU,KAAK,WAAW,OAAO;;KAO/B,uBACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS;;;;;;;;;;EAUlC,aAAa,kBAAkB,UAAU;;;;;;;EAOzC;IACE,4BAA4B,SAAS,UAAU;;KAGvC,8BACV,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,oBAChB,uBAAuB,SAAS,UAAU;EAC5C,KAAK;EACL,KAAK;;;;;EAKL;;;;;;;KAQU,+BAA+B,UAAU;EACnD,KAAK;EACL,KAAK;EACL,MAAM;;;KAGI,wBACV,gBAAgB,WAChB,UACA,cAEA,MAAM,+BAA+B,UAAU,eAC5C,aAAa,mBAAmB;;;;;;;iBC1GrB,0BACd,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,cAAU;;;;;iBAoC7C,uBACpB,gBAAgB,WAChB,iBAAiB,iBACjB,kBAAkB,kBAClB,MAAM,8BAA8B,SAAS,UAAU,aAAU;;;;;;;iBCoBnD,UAAU,KAAK,kBAAkB;;;;;iBAiDjC,yBACd,KAAK,iBACL,KAAK,kBACL;;;;EAIE;IAED"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_getErrorShape = require("./getErrorShape-
|
|
3
|
-
const require_asyncGeneratorDelegate = require("./asyncGeneratorDelegate-
|
|
4
|
-
const require_initTRPC = require("./initTRPC-
|
|
2
|
+
const require_getErrorShape = require("./getErrorShape-8t0oLscZ.cjs");
|
|
3
|
+
const require_asyncGeneratorDelegate = require("./asyncGeneratorDelegate-CPV0O1Hn.cjs");
|
|
4
|
+
const require_initTRPC = require("./initTRPC-jn7uHFOx.cjs");
|
|
5
5
|
exports.StandardSchemaV1Error = require_initTRPC.StandardSchemaV1Error;
|
|
6
6
|
exports.TRPCError = require_asyncGeneratorDelegate.TRPCError;
|
|
7
7
|
exports.callTRPCProcedure = require_asyncGeneratorDelegate.callProcedure;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as AnyMutationProcedure, $n as callProcedure, Ar as tracked, B as createRecursiveProxy, Bn as BuiltRouter, Ct as UnsetMarker, Er as TrackedEnvelope, G as inferTransformedProcedureOutput, Gn as MergeRouters, Gt as experimental_standaloneMiddleware, H as inferProcedureErrorShape, Hn as DecorateCreateRouterOptions, Jn as RouterCaller, Jt as DefaultErrorData, K as inferTransformedSubscriptionOutput, Lt as AnyMiddlewareFunction, Oi as Unwrap, Or as isTrackedEnvelope, Q as inferClientTypes, Qn as RouterRecord, R as getErrorShape, Rt as MiddlewareBuilder, St as inferProcedureBuilderResolverOptions, U as inferRouterInputs, Vn as CreateRouterOptions, W as inferRouterOutputs, X as AnyClientTypes, Xn as RouterCallerFactory, Xt as ErrorFormatter, Yt as DefaultErrorShape, Zn as RouterDef, _ as TRPCRootObject, an as CombinedDataTransformer, at as MutationProcedure, bn as TRPCErrorShape, c as StandardSchemaV1Error, ci as TRPC_ERROR_CODE_NUMBER, ct as QueryProcedure, di as Dict, dt as inferProcedureOutput, et as AnyProcedure, fn as transformTRPCResponse, g as TRPCBuilder, h as RuntimeConfigOptions, ii as getTRPCErrorFromUnknown, ir as inferRouterError, kr as sse, lr as AnyRootTypes, lt as SubscriptionProcedure, mr as RootConfig, mt as inferSubscriptionOutput, ni as TRPCError, nt as AnySubscriptionProcedure, pt as inferSubscriptionInput, qn as RouterBuilder, rr as inferRouterContext, si as TRPC_ERROR_CODE_KEY, sn as DataTransformer, sr as lazy, st as ProcedureType, tt as AnyQueryProcedure, ui as DeepPartial, ur as CreateContextCallback, ut as inferProcedureInput, v as initTRPC, vt as ProcedureBuilder, z as createFlatProxy, zn as AnyRouter, zt as MiddlewareFunction } from "./unstable-core-do-not-import-
|
|
1
|
+
import { $ as AnyMutationProcedure, $n as callProcedure, Ar as tracked, B as createRecursiveProxy, Bn as BuiltRouter, Ct as UnsetMarker, Er as TrackedEnvelope, G as inferTransformedProcedureOutput, Gn as MergeRouters, Gt as experimental_standaloneMiddleware, H as inferProcedureErrorShape, Hn as DecorateCreateRouterOptions, Jn as RouterCaller, Jt as DefaultErrorData, K as inferTransformedSubscriptionOutput, Lt as AnyMiddlewareFunction, Oi as Unwrap, Or as isTrackedEnvelope, Q as inferClientTypes, Qn as RouterRecord, R as getErrorShape, Rt as MiddlewareBuilder, St as inferProcedureBuilderResolverOptions, U as inferRouterInputs, Vn as CreateRouterOptions, W as inferRouterOutputs, X as AnyClientTypes, Xn as RouterCallerFactory, Xt as ErrorFormatter, Yt as DefaultErrorShape, Zn as RouterDef, _ as TRPCRootObject, an as CombinedDataTransformer, at as MutationProcedure, bn as TRPCErrorShape, c as StandardSchemaV1Error, ci as TRPC_ERROR_CODE_NUMBER, ct as QueryProcedure, di as Dict, dt as inferProcedureOutput, et as AnyProcedure, fn as transformTRPCResponse, g as TRPCBuilder, h as RuntimeConfigOptions, ii as getTRPCErrorFromUnknown, ir as inferRouterError, kr as sse, lr as AnyRootTypes, lt as SubscriptionProcedure, mr as RootConfig, mt as inferSubscriptionOutput, ni as TRPCError, nt as AnySubscriptionProcedure, pt as inferSubscriptionInput, qn as RouterBuilder, rr as inferRouterContext, si as TRPC_ERROR_CODE_KEY, sn as DataTransformer, sr as lazy, st as ProcedureType, tt as AnyQueryProcedure, ui as DeepPartial, ur as CreateContextCallback, ut as inferProcedureInput, v as initTRPC, vt as ProcedureBuilder, z as createFlatProxy, zn as AnyRouter, zt as MiddlewareFunction } from "./unstable-core-do-not-import-DYnAWlN7.cjs";
|
|
2
2
|
//#region src/@trpc/server/index.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Use `Awaited<ReturnType<typeof myFunction>>` instead
|
|
4
|
+
* The type a function's promise resolves to.
|
|
5
|
+
* @deprecated Use `Awaited<ReturnType<typeof myFunction>>` instead.
|
|
6
6
|
*/
|
|
7
7
|
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
|
|
8
8
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as AnyMutationProcedure, $n as callProcedure, Ar as tracked, B as createRecursiveProxy, Bn as BuiltRouter, Ct as UnsetMarker, Er as TrackedEnvelope, G as inferTransformedProcedureOutput, Gn as MergeRouters, Gt as experimental_standaloneMiddleware, H as inferProcedureErrorShape, Hn as DecorateCreateRouterOptions, Jn as RouterCaller, Jt as DefaultErrorData, K as inferTransformedSubscriptionOutput, Lt as AnyMiddlewareFunction, Oi as Unwrap, Or as isTrackedEnvelope, Q as inferClientTypes, Qn as RouterRecord, R as getErrorShape, Rt as MiddlewareBuilder, St as inferProcedureBuilderResolverOptions, U as inferRouterInputs, Vn as CreateRouterOptions, W as inferRouterOutputs, X as AnyClientTypes, Xn as RouterCallerFactory, Xt as ErrorFormatter, Yt as DefaultErrorShape, Zn as RouterDef, _ as TRPCRootObject, an as CombinedDataTransformer, at as MutationProcedure, bn as TRPCErrorShape, c as StandardSchemaV1Error, ci as TRPC_ERROR_CODE_NUMBER, ct as QueryProcedure, di as Dict, dt as inferProcedureOutput, et as AnyProcedure, fn as transformTRPCResponse, g as TRPCBuilder, h as RuntimeConfigOptions, ii as getTRPCErrorFromUnknown, ir as inferRouterError, kr as sse, lr as AnyRootTypes, lt as SubscriptionProcedure, mr as RootConfig, mt as inferSubscriptionOutput, ni as TRPCError, nt as AnySubscriptionProcedure, pt as inferSubscriptionInput, qn as RouterBuilder, rr as inferRouterContext, si as TRPC_ERROR_CODE_KEY, sn as DataTransformer, sr as lazy, st as ProcedureType, tt as AnyQueryProcedure, ui as DeepPartial, ur as CreateContextCallback, ut as inferProcedureInput, v as initTRPC, vt as ProcedureBuilder, z as createFlatProxy, zn as AnyRouter, zt as MiddlewareFunction } from "./unstable-core-do-not-import-
|
|
1
|
+
import { $ as AnyMutationProcedure, $n as callProcedure, Ar as tracked, B as createRecursiveProxy, Bn as BuiltRouter, Ct as UnsetMarker, Er as TrackedEnvelope, G as inferTransformedProcedureOutput, Gn as MergeRouters, Gt as experimental_standaloneMiddleware, H as inferProcedureErrorShape, Hn as DecorateCreateRouterOptions, Jn as RouterCaller, Jt as DefaultErrorData, K as inferTransformedSubscriptionOutput, Lt as AnyMiddlewareFunction, Oi as Unwrap, Or as isTrackedEnvelope, Q as inferClientTypes, Qn as RouterRecord, R as getErrorShape, Rt as MiddlewareBuilder, St as inferProcedureBuilderResolverOptions, U as inferRouterInputs, Vn as CreateRouterOptions, W as inferRouterOutputs, X as AnyClientTypes, Xn as RouterCallerFactory, Xt as ErrorFormatter, Yt as DefaultErrorShape, Zn as RouterDef, _ as TRPCRootObject, an as CombinedDataTransformer, at as MutationProcedure, bn as TRPCErrorShape, c as StandardSchemaV1Error, ci as TRPC_ERROR_CODE_NUMBER, ct as QueryProcedure, di as Dict, dt as inferProcedureOutput, et as AnyProcedure, fn as transformTRPCResponse, g as TRPCBuilder, h as RuntimeConfigOptions, ii as getTRPCErrorFromUnknown, ir as inferRouterError, kr as sse, lr as AnyRootTypes, lt as SubscriptionProcedure, mr as RootConfig, mt as inferSubscriptionOutput, ni as TRPCError, nt as AnySubscriptionProcedure, pt as inferSubscriptionInput, qn as RouterBuilder, rr as inferRouterContext, si as TRPC_ERROR_CODE_KEY, sn as DataTransformer, sr as lazy, st as ProcedureType, tt as AnyQueryProcedure, ui as DeepPartial, ur as CreateContextCallback, ut as inferProcedureInput, v as initTRPC, vt as ProcedureBuilder, z as createFlatProxy, zn as AnyRouter, zt as MiddlewareFunction } from "./unstable-core-do-not-import-hC2_7K-s.mjs";
|
|
2
2
|
//#region src/@trpc/server/index.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Use `Awaited<ReturnType<typeof myFunction>>` instead
|
|
4
|
+
* The type a function's promise resolves to.
|
|
5
|
+
* @deprecated Use `Awaited<ReturnType<typeof myFunction>>` instead.
|
|
6
6
|
*/
|
|
7
7
|
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
|
|
8
8
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as createRecursiveProxy, h as createFlatProxy, t as getErrorShape } from "./getErrorShape-
|
|
2
|
-
import { _ as transformTRPCResponse, b as getTRPCErrorFromUnknown, c as callProcedure, f as lazy, i as tracked, n as isTrackedEnvelope, r as sse, v as TRPCError } from "./asyncGeneratorDelegate-
|
|
3
|
-
import { d as experimental_standaloneMiddleware, o as StandardSchemaV1Error, t as initTRPC } from "./initTRPC-
|
|
1
|
+
import { g as createRecursiveProxy, h as createFlatProxy, t as getErrorShape } from "./getErrorShape-B6z8u8q0.mjs";
|
|
2
|
+
import { _ as transformTRPCResponse, b as getTRPCErrorFromUnknown, c as callProcedure, f as lazy, i as tracked, n as isTrackedEnvelope, r as sse, v as TRPCError } from "./asyncGeneratorDelegate-Bl41FGB5.mjs";
|
|
3
|
+
import { d as experimental_standaloneMiddleware, o as StandardSchemaV1Error, t as initTRPC } from "./initTRPC-JhlmAV6P.mjs";
|
|
4
4
|
export { StandardSchemaV1Error, TRPCError, callProcedure as callTRPCProcedure, createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy, lazy as experimental_lazy, lazy, experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, getErrorShape, getErrorShape as getTRPCErrorShape, getTRPCErrorFromUnknown, initTRPC, isTrackedEnvelope, sse, tracked, transformTRPCResponse };
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as isObject, f as mergeWithoutOverrides, l as isAsyncIterable } from "./codes-
|
|
2
|
-
import { a as getDefaultErrorShape, c as setFormattedErrorShape, i as defaultFormatter, n as _objectSpread2, r as _defineProperty, s as isFormattedErrorShape } from "./getErrorShape-
|
|
3
|
-
import { a as _asyncIterator, b as getTRPCErrorFromUnknown, h as getDataTransformer, l as createCallerFactory, m as defaultTransformer, o as _wrapAsyncGenerator, p as mergeRouters, t as _asyncGeneratorDelegate, u as createRouterFactory, v as TRPCError } from "./asyncGeneratorDelegate-
|
|
4
|
-
import { n as observable, t as isObservable } from "./observable-
|
|
1
|
+
import { d as isObject, f as mergeWithoutOverrides, l as isAsyncIterable } from "./codes-nbrm_zWY.mjs";
|
|
2
|
+
import { a as getDefaultErrorShape, c as setFormattedErrorShape, i as defaultFormatter, n as _objectSpread2, r as _defineProperty, s as isFormattedErrorShape } from "./getErrorShape-B6z8u8q0.mjs";
|
|
3
|
+
import { a as _asyncIterator, b as getTRPCErrorFromUnknown, h as getDataTransformer, l as createCallerFactory, m as defaultTransformer, o as _wrapAsyncGenerator, p as mergeRouters, t as _asyncGeneratorDelegate, u as createRouterFactory, v as TRPCError } from "./asyncGeneratorDelegate-Bl41FGB5.mjs";
|
|
4
|
+
import { n as observable, t as isObservable } from "./observable-CdPmrXKY.mjs";
|
|
5
5
|
//#region src/unstable-core-do-not-import/middleware.ts
|
|
6
6
|
/** @internal */
|
|
7
7
|
const middlewareMarker = "middlewareMarker";
|
|
@@ -24,9 +24,10 @@ function createMiddlewareFactory() {
|
|
|
24
24
|
return createMiddleware;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @deprecated
|
|
27
|
+
* Creates a middleware that isn't tied to a root object, for the context,
|
|
28
|
+
* metadata and input types you give it.
|
|
29
|
+
* @deprecated Use `.concat()` with a procedure builder instead.
|
|
30
|
+
* @see https://trpc.io/docs/server/middlewares#concat
|
|
30
31
|
*/
|
|
31
32
|
const experimental_standaloneMiddleware = () => ({ create: createMiddlewareFactory() });
|
|
32
33
|
/**
|
|
@@ -312,7 +313,7 @@ function createResolver(_defIn, resolver) {
|
|
|
312
313
|
}
|
|
313
314
|
const codeblock = `
|
|
314
315
|
This is a client-only function.
|
|
315
|
-
If you want to call this function on the server, see https://trpc.io/docs/
|
|
316
|
+
If you want to call this function on the server, see https://trpc.io/docs/server/server-side-calls
|
|
316
317
|
`.trim();
|
|
317
318
|
async function callRecursive(index, _def, opts) {
|
|
318
319
|
try {
|
|
@@ -355,27 +356,35 @@ function createProcedureCaller(_def) {
|
|
|
355
356
|
return procedure;
|
|
356
357
|
}
|
|
357
358
|
/**
|
|
358
|
-
*
|
|
359
|
-
* @
|
|
359
|
+
* The starting point of every tRPC backend. Call it once.
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* const t = initTRPC.context<Context>().create();
|
|
363
|
+
* export const router = t.router;
|
|
364
|
+
* export const publicProcedure = t.procedure;
|
|
365
|
+
* ```
|
|
366
|
+
* @see https://trpc.io/docs/server/routers#initialize-trpc
|
|
360
367
|
*/
|
|
361
368
|
const initTRPC = new class TRPCBuilder {
|
|
362
369
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
370
|
+
* Sets the type of the context every procedure gets. Pass the type, or
|
|
371
|
+
* the type of your `createContext` function.
|
|
372
|
+
* @see https://trpc.io/docs/server/context#defining-the-context-type
|
|
365
373
|
*/
|
|
366
374
|
context() {
|
|
367
375
|
return new TRPCBuilder();
|
|
368
376
|
}
|
|
369
377
|
/**
|
|
370
|
-
*
|
|
371
|
-
* @see https://trpc.io/docs/
|
|
378
|
+
* Sets the type of the metadata procedures can set with `.meta()`.
|
|
379
|
+
* @see https://trpc.io/docs/server/metadata
|
|
372
380
|
*/
|
|
373
381
|
meta() {
|
|
374
382
|
return new TRPCBuilder();
|
|
375
383
|
}
|
|
376
384
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
385
|
+
* Creates the root object, which holds the builders for your procedures,
|
|
386
|
+
* middlewares and routers.
|
|
387
|
+
* @see https://trpc.io/docs/server/routers#initialize-trpc
|
|
379
388
|
*/
|
|
380
389
|
create(opts) {
|
|
381
390
|
var _opts$transformer, _opts$isDev, _opts$allowOutsideOfS, _opts$errorFormatter, _opts$isServer;
|
|
@@ -401,7 +410,7 @@ const initTRPC = new class TRPCBuilder {
|
|
|
401
410
|
_config: config,
|
|
402
411
|
/**
|
|
403
412
|
* Builder object for creating procedures
|
|
404
|
-
* @see https://trpc.io/docs/
|
|
413
|
+
* @see https://trpc.io/docs/server/procedures
|
|
405
414
|
*/
|
|
406
415
|
procedure: createBuilder({
|
|
407
416
|
meta: opts === null || opts === void 0 ? void 0 : opts.defaultMeta,
|
|
@@ -409,22 +418,22 @@ const initTRPC = new class TRPCBuilder {
|
|
|
409
418
|
}),
|
|
410
419
|
/**
|
|
411
420
|
* Create reusable middlewares
|
|
412
|
-
* @see https://trpc.io/docs/
|
|
421
|
+
* @see https://trpc.io/docs/server/middlewares
|
|
413
422
|
*/
|
|
414
423
|
middleware: createMiddlewareFactory(),
|
|
415
424
|
/**
|
|
416
425
|
* Create a router
|
|
417
|
-
* @see https://trpc.io/docs/
|
|
426
|
+
* @see https://trpc.io/docs/server/routers
|
|
418
427
|
*/
|
|
419
428
|
router: createRouterFactory(config),
|
|
420
429
|
/**
|
|
421
430
|
* Merge Routers
|
|
422
|
-
* @see https://trpc.io/docs/
|
|
431
|
+
* @see https://trpc.io/docs/server/merging-routers
|
|
423
432
|
*/
|
|
424
433
|
mergeRouters,
|
|
425
434
|
/**
|
|
426
435
|
* Create a server-side caller for a router
|
|
427
|
-
* @see https://trpc.io/docs/
|
|
436
|
+
* @see https://trpc.io/docs/server/server-side-calls
|
|
428
437
|
*/
|
|
429
438
|
createCallerFactory: createCallerFactory()
|
|
430
439
|
};
|
|
@@ -434,4 +443,4 @@ const initTRPC = new class TRPCBuilder {
|
|
|
434
443
|
export { getParseFn as a, createInputMiddleware as c, experimental_standaloneMiddleware as d, middlewareMarker as f, isServerDefault as i, createMiddlewareFactory as l, createBuilder as n, StandardSchemaV1Error as o, isDevDefault as r, createErrorFormatterMiddleware as s, initTRPC as t, createOutputMiddleware as u };
|
|
435
444
|
|
|
436
445
|
|
|
437
|
-
//# sourceMappingURL=initTRPC-
|
|
446
|
+
//# sourceMappingURL=initTRPC-JhlmAV6P.mjs.map
|