@temporary-name/server 1.9.3-alpha.5537ef74244620c125352bc9356d8c0ae804f10d → 1.9.3-alpha.62445d8d52a6787e7750865cd468fca8cccd3e28
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 +14 -30
- package/dist/adapters/standard/index.d.ts +14 -30
- package/dist/adapters/standard/index.mjs +3 -3
- package/dist/index.d.mts +9 -69
- package/dist/index.d.ts +9 -69
- package/dist/index.mjs +40 -94
- 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.Cp__uvkw.d.mts → server.B93y_8tj.d.mts} +2 -2
- package/dist/shared/{server.Bzrdopnd.d.ts → server.C3RuMHWl.d.mts} +29 -29
- package/dist/shared/{server.Bzrdopnd.d.mts → server.C3RuMHWl.d.ts} +29 -29
- package/dist/shared/{server.B9i6p26R.d.ts → server.CT1xhSmE.d.mts} +1 -2
- package/dist/shared/{server.B9VxPdeK.mjs → server.CqTex_jI.mjs} +57 -85
- package/dist/shared/{server.CYRDznXq.d.ts → server.D_fags8X.d.ts} +2 -2
- package/dist/shared/{server.BEHw7Eyx.mjs → server.Kxw442A9.mjs} +1 -1
- package/dist/shared/{server.C-j2WKJz.d.mts → server.cjcgLdr1.d.ts} +1 -2
- package/package.json +10 -10
- package/dist/shared/{server.DcfsPloY.mjs → server.BYYf0Wn6.mjs} +19 -19
|
@@ -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, 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.C3RuMHWl.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.CT1xhSmE.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B93y_8tj.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
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, 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.C3RuMHWl.js';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.cjcgLdr1.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D_fags8X.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
@@ -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.CqTex_jI.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.BYYf0Wn6.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.Kxw442A9.mjs';
|
|
11
11
|
|
|
12
12
|
class AwsLambdaHandler {
|
|
13
13
|
sendStandardResponseOptions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.C3RuMHWl.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.CT1xhSmE.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B93y_8tj.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.C3RuMHWl.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.cjcgLdr1.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D_fags8X.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
@@ -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.CqTex_jI.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.BYYf0Wn6.mjs';
|
|
10
|
+
import '../../shared/server.Kxw442A9.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
13
13
|
maxBodySize;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.C3RuMHWl.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.CT1xhSmE.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B93y_8tj.mjs';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
8
|
import '@temporary-name/standard-server';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.C3RuMHWl.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.cjcgLdr1.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D_fags8X.js';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
8
|
import '@temporary-name/standard-server';
|
|
@@ -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.CqTex_jI.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.BYYf0Wn6.mjs';
|
|
11
|
+
import '../../shared/server.Kxw442A9.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
14
14
|
maxBodySize;
|
|
@@ -1,42 +1,26 @@
|
|
|
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.CT1xhSmE.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { StandardCodec as StandardCodec$1, StandardParams as StandardParams$1, StandardMatcher as StandardMatcher$1, StandardMatchResult as StandardMatchResult$1 } from '@temporary-name/server/standard';
|
|
4
3
|
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
5
4
|
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
6
|
-
|
|
7
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.Cp__uvkw.mjs';
|
|
5
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.B93y_8tj.mjs';
|
|
8
6
|
import '@temporary-name/contract';
|
|
7
|
+
import '../../shared/server.C3RuMHWl.mjs';
|
|
9
8
|
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
decode(request: StandardLazyRequest, params: StandardParams$1 | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
14
|
-
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
15
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare class StandardOpenAPIMatcher implements StandardMatcher$1 {
|
|
19
|
-
private readonly tree;
|
|
20
|
-
private pendingRouters;
|
|
21
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
-
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult$1>;
|
|
23
|
-
}
|
|
9
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<unknown>;
|
|
10
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
24
12
|
|
|
25
|
-
type StandardParams = Record<string, string>;
|
|
26
13
|
type StandardMatchResult = {
|
|
27
14
|
path: readonly string[];
|
|
28
|
-
procedure: AnyProcedure
|
|
29
|
-
params?:
|
|
15
|
+
procedure: AnyProcedure;
|
|
16
|
+
params?: Record<string, string>;
|
|
30
17
|
} | undefined;
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
declare class StandardOpenAPIMatcher {
|
|
19
|
+
private readonly tree;
|
|
20
|
+
private pendingRouters;
|
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
33
22
|
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
34
23
|
}
|
|
35
|
-
interface StandardCodec {
|
|
36
|
-
encode(output: unknown, procedure: AnyProcedure$1): StandardResponse;
|
|
37
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
38
|
-
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure$1): Promise<unknown>;
|
|
39
|
-
}
|
|
40
24
|
|
|
41
|
-
export {
|
|
42
|
-
export type {
|
|
25
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
26
|
+
export type { StandardMatchResult };
|
|
@@ -1,42 +1,26 @@
|
|
|
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.cjcgLdr1.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { StandardCodec as StandardCodec$1, StandardParams as StandardParams$1, StandardMatcher as StandardMatcher$1, StandardMatchResult as StandardMatchResult$1 } from '@temporary-name/server/standard';
|
|
4
3
|
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
5
4
|
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
6
|
-
|
|
7
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.CYRDznXq.js';
|
|
5
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.D_fags8X.js';
|
|
8
6
|
import '@temporary-name/contract';
|
|
7
|
+
import '../../shared/server.C3RuMHWl.js';
|
|
9
8
|
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
decode(request: StandardLazyRequest, params: StandardParams$1 | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
14
|
-
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
15
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare class StandardOpenAPIMatcher implements StandardMatcher$1 {
|
|
19
|
-
private readonly tree;
|
|
20
|
-
private pendingRouters;
|
|
21
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
-
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult$1>;
|
|
23
|
-
}
|
|
9
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<unknown>;
|
|
10
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
24
12
|
|
|
25
|
-
type StandardParams = Record<string, string>;
|
|
26
13
|
type StandardMatchResult = {
|
|
27
14
|
path: readonly string[];
|
|
28
|
-
procedure: AnyProcedure
|
|
29
|
-
params?:
|
|
15
|
+
procedure: AnyProcedure;
|
|
16
|
+
params?: Record<string, string>;
|
|
30
17
|
} | undefined;
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
declare class StandardOpenAPIMatcher {
|
|
19
|
+
private readonly tree;
|
|
20
|
+
private pendingRouters;
|
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
33
22
|
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
34
23
|
}
|
|
35
|
-
interface StandardCodec {
|
|
36
|
-
encode(output: unknown, procedure: AnyProcedure$1): StandardResponse;
|
|
37
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
38
|
-
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure$1): Promise<unknown>;
|
|
39
|
-
}
|
|
40
24
|
|
|
41
|
-
export {
|
|
42
|
-
export type {
|
|
25
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
26
|
+
export type { StandardMatchResult };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler,
|
|
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.CqTex_jI.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
3
|
import '@temporary-name/standard-server';
|
|
4
|
-
import '../../shared/server.
|
|
4
|
+
import '../../shared/server.BYYf0Wn6.mjs';
|
|
5
5
|
import '@temporary-name/contract';
|
|
6
6
|
import '@temporary-name/zod';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.Kxw442A9.mjs';
|
|
8
8
|
import '@temporary-name/server';
|
|
9
9
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
import { AnySchema, ErrorMap, Meta,
|
|
2
|
-
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput,
|
|
3
|
-
import {
|
|
1
|
+
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput, InferSchemaInput, ContractRouter, ContractProcedureDef, Schema, InferContractRouterErrorMap, InferContractRouterMeta, 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
5
|
import { SchemaClass } from '@temporary-name/zod';
|
|
6
|
-
import { C as Context, P as Procedure,
|
|
7
|
-
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, n as LAZY_SYMBOL, o as LazyMeta, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, k as ORPCErrorConstructorMapItem, j as ORPCErrorConstructorMapItemOptions, E as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, l as createORPCErrorConstructorMap, F as createProcedureClient, r as getLazyMeta, q as isLazy, D as isProcedure, p as lazy, m as mergeCurrentContext, y as middlewareOutputFn, u as unlazy } from './shared/server.
|
|
6
|
+
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, A as AnyMiddleware, L as Lazyable, c as AnyRouter, d as Lazy, e as AnyProcedure, M as MergedInitialContext, f as Middleware, O as ORPCErrorConstructorMap, g as MergedCurrentContext, h as ProcedureHandler, R as Router, i as MapInputMiddleware, I as InferRouterInitialContext } from './shared/server.C3RuMHWl.mjs';
|
|
7
|
+
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, n as LAZY_SYMBOL, o as LazyMeta, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, k as ORPCErrorConstructorMapItem, j as ORPCErrorConstructorMapItemOptions, E as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, l as createORPCErrorConstructorMap, F as createProcedureClient, r as getLazyMeta, q as isLazy, D as isProcedure, p as lazy, m as mergeCurrentContext, y as middlewareOutputFn, u as unlazy } from './shared/server.C3RuMHWl.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
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> {
|
|
11
|
-
/**
|
|
12
|
-
* Adds type-safe custom errors.
|
|
13
|
-
* The provided errors are spared-merged with any existing errors.
|
|
14
|
-
*
|
|
15
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
16
|
-
*/
|
|
17
|
-
errors<U extends ErrorMap>(errors: U): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
18
|
-
/**
|
|
19
|
-
* Sets or updates the metadata.
|
|
20
|
-
* The provided metadata is spared-merged with any existing metadata.
|
|
21
|
-
*
|
|
22
|
-
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
23
|
-
*/
|
|
24
|
-
meta(meta: TMeta): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
25
|
-
/**
|
|
26
|
-
* Sets or updates the route definition.
|
|
27
|
-
* The provided route is spared-merged with any existing route.
|
|
28
|
-
* This option is typically relevant when integrating with OpenAPI.
|
|
29
|
-
*
|
|
30
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
31
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
32
|
-
*/
|
|
33
|
-
route(route: Route): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
34
|
-
/**
|
|
35
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
36
|
-
*
|
|
37
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
38
|
-
* @info Pass second argument to map the input.
|
|
39
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
40
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
41
|
-
*/
|
|
42
|
-
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>;
|
|
43
|
-
/**
|
|
44
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
45
|
-
*
|
|
46
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
47
|
-
* @info Pass second argument to map the input.
|
|
48
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
49
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
50
|
-
*/
|
|
51
|
-
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>;
|
|
52
11
|
/**
|
|
53
12
|
* Make this procedure callable (works like a function while still being a procedure).
|
|
54
13
|
*
|
|
@@ -152,7 +111,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
152
111
|
*
|
|
153
112
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
154
113
|
*/
|
|
155
|
-
handler
|
|
114
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
156
115
|
}
|
|
157
116
|
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> {
|
|
158
117
|
/**
|
|
@@ -177,17 +136,8 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
177
136
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
178
137
|
*/
|
|
179
138
|
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
180
|
-
/**
|
|
181
|
-
* Create a lazy router
|
|
182
|
-
* And applies all of the previously defined options to the specified router.
|
|
183
|
-
*
|
|
184
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
185
|
-
*/
|
|
186
|
-
lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
187
|
-
default: U;
|
|
188
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
189
139
|
}
|
|
190
|
-
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'
|
|
140
|
+
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'> {
|
|
191
141
|
/**
|
|
192
142
|
* This property holds the defined options.
|
|
193
143
|
*/
|
|
@@ -227,7 +177,7 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
227
177
|
*
|
|
228
178
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
229
179
|
*/
|
|
230
|
-
$context<U extends Context>(): Builder<U
|
|
180
|
+
$context<U extends Context>(): Builder<U, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
231
181
|
/**
|
|
232
182
|
* Creates a middleware.
|
|
233
183
|
*
|
|
@@ -319,16 +269,6 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
319
269
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
320
270
|
*/
|
|
321
271
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
322
|
-
/**
|
|
323
|
-
* Create a lazy router
|
|
324
|
-
* And applies all of the previously defined options to the specified router.
|
|
325
|
-
* And enforces the router match the contract.
|
|
326
|
-
*
|
|
327
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
328
|
-
*/
|
|
329
|
-
lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
|
|
330
|
-
default: U;
|
|
331
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
332
272
|
}
|
|
333
273
|
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> & {
|
|
334
274
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
@@ -378,7 +318,7 @@ type Implementer<TContract extends AnyContractRouter, TInitialContext extends Co
|
|
|
378
318
|
*
|
|
379
319
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
380
320
|
*/
|
|
381
|
-
$context<U extends Context>(): Implementer<TContract, U
|
|
321
|
+
$context<U extends Context>(): Implementer<TContract, U, U>;
|
|
382
322
|
} & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
|
|
383
323
|
declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
|
|
384
324
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
import { AnySchema, ErrorMap, Meta,
|
|
2
|
-
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput,
|
|
3
|
-
import {
|
|
1
|
+
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput, InferSchemaInput, ContractRouter, ContractProcedureDef, Schema, InferContractRouterErrorMap, InferContractRouterMeta, 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
5
|
import { SchemaClass } from '@temporary-name/zod';
|
|
6
|
-
import { C as Context, P as Procedure,
|
|
7
|
-
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, n as LAZY_SYMBOL, o as LazyMeta, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, k as ORPCErrorConstructorMapItem, j as ORPCErrorConstructorMapItemOptions, E as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, l as createORPCErrorConstructorMap, F as createProcedureClient, r as getLazyMeta, q as isLazy, D as isProcedure, p as lazy, m as mergeCurrentContext, y as middlewareOutputFn, u as unlazy } from './shared/server.
|
|
6
|
+
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, A as AnyMiddleware, L as Lazyable, c as AnyRouter, d as Lazy, e as AnyProcedure, M as MergedInitialContext, f as Middleware, O as ORPCErrorConstructorMap, g as MergedCurrentContext, h as ProcedureHandler, R as Router, i as MapInputMiddleware, I as InferRouterInitialContext } from './shared/server.C3RuMHWl.js';
|
|
7
|
+
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, n as LAZY_SYMBOL, o as LazyMeta, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, k as ORPCErrorConstructorMapItem, j as ORPCErrorConstructorMapItemOptions, E as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, l as createORPCErrorConstructorMap, F as createProcedureClient, r as getLazyMeta, q as isLazy, D as isProcedure, p as lazy, m as mergeCurrentContext, y as middlewareOutputFn, u as unlazy } from './shared/server.C3RuMHWl.js';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
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> {
|
|
11
|
-
/**
|
|
12
|
-
* Adds type-safe custom errors.
|
|
13
|
-
* The provided errors are spared-merged with any existing errors.
|
|
14
|
-
*
|
|
15
|
-
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
16
|
-
*/
|
|
17
|
-
errors<U extends ErrorMap>(errors: U): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
18
|
-
/**
|
|
19
|
-
* Sets or updates the metadata.
|
|
20
|
-
* The provided metadata is spared-merged with any existing metadata.
|
|
21
|
-
*
|
|
22
|
-
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
23
|
-
*/
|
|
24
|
-
meta(meta: TMeta): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
25
|
-
/**
|
|
26
|
-
* Sets or updates the route definition.
|
|
27
|
-
* The provided route is spared-merged with any existing route.
|
|
28
|
-
* This option is typically relevant when integrating with OpenAPI.
|
|
29
|
-
*
|
|
30
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
31
|
-
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
32
|
-
*/
|
|
33
|
-
route(route: Route): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
34
|
-
/**
|
|
35
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
36
|
-
*
|
|
37
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
38
|
-
* @info Pass second argument to map the input.
|
|
39
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
40
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
41
|
-
*/
|
|
42
|
-
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>;
|
|
43
|
-
/**
|
|
44
|
-
* Uses a middleware to modify the context or improve the pipeline.
|
|
45
|
-
*
|
|
46
|
-
* @info Supports both normal middleware and inline middleware implementations.
|
|
47
|
-
* @info Pass second argument to map the input.
|
|
48
|
-
* @note The current context must be satisfy middleware dependent-context
|
|
49
|
-
* @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
|
|
50
|
-
*/
|
|
51
|
-
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>;
|
|
52
11
|
/**
|
|
53
12
|
* Make this procedure callable (works like a function while still being a procedure).
|
|
54
13
|
*
|
|
@@ -152,7 +111,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
152
111
|
*
|
|
153
112
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
154
113
|
*/
|
|
155
|
-
handler
|
|
114
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
156
115
|
}
|
|
157
116
|
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> {
|
|
158
117
|
/**
|
|
@@ -177,17 +136,8 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
177
136
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
178
137
|
*/
|
|
179
138
|
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
180
|
-
/**
|
|
181
|
-
* Create a lazy router
|
|
182
|
-
* And applies all of the previously defined options to the specified router.
|
|
183
|
-
*
|
|
184
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
185
|
-
*/
|
|
186
|
-
lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
187
|
-
default: U;
|
|
188
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
189
139
|
}
|
|
190
|
-
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'
|
|
140
|
+
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'> {
|
|
191
141
|
/**
|
|
192
142
|
* This property holds the defined options.
|
|
193
143
|
*/
|
|
@@ -227,7 +177,7 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
227
177
|
*
|
|
228
178
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
229
179
|
*/
|
|
230
|
-
$context<U extends Context>(): Builder<U
|
|
180
|
+
$context<U extends Context>(): Builder<U, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
231
181
|
/**
|
|
232
182
|
* Creates a middleware.
|
|
233
183
|
*
|
|
@@ -319,16 +269,6 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
319
269
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
320
270
|
*/
|
|
321
271
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
322
|
-
/**
|
|
323
|
-
* Create a lazy router
|
|
324
|
-
* And applies all of the previously defined options to the specified router.
|
|
325
|
-
* And enforces the router match the contract.
|
|
326
|
-
*
|
|
327
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
328
|
-
*/
|
|
329
|
-
lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
|
|
330
|
-
default: U;
|
|
331
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
332
272
|
}
|
|
333
273
|
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> & {
|
|
334
274
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
@@ -378,7 +318,7 @@ type Implementer<TContract extends AnyContractRouter, TInitialContext extends Co
|
|
|
378
318
|
*
|
|
379
319
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
380
320
|
*/
|
|
381
|
-
$context<U extends Context>(): Implementer<TContract, U
|
|
321
|
+
$context<U extends Context>(): Implementer<TContract, U, U>;
|
|
382
322
|
} & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
|
|
383
323
|
declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
|
|
384
324
|
|