@temporary-name/server 1.9.3-alpha.37dfe6603933b8e445661fe453c4fbdb30ccb524 → 1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a
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.d.mts +3 -3
- package/dist/adapters/aws-lambda/index.d.ts +3 -3
- package/dist/adapters/aws-lambda/index.mjs +4 -6
- package/dist/adapters/fetch/index.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +4 -6
- package/dist/adapters/node/index.d.mts +3 -3
- package/dist/adapters/node/index.d.ts +3 -3
- package/dist/adapters/node/index.mjs +4 -6
- package/dist/adapters/standard/index.d.mts +14 -30
- package/dist/adapters/standard/index.d.ts +14 -30
- package/dist/adapters/standard/index.mjs +4 -6
- package/dist/index.d.mts +41 -319
- package/dist/index.d.ts +41 -319
- package/dist/index.mjs +102 -352
- package/dist/openapi/index.mjs +27 -61
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{server.BeuTpcmO.d.mts → server.BYnDyuDL.d.mts} +2 -2
- package/dist/shared/{server.CQyYNJ1H.d.ts → server.BlJrjUA9.d.mts} +1 -2
- package/dist/shared/{server.C1fnTLq0.d.mts → server.C-tNYmY_.d.ts} +1 -2
- package/dist/shared/server.CjkiSCui.mjs +396 -0
- package/dist/shared/{server.DLsti1Pv.mjs → server.DdHBdcen.mjs} +58 -89
- package/dist/shared/{server.SLLuK6_v.d.ts → server.JI4dqTgD.d.ts} +2 -2
- package/dist/shared/{server.BEHw7Eyx.mjs → server.Kxw442A9.mjs} +1 -1
- package/dist/shared/{server.BKSOrA6h.d.mts → server.WsFQIubj.d.mts} +103 -60
- package/dist/shared/{server.BKSOrA6h.d.ts → server.WsFQIubj.d.ts} +103 -60
- package/package.json +10 -9
- package/dist/shared/server.BKh8I1Ny.mjs +0 -239
package/dist/index.d.mts
CHANGED
|
@@ -1,53 +1,13 @@
|
|
|
1
|
-
import { AnySchema, ErrorMap, Meta, MergedErrorMap, Route, InferSchemaOutput, InferSchemaInput,
|
|
2
|
-
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput,
|
|
3
|
-
import {
|
|
1
|
+
import { AnySchema, ErrorMap, Meta, ContractProcedure, MergedErrorMap, Route, InferSchemaOutput, InferSchemaInput, ContractRouter, ContractProcedureDef, Schema, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
|
+
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { SchemaClass } from '@temporary-name/zod';
|
|
6
|
+
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.WsFQIubj.mjs';
|
|
7
|
+
export { U as AccessibleLazyRouter, Z as ContractProcedureCallbackOptions, N as InferRouterCurrentContexts, K as InferRouterInitialContexts, Q as InferRouterInputs, S as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, _ as LazyTraverseContractProceduresOptions, x as MiddlewareNextFn, w as MiddlewareNextFnOptions, z as MiddlewareOptions, y as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, H as ProcedureClientInterceptorOptions, F as ProcedureDef, D as ProcedureHandlerOptions, Y as TraverseContractProcedureCallbackOptions, X as TraverseContractProceduresOptions, a1 as UnlaziedRouter, V as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, J as createProcedureClient, W as enhanceRouter, t as getLazyMeta, T as getRouter, s as isLazy, G as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, B as middlewareOutputFn, a0 as resolveContractProcedures, $ as traverseContractProcedures, u as unlazy, a2 as unlazyRouter } from './shared/server.WsFQIubj.mjs';
|
|
7
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
8
9
|
|
|
9
10
|
declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
|
10
|
-
/**
|
|
11
|
-
* Adds type-safe custom errors.
|
|
12
|
-
* The provided errors are spared-merged with any existing errors.
|
|
13
|
-
*
|
|
14
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
15
|
-
*/
|
|
16
|
-
errors<U extends ErrorMap>(errors: U): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
17
|
-
/**
|
|
18
|
-
* Sets or updates the metadata.
|
|
19
|
-
* The provided metadata is spared-merged with any existing metadata.
|
|
20
|
-
*
|
|
21
|
-
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
22
|
-
*/
|
|
23
|
-
meta(meta: TMeta): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
24
|
-
/**
|
|
25
|
-
* Sets or updates the route definition.
|
|
26
|
-
* The provided route is spared-merged with any existing route.
|
|
27
|
-
* This option is typically relevant when integrating with OpenAPI.
|
|
28
|
-
*
|
|
29
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
30
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
31
|
-
*/
|
|
32
|
-
route(route: Route): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
33
|
-
/**
|
|
34
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
35
|
-
*
|
|
36
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
37
|
-
* @info Pass second argument to map the input.
|
|
38
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
39
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
40
|
-
*/
|
|
41
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): DecoratedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
42
|
-
/**
|
|
43
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
44
|
-
*
|
|
45
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
46
|
-
* @info Pass second argument to map the input.
|
|
47
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
48
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
49
|
-
*/
|
|
50
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): DecoratedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
51
11
|
/**
|
|
52
12
|
* Make this procedure callable (works like a function while still being a procedure).
|
|
53
13
|
*
|
|
@@ -56,141 +16,48 @@ declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContex
|
|
|
56
16
|
callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> & ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
|
|
57
17
|
}
|
|
58
18
|
|
|
59
|
-
declare
|
|
60
|
-
|
|
61
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
|
62
|
-
};
|
|
63
|
-
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
|
64
|
-
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends (Procedure<infer UInitialContext, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta>) ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
|
65
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
|
|
66
|
-
};
|
|
67
|
-
interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
|
|
68
|
-
middlewares: readonly AnyMiddleware[];
|
|
69
|
-
errorMap: TErrorMap;
|
|
70
|
-
dedupeLeadingMiddlewares: boolean;
|
|
71
|
-
}
|
|
72
|
-
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
|
|
73
|
-
interface TraverseContractProceduresOptions {
|
|
74
|
-
router: AnyContractRouter | AnyRouter;
|
|
75
|
-
path: readonly string[];
|
|
76
|
-
}
|
|
77
|
-
interface TraverseContractProcedureCallbackOptions {
|
|
78
|
-
contract: AnyContractProcedure | AnyProcedure;
|
|
79
|
-
path: readonly string[];
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
|
|
83
|
-
*/
|
|
84
|
-
type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
|
|
85
|
-
interface LazyTraverseContractProceduresOptions {
|
|
86
|
-
router: Lazy<AnyRouter>;
|
|
87
|
-
path: readonly string[];
|
|
88
|
-
}
|
|
89
|
-
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
|
90
|
-
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
|
|
91
|
-
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
|
92
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
|
93
|
-
};
|
|
94
|
-
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
|
95
|
-
|
|
96
|
-
interface BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> {
|
|
19
|
+
declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
|
20
|
+
z: SchemaClass<TGateName>;
|
|
97
21
|
/**
|
|
98
22
|
* This property holds the defined options.
|
|
99
23
|
*/
|
|
100
|
-
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta
|
|
24
|
+
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
25
|
+
constructor(def: BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
|
101
26
|
/**
|
|
102
|
-
* Adds type-safe custom errors.
|
|
103
|
-
* The provided errors are spared-merged with any existing errors.
|
|
27
|
+
* Adds type-safe custom errors to the contract.
|
|
28
|
+
* The provided errors are spared-merged with any existing errors in the contract.
|
|
104
29
|
*
|
|
105
30
|
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
106
31
|
*/
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
110
|
-
*
|
|
111
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
112
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
113
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
114
|
-
*/
|
|
115
|
-
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<TErrorMap>, TMeta>): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
32
|
+
errors<U extends ErrorMap>(errors: U): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
116
33
|
/**
|
|
117
|
-
* Sets or updates the metadata.
|
|
118
|
-
* The provided metadata is spared-merged with any existing metadata.
|
|
34
|
+
* Sets or updates the metadata for the contract.
|
|
35
|
+
* The provided metadata is spared-merged with any existing metadata in the contract.
|
|
119
36
|
*
|
|
120
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
121
38
|
*/
|
|
122
|
-
|
|
39
|
+
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
123
40
|
/**
|
|
124
|
-
* Sets or updates the route definition.
|
|
125
|
-
* The provided route is spared-merged with any existing route.
|
|
41
|
+
* Sets or updates the route definition for the contract.
|
|
42
|
+
* The provided route is spared-merged with any existing route in the contract.
|
|
126
43
|
* This option is typically relevant when integrating with OpenAPI.
|
|
127
44
|
*
|
|
128
45
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
129
46
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
130
47
|
*/
|
|
131
|
-
|
|
48
|
+
route(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
132
49
|
/**
|
|
133
50
|
* Defines the input validation schema.
|
|
134
51
|
*
|
|
135
52
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
|
|
136
53
|
*/
|
|
137
|
-
|
|
54
|
+
input<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, USchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
138
55
|
/**
|
|
139
56
|
* Defines the output validation schema.
|
|
140
57
|
*
|
|
141
58
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
142
59
|
*/
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Defines the handler of the procedure.
|
|
146
|
-
*
|
|
147
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
148
|
-
*/
|
|
149
|
-
'handler'<UFuncOutput>(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, UFuncOutput, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, Schema<UFuncOutput, UFuncOutput>, TErrorMap, TMeta>;
|
|
150
|
-
/**
|
|
151
|
-
* Prefixes all procedures in the router.
|
|
152
|
-
* The provided prefix is post-appended to any existing router prefix.
|
|
153
|
-
*
|
|
154
|
-
* @note This option does not affect procedures that do not define a path in their route definition.
|
|
155
|
-
*
|
|
156
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
|
|
157
|
-
*/
|
|
158
|
-
'prefix'(prefix: HTTPPath): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
|
|
159
|
-
/**
|
|
160
|
-
* Adds tags to all procedures in the router.
|
|
161
|
-
* This helpful when you want to group procedures together in the OpenAPI specification.
|
|
162
|
-
*
|
|
163
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
164
|
-
*/
|
|
165
|
-
'tag'(...tags: string[]): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
|
|
166
|
-
/**
|
|
167
|
-
* Applies all of the previously defined options to the specified router.
|
|
168
|
-
*
|
|
169
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
170
|
-
*/
|
|
171
|
-
'router'<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
172
|
-
/**
|
|
173
|
-
* Create a lazy router
|
|
174
|
-
* And applies all of the previously defined options to the specified router.
|
|
175
|
-
*
|
|
176
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
177
|
-
*/
|
|
178
|
-
'lazyRoute'<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
179
|
-
default: U;
|
|
180
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
181
|
-
}
|
|
182
|
-
interface ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> {
|
|
183
|
-
/**
|
|
184
|
-
* This property holds the defined options.
|
|
185
|
-
*/
|
|
186
|
-
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
187
|
-
/**
|
|
188
|
-
* Adds type-safe custom errors.
|
|
189
|
-
* The provided errors are spared-merged with any existing errors.
|
|
190
|
-
*
|
|
191
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
192
|
-
*/
|
|
193
|
-
'errors'<U extends ErrorMap>(errors: U): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
60
|
+
output<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, USchema, TErrorMap, TMeta, TGateName>;
|
|
194
61
|
/**
|
|
195
62
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
196
63
|
*
|
|
@@ -198,62 +65,18 @@ interface ProcedureBuilder<TInitialContext extends Context, TCurrentContext exte
|
|
|
198
65
|
* @note The current context must be satisfy middleware dependent-context
|
|
199
66
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
200
67
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
*
|
|
206
|
-
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
207
|
-
*/
|
|
208
|
-
'meta'(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
209
|
-
/**
|
|
210
|
-
* Sets or updates the route definition.
|
|
211
|
-
* The provided route is spared-merged with any existing route.
|
|
212
|
-
* This option is typically relevant when integrating with OpenAPI.
|
|
213
|
-
*
|
|
214
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
215
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
216
|
-
*/
|
|
217
|
-
'route'(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
218
|
-
/**
|
|
219
|
-
* Defines the input validation schema.
|
|
220
|
-
*
|
|
221
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
|
|
222
|
-
*/
|
|
223
|
-
'input'<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, USchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
224
|
-
/**
|
|
225
|
-
* Defines the output validation schema.
|
|
226
|
-
*
|
|
227
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
228
|
-
*/
|
|
229
|
-
'output'<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, USchema, TErrorMap, TMeta, TGateName>;
|
|
68
|
+
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
69
|
+
useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
|
|
70
|
+
isGateEnabled: typeof isGateEnabled;
|
|
71
|
+
}>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TInferredGateName>;
|
|
230
72
|
/**
|
|
231
73
|
* Defines the handler of the procedure.
|
|
232
74
|
*
|
|
233
75
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
234
76
|
*/
|
|
235
|
-
|
|
77
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
236
78
|
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* This property holds the defined options.
|
|
240
|
-
*/
|
|
241
|
-
'~orpc': EnhanceRouterOptions<TErrorMap>;
|
|
242
|
-
/**
|
|
243
|
-
* Adds type-safe custom errors.
|
|
244
|
-
* The provided errors are spared-merged with any existing errors.
|
|
245
|
-
*
|
|
246
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
247
|
-
*/
|
|
248
|
-
'errors'<U extends ErrorMap>(errors: U): RouterBuilder<TInitialContext, TCurrentContext, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
249
|
-
/**
|
|
250
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
251
|
-
*
|
|
252
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
253
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
254
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
255
|
-
*/
|
|
256
|
-
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<TErrorMap>, TMeta>): RouterBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TErrorMap, TMeta>;
|
|
79
|
+
declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName> {
|
|
257
80
|
/**
|
|
258
81
|
* Prefixes all procedures in the router.
|
|
259
82
|
* The provided prefix is post-appended to any existing router prefix.
|
|
@@ -262,29 +85,26 @@ interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends
|
|
|
262
85
|
*
|
|
263
86
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
|
|
264
87
|
*/
|
|
265
|
-
|
|
88
|
+
prefix(prefix: HTTPPath): BuilderWithMiddlewares<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
266
89
|
/**
|
|
267
90
|
* Adds tags to all procedures in the router.
|
|
268
91
|
* This helpful when you want to group procedures together in the OpenAPI specification.
|
|
269
92
|
*
|
|
270
93
|
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
271
94
|
*/
|
|
272
|
-
|
|
95
|
+
tag(...tags: string[]): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
|
|
273
96
|
/**
|
|
274
97
|
* Applies all of the previously defined options to the specified router.
|
|
275
98
|
*
|
|
276
99
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
277
100
|
*/
|
|
278
|
-
|
|
101
|
+
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
102
|
+
}
|
|
103
|
+
interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends Pick<BuilderWithMiddlewares<TInitialContext, TCurrentContext, any, any, TErrorMap, TMeta, any>, 'prefix' | 'tag' | 'router'> {
|
|
279
104
|
/**
|
|
280
|
-
*
|
|
281
|
-
* And applies all of the previously defined options to the specified router.
|
|
282
|
-
*
|
|
283
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
105
|
+
* This property holds the defined options.
|
|
284
106
|
*/
|
|
285
|
-
'
|
|
286
|
-
default: U;
|
|
287
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
107
|
+
'~orpc': EnhanceRouterOptions<TErrorMap>;
|
|
288
108
|
}
|
|
289
109
|
|
|
290
110
|
interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> extends Middleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta> {
|
|
@@ -309,23 +129,18 @@ interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Co
|
|
|
309
129
|
}
|
|
310
130
|
declare function decorateMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta>(middleware: Middleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta>): DecoratedMiddleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta>;
|
|
311
131
|
|
|
312
|
-
interface BuilderDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta
|
|
132
|
+
interface BuilderDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>, EnhanceRouterOptions<TErrorMap> {
|
|
313
133
|
middlewares: readonly AnyMiddleware[];
|
|
314
134
|
inputValidationIndex: number;
|
|
315
135
|
outputValidationIndex: number;
|
|
316
136
|
}
|
|
317
|
-
declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> {
|
|
318
|
-
/**
|
|
319
|
-
* This property holds the defined options.
|
|
320
|
-
*/
|
|
321
|
-
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
322
|
-
constructor(def: BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>);
|
|
137
|
+
declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends BuilderWithMiddlewares<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName> {
|
|
323
138
|
/**
|
|
324
139
|
* Set or override the initial context.
|
|
325
140
|
*
|
|
326
141
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
327
142
|
*/
|
|
328
|
-
$context<U extends Context>(): Builder<U
|
|
143
|
+
$context<U extends Context>(): Builder<U, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
329
144
|
/**
|
|
330
145
|
* Creates a middleware.
|
|
331
146
|
*
|
|
@@ -333,89 +148,6 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
333
148
|
*/
|
|
334
149
|
middleware<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, TInput, TOutput = any>(// = any here is important to make middleware can be used in any output by default
|
|
335
150
|
middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, ORPCErrorConstructorMap<TErrorMap>, TMeta>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, any, TMeta>;
|
|
336
|
-
/**
|
|
337
|
-
* Adds type-safe custom errors.
|
|
338
|
-
* The provided errors are spared-merged with any existing errors.
|
|
339
|
-
*
|
|
340
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
341
|
-
*/
|
|
342
|
-
errors<U extends ErrorMap>(errors: U): Builder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
343
|
-
/**
|
|
344
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
345
|
-
*
|
|
346
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
347
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
348
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
349
|
-
*/
|
|
350
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<TErrorMap>, TMeta>): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
351
|
-
useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
|
|
352
|
-
isGateEnabled: typeof isGateEnabled;
|
|
353
|
-
}>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TInferredGateName>;
|
|
354
|
-
/**
|
|
355
|
-
* Sets or updates the metadata.
|
|
356
|
-
* The provided metadata is spared-merged with any existing metadata.
|
|
357
|
-
*
|
|
358
|
-
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
359
|
-
*/
|
|
360
|
-
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
361
|
-
/**
|
|
362
|
-
* Sets or updates the route definition.
|
|
363
|
-
* The provided route is spared-merged with any existing route.
|
|
364
|
-
* This option is typically relevant when integrating with OpenAPI.
|
|
365
|
-
*
|
|
366
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
367
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
368
|
-
*/
|
|
369
|
-
route(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
370
|
-
/**
|
|
371
|
-
* Defines the input validation schema.
|
|
372
|
-
*
|
|
373
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
|
|
374
|
-
*/
|
|
375
|
-
input<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, USchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
376
|
-
/**
|
|
377
|
-
* Defines the output validation schema.
|
|
378
|
-
*
|
|
379
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
380
|
-
*/
|
|
381
|
-
output<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, USchema, TErrorMap, TMeta, TGateName>;
|
|
382
|
-
/**
|
|
383
|
-
* Defines the handler of the procedure.
|
|
384
|
-
*
|
|
385
|
-
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
386
|
-
*/
|
|
387
|
-
handler<UFuncOutput>(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, UFuncOutput, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, Schema<UFuncOutput, UFuncOutput>, TErrorMap, TMeta>;
|
|
388
|
-
/**
|
|
389
|
-
* Prefixes all procedures in the router.
|
|
390
|
-
* The provided prefix is post-appended to any existing router prefix.
|
|
391
|
-
*
|
|
392
|
-
* @note This option does not affect procedures that do not define a path in their route definition.
|
|
393
|
-
*
|
|
394
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
|
|
395
|
-
*/
|
|
396
|
-
prefix(prefix: HTTPPath): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
|
|
397
|
-
/**
|
|
398
|
-
* Adds tags to all procedures in the router.
|
|
399
|
-
* This helpful when you want to group procedures together in the OpenAPI specification.
|
|
400
|
-
*
|
|
401
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
402
|
-
*/
|
|
403
|
-
tag(...tags: string[]): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
|
|
404
|
-
/**
|
|
405
|
-
* Applies all of the previously defined options to the specified router.
|
|
406
|
-
*
|
|
407
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
408
|
-
*/
|
|
409
|
-
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
410
|
-
/**
|
|
411
|
-
* Create a lazy router
|
|
412
|
-
* And applies all of the previously defined options to the specified router.
|
|
413
|
-
*
|
|
414
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
415
|
-
*/
|
|
416
|
-
lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
417
|
-
default: U;
|
|
418
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
419
151
|
}
|
|
420
152
|
type ApiBuilder<TMeta extends Meta> = Builder<Record<never, never>, Record<never, never>, Schema<unknown, unknown>, Schema<unknown, unknown>, Record<never, never>, TMeta, never>;
|
|
421
153
|
interface ApiBuilderOpts<TMeta extends Meta> {
|
|
@@ -457,7 +189,7 @@ interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext
|
|
|
457
189
|
* Like `ProcedureBuilderWithoutHandler`, but removed all method that can change the contract.
|
|
458
190
|
*/
|
|
459
191
|
interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
460
|
-
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta
|
|
192
|
+
'~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
461
193
|
/**
|
|
462
194
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
463
195
|
*
|
|
@@ -500,16 +232,6 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
500
232
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
501
233
|
*/
|
|
502
234
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
503
|
-
/**
|
|
504
|
-
* Create a lazy router
|
|
505
|
-
* And applies all of the previously defined options to the specified router.
|
|
506
|
-
* And enforces the router match the contract.
|
|
507
|
-
*
|
|
508
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
509
|
-
*/
|
|
510
|
-
lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
|
|
511
|
-
default: U;
|
|
512
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
513
235
|
}
|
|
514
236
|
type ImplementerInternalWithMiddlewares<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? ProcedureImplementer<TInitialContext, TCurrentContext, UInputSchema, UOutputSchema, UErrorMap, UMeta> : RouterImplementerWithMiddlewares<TContract, TInitialContext, TCurrentContext> & {
|
|
515
237
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
@@ -559,7 +281,7 @@ type Implementer<TContract extends AnyContractRouter, TInitialContext extends Co
|
|
|
559
281
|
*
|
|
560
282
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
561
283
|
*/
|
|
562
|
-
$context<U extends Context>(): Implementer<TContract, U
|
|
284
|
+
$context<U extends Context>(): Implementer<TContract, U, U>;
|
|
563
285
|
} & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
|
|
564
286
|
declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
|
|
565
287
|
|
|
@@ -599,5 +321,5 @@ declare function createRouterClient<T extends AnyRouter, TClientContext extends
|
|
|
599
321
|
declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router: T, contract: AnyContractRouter): T;
|
|
600
322
|
declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
|
|
601
323
|
|
|
602
|
-
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call,
|
|
603
|
-
export type {
|
|
324
|
+
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, BuilderWithMiddlewares, Context, CreateProcedureClientOptions, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureBuilder, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createApiBuilder, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, getHiddenRouterContract, implement, implementerInternal, isStartWithMiddlewares, mergeMiddlewares, os, setHiddenRouterContract };
|
|
325
|
+
export type { ApiBuilder, BuilderDef, DecoratedMiddleware, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares };
|