@temporary-name/server 1.9.3-alpha.d751d322a9d105467b863db2bab6037dd277fd56 → 1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0
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 +2 -2
- package/dist/adapters/fetch/index.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/node/index.d.mts +3 -3
- package/dist/adapters/node/index.d.ts +3 -3
- package/dist/adapters/node/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +14 -30
- package/dist/adapters/standard/index.d.ts +14 -30
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/index.d.mts +7 -26
- package/dist/index.d.ts +7 -26
- package/dist/index.mjs +2 -12
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{server.ChraIVaQ.d.mts → server.B93y_8tj.d.mts} +2 -2
- package/dist/shared/{server.B9VxPdeK.mjs → server.BeBVpcA9.mjs} +76 -82
- package/dist/shared/{server.CZNLCQBm.d.ts → server.C3RuMHWl.d.mts} +28 -28
- package/dist/shared/{server.CZNLCQBm.d.mts → server.C3RuMHWl.d.ts} +28 -28
- package/dist/shared/{server.B15EEOr0.d.ts → server.CT1xhSmE.d.mts} +1 -2
- package/dist/shared/{server.8gkXYsTZ.d.ts → server.D_fags8X.d.ts} +2 -2
- package/dist/shared/{server.YXplw8TW.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,11 +1,11 @@
|
|
|
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.BeBVpcA9.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
10
|
import '../../shared/server.BEHw7Eyx.mjs';
|
|
11
11
|
|
|
@@ -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,12 +1,12 @@
|
|
|
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.BeBVpcA9.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.
|
|
9
|
+
import '../../shared/server.BYYf0Wn6.mjs';
|
|
10
10
|
import '../../shared/server.BEHw7Eyx.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
@@ -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,13 +1,13 @@
|
|
|
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.BeBVpcA9.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.
|
|
10
|
+
import '../../shared/server.BYYf0Wn6.mjs';
|
|
11
11
|
import '../../shared/server.BEHw7Eyx.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
@@ -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.ChraIVaQ.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, params: Record<string, string> | undefined, procedure: AnyProcedure): 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.8gkXYsTZ.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, params: Record<string, string> | undefined, procedure: AnyProcedure): 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,7 +1,7 @@
|
|
|
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.BeBVpcA9.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
7
|
import '../../shared/server.BEHw7Eyx.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput,
|
|
1
|
+
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput, InferSchemaInput, ContractRouter, ContractProcedureDef, Schema, InferContractRouterErrorMap, InferContractRouterMeta, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
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, 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.
|
|
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> {
|
|
@@ -111,7 +111,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
111
111
|
*
|
|
112
112
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
113
113
|
*/
|
|
114
|
-
handler
|
|
114
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
115
115
|
}
|
|
116
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> {
|
|
117
117
|
/**
|
|
@@ -136,17 +136,8 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
136
136
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
137
137
|
*/
|
|
138
138
|
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
139
|
-
/**
|
|
140
|
-
* Create a lazy router
|
|
141
|
-
* And applies all of the previously defined options to the specified router.
|
|
142
|
-
*
|
|
143
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
144
|
-
*/
|
|
145
|
-
lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
146
|
-
default: U;
|
|
147
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
148
139
|
}
|
|
149
|
-
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'> {
|
|
150
141
|
/**
|
|
151
142
|
* This property holds the defined options.
|
|
152
143
|
*/
|
|
@@ -186,7 +177,7 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
186
177
|
*
|
|
187
178
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
188
179
|
*/
|
|
189
|
-
$context<U extends Context>(): Builder<U
|
|
180
|
+
$context<U extends Context>(): Builder<U, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
190
181
|
/**
|
|
191
182
|
* Creates a middleware.
|
|
192
183
|
*
|
|
@@ -278,16 +269,6 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
278
269
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
279
270
|
*/
|
|
280
271
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
281
|
-
/**
|
|
282
|
-
* Create a lazy router
|
|
283
|
-
* And applies all of the previously defined options to the specified router.
|
|
284
|
-
* And enforces the router match the contract.
|
|
285
|
-
*
|
|
286
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
287
|
-
*/
|
|
288
|
-
lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
|
|
289
|
-
default: U;
|
|
290
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
291
272
|
}
|
|
292
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> & {
|
|
293
274
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
@@ -337,7 +318,7 @@ type Implementer<TContract extends AnyContractRouter, TInitialContext extends Co
|
|
|
337
318
|
*
|
|
338
319
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
339
320
|
*/
|
|
340
|
-
$context<U extends Context>(): Implementer<TContract, U
|
|
321
|
+
$context<U extends Context>(): Implementer<TContract, U, U>;
|
|
341
322
|
} & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
|
|
342
323
|
declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
|
|
343
324
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput,
|
|
1
|
+
import { AnySchema, ErrorMap, Meta, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure, ContractProcedure, Route, InferSchemaOutput, InferSchemaInput, ContractRouter, ContractProcedureDef, Schema, InferContractRouterErrorMap, InferContractRouterMeta, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
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, 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.
|
|
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> {
|
|
@@ -111,7 +111,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
111
111
|
*
|
|
112
112
|
* @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
|
|
113
113
|
*/
|
|
114
|
-
handler
|
|
114
|
+
handler(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
115
115
|
}
|
|
116
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> {
|
|
117
117
|
/**
|
|
@@ -136,17 +136,8 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
|
|
|
136
136
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
137
137
|
*/
|
|
138
138
|
router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
|
|
139
|
-
/**
|
|
140
|
-
* Create a lazy router
|
|
141
|
-
* And applies all of the previously defined options to the specified router.
|
|
142
|
-
*
|
|
143
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
144
|
-
*/
|
|
145
|
-
lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
|
|
146
|
-
default: U;
|
|
147
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
|
|
148
139
|
}
|
|
149
|
-
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'> {
|
|
150
141
|
/**
|
|
151
142
|
* This property holds the defined options.
|
|
152
143
|
*/
|
|
@@ -186,7 +177,7 @@ declare class Builder<TInitialContext extends Context, TCurrentContext extends C
|
|
|
186
177
|
*
|
|
187
178
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
188
179
|
*/
|
|
189
|
-
$context<U extends Context>(): Builder<U
|
|
180
|
+
$context<U extends Context>(): Builder<U, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
|
|
190
181
|
/**
|
|
191
182
|
* Creates a middleware.
|
|
192
183
|
*
|
|
@@ -278,16 +269,6 @@ interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitial
|
|
|
278
269
|
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
279
270
|
*/
|
|
280
271
|
router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
281
|
-
/**
|
|
282
|
-
* Create a lazy router
|
|
283
|
-
* And applies all of the previously defined options to the specified router.
|
|
284
|
-
* And enforces the router match the contract.
|
|
285
|
-
*
|
|
286
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
287
|
-
*/
|
|
288
|
-
lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
|
|
289
|
-
default: U;
|
|
290
|
-
}>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
|
|
291
272
|
}
|
|
292
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> & {
|
|
293
274
|
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
|
|
@@ -337,7 +318,7 @@ type Implementer<TContract extends AnyContractRouter, TInitialContext extends Co
|
|
|
337
318
|
*
|
|
338
319
|
* @see {@link https://orpc.unnoq.com/docs/context Context Docs}
|
|
339
320
|
*/
|
|
340
|
-
$context<U extends Context>(): Implementer<TContract, U
|
|
321
|
+
$context<U extends Context>(): Implementer<TContract, U, U>;
|
|
341
322
|
} & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
|
|
342
323
|
declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
|
|
343
324
|
|
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ export { AsyncIteratorClass, EventPublisher, ORPCError, asyncIteratorToStream as
|
|
|
3
3
|
import { isContractProcedure, mergePrefix, mergeErrorMap, enhanceRoute, mergeTags, ContractProcedure, mergeMeta, mergeRoute, prefixRoute, getContractRouter } from '@temporary-name/contract';
|
|
4
4
|
export { ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
5
5
|
import { SchemaClass, gatingContext } from '@temporary-name/zod';
|
|
6
|
-
import { c as createProcedureClient, i as isLazy, g as getLazyMeta, l as lazy, u as unlazy } from './shared/server.
|
|
7
|
-
export { L as LAZY_SYMBOL, a as createORPCErrorConstructorMap, m as mergeCurrentContext, b as middlewareOutputFn } from './shared/server.
|
|
6
|
+
import { c as createProcedureClient, i as isLazy, g as getLazyMeta, l as lazy, u as unlazy } from './shared/server.BYYf0Wn6.mjs';
|
|
7
|
+
export { L as LAZY_SYMBOL, a as createORPCErrorConstructorMap, m as mergeCurrentContext, b as middlewareOutputFn } from './shared/server.BYYf0Wn6.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
10
|
function isStartWithMiddlewares(middlewares, compare) {
|
|
@@ -349,16 +349,6 @@ class BuilderWithMiddlewares extends ProcedureBuilder {
|
|
|
349
349
|
router(router) {
|
|
350
350
|
return enhanceRouter(router, this["~orpc"]);
|
|
351
351
|
}
|
|
352
|
-
/**
|
|
353
|
-
* Create a lazy router
|
|
354
|
-
* And applies all of the previously defined options to the specified router.
|
|
355
|
-
*
|
|
356
|
-
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
|
|
357
|
-
*/
|
|
358
|
-
lazyRoute(loader) {
|
|
359
|
-
const lazied = lazy(loader);
|
|
360
|
-
return enhanceRouter(lazied, this["~orpc"]);
|
|
361
|
-
}
|
|
362
352
|
}
|
|
363
353
|
|
|
364
354
|
function decorateMiddleware(middleware) {
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Value, Promisable, ORPCError } from '@temporary-name/shared';
|
|
2
2
|
import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
|
|
3
3
|
import { BatchResponseBodyItem } from '@temporary-name/standard-server/batch';
|
|
4
|
-
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.
|
|
5
|
-
import { C as Context, E as ProcedureClientInterceptorOptions } from '../shared/server.
|
|
4
|
+
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.CT1xhSmE.mjs';
|
|
5
|
+
import { C as Context, E as ProcedureClientInterceptorOptions } from '../shared/server.C3RuMHWl.mjs';
|
|
6
6
|
import { Meta } from '@temporary-name/contract';
|
|
7
7
|
|
|
8
8
|
interface BatchHandlerOptions<T extends Context> {
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Value, Promisable, ORPCError } from '@temporary-name/shared';
|
|
2
2
|
import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
|
|
3
3
|
import { BatchResponseBodyItem } from '@temporary-name/standard-server/batch';
|
|
4
|
-
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.
|
|
5
|
-
import { C as Context, E as ProcedureClientInterceptorOptions } from '../shared/server.
|
|
4
|
+
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.cjcgLdr1.js';
|
|
5
|
+
import { C as Context, E as ProcedureClientInterceptorOptions } from '../shared/server.C3RuMHWl.js';
|
|
6
6
|
import { Meta } from '@temporary-name/contract';
|
|
7
7
|
|
|
8
8
|
interface BatchHandlerOptions<T extends Context> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTTPPath } from '@temporary-name/shared';
|
|
2
|
-
import { C as Context } from './server.
|
|
3
|
-
import { c as StandardHandleOptions } from './server.
|
|
2
|
+
import { C as Context } from './server.C3RuMHWl.mjs';
|
|
3
|
+
import { c as StandardHandleOptions } from './server.CT1xhSmE.mjs';
|
|
4
4
|
|
|
5
5
|
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
|
6
6
|
context?: T;
|
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
import { isObject, stringifyJSON, isORPCErrorStatus, tryDecodeURIComponent, value, toHttpPath, toArray, intercept, runWithSpan, ORPC_NAME, isAsyncIteratorObject, asyncIteratorWithSpan, setSpanError, ORPCError, toORPCError } from '@temporary-name/shared';
|
|
2
2
|
import { flattenHeader } from '@temporary-name/standard-server';
|
|
3
|
-
import { c as createProcedureClient } from './server.
|
|
3
|
+
import { c as createProcedureClient } from './server.BYYf0Wn6.mjs';
|
|
4
4
|
import { fallbackContractConfig } from '@temporary-name/contract';
|
|
5
5
|
import { d as deserialize, s as serialize, a as standardizeHTTPPath } from './server.BEHw7Eyx.mjs';
|
|
6
6
|
import { traverseContractProcedures, isProcedure, getLazyMeta, unlazy, getRouter, createContractedProcedure } from '@temporary-name/server';
|
|
7
7
|
import { createRouter, addRoute, findRoute } from 'rou3';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
const data = request.method === "GET" ? deserialize(request.url.searchParams) : deserialize(await request.body());
|
|
19
|
-
if (data === void 0) {
|
|
20
|
-
return params;
|
|
21
|
-
}
|
|
22
|
-
if (isObject(data)) {
|
|
23
|
-
return {
|
|
24
|
-
...params,
|
|
25
|
-
...data
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
return data;
|
|
9
|
+
async function decode(request, params, procedure) {
|
|
10
|
+
const inputStructure = fallbackContractConfig(
|
|
11
|
+
"defaultInputStructure",
|
|
12
|
+
procedure["~orpc"].route.inputStructure
|
|
13
|
+
);
|
|
14
|
+
if (inputStructure === "compact") {
|
|
15
|
+
const data = request.method === "GET" ? deserialize(request.url.searchParams) : deserialize(await request.body());
|
|
16
|
+
if (data === void 0) {
|
|
17
|
+
return params;
|
|
29
18
|
}
|
|
30
|
-
|
|
31
|
-
return deserialize(request.url.searchParams);
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
params,
|
|
35
|
-
get query() {
|
|
36
|
-
const value = deserializeSearchParams();
|
|
37
|
-
Object.defineProperty(this, "query", { value, writable: true });
|
|
38
|
-
return value;
|
|
39
|
-
},
|
|
40
|
-
set query(value) {
|
|
41
|
-
Object.defineProperty(this, "query", { value, writable: true });
|
|
42
|
-
},
|
|
43
|
-
headers: request.headers,
|
|
44
|
-
body: deserialize(await request.body())
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
encode(output, procedure) {
|
|
48
|
-
const successStatus = fallbackContractConfig(
|
|
49
|
-
"defaultSuccessStatus",
|
|
50
|
-
procedure["~orpc"].route.successStatus
|
|
51
|
-
);
|
|
52
|
-
const outputStructure = fallbackContractConfig(
|
|
53
|
-
"defaultOutputStructure",
|
|
54
|
-
procedure["~orpc"].route.outputStructure
|
|
55
|
-
);
|
|
56
|
-
if (outputStructure === "compact") {
|
|
19
|
+
if (isObject(data)) {
|
|
57
20
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
body: serialize(output)
|
|
21
|
+
...params,
|
|
22
|
+
...data
|
|
61
23
|
};
|
|
62
24
|
}
|
|
63
|
-
|
|
64
|
-
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
const deserializeSearchParams = () => {
|
|
28
|
+
return deserialize(request.url.searchParams);
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
params,
|
|
32
|
+
get query() {
|
|
33
|
+
const value = deserializeSearchParams();
|
|
34
|
+
Object.defineProperty(this, "query", { value, writable: true });
|
|
35
|
+
return value;
|
|
36
|
+
},
|
|
37
|
+
set query(value) {
|
|
38
|
+
Object.defineProperty(this, "query", { value, writable: true });
|
|
39
|
+
},
|
|
40
|
+
headers: request.headers,
|
|
41
|
+
body: deserialize(await request.body())
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function encode(output, procedure) {
|
|
45
|
+
const successStatus = fallbackContractConfig(
|
|
46
|
+
"defaultSuccessStatus",
|
|
47
|
+
procedure["~orpc"].route.successStatus
|
|
48
|
+
);
|
|
49
|
+
const outputStructure = fallbackContractConfig(
|
|
50
|
+
"defaultOutputStructure",
|
|
51
|
+
procedure["~orpc"].route.outputStructure
|
|
52
|
+
);
|
|
53
|
+
if (outputStructure === "compact") {
|
|
54
|
+
return {
|
|
55
|
+
status: successStatus,
|
|
56
|
+
headers: {},
|
|
57
|
+
body: serialize(output)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (!isDetailedOutput(output)) {
|
|
61
|
+
throw new Error(`
|
|
65
62
|
Invalid "detailed" output structure:
|
|
66
63
|
\u2022 Expected an object with optional properties:
|
|
67
64
|
- status (number 200-399)
|
|
@@ -72,32 +69,31 @@ class StandardOpenAPICodec {
|
|
|
72
69
|
Actual value:
|
|
73
70
|
${stringifyJSON(output)}
|
|
74
71
|
`);
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
status: output.status ?? successStatus,
|
|
78
|
-
headers: output.headers ?? {},
|
|
79
|
-
body: serialize(output.body)
|
|
80
|
-
};
|
|
81
72
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
return {
|
|
74
|
+
status: output.status ?? successStatus,
|
|
75
|
+
headers: output.headers ?? {},
|
|
76
|
+
body: serialize(output.body)
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function encodeError(error) {
|
|
80
|
+
return {
|
|
81
|
+
status: error.status,
|
|
82
|
+
headers: {},
|
|
83
|
+
body: serialize(error.toJSON(), { outputFormat: "plain" })
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function isDetailedOutput(output) {
|
|
87
|
+
if (!isObject(output)) {
|
|
88
|
+
return false;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) || isORPCErrorStatus(output.status))) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
90
|
+
if (output.headers && !isObject(output.headers)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (output.status !== void 0 && (typeof output.status !== "number" || !Number.isInteger(output.status) || isORPCErrorStatus(output.status))) {
|
|
94
|
+
return false;
|
|
100
95
|
}
|
|
96
|
+
return true;
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
function resolveFriendlyStandardHandleOptions(options) {
|
|
@@ -204,10 +200,8 @@ class StandardHandler {
|
|
|
204
200
|
clientInterceptors;
|
|
205
201
|
rootInterceptors;
|
|
206
202
|
matcher;
|
|
207
|
-
codec;
|
|
208
203
|
constructor(router, options) {
|
|
209
204
|
this.matcher = new StandardOpenAPIMatcher();
|
|
210
|
-
this.codec = new StandardOpenAPICodec();
|
|
211
205
|
const plugins = new CompositeStandardHandlerPlugin(options.plugins);
|
|
212
206
|
plugins.init(options, router);
|
|
213
207
|
this.interceptors = toArray(options.interceptors);
|
|
@@ -244,7 +238,7 @@ class StandardHandler {
|
|
|
244
238
|
step = "decode_input";
|
|
245
239
|
let input = await runWithSpan(
|
|
246
240
|
{ name: "decode_input" },
|
|
247
|
-
() =>
|
|
241
|
+
() => decode(request2, match.params, match.procedure)
|
|
248
242
|
);
|
|
249
243
|
step = void 0;
|
|
250
244
|
if (isAsyncIteratorObject(input)) {
|
|
@@ -264,7 +258,7 @@ class StandardHandler {
|
|
|
264
258
|
lastEventId: flattenHeader(request2.headers["last-event-id"])
|
|
265
259
|
});
|
|
266
260
|
step = void 0;
|
|
267
|
-
const response =
|
|
261
|
+
const response = encode(output, match.procedure);
|
|
268
262
|
return {
|
|
269
263
|
matched: true,
|
|
270
264
|
response
|
|
@@ -279,7 +273,7 @@ class StandardHandler {
|
|
|
279
273
|
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
280
274
|
cause: e
|
|
281
275
|
}) : toORPCError(e);
|
|
282
|
-
const response =
|
|
276
|
+
const response = encodeError(error);
|
|
283
277
|
return {
|
|
284
278
|
matched: true,
|
|
285
279
|
response
|
|
@@ -290,4 +284,4 @@ class StandardHandler {
|
|
|
290
284
|
}
|
|
291
285
|
}
|
|
292
286
|
|
|
293
|
-
export { CompositeStandardHandlerPlugin as C, StandardHandler as S,
|
|
287
|
+
export { CompositeStandardHandlerPlugin as C, StandardHandler as S, encodeError as a, StandardOpenAPIMatcher as b, decodeParams as c, decode as d, encode as e, resolveFriendlyStandardHandleOptions as r, toRou3Pattern as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@temporary-name/contract';
|
|
2
|
-
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError,
|
|
2
|
+
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
3
3
|
|
|
4
4
|
type Context = Record<PropertyKey, any>;
|
|
5
5
|
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
|
@@ -13,33 +13,6 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
|
15
15
|
|
|
16
|
-
declare const LAZY_SYMBOL: unique symbol;
|
|
17
|
-
interface LazyMeta {
|
|
18
|
-
prefix?: HTTPPath;
|
|
19
|
-
}
|
|
20
|
-
interface Lazy<T> {
|
|
21
|
-
[LAZY_SYMBOL]: {
|
|
22
|
-
loader: () => Promise<{
|
|
23
|
-
default: T;
|
|
24
|
-
}>;
|
|
25
|
-
meta: LazyMeta;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
type Lazyable<T> = T | Lazy<T>;
|
|
29
|
-
/**
|
|
30
|
-
* Creates a lazy-loaded item.
|
|
31
|
-
*
|
|
32
|
-
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
33
|
-
*/
|
|
34
|
-
declare function lazy<T>(loader: () => Promise<{
|
|
35
|
-
default: T;
|
|
36
|
-
}>, meta?: LazyMeta): Lazy<T>;
|
|
37
|
-
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
38
|
-
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
39
|
-
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
40
|
-
default: T extends Lazy<infer U> ? U : T;
|
|
41
|
-
}>;
|
|
42
|
-
|
|
43
16
|
interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
44
17
|
context: TCurrentContext;
|
|
45
18
|
input: TInput;
|
|
@@ -112,6 +85,33 @@ interface MapInputMiddleware<TInput, TMappedInput> {
|
|
|
112
85
|
}
|
|
113
86
|
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
114
87
|
|
|
88
|
+
declare const LAZY_SYMBOL: unique symbol;
|
|
89
|
+
interface LazyMeta {
|
|
90
|
+
prefix?: HTTPPath;
|
|
91
|
+
}
|
|
92
|
+
interface Lazy<T> {
|
|
93
|
+
[LAZY_SYMBOL]: {
|
|
94
|
+
loader: () => Promise<{
|
|
95
|
+
default: T;
|
|
96
|
+
}>;
|
|
97
|
+
meta: LazyMeta;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
type Lazyable<T> = T | Lazy<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a lazy-loaded item.
|
|
103
|
+
*
|
|
104
|
+
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
105
|
+
*/
|
|
106
|
+
declare function lazy<T>(loader: () => Promise<{
|
|
107
|
+
default: T;
|
|
108
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
|
109
|
+
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
110
|
+
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
111
|
+
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
112
|
+
default: T extends Lazy<infer U> ? U : T;
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
115
|
type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
|
|
116
116
|
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
117
117
|
context: TInitialContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@temporary-name/contract';
|
|
2
|
-
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError,
|
|
2
|
+
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
3
3
|
|
|
4
4
|
type Context = Record<PropertyKey, any>;
|
|
5
5
|
type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
|
|
@@ -13,33 +13,6 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
|
|
|
13
13
|
};
|
|
14
14
|
declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
|
|
15
15
|
|
|
16
|
-
declare const LAZY_SYMBOL: unique symbol;
|
|
17
|
-
interface LazyMeta {
|
|
18
|
-
prefix?: HTTPPath;
|
|
19
|
-
}
|
|
20
|
-
interface Lazy<T> {
|
|
21
|
-
[LAZY_SYMBOL]: {
|
|
22
|
-
loader: () => Promise<{
|
|
23
|
-
default: T;
|
|
24
|
-
}>;
|
|
25
|
-
meta: LazyMeta;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
type Lazyable<T> = T | Lazy<T>;
|
|
29
|
-
/**
|
|
30
|
-
* Creates a lazy-loaded item.
|
|
31
|
-
*
|
|
32
|
-
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
33
|
-
*/
|
|
34
|
-
declare function lazy<T>(loader: () => Promise<{
|
|
35
|
-
default: T;
|
|
36
|
-
}>, meta?: LazyMeta): Lazy<T>;
|
|
37
|
-
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
38
|
-
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
39
|
-
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
40
|
-
default: T extends Lazy<infer U> ? U : T;
|
|
41
|
-
}>;
|
|
42
|
-
|
|
43
16
|
interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
44
17
|
context: TCurrentContext;
|
|
45
18
|
input: TInput;
|
|
@@ -112,6 +85,33 @@ interface MapInputMiddleware<TInput, TMappedInput> {
|
|
|
112
85
|
}
|
|
113
86
|
declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
114
87
|
|
|
88
|
+
declare const LAZY_SYMBOL: unique symbol;
|
|
89
|
+
interface LazyMeta {
|
|
90
|
+
prefix?: HTTPPath;
|
|
91
|
+
}
|
|
92
|
+
interface Lazy<T> {
|
|
93
|
+
[LAZY_SYMBOL]: {
|
|
94
|
+
loader: () => Promise<{
|
|
95
|
+
default: T;
|
|
96
|
+
}>;
|
|
97
|
+
meta: LazyMeta;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
type Lazyable<T> = T | Lazy<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a lazy-loaded item.
|
|
103
|
+
*
|
|
104
|
+
* @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazyRoute(...)` instead.
|
|
105
|
+
*/
|
|
106
|
+
declare function lazy<T>(loader: () => Promise<{
|
|
107
|
+
default: T;
|
|
108
|
+
}>, meta?: LazyMeta): Lazy<T>;
|
|
109
|
+
declare function isLazy(item: unknown): item is Lazy<any>;
|
|
110
|
+
declare function getLazyMeta(lazied: Lazy<any>): LazyMeta;
|
|
111
|
+
declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
112
|
+
default: T extends Lazy<infer U> ? U : T;
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
115
|
type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
|
|
116
116
|
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
117
117
|
context: TInitialContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@temporary-name/contract';
|
|
2
2
|
import { HTTPPath, Interceptor } from '@temporary-name/shared';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
4
|
-
import { C as Context, R as Router, E as ProcedureClientInterceptorOptions } from './server.
|
|
4
|
+
import { C as Context, R as Router, E as ProcedureClientInterceptorOptions } from './server.C3RuMHWl.mjs';
|
|
5
5
|
|
|
6
6
|
interface StandardHandlerPlugin<T extends Context> {
|
|
7
7
|
order?: number;
|
|
@@ -48,7 +48,6 @@ declare class StandardHandler<T extends Context> {
|
|
|
48
48
|
private readonly clientInterceptors;
|
|
49
49
|
private readonly rootInterceptors;
|
|
50
50
|
private readonly matcher;
|
|
51
|
-
private readonly codec;
|
|
52
51
|
constructor(router: Router<any, T>, options: NoInfer<StandardHandlerOptions<T>>);
|
|
53
52
|
handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
|
|
54
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTTPPath } from '@temporary-name/shared';
|
|
2
|
-
import { C as Context } from './server.
|
|
3
|
-
import { c as StandardHandleOptions } from './server.
|
|
2
|
+
import { C as Context } from './server.C3RuMHWl.js';
|
|
3
|
+
import { c as StandardHandleOptions } from './server.cjcgLdr1.js';
|
|
4
4
|
|
|
5
5
|
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
|
6
6
|
context?: T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@temporary-name/contract';
|
|
2
2
|
import { HTTPPath, Interceptor } from '@temporary-name/shared';
|
|
3
3
|
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
4
|
-
import { C as Context, R as Router, E as ProcedureClientInterceptorOptions } from './server.
|
|
4
|
+
import { C as Context, R as Router, E as ProcedureClientInterceptorOptions } from './server.C3RuMHWl.js';
|
|
5
5
|
|
|
6
6
|
interface StandardHandlerPlugin<T extends Context> {
|
|
7
7
|
order?: number;
|
|
@@ -48,7 +48,6 @@ declare class StandardHandler<T extends Context> {
|
|
|
48
48
|
private readonly clientInterceptors;
|
|
49
49
|
private readonly rootInterceptors;
|
|
50
50
|
private readonly matcher;
|
|
51
|
-
private readonly codec;
|
|
52
51
|
constructor(router: Router<any, T>, options: NoInfer<StandardHandlerOptions<T>>);
|
|
53
52
|
handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
|
|
54
53
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporary-name/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.3-alpha.
|
|
4
|
+
"version": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"cookie": "^1.0.2",
|
|
74
74
|
"rou3": "^0.7.7",
|
|
75
75
|
"zod": "^4.1.12",
|
|
76
|
-
"@temporary-name/interop": "1.9.3-alpha.
|
|
77
|
-
"@temporary-name/
|
|
78
|
-
"@temporary-name/
|
|
79
|
-
"@temporary-name/
|
|
80
|
-
"@temporary-name/standard-server-
|
|
81
|
-
"@temporary-name/
|
|
82
|
-
"@temporary-name/
|
|
83
|
-
"@temporary-name/
|
|
84
|
-
"@temporary-name/standard-server-
|
|
76
|
+
"@temporary-name/interop": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
77
|
+
"@temporary-name/json-schema": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
78
|
+
"@temporary-name/standard-server": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
79
|
+
"@temporary-name/shared": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
80
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
81
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
82
|
+
"@temporary-name/zod": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
83
|
+
"@temporary-name/contract": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0",
|
|
84
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.d9b25e999833b2b788712bccd5957f10e42416b0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/supertest": "^6.0.3",
|
|
@@ -3,25 +3,6 @@ import { resolveMaybeOptionalOptions, ORPCError, toArray, value, runWithSpan, in
|
|
|
3
3
|
import { HibernationEventIterator, mapEventIterator } from '@temporary-name/standard-server';
|
|
4
4
|
import { safeParseAsync } from '@temporary-name/zod';
|
|
5
5
|
|
|
6
|
-
const LAZY_SYMBOL = Symbol("ORPC_LAZY_SYMBOL");
|
|
7
|
-
function lazy(loader, meta = {}) {
|
|
8
|
-
return {
|
|
9
|
-
[LAZY_SYMBOL]: {
|
|
10
|
-
loader,
|
|
11
|
-
meta
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function isLazy(item) {
|
|
16
|
-
return (typeof item === "object" || typeof item === "function") && item !== null && LAZY_SYMBOL in item;
|
|
17
|
-
}
|
|
18
|
-
function getLazyMeta(lazied) {
|
|
19
|
-
return lazied[LAZY_SYMBOL].meta;
|
|
20
|
-
}
|
|
21
|
-
function unlazy(lazied) {
|
|
22
|
-
return isLazy(lazied) ? lazied[LAZY_SYMBOL].loader() : Promise.resolve({ default: lazied });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
6
|
function mergeCurrentContext(context, other) {
|
|
26
7
|
return { ...context, ...other };
|
|
27
8
|
}
|
|
@@ -49,6 +30,25 @@ function createORPCErrorConstructorMap(errors) {
|
|
|
49
30
|
return proxy;
|
|
50
31
|
}
|
|
51
32
|
|
|
33
|
+
const LAZY_SYMBOL = Symbol("ORPC_LAZY_SYMBOL");
|
|
34
|
+
function lazy(loader, meta = {}) {
|
|
35
|
+
return {
|
|
36
|
+
[LAZY_SYMBOL]: {
|
|
37
|
+
loader,
|
|
38
|
+
meta
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function isLazy(item) {
|
|
43
|
+
return (typeof item === "object" || typeof item === "function") && item !== null && LAZY_SYMBOL in item;
|
|
44
|
+
}
|
|
45
|
+
function getLazyMeta(lazied) {
|
|
46
|
+
return lazied[LAZY_SYMBOL].meta;
|
|
47
|
+
}
|
|
48
|
+
function unlazy(lazied) {
|
|
49
|
+
return isLazy(lazied) ? lazied[LAZY_SYMBOL].loader() : Promise.resolve({ default: lazied });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
52
|
function middlewareOutputFn(output) {
|
|
53
53
|
return { output, context: {} };
|
|
54
54
|
}
|