@temporary-name/server 1.9.3-alpha.2957dbc009ec31fa21575f028b83c96651cba827 → 1.9.3-alpha.305aebe633f301e28426c6b15cdfd58ddf45641c
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 +3 -3
- package/dist/adapters/fetch/index.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +3 -3
- package/dist/adapters/node/index.d.ts +3 -3
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/adapters/standard/index.d.mts +3 -3
- package/dist/adapters/standard/index.d.ts +3 -3
- package/dist/adapters/standard/index.mjs +3 -3
- package/dist/index.d.mts +338 -34
- package/dist/index.d.ts +338 -34
- package/dist/index.mjs +424 -96
- package/dist/openapi/index.d.mts +16 -34
- package/dist/openapi/index.d.ts +16 -34
- package/dist/openapi/index.mjs +339 -298
- package/dist/shared/{server.DfUs5c4R.d.ts → server.B0LJ_wu-.d.ts} +3 -3
- package/dist/shared/{server.L8lRAYBR.d.mts → server.BQZMQrPe.d.mts} +3 -3
- package/dist/shared/{server.CpS0m3at.mjs → server.CYa9puL2.mjs} +3 -3
- package/dist/shared/server.ChOv1yG3.mjs +319 -0
- package/dist/shared/server.CjPiuQYH.d.mts +51 -0
- package/dist/shared/server.CjPiuQYH.d.ts +51 -0
- package/dist/shared/server.Cza0RB3u.mjs +160 -0
- package/dist/shared/{server.DPD7R7h_.d.mts → server.DXPMDozZ.d.mts} +182 -20
- package/dist/shared/{server.DPD7R7h_.d.ts → server.DXPMDozZ.d.ts} +182 -20
- package/dist/shared/server.Ny4yD6yY.mjs +525 -0
- package/package.json +10 -11
- package/dist/shared/server.B7tjiDal.mjs +0 -354
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.BQZMQrPe.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.js';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.B0LJ_wu-.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
8
8
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CYa9puL2.mjs';
|
|
5
4
|
import '@temporary-name/standard-server';
|
|
6
5
|
import '@temporary-name/server';
|
|
7
6
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.Cza0RB3u.mjs';
|
|
9
8
|
import '@temporary-name/zod';
|
|
9
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
10
10
|
import '../../shared/server.CQIFwyhc.mjs';
|
|
11
11
|
|
|
12
12
|
class AwsLambdaHandler {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.BQZMQrPe.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type FetchHandleResult = {
|
|
8
8
|
matched: true;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.js';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.B0LJ_wu-.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type FetchHandleResult = {
|
|
8
8
|
matched: true;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CYa9puL2.mjs';
|
|
5
4
|
import '@temporary-name/standard-server';
|
|
6
5
|
import '@temporary-name/server';
|
|
7
6
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.Cza0RB3u.mjs';
|
|
9
8
|
import '@temporary-name/zod';
|
|
9
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
10
10
|
import '../../shared/server.CQIFwyhc.mjs';
|
|
11
11
|
|
|
12
12
|
class FetchHandler {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.BQZMQrPe.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type NodeHttpHandleResult = {
|
|
8
8
|
matched: true;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { C as Context,
|
|
4
|
-
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
3
|
+
import { C as Context, l as Router } from '../../shared/server.DXPMDozZ.js';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.B0LJ_wu-.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
type NodeHttpHandleResult = {
|
|
8
8
|
matched: true;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CYa9puL2.mjs';
|
|
5
4
|
import '@temporary-name/standard-server';
|
|
6
5
|
import '@temporary-name/server';
|
|
7
6
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.Cza0RB3u.mjs';
|
|
9
8
|
import '@temporary-name/zod';
|
|
9
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
10
10
|
import '../../shared/server.CQIFwyhc.mjs';
|
|
11
11
|
|
|
12
12
|
class NodeHttpHandler {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.BQZMQrPe.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
import '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
4
|
+
import '../../shared/server.DXPMDozZ.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
8
8
|
path: unknown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.B0LJ_wu-.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
import '../../shared/server.
|
|
5
|
-
import '@temporary-name/
|
|
4
|
+
import '../../shared/server.DXPMDozZ.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
6
|
|
|
7
7
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
8
8
|
path: unknown;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.
|
|
1
|
+
export { S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.CYa9puL2.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
|
-
import '../../shared/server.
|
|
4
|
-
import '@temporary-name/contract';
|
|
3
|
+
import '../../shared/server.Cza0RB3u.mjs';
|
|
5
4
|
import '@temporary-name/standard-server';
|
|
6
5
|
import '@temporary-name/zod';
|
|
6
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
7
7
|
import '../../shared/server.CQIFwyhc.mjs';
|
|
8
8
|
import '@temporary-name/server';
|
|
9
9
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { InferSchemaInput, InferSchemaOutput, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator } from '@temporary-name/contract';
|
|
3
|
-
import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint, IntersectPick, OptionalIfEmpty, HTTPPath, ClientOptions } from '@temporary-name/shared';
|
|
4
|
-
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
1
|
+
import * as z from '@temporary-name/zod';
|
|
5
2
|
import { SchemaClass, core } from '@temporary-name/zod';
|
|
6
|
-
import
|
|
7
|
-
|
|
3
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
4
|
+
import { $input, $output } from 'zod/v4/core';
|
|
5
|
+
import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint as HTTPEndpoint$1, IntersectPick, HTTPPath, AsyncIteratorClass, ClientOptions, HTTPMethod } from '@temporary-name/shared';
|
|
6
|
+
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
7
|
+
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, E as EnhanceRouterOptions, l as Router, m as EnhancedRouter, n as MapInputMiddleware, o as ContractDef, p as SchemaIssue, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as AnyRouter, v as InferRouterInitialContext } from './shared/server.DXPMDozZ.mjs';
|
|
8
|
+
export { a5 as AccessibleLazyRouter, Y as AnyContractDef, aa as ContractProcedureCallbackOptions, $ as ContractRouter, a1 as InferRouterCurrentContexts, a0 as InferRouterInitialContexts, a2 as InferRouterInputs, a3 as InferRouterOutputs, ai as InitialSchemas, x as LAZY_SYMBOL, y as LazyMeta, ab as LazyTraverseContractProceduresOptions, N as MiddlewareNextFn, Q as MiddlewareOptions, O as MiddlewareOutputFn, K as MiddlewareResult, Z as ProcedureDef, X as ProcedureHandlerOptions, a9 as TraverseContractProcedureCallbackOptions, a8 as TraverseContractProceduresOptions, ag as TypeRest, ae as UnlaziedRouter, a6 as createAccessibleLazyRouter, a7 as enhanceRouter, G as getLazyMeta, a4 as getRouter, ah as initialSchemas, F as isLazy, _ as isProcedure, D as lazy, z as lazyInternal, w as mergeCurrentContext, J as mergeMeta, T as middlewareOutputFn, ad as resolveContractProcedures, ac as traverseContractProcedures, H as unlazy, af as unlazyRouter } from './shared/server.DXPMDozZ.mjs';
|
|
9
|
+
import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
|
|
10
|
+
import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
|
|
11
|
+
import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
12
|
+
export { a as ZodToJsonSchemaConverter, Z as ZodToJsonSchemaConverterOptions } from './shared/server.CjPiuQYH.mjs';
|
|
13
|
+
import { JSONSchema } from '@temporary-name/server/openapi';
|
|
8
14
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
15
|
|
|
10
16
|
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>>;
|
|
@@ -13,7 +19,7 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TClientContex
|
|
|
13
19
|
* This is helpful for logging and analytics.
|
|
14
20
|
*/
|
|
15
21
|
path?: readonly string[];
|
|
16
|
-
} & (
|
|
22
|
+
} & (object extends TInitialContext ? {
|
|
17
23
|
context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
|
18
24
|
} : {
|
|
19
25
|
context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
|
|
@@ -47,7 +53,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
47
53
|
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
48
54
|
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
49
55
|
}>, TMeta, TGateName>;
|
|
50
|
-
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint$1, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
51
57
|
pathSchema: WrapShape<U>;
|
|
52
58
|
}>, TMeta, TGateName>;
|
|
53
59
|
/**
|
|
@@ -80,8 +86,9 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
80
86
|
* @note The current context must be satisfy middleware dependent-context
|
|
81
87
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
82
88
|
*/
|
|
83
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext
|
|
84
|
-
|
|
89
|
+
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>>(middleware: Middleware<TCurrentContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<TInitialContext, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
|
|
90
|
+
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
|
|
91
|
+
useAuth<TAuthContext extends ValidatedAuthContext = false>(config: AuthConfig<TAuthContext, TCurrentContext, TMeta>): ProcedureBuilder<TInitialContext, BuildContextWithAuth<TCurrentContext, TAuthContext>, TSchemas, TMeta, TGateName>;
|
|
85
92
|
useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
|
|
86
93
|
isGateEnabled: typeof isGateEnabled;
|
|
87
94
|
}>, TSchemas, TMeta, TInferredGateName>;
|
|
@@ -128,24 +135,10 @@ interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Co
|
|
|
128
135
|
* Change the expected input type by providing a map function.
|
|
129
136
|
*/
|
|
130
137
|
mapInput<UInput>(map: MapInputMiddleware<UInput, TInput>): DecoratedMiddleware<TInContext, TOutContext, UInput, TOutput, TMeta>;
|
|
131
|
-
/**
|
|
132
|
-
* Concatenates two middlewares.
|
|
133
|
-
*
|
|
134
|
-
* @info Pass second argument to map the input.
|
|
135
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware#concatenation Middleware Concatenation Docs}
|
|
136
|
-
*/
|
|
137
|
-
concat<UOutContext extends IntersectPick<MergedCurrentContext<TInContext, TOutContext>, UOutContext>, UInput extends TInput, UInContext extends Context = MergedCurrentContext<TInContext, TOutContext>>(middleware: Middleware<UInContext | MergedCurrentContext<TInContext, TOutContext>, UOutContext, UInput, TOutput, TMeta>): DecoratedMiddleware<MergedInitialContext<TInContext, UInContext, MergedCurrentContext<TInContext, TOutContext>>, MergedCurrentContext<TOutContext, UOutContext>, UInput, TOutput, TMeta>;
|
|
138
|
-
/**
|
|
139
|
-
* Concatenates two middlewares.
|
|
140
|
-
*
|
|
141
|
-
* @info Pass second argument to map the input.
|
|
142
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware#concatenation Middleware Concatenation Docs}
|
|
143
|
-
*/
|
|
144
|
-
concat<UOutContext extends IntersectPick<MergedCurrentContext<TInContext, TOutContext>, UOutContext>, UInput extends TInput, UMappedInput, UInContext extends Context = MergedCurrentContext<TInContext, TOutContext>>(middleware: Middleware<UInContext | MergedCurrentContext<TInContext, TOutContext>, UOutContext, UMappedInput, TOutput, TMeta>, mapInput: MapInputMiddleware<UInput, UMappedInput>): DecoratedMiddleware<MergedInitialContext<TInContext, UInContext, MergedCurrentContext<TInContext, TOutContext>>, MergedCurrentContext<TOutContext, UOutContext>, UInput, TOutput, TMeta>;
|
|
145
138
|
}
|
|
146
139
|
declare function decorateMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TMeta extends Meta>(middleware: Middleware<TInContext, TOutContext, TInput, TOutput, TMeta>): DecoratedMiddleware<TInContext, TOutContext, TInput, TOutput, TMeta>;
|
|
147
140
|
|
|
148
|
-
interface BuilderDef<TSchemas extends Schemas, TMeta extends Meta> extends ContractDef<
|
|
141
|
+
interface BuilderDef<TSchemas extends Schemas, TMeta extends Meta> extends ContractDef<TSchemas, TMeta>, EnhanceRouterOptions {
|
|
149
142
|
}
|
|
150
143
|
declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta, TGateName extends string> extends BuilderWithMiddlewares<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName> {
|
|
151
144
|
/**
|
|
@@ -162,12 +155,299 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
162
155
|
middleware<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, TInput, TOutput = any>(// = any here is important to make middleware can be used in any output by default
|
|
163
156
|
middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, TMeta>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, TMeta>;
|
|
164
157
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
158
|
+
declare const baseApi: Builder<{}, {}, {
|
|
159
|
+
pathSchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
|
|
160
|
+
querySchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
|
|
161
|
+
bodySchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
|
|
162
|
+
outputSchema: z.KrustyUnknown<z.KrustyInternals<string>>;
|
|
163
|
+
}, Record<never, never>, never>;
|
|
164
|
+
|
|
165
|
+
interface ValidationErrorOptions extends ErrorOptions {
|
|
166
|
+
message: string;
|
|
167
|
+
issues: readonly SchemaIssue[];
|
|
168
|
+
/**
|
|
169
|
+
* @todo require this field in v2
|
|
170
|
+
*/
|
|
171
|
+
data?: unknown;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* This errors usually used for ORPCError.cause when the error is a validation error.
|
|
175
|
+
*
|
|
176
|
+
* @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
|
|
177
|
+
*/
|
|
178
|
+
declare class ValidationError extends Error {
|
|
179
|
+
readonly issues: readonly SchemaIssue[];
|
|
180
|
+
readonly data: unknown;
|
|
181
|
+
constructor(options: ValidationErrorOptions);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface EventIteratorSchemaDetails {
|
|
185
|
+
yields: AnySchema;
|
|
186
|
+
returns?: AnySchema;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Define schema for an event iterator.
|
|
190
|
+
*
|
|
191
|
+
* @see {@link https://orpc.unnoq.com/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
|
|
192
|
+
*/
|
|
193
|
+
declare function eventIterator<TYieldIn, TYieldOut, TReturnIn = unknown, TReturnOut = unknown>(yields: Schema<TYieldIn, TYieldOut>, returns?: Schema<TReturnIn, TReturnOut>): Schema<AsyncIteratorObject<TYieldIn, TReturnIn, void>, AsyncIteratorClass<TYieldOut, TReturnOut, void>>;
|
|
194
|
+
declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;
|
|
195
|
+
|
|
196
|
+
type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
|
|
197
|
+
declare enum JsonSchemaXNativeType {
|
|
198
|
+
BigInt = "bigint",
|
|
199
|
+
RegExp = "regexp",
|
|
200
|
+
Date = "date",
|
|
201
|
+
Url = "url",
|
|
202
|
+
Set = "set",
|
|
203
|
+
Map = "map"
|
|
168
204
|
}
|
|
169
|
-
|
|
170
|
-
|
|
205
|
+
|
|
206
|
+
interface experimental_JsonSchemaCoerceOptions {
|
|
207
|
+
components?: Record<string, JsonSchema>;
|
|
208
|
+
}
|
|
209
|
+
declare class experimental_JsonSchemaCoercer {
|
|
210
|
+
#private;
|
|
211
|
+
coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Zod registry for customizing generated JSON schema, can use both for .input and .output
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* import { JSON_SCHEMA_REGISTRY } from '@temporary-name/zod/zod4'
|
|
220
|
+
*
|
|
221
|
+
* const user = z.object({
|
|
222
|
+
* name: z.string(),
|
|
223
|
+
* age: z.number(),
|
|
224
|
+
* })
|
|
225
|
+
*
|
|
226
|
+
* JSON_SCHEMA_REGISTRY.add(user, {
|
|
227
|
+
* examples: [{ name: 'John', age: 20 }],
|
|
228
|
+
* })
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
declare const JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
232
|
+
$anchor?: string;
|
|
233
|
+
$comment?: string;
|
|
234
|
+
$defs?: Record<string, JSONSchema>;
|
|
235
|
+
$dynamicAnchor?: string;
|
|
236
|
+
$dynamicRef?: string;
|
|
237
|
+
$id?: string;
|
|
238
|
+
$ref?: string;
|
|
239
|
+
$schema?: string;
|
|
240
|
+
$vocabulary?: Record<string, string>;
|
|
241
|
+
additionalItems?: JSONSchema;
|
|
242
|
+
additionalProperties?: JSONSchema;
|
|
243
|
+
allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
244
|
+
anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
245
|
+
const?: typeof $input | typeof $output | undefined;
|
|
246
|
+
contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
247
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
248
|
+
contentMediaType?: string;
|
|
249
|
+
contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
250
|
+
default?: typeof $input | typeof $output | undefined;
|
|
251
|
+
definitions?: Record<string, JSONSchema>;
|
|
252
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
253
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
254
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
255
|
+
deprecated?: boolean;
|
|
256
|
+
description?: string;
|
|
257
|
+
else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
258
|
+
enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
|
|
259
|
+
examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
|
|
260
|
+
exclusiveMaximum?: number;
|
|
261
|
+
exclusiveMinimum?: number;
|
|
262
|
+
format?: string;
|
|
263
|
+
if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
264
|
+
items?: JSONSchema;
|
|
265
|
+
maxContains?: number;
|
|
266
|
+
maximum?: number;
|
|
267
|
+
maxItems?: number;
|
|
268
|
+
maxLength?: number;
|
|
269
|
+
maxProperties?: number;
|
|
270
|
+
minContains?: number;
|
|
271
|
+
minimum?: number;
|
|
272
|
+
minItems?: number;
|
|
273
|
+
minLength?: number;
|
|
274
|
+
minProperties?: number;
|
|
275
|
+
multipleOf?: number;
|
|
276
|
+
not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
277
|
+
oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
278
|
+
pattern?: string;
|
|
279
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
280
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
281
|
+
properties?: Record<string, JSONSchema>;
|
|
282
|
+
propertyNames?: JSONSchema;
|
|
283
|
+
readOnly?: boolean;
|
|
284
|
+
required?: string[] | readonly string[];
|
|
285
|
+
then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
286
|
+
title?: string;
|
|
287
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
288
|
+
unevaluatedItems?: JSONSchema;
|
|
289
|
+
unevaluatedProperties?: JSONSchema;
|
|
290
|
+
uniqueItems?: boolean;
|
|
291
|
+
writeOnly?: boolean;
|
|
292
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
293
|
+
/**
|
|
294
|
+
* Zod registry for customizing generated JSON schema, only useful for .input
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* import { JSON_SCHEMA_INPUT_REGISTRY } from '@temporary-name/zod/zod4'
|
|
299
|
+
*
|
|
300
|
+
* const user = z.object({
|
|
301
|
+
* name: z.string(),
|
|
302
|
+
* age: z.string().transform(v => Number(v)),
|
|
303
|
+
* })
|
|
304
|
+
*
|
|
305
|
+
* JSON_SCHEMA_REGISTRY.add(user, {
|
|
306
|
+
* examples: [{ name: 'John', age: "20" }],
|
|
307
|
+
* })
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
declare const JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
311
|
+
$anchor?: string;
|
|
312
|
+
$comment?: string;
|
|
313
|
+
$defs?: Record<string, JSONSchema>;
|
|
314
|
+
$dynamicAnchor?: string;
|
|
315
|
+
$dynamicRef?: string;
|
|
316
|
+
$id?: string;
|
|
317
|
+
$ref?: string;
|
|
318
|
+
$schema?: string;
|
|
319
|
+
$vocabulary?: Record<string, string>;
|
|
320
|
+
additionalItems?: JSONSchema;
|
|
321
|
+
additionalProperties?: JSONSchema;
|
|
322
|
+
allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
323
|
+
anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
324
|
+
const?: typeof $input | undefined;
|
|
325
|
+
contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
326
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
327
|
+
contentMediaType?: string;
|
|
328
|
+
contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
329
|
+
default?: typeof $input | undefined;
|
|
330
|
+
definitions?: Record<string, JSONSchema>;
|
|
331
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
332
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
333
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
334
|
+
deprecated?: boolean;
|
|
335
|
+
description?: string;
|
|
336
|
+
else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
337
|
+
enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
|
|
338
|
+
examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
|
|
339
|
+
exclusiveMaximum?: number;
|
|
340
|
+
exclusiveMinimum?: number;
|
|
341
|
+
format?: string;
|
|
342
|
+
if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
343
|
+
items?: JSONSchema;
|
|
344
|
+
maxContains?: number;
|
|
345
|
+
maximum?: number;
|
|
346
|
+
maxItems?: number;
|
|
347
|
+
maxLength?: number;
|
|
348
|
+
maxProperties?: number;
|
|
349
|
+
minContains?: number;
|
|
350
|
+
minimum?: number;
|
|
351
|
+
minItems?: number;
|
|
352
|
+
minLength?: number;
|
|
353
|
+
minProperties?: number;
|
|
354
|
+
multipleOf?: number;
|
|
355
|
+
not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
356
|
+
oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
357
|
+
pattern?: string;
|
|
358
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
359
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
360
|
+
properties?: Record<string, JSONSchema>;
|
|
361
|
+
propertyNames?: JSONSchema;
|
|
362
|
+
readOnly?: boolean;
|
|
363
|
+
required?: string[] | readonly string[];
|
|
364
|
+
then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
365
|
+
title?: string;
|
|
366
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
367
|
+
unevaluatedItems?: JSONSchema;
|
|
368
|
+
unevaluatedProperties?: JSONSchema;
|
|
369
|
+
uniqueItems?: boolean;
|
|
370
|
+
writeOnly?: boolean;
|
|
371
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
372
|
+
/**
|
|
373
|
+
* Zod registry for customizing generated JSON schema, only useful for .input
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@temporary-name/zod/zod4'
|
|
378
|
+
*
|
|
379
|
+
* const user = z.object({
|
|
380
|
+
* name: z.string(),
|
|
381
|
+
* age: z.string().transform(v => Number(v)),
|
|
382
|
+
* })
|
|
383
|
+
*
|
|
384
|
+
* JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
|
|
385
|
+
* examples: [{ name: 'John', age: 20 }],
|
|
386
|
+
* })
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
declare const JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
390
|
+
$anchor?: string;
|
|
391
|
+
$comment?: string;
|
|
392
|
+
$defs?: Record<string, JSONSchema>;
|
|
393
|
+
$dynamicAnchor?: string;
|
|
394
|
+
$dynamicRef?: string;
|
|
395
|
+
$id?: string;
|
|
396
|
+
$ref?: string;
|
|
397
|
+
$schema?: string;
|
|
398
|
+
$vocabulary?: Record<string, string>;
|
|
399
|
+
additionalItems?: JSONSchema;
|
|
400
|
+
additionalProperties?: JSONSchema;
|
|
401
|
+
allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
402
|
+
anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
403
|
+
const?: typeof $output | undefined;
|
|
404
|
+
contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
405
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
406
|
+
contentMediaType?: string;
|
|
407
|
+
contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
408
|
+
default?: typeof $output | undefined;
|
|
409
|
+
definitions?: Record<string, JSONSchema>;
|
|
410
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
411
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
412
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
413
|
+
deprecated?: boolean;
|
|
414
|
+
description?: string;
|
|
415
|
+
else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
416
|
+
enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
|
|
417
|
+
examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
|
|
418
|
+
exclusiveMaximum?: number;
|
|
419
|
+
exclusiveMinimum?: number;
|
|
420
|
+
format?: string;
|
|
421
|
+
if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
422
|
+
items?: JSONSchema;
|
|
423
|
+
maxContains?: number;
|
|
424
|
+
maximum?: number;
|
|
425
|
+
maxItems?: number;
|
|
426
|
+
maxLength?: number;
|
|
427
|
+
maxProperties?: number;
|
|
428
|
+
minContains?: number;
|
|
429
|
+
minimum?: number;
|
|
430
|
+
minItems?: number;
|
|
431
|
+
minLength?: number;
|
|
432
|
+
minProperties?: number;
|
|
433
|
+
multipleOf?: number;
|
|
434
|
+
not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
435
|
+
oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
436
|
+
pattern?: string;
|
|
437
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
438
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
439
|
+
properties?: Record<string, JSONSchema>;
|
|
440
|
+
propertyNames?: JSONSchema;
|
|
441
|
+
readOnly?: boolean;
|
|
442
|
+
required?: string[] | readonly string[];
|
|
443
|
+
then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
444
|
+
title?: string;
|
|
445
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
446
|
+
unevaluatedItems?: JSONSchema;
|
|
447
|
+
unevaluatedProperties?: JSONSchema;
|
|
448
|
+
uniqueItems?: boolean;
|
|
449
|
+
writeOnly?: boolean;
|
|
450
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
171
451
|
|
|
172
452
|
declare function isStartWithMiddlewares(middlewares: readonly AnyMiddleware[], compare: readonly AnyMiddleware[]): boolean;
|
|
173
453
|
declare function mergeMiddlewares(first: readonly AnyMiddleware[], second: readonly AnyMiddleware[], options: {
|
|
@@ -186,9 +466,9 @@ declare function createAssertedLazyProcedure(lazied: Lazy<any>): Lazy<AnyProcedu
|
|
|
186
466
|
* ```
|
|
187
467
|
*
|
|
188
468
|
*/
|
|
189
|
-
declare function call<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TMeta>>, input: InferProcedureClientInputs<TSchemas>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext,
|
|
469
|
+
declare function call<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TMeta>>, input: InferProcedureClientInputs<TSchemas>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, {}> & Omit<ClientOptions<{}>, 'context'>>): Promise<InferSchemaOutput<TSchemas['outputSchema']>>;
|
|
190
470
|
|
|
191
|
-
type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext =
|
|
471
|
+
type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = {}> = TRouter extends Procedure<any, any, infer USchemas, any> ? ProcedureClient<TClientContext, USchemas> : {
|
|
192
472
|
[K in keyof TRouter]: TRouter[K] extends Lazyable<infer U extends AnyRouter> ? RouterClient<U, TClientContext> : never;
|
|
193
473
|
};
|
|
194
474
|
/**
|
|
@@ -198,5 +478,29 @@ type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContex
|
|
|
198
478
|
*/
|
|
199
479
|
declare function createRouterClient<T extends AnyRouter, TClientContext extends ClientContext>(router: Lazyable<T | undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<T>, TClientContext>>): RouterClient<T, TClientContext>;
|
|
200
480
|
|
|
201
|
-
|
|
202
|
-
|
|
481
|
+
declare function isSchemaIssue(issue: unknown): issue is SchemaIssue;
|
|
482
|
+
|
|
483
|
+
type HTTPEndpoint = `${HTTPMethod} ${HTTPPath}`;
|
|
484
|
+
declare const endpointRegex: RegExp;
|
|
485
|
+
/**
|
|
486
|
+
* @internal
|
|
487
|
+
*/
|
|
488
|
+
declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
|
|
489
|
+
/**
|
|
490
|
+
* @internal
|
|
491
|
+
*/
|
|
492
|
+
declare function getDynamicParams(path: HTTPPath | undefined): {
|
|
493
|
+
raw: string;
|
|
494
|
+
name: string;
|
|
495
|
+
}[] | undefined;
|
|
496
|
+
/**
|
|
497
|
+
* @internal
|
|
498
|
+
*/
|
|
499
|
+
declare function parseEndpointDefinition(stringsOrEndpoint: TemplateStringsArray | HTTPEndpoint, values: AnyShape[] | [AnySchema | AnyShape] | []): {
|
|
500
|
+
method: HTTPMethod;
|
|
501
|
+
path: HTTPPath;
|
|
502
|
+
pathSchema: AnySchema;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
export { AnyMiddleware, AnyProcedure, AnyRouter, AnySchema, AnyShape, BuildContextWithAuth, Builder, BuilderWithMiddlewares, Context, Contract, ContractDef, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, InferHandlerInputs, InferProcedureClientInputs, InferRouterInitialContext, InferSchemaInput, InferSchemaOutput, JSON_SCHEMA_INPUT_REGISTRY, JSON_SCHEMA_OUTPUT_REGISTRY, JSON_SCHEMA_REGISTRY, JsonSchemaXNativeType, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, MergedSchemas, Meta, Middleware, Procedure, ProcedureBuilder, ProcedureHandler, Router, Schema, SchemaIssue, Schemas, UnionToIntersection, ValidationError, WrapShape, addMiddleware, baseApi, call, createAssertedLazyProcedure, createProcedureClient, createRouterClient, decorateMiddleware, endpointRegex, eventIterator, experimental_JsonSchemaCoercer, getDynamicParams, getEventIteratorSchemaDetails, isSchemaIssue, isStartWithMiddlewares, mergeMiddlewares, parseEndpointDefinition, standardizeHTTPPath };
|
|
506
|
+
export type { BuilderDef, CreateProcedureClientOptions, DecoratedMiddleware, EventIteratorSchemaDetails, HTTPEndpoint, JsonSchema, ProcedureClient, RouterBuilder, RouterClient, ValidationErrorOptions, experimental_JsonSchemaCoerceOptions };
|