@temporary-name/server 1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a → 1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6
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 -4
- package/dist/adapters/aws-lambda/index.d.ts +3 -4
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/fetch/index.d.mts +3 -4
- package/dist/adapters/fetch/index.d.ts +3 -4
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +3 -4
- package/dist/adapters/node/index.d.ts +3 -4
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/adapters/standard/index.d.mts +10 -6
- package/dist/adapters/standard/index.d.ts +10 -6
- package/dist/adapters/standard/index.mjs +4 -4
- package/dist/index.d.mts +51 -43
- package/dist/index.d.ts +51 -43
- package/dist/index.mjs +42 -14
- package/dist/openapi/index.d.mts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.mjs +52 -35
- package/dist/plugins/index.d.mts +4 -80
- package/dist/plugins/index.d.ts +4 -80
- package/dist/plugins/index.mjs +17 -189
- package/dist/shared/{server.BYnDyuDL.d.mts → server.7aL9gcoU.d.mts} +2 -2
- package/dist/shared/{server.WsFQIubj.d.mts → server.BL2R5jcp.d.mts} +36 -43
- package/dist/shared/{server.WsFQIubj.d.ts → server.BL2R5jcp.d.ts} +36 -43
- package/dist/shared/{server.CjkiSCui.mjs → server.C61o1Zch.mjs} +36 -19
- package/dist/shared/{server.C-tNYmY_.d.ts → server.D6Qs_UcF.d.mts} +2 -3
- package/dist/shared/{server.JI4dqTgD.d.ts → server.DFptr1Nz.d.ts} +2 -2
- package/dist/shared/{server.BlJrjUA9.d.mts → server.DpoO_ER_.d.ts} +2 -3
- package/dist/shared/{server.DdHBdcen.mjs → server.DwbIdsnK.mjs} +18 -26
- package/dist/shared/{server.Kxw442A9.mjs → server.JtIZ8YG7.mjs} +1 -11
- package/package.json +10 -10
|
@@ -1,10 +1,9 @@
|
|
|
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, R as Router } from '../../shared/server.
|
|
4
|
-
import { b as StandardHandlerOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
9
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
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, R as Router } from '../../shared/server.
|
|
4
|
-
import { b as StandardHandlerOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
9
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
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.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DwbIdsnK.mjs';
|
|
4
4
|
import '@temporary-name/contract';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import '@temporary-name/server';
|
|
7
7
|
import 'rou3';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.C61o1Zch.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class AwsLambdaHandler {
|
|
13
13
|
sendStandardResponseOptions;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface FetchHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
10
9
|
initRuntimeAdapter?(options: FetchHandlerOptions<T>): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface FetchHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
10
9
|
initRuntimeAdapter?(options: FetchHandlerOptions<T>): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DwbIdsnK.mjs';
|
|
4
4
|
import '@temporary-name/contract';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import '@temporary-name/server';
|
|
7
7
|
import 'rou3';
|
|
8
8
|
import '@temporary-name/zod';
|
|
9
|
-
import '../../shared/server.
|
|
10
|
-
import '../../shared/server.
|
|
9
|
+
import '../../shared/server.C61o1Zch.mjs';
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
13
13
|
maxBodySize;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
|
-
import '@temporary-name/standard-server';
|
|
9
8
|
|
|
10
9
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
11
10
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
|
-
import '@temporary-name/standard-server';
|
|
9
8
|
|
|
10
9
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
11
10
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { once, ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import compression from '@temporary-name/interop/compression';
|
|
3
3
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DwbIdsnK.mjs';
|
|
5
5
|
import '@temporary-name/contract';
|
|
6
6
|
import '@temporary-name/standard-server';
|
|
7
7
|
import '@temporary-name/server';
|
|
8
8
|
import 'rou3';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
|
-
import '../../shared/server.
|
|
11
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.C61o1Zch.mjs';
|
|
11
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
14
14
|
maxBodySize;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.D6Qs_UcF.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
|
|
5
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.BYnDyuDL.mjs';
|
|
3
|
+
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BL2R5jcp.mjs';
|
|
8
7
|
|
|
9
|
-
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<
|
|
8
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
9
|
+
path: unknown;
|
|
10
|
+
query: unknown;
|
|
11
|
+
headers: Headers;
|
|
12
|
+
body: unknown;
|
|
13
|
+
}>;
|
|
10
14
|
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
15
|
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
12
16
|
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.DpoO_ER_.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
|
|
5
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.JI4dqTgD.js';
|
|
3
|
+
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.DFptr1Nz.js';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BL2R5jcp.js';
|
|
8
7
|
|
|
9
|
-
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<
|
|
8
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
9
|
+
path: unknown;
|
|
10
|
+
query: unknown;
|
|
11
|
+
headers: Headers;
|
|
12
|
+
body: unknown;
|
|
13
|
+
}>;
|
|
10
14
|
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
15
|
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
12
16
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, 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 { C as CompositeStandardHandlerPlugin, 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.DwbIdsnK.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
|
-
import '
|
|
4
|
-
import '../../shared/server.CjkiSCui.mjs';
|
|
3
|
+
import '../../shared/server.C61o1Zch.mjs';
|
|
5
4
|
import '@temporary-name/contract';
|
|
5
|
+
import '@temporary-name/standard-server';
|
|
6
6
|
import '@temporary-name/zod';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
8
8
|
import '@temporary-name/server';
|
|
9
9
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap, AnyShape, MergedSchemas, WrapShape, UnionToIntersection, AnySchema, Route, InferHandlerInputs, InferSchemaInput, ContractRouter, ContractProcedureDef, InitialSchemas, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, InferProcedureClientInputs, InferSchemaOutput, ErrorFromErrorMap, Schema } from '@temporary-name/contract';
|
|
2
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';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, HTTPEndpoint, 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 { 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.
|
|
7
|
-
export {
|
|
5
|
+
import { SchemaClass, core } 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.BL2R5jcp.mjs';
|
|
7
|
+
export { T as AccessibleLazyRouter, Y as ContractProcedureCallbackOptions, K as InferRouterCurrentContexts, J as InferRouterInitialContexts, N as InferRouterInputs, Q as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, Z as LazyTraverseContractProceduresOptions, w as MiddlewareNextFn, y as MiddlewareOptions, x as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, G as ProcedureClientInterceptorOptions, D as ProcedureDef, B as ProcedureHandlerOptions, X as TraverseContractProcedureCallbackOptions, W as TraverseContractProceduresOptions, a0 as UnlaziedRouter, U as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, H as createProcedureClient, V as enhanceRouter, t as getLazyMeta, S as getRouter, s as isLazy, F as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, z as middlewareOutputFn, $ as resolveContractProcedures, _ as traverseContractProcedures, u as unlazy, a1 as unlazyRouter } from './shared/server.BL2R5jcp.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
|
-
declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context,
|
|
10
|
+
declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> {
|
|
11
11
|
/**
|
|
12
12
|
* Make this procedure callable (works like a function while still being a procedure).
|
|
13
13
|
*
|
|
14
14
|
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
|
15
15
|
*/
|
|
16
|
-
callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext,
|
|
16
|
+
callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): DecoratedProcedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> & ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context,
|
|
19
|
+
declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ContractProcedure<TSchemas, TErrorMap, TMeta> {
|
|
20
20
|
z: SchemaClass<TGateName>;
|
|
21
21
|
/**
|
|
22
22
|
* This property holds the defined options.
|
|
23
23
|
*/
|
|
24
|
-
'~orpc': BuilderDef<
|
|
25
|
-
constructor(def: BuilderDef<
|
|
24
|
+
'~orpc': BuilderDef<TSchemas, TErrorMap, TMeta>;
|
|
25
|
+
constructor(def: BuilderDef<TSchemas, TErrorMap, TMeta>);
|
|
26
26
|
/**
|
|
27
27
|
* Adds type-safe custom errors to the contract.
|
|
28
28
|
* The provided errors are spared-merged with any existing errors in the contract.
|
|
29
29
|
*
|
|
30
30
|
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
31
31
|
*/
|
|
32
|
-
errors<U extends ErrorMap>(errors: U): ProcedureBuilder<TInitialContext, TCurrentContext,
|
|
32
|
+
errors<U extends ErrorMap>(errors: U): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
|
|
33
33
|
/**
|
|
34
34
|
* Sets or updates the metadata for the contract.
|
|
35
35
|
* The provided metadata is spared-merged with any existing metadata in the contract.
|
|
36
36
|
*
|
|
37
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
38
38
|
*/
|
|
39
|
-
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext,
|
|
39
|
+
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
40
|
+
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
41
|
+
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
42
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
43
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
44
|
+
pathSchema: WrapShape<U>;
|
|
45
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
40
46
|
/**
|
|
41
47
|
* Sets or updates the route definition for the contract.
|
|
42
48
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -45,19 +51,21 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
45
51
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
46
52
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
55
|
+
query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
querySchema: WrapShape<U>;
|
|
57
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
58
|
+
body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
59
|
+
bodySchema: WrapShape<U>;
|
|
60
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
55
61
|
/**
|
|
56
62
|
* Defines the output validation schema.
|
|
57
63
|
*
|
|
58
64
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
59
65
|
*/
|
|
60
|
-
output<
|
|
66
|
+
output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
67
|
+
outputSchema: WrapShape<U>;
|
|
68
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
61
69
|
/**
|
|
62
70
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
63
71
|
*
|
|
@@ -65,18 +73,18 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
65
73
|
* @note The current context must be satisfy middleware dependent-context
|
|
66
74
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
67
75
|
*/
|
|
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>,
|
|
76
|
+
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>, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
69
77
|
useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
|
|
70
78
|
isGateEnabled: typeof isGateEnabled;
|
|
71
|
-
}>,
|
|
79
|
+
}>, TSchemas, TErrorMap, TMeta, TInferredGateName>;
|
|
72
80
|
/**
|
|
73
81
|
* Defines the handler of the procedure.
|
|
74
82
|
*
|
|
75
83
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
76
84
|
*/
|
|
77
|
-
handler(handler: ProcedureHandler<TCurrentContext,
|
|
85
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferHandlerInputs<TSchemas>, InferSchemaInput<TSchemas['outputSchema']>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>;
|
|
78
86
|
}
|
|
79
|
-
declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context,
|
|
87
|
+
declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName> {
|
|
80
88
|
/**
|
|
81
89
|
* Prefixes all procedures in the router.
|
|
82
90
|
* The provided prefix is post-appended to any existing router prefix.
|
|
@@ -85,7 +93,7 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
85
93
|
*
|
|
86
94
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
|
|
87
95
|
*/
|
|
88
|
-
prefix(prefix: HTTPPath): BuilderWithMiddlewares<TInitialContext, TCurrentContext,
|
|
96
|
+
prefix(prefix: HTTPPath): BuilderWithMiddlewares<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
89
97
|
/**
|
|
90
98
|
* Adds tags to all procedures in the router.
|
|
91
99
|
* This helpful when you want to group procedures together in the OpenAPI specification.
|
|
@@ -100,7 +108,7 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
100
108
|
*/
|
|
101
109
|
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
102
110
|
}
|
|
103
|
-
interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends Pick<BuilderWithMiddlewares<TInitialContext, TCurrentContext, any,
|
|
111
|
+
interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends Pick<BuilderWithMiddlewares<TInitialContext, TCurrentContext, any, TErrorMap, TMeta, any>, 'prefix' | 'tag' | 'router'> {
|
|
104
112
|
/**
|
|
105
113
|
* This property holds the defined options.
|
|
106
114
|
*/
|
|
@@ -129,18 +137,18 @@ interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Co
|
|
|
129
137
|
}
|
|
130
138
|
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>;
|
|
131
139
|
|
|
132
|
-
interface BuilderDef<
|
|
140
|
+
interface BuilderDef<TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedureDef<TSchemas, TErrorMap, TMeta>, EnhanceRouterOptions<TErrorMap> {
|
|
133
141
|
middlewares: readonly AnyMiddleware[];
|
|
134
142
|
inputValidationIndex: number;
|
|
135
143
|
outputValidationIndex: number;
|
|
136
144
|
}
|
|
137
|
-
declare class Builder<TInitialContext extends Context, TCurrentContext extends Context,
|
|
145
|
+
declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends BuilderWithMiddlewares<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName> {
|
|
138
146
|
/**
|
|
139
147
|
* Set or override the initial context.
|
|
140
148
|
*
|
|
141
149
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
142
150
|
*/
|
|
143
|
-
$context<U extends Context>(): Builder<U, U,
|
|
151
|
+
$context<U extends Context>(): Builder<U, U, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
144
152
|
/**
|
|
145
153
|
* Creates a middleware.
|
|
146
154
|
*
|
|
@@ -149,7 +157,7 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
149
157
|
middleware<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, TInput, TOutput = any>(// = any here is important to make middleware can be used in any output by default
|
|
150
158
|
middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, ORPCErrorConstructorMap<TErrorMap>, TMeta>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, any, TMeta>;
|
|
151
159
|
}
|
|
152
|
-
type ApiBuilder<TMeta extends Meta> = Builder<Record<never, never>, Record<never, never>,
|
|
160
|
+
type ApiBuilder<TMeta extends Meta> = Builder<Record<never, never>, Record<never, never>, InitialSchemas, Record<never, never>, TMeta, never>;
|
|
153
161
|
interface ApiBuilderOpts<TMeta extends Meta> {
|
|
154
162
|
meta?: TMeta;
|
|
155
163
|
}
|
|
@@ -159,7 +167,7 @@ declare const os: ApiBuilder<Record<never, never>>;
|
|
|
159
167
|
/**
|
|
160
168
|
* Like `DecoratedProcedure`, but removed all method that can change the contract.
|
|
161
169
|
*/
|
|
162
|
-
interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext extends Context,
|
|
170
|
+
interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> {
|
|
163
171
|
/**
|
|
164
172
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
165
173
|
*
|
|
@@ -168,7 +176,7 @@ interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext
|
|
|
168
176
|
* @note The current context must be satisfy middleware dependent-context
|
|
169
177
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
170
178
|
*/
|
|
171
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext,
|
|
179
|
+
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferHandlerInputs<TSchemas>, InferSchemaInput<TSchemas['outputSchema']>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ImplementedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TErrorMap, TMeta>;
|
|
172
180
|
/**
|
|
173
181
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
174
182
|
*
|
|
@@ -177,19 +185,19 @@ interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext
|
|
|
177
185
|
* @note The current context must be satisfy middleware dependent-context
|
|
178
186
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
179
187
|
*/
|
|
180
|
-
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<
|
|
188
|
+
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TSchemas['outputSchema']>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferHandlerInputs<TSchemas>, UInput>): ImplementedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TErrorMap, TMeta>;
|
|
181
189
|
/**
|
|
182
190
|
* Make this procedure callable (works like a function while still being a procedure).
|
|
183
191
|
*
|
|
184
192
|
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
|
185
193
|
*/
|
|
186
|
-
callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext,
|
|
194
|
+
callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): ImplementedProcedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> & ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
187
195
|
}
|
|
188
196
|
/**
|
|
189
197
|
* Like `ProcedureBuilderWithoutHandler`, but removed all method that can change the contract.
|
|
190
198
|
*/
|
|
191
|
-
interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext extends Context,
|
|
192
|
-
'~orpc': BuilderDef<
|
|
199
|
+
interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
200
|
+
'~orpc': BuilderDef<TSchemas, TErrorMap, TMeta>;
|
|
193
201
|
/**
|
|
194
202
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
195
203
|
*
|
|
@@ -198,7 +206,7 @@ interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext
|
|
|
198
206
|
* @note The current context must be satisfy middleware dependent-context
|
|
199
207
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
200
208
|
*/
|
|
201
|
-
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext,
|
|
209
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferHandlerInputs<TSchemas>, InferSchemaInput<TSchemas['outputSchema']>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureImplementer<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TErrorMap, TMeta>;
|
|
202
210
|
/**
|
|
203
211
|
* Uses a middleware to modify the context or improve the pipeline.
|
|
204
212
|
*
|
|
@@ -207,13 +215,13 @@ interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext
|
|
|
207
215
|
* @note The current context must be satisfy middleware dependent-context
|
|
208
216
|
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
209
217
|
*/
|
|
210
|
-
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<
|
|
218
|
+
'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TSchemas['outputSchema']>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferHandlerInputs<TSchemas>, UInput>): ProcedureImplementer<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TErrorMap, TMeta>;
|
|
211
219
|
/**
|
|
212
220
|
* Defines the handler of the procedure.
|
|
213
221
|
*
|
|
214
222
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
215
223
|
*/
|
|
216
|
-
'handler'(handler: ProcedureHandler<TCurrentContext,
|
|
224
|
+
'handler'(handler: ProcedureHandler<TCurrentContext, InferHandlerInputs<TSchemas>, InferSchemaInput<TSchemas['outputSchema']>, TErrorMap, TMeta>): ImplementedProcedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta>;
|
|
217
225
|
}
|
|
218
226
|
|
|
219
227
|
interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> {
|
|
@@ -233,7 +241,7 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
233
241
|
*/
|
|
234
242
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
235
243
|
}
|
|
236
|
-
type ImplementerInternalWithMiddlewares<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer
|
|
244
|
+
type ImplementerInternalWithMiddlewares<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer USchemas, infer UErrorMap, infer UMeta> ? ProcedureImplementer<TInitialContext, TCurrentContext, USchemas, UErrorMap, UMeta> : RouterImplementerWithMiddlewares<TContract, TInitialContext, TCurrentContext> & {
|
|
237
245
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
238
246
|
};
|
|
239
247
|
|
|
@@ -271,7 +279,7 @@ interface RouterImplementer<T extends AnyContractRouter, TInitialContext extends
|
|
|
271
279
|
default: U;
|
|
272
280
|
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
273
281
|
}
|
|
274
|
-
type ImplementerInternal<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer
|
|
282
|
+
type ImplementerInternal<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer USchemas, infer UErrorMap, infer UMeta> ? ProcedureImplementer<TInitialContext, TCurrentContext, USchemas, UErrorMap, UMeta> : RouterImplementer<TContract, TInitialContext, TCurrentContext> & {
|
|
275
283
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternal<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
276
284
|
};
|
|
277
285
|
declare function implementerInternal<T extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context>(contract: T, middlewares: AnyMiddleware[]): ImplementerInternal<T, TInitialContext, TCurrentContext>;
|
|
@@ -306,9 +314,9 @@ declare function createContractedProcedure(procedure: AnyProcedure, contract: An
|
|
|
306
314
|
* ```
|
|
307
315
|
*
|
|
308
316
|
*/
|
|
309
|
-
declare function call<TInitialContext extends Context,
|
|
317
|
+
declare function call<TInitialContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TErrorMap, TMeta>>, input: InferProcedureClientInputs<TSchemas>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, Record<never, never>> & Omit<ClientOptions<Record<never, never>>, 'context'>>): ClientPromiseResult<InferSchemaOutput<TSchemas['outputSchema']>, ErrorFromErrorMap<TErrorMap>>;
|
|
310
318
|
|
|
311
|
-
type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = Record<never, never>> = TRouter extends Procedure<any, any, infer
|
|
319
|
+
type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = Record<never, never>> = TRouter extends Procedure<any, any, infer USchemas, infer UErrorMap, any> ? ProcedureClient<TClientContext, USchemas, UErrorMap> : {
|
|
312
320
|
[K in keyof TRouter]: TRouter[K] extends Lazyable<infer U extends AnyRouter> ? RouterClient<U, TClientContext> : never;
|
|
313
321
|
};
|
|
314
322
|
/**
|