@temporary-name/server 1.9.3-alpha.1a5ff4923d25c9d83e80d717687ebc859f5312f2 → 1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/aws-lambda/index.d.mts +3 -4
- package/dist/adapters/aws-lambda/index.d.ts +3 -4
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/fetch/index.d.mts +3 -4
- package/dist/adapters/fetch/index.d.ts +3 -4
- package/dist/adapters/fetch/index.mjs +3 -3
- package/dist/adapters/node/index.d.mts +3 -4
- package/dist/adapters/node/index.d.ts +3 -4
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/adapters/standard/index.d.mts +4 -5
- package/dist/adapters/standard/index.d.ts +4 -5
- package/dist/adapters/standard/index.mjs +3 -3
- package/dist/index.d.mts +18 -15
- package/dist/index.d.ts +18 -15
- package/dist/index.mjs +21 -18
- package/dist/openapi/index.mjs +2 -2
- package/dist/plugins/index.d.mts +3 -4
- package/dist/plugins/index.d.ts +3 -4
- package/dist/shared/{server.DHezmW6C.d.mts → server.7aL9gcoU.d.mts} +2 -2
- package/dist/shared/{server.DecvGKtb.d.mts → server.BL2R5jcp.d.mts} +10 -24
- package/dist/shared/{server.DecvGKtb.d.ts → server.BL2R5jcp.d.ts} +10 -24
- package/dist/shared/{server.B--sAUhn.mjs → server.CttFCjkj.mjs} +4 -3
- package/dist/shared/{server.CdeqmULw.d.ts → server.D6Qs_UcF.d.mts} +2 -3
- package/dist/shared/{server.Da-qLzdU.d.ts → server.DFptr1Nz.d.ts} +2 -2
- package/dist/shared/{server.CHV9AQHl.mjs → server.DmGicgbG.mjs} +1 -0
- package/dist/shared/{server.BCcLYvdF.d.mts → server.DpoO_ER_.d.ts} +2 -3
- package/dist/shared/{server.Kxw442A9.mjs → server.JtIZ8YG7.mjs} +1 -11
- package/package.json +10 -10
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
4
|
-
import { b as StandardHandlerOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
9
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
4
|
-
import { b as StandardHandlerOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
9
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CttFCjkj.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.DmGicgbG.mjs';
|
|
9
9
|
import '@temporary-name/zod';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class AwsLambdaHandler {
|
|
13
13
|
sendStandardResponseOptions;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface FetchHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
10
9
|
initRuntimeAdapter?(options: FetchHandlerOptions<T>): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
|
-
import '@temporary-name/standard-server';
|
|
8
7
|
|
|
9
8
|
interface FetchHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
10
9
|
initRuntimeAdapter?(options: FetchHandlerOptions<T>): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CttFCjkj.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.DmGicgbG.mjs';
|
|
10
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
13
13
|
maxBodySize;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.D6Qs_UcF.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
|
-
import '@temporary-name/standard-server';
|
|
9
8
|
|
|
10
9
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
11
10
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.BL2R5jcp.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.DpoO_ER_.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DFptr1Nz.js';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
|
-
import '@temporary-name/standard-server';
|
|
9
8
|
|
|
10
9
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
11
10
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { once, ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import compression from '@temporary-name/interop/compression';
|
|
3
3
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CttFCjkj.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.DmGicgbG.mjs';
|
|
11
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
14
14
|
maxBodySize;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.D6Qs_UcF.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
|
|
5
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.DHezmW6C.mjs';
|
|
3
|
+
import { StandardLazyRequest, StandardHeaders, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.7aL9gcoU.mjs';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BL2R5jcp.mjs';
|
|
8
7
|
|
|
9
8
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
10
9
|
path: unknown;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.DpoO_ER_.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
-
|
|
5
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.Da-qLzdU.js';
|
|
3
|
+
import { StandardLazyRequest, StandardHeaders, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.DFptr1Nz.js';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '../../shared/server.
|
|
6
|
+
import '../../shared/server.BL2R5jcp.js';
|
|
8
7
|
|
|
9
8
|
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
10
9
|
path: unknown;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.CttFCjkj.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
3
|
import '@temporary-name/standard-server';
|
|
4
|
-
import '../../shared/server.
|
|
4
|
+
import '../../shared/server.DmGicgbG.mjs';
|
|
5
5
|
import '@temporary-name/contract';
|
|
6
6
|
import '@temporary-name/zod';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.JtIZ8YG7.mjs';
|
|
8
8
|
import '@temporary-name/server';
|
|
9
9
|
import 'rou3';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap,
|
|
1
|
+
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap, AnyShape, MergedSchemas, WrapShape, UnionToIntersection, AnySchema, Route, InferHandlerInputs, InferSchemaInput, ContractRouter, ContractProcedureDef, InitialSchemas, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, InferProcedureClientInputs, InferSchemaOutput, ErrorFromErrorMap, Schema } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
|
-
import { ClientContext, MaybeOptionalOptions, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, HTTPEndpoint, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass } from '@temporary-name/zod';
|
|
6
|
-
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.
|
|
7
|
-
export {
|
|
5
|
+
import { SchemaClass, core } from '@temporary-name/zod';
|
|
6
|
+
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.BL2R5jcp.mjs';
|
|
7
|
+
export { T as AccessibleLazyRouter, Y as ContractProcedureCallbackOptions, K as InferRouterCurrentContexts, J as InferRouterInitialContexts, N as InferRouterInputs, Q as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, Z as LazyTraverseContractProceduresOptions, w as MiddlewareNextFn, y as MiddlewareOptions, x as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, G as ProcedureClientInterceptorOptions, D as ProcedureDef, B as ProcedureHandlerOptions, X as TraverseContractProcedureCallbackOptions, W as TraverseContractProceduresOptions, a0 as UnlaziedRouter, U as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, H as createProcedureClient, V as enhanceRouter, t as getLazyMeta, S as getRouter, s as isLazy, F as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, z as middlewareOutputFn, $ as resolveContractProcedures, _ as traverseContractProcedures, u as unlazy, a1 as unlazyRouter } from './shared/server.BL2R5jcp.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
10
|
declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> {
|
|
@@ -37,6 +37,12 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
37
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
38
38
|
*/
|
|
39
39
|
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
40
|
+
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
41
|
+
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
42
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
43
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
44
|
+
pathSchema: WrapShape<U>;
|
|
45
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
40
46
|
/**
|
|
41
47
|
* Sets or updates the route definition for the contract.
|
|
42
48
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -45,23 +51,20 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
45
51
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
46
52
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}>, TErrorMap, TMeta, TGateName>;
|
|
52
|
-
query<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
53
|
-
querySchema: USchema;
|
|
54
|
+
endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
55
|
+
query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
querySchema: WrapShape<U>;
|
|
54
57
|
}>, TErrorMap, TMeta, TGateName>;
|
|
55
|
-
body<
|
|
56
|
-
bodySchema:
|
|
58
|
+
body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
59
|
+
bodySchema: WrapShape<U>;
|
|
57
60
|
}>, TErrorMap, TMeta, TGateName>;
|
|
58
61
|
/**
|
|
59
62
|
* Defines the output validation schema.
|
|
60
63
|
*
|
|
61
64
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
62
65
|
*/
|
|
63
|
-
output<
|
|
64
|
-
outputSchema:
|
|
66
|
+
output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
67
|
+
outputSchema: WrapShape<U>;
|
|
65
68
|
}>, TErrorMap, TMeta, TGateName>;
|
|
66
69
|
/**
|
|
67
70
|
* Uses a middleware to modify the context or improve the pipeline.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap,
|
|
1
|
+
import { Schemas, ErrorMap, Meta, ContractProcedure, MergedErrorMap, AnyShape, MergedSchemas, WrapShape, UnionToIntersection, AnySchema, Route, InferHandlerInputs, InferSchemaInput, ContractRouter, ContractProcedureDef, InitialSchemas, AnyContractRouter, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure, InferProcedureClientInputs, InferSchemaOutput, ErrorFromErrorMap, Schema } from '@temporary-name/contract';
|
|
2
2
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
|
-
import { ClientContext, MaybeOptionalOptions, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
3
|
+
import { ClientContext, MaybeOptionalOptions, HTTPEndpoint, IntersectPick, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass } from '@temporary-name/zod';
|
|
6
|
-
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.
|
|
7
|
-
export {
|
|
5
|
+
import { SchemaClass, core } from '@temporary-name/zod';
|
|
6
|
+
import { C as Context, P as Procedure, a as CreateProcedureClientOptions, b as ProcedureClient, M as Middleware, O as ORPCErrorConstructorMap, c as MergedInitialContext, d as MergedCurrentContext, e as ProcedureHandler, E as EnhanceRouterOptions, R as Router, f as EnhancedRouter, g as MapInputMiddleware, A as AnyMiddleware, L as Lazy, h as AnyProcedure, i as Lazyable, j as AnyRouter, I as InferRouterInitialContext } from './shared/server.BL2R5jcp.js';
|
|
7
|
+
export { T as AccessibleLazyRouter, Y as ContractProcedureCallbackOptions, K as InferRouterCurrentContexts, J as InferRouterInitialContexts, N as InferRouterInputs, Q as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, Z as LazyTraverseContractProceduresOptions, w as MiddlewareNextFn, y as MiddlewareOptions, x as MiddlewareOutputFn, v as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, G as ProcedureClientInterceptorOptions, D as ProcedureDef, B as ProcedureHandlerOptions, X as TraverseContractProcedureCallbackOptions, W as TraverseContractProceduresOptions, a0 as UnlaziedRouter, U as createAccessibleLazyRouter, n as createORPCErrorConstructorMap, H as createProcedureClient, V as enhanceRouter, t as getLazyMeta, S as getRouter, s as isLazy, F as isProcedure, r as lazy, q as lazyInternal, m as mergeCurrentContext, z as middlewareOutputFn, $ as resolveContractProcedures, _ as traverseContractProcedures, u as unlazy, a1 as unlazyRouter } from './shared/server.BL2R5jcp.js';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
10
|
declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta> {
|
|
@@ -37,6 +37,12 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
37
37
|
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
|
|
38
38
|
*/
|
|
39
39
|
meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
40
|
+
endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
41
|
+
pathSchema: WrapShape<UnionToIntersection<U>>;
|
|
42
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
43
|
+
endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
44
|
+
pathSchema: WrapShape<U>;
|
|
45
|
+
}>, TErrorMap, TMeta, TGateName>;
|
|
40
46
|
/**
|
|
41
47
|
* Sets or updates the route definition for the contract.
|
|
42
48
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -45,23 +51,20 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
45
51
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
46
52
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}>, TErrorMap, TMeta, TGateName>;
|
|
52
|
-
query<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
53
|
-
querySchema: USchema;
|
|
54
|
+
endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TErrorMap, TMeta, TGateName>;
|
|
55
|
+
query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
56
|
+
querySchema: WrapShape<U>;
|
|
54
57
|
}>, TErrorMap, TMeta, TGateName>;
|
|
55
|
-
body<
|
|
56
|
-
bodySchema:
|
|
58
|
+
body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
59
|
+
bodySchema: WrapShape<U>;
|
|
57
60
|
}>, TErrorMap, TMeta, TGateName>;
|
|
58
61
|
/**
|
|
59
62
|
* Defines the output validation schema.
|
|
60
63
|
*
|
|
61
64
|
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
|
|
62
65
|
*/
|
|
63
|
-
output<
|
|
64
|
-
outputSchema:
|
|
66
|
+
output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
|
|
67
|
+
outputSchema: WrapShape<U>;
|
|
65
68
|
}>, TErrorMap, TMeta, TGateName>;
|
|
66
69
|
/**
|
|
67
70
|
* Uses a middleware to modify the context or improve the pipeline.
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { mergePrefix, mergeTags, ContractProcedure, mergeErrorMap, mergeMeta, mergeRoute, prefixRoute, initialSchemas, isContractProcedure, getContractRouter } from '@temporary-name/contract';
|
|
1
|
+
import { mergePrefix, mergeTags, ContractProcedure, mergeErrorMap, mergeMeta, parseEndpointDefinition, mergeRoute, prefixRoute, initialSchemas, isContractProcedure, getContractRouter } from '@temporary-name/contract';
|
|
2
2
|
export { ValidationError, eventIterator, validateORPCError } from '@temporary-name/contract';
|
|
3
3
|
import { onError, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
4
4
|
export { AsyncIteratorClass, EventPublisher, ORPCError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
5
|
-
import { SchemaClass, gatingContext } from '@temporary-name/zod';
|
|
6
|
-
import { P as Procedure, c as createProcedureClient, e as enhanceRouter, a as addMiddleware, s as setHiddenRouterContract, l as lazyInternal, g as getLazyMeta, u as unlazy, i as isProcedure, b as isLazy, d as getRouter } from './shared/server.
|
|
7
|
-
export { L as LAZY_SYMBOL, p as createAccessibleLazyRouter, f as createORPCErrorConstructorMap, o as getHiddenRouterContract, k as isStartWithMiddlewares, h as lazy, m as mergeCurrentContext, n as mergeMiddlewares, j as middlewareOutputFn, r as resolveContractProcedures, t as traverseContractProcedures, q as unlazyRouter } from './shared/server.
|
|
5
|
+
import { SchemaClass, object, core, gatingContext } from '@temporary-name/zod';
|
|
6
|
+
import { P as Procedure, c as createProcedureClient, e as enhanceRouter, a as addMiddleware, s as setHiddenRouterContract, l as lazyInternal, g as getLazyMeta, u as unlazy, i as isProcedure, b as isLazy, d as getRouter } from './shared/server.DmGicgbG.mjs';
|
|
7
|
+
export { L as LAZY_SYMBOL, p as createAccessibleLazyRouter, f as createORPCErrorConstructorMap, o as getHiddenRouterContract, k as isStartWithMiddlewares, h as lazy, m as mergeCurrentContext, n as mergeMiddlewares, j as middlewareOutputFn, r as resolveContractProcedures, t as traverseContractProcedures, q as unlazyRouter } from './shared/server.DmGicgbG.mjs';
|
|
8
8
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
9
|
|
|
10
10
|
class DecoratedProcedure extends Procedure {
|
|
@@ -56,6 +56,19 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
56
56
|
meta: mergeMeta(this["~orpc"].meta, meta)
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
endpoint(stringsOrEndpoint, ...values) {
|
|
60
|
+
const { method, path, pathSchema } = parseEndpointDefinition(stringsOrEndpoint, values);
|
|
61
|
+
const { prefix } = this["~orpc"];
|
|
62
|
+
const route = { method, path };
|
|
63
|
+
return new ProcedureBuilder({
|
|
64
|
+
...this["~orpc"],
|
|
65
|
+
route: mergeRoute(this["~orpc"].route, prefix ? prefixRoute(route, prefix) : route),
|
|
66
|
+
schemas: {
|
|
67
|
+
...this["~orpc"].schemas,
|
|
68
|
+
pathSchema
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
59
72
|
/**
|
|
60
73
|
* Sets or updates the route definition for the contract.
|
|
61
74
|
* The provided route is spared-merged with any existing route in the contract.
|
|
@@ -64,29 +77,19 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
64
77
|
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
|
|
65
78
|
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
66
79
|
*/
|
|
67
|
-
|
|
80
|
+
endpointOpts(route) {
|
|
68
81
|
const { prefix } = this["~orpc"];
|
|
69
82
|
return new ProcedureBuilder({
|
|
70
83
|
...this["~orpc"],
|
|
71
84
|
route: mergeRoute(this["~orpc"].route, prefix ? prefixRoute(route, prefix) : route)
|
|
72
85
|
});
|
|
73
86
|
}
|
|
74
|
-
path(schema) {
|
|
75
|
-
return new ProcedureBuilder({
|
|
76
|
-
...this["~orpc"],
|
|
77
|
-
schemas: {
|
|
78
|
-
...this["~orpc"].schemas,
|
|
79
|
-
pathSchema: schema
|
|
80
|
-
},
|
|
81
|
-
inputValidationIndex: this["~orpc"].middlewares.length
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
87
|
query(schema) {
|
|
85
88
|
return new ProcedureBuilder({
|
|
86
89
|
...this["~orpc"],
|
|
87
90
|
schemas: {
|
|
88
91
|
...this["~orpc"].schemas,
|
|
89
|
-
querySchema: schema
|
|
92
|
+
querySchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
90
93
|
},
|
|
91
94
|
inputValidationIndex: this["~orpc"].middlewares.length
|
|
92
95
|
});
|
|
@@ -96,7 +99,7 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
96
99
|
...this["~orpc"],
|
|
97
100
|
schemas: {
|
|
98
101
|
...this["~orpc"].schemas,
|
|
99
|
-
bodySchema: schema
|
|
102
|
+
bodySchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
100
103
|
},
|
|
101
104
|
inputValidationIndex: this["~orpc"].middlewares.length
|
|
102
105
|
});
|
|
@@ -111,7 +114,7 @@ class ProcedureBuilder extends ContractProcedure {
|
|
|
111
114
|
...this["~orpc"],
|
|
112
115
|
schemas: {
|
|
113
116
|
...this["~orpc"].schemas,
|
|
114
|
-
outputSchema: schema
|
|
117
|
+
outputSchema: schema instanceof core.$ZodType ? schema : object(schema)
|
|
115
118
|
},
|
|
116
119
|
outputValidationIndex: this["~orpc"].middlewares.length
|
|
117
120
|
});
|
package/dist/openapi/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isProcedure, resolveContractProcedures, ORPCError, createRouterClient } from '@temporary-name/server';
|
|
2
|
-
import { fallbackContractConfig, getEventIteratorSchemaDetails } from '@temporary-name/contract';
|
|
2
|
+
import { standardizeHTTPPath, fallbackContractConfig, getDynamicParams, getEventIteratorSchemaDetails } from '@temporary-name/contract';
|
|
3
3
|
import { isObject, stringifyJSON, findDeepMatches, toArray, clone, value, toHttpPath, isORPCErrorStatus, fallbackORPCErrorStatus, fallbackORPCErrorMessage, resolveMaybeOptionalOptions, createORPCErrorFromJson } from '@temporary-name/shared';
|
|
4
|
-
import {
|
|
4
|
+
import { j as jsonSerialize, d as deserialize, s as serialize } from '../shared/server.JtIZ8YG7.mjs';
|
|
5
5
|
import '@temporary-name/standard-server';
|
|
6
6
|
import { TypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
7
7
|
export { ContentEncoding as JSONSchemaContentEncoding, Format as JSONSchemaFormat, TypeName as JSONSchemaTypeName } from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Value, Promisable, ORPCError } from '@temporary-name/shared';
|
|
2
|
-
import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
|
|
1
|
+
import { Value, Promisable, StandardRequest, StandardHeaders, ORPCError } from '@temporary-name/shared';
|
|
3
2
|
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,
|
|
3
|
+
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.D6Qs_UcF.mjs';
|
|
4
|
+
import { C as Context, G as ProcedureClientInterceptorOptions } from '../shared/server.BL2R5jcp.mjs';
|
|
6
5
|
import { Meta } from '@temporary-name/contract';
|
|
7
6
|
|
|
8
7
|
interface BatchHandlerOptions<T extends Context> {
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Value, Promisable, ORPCError } from '@temporary-name/shared';
|
|
2
|
-
import { StandardRequest, StandardHeaders } from '@temporary-name/standard-server';
|
|
1
|
+
import { Value, Promisable, StandardRequest, StandardHeaders, ORPCError } from '@temporary-name/shared';
|
|
3
2
|
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,
|
|
3
|
+
import { S as StandardHandlerInterceptorOptions, a as StandardHandlerPlugin, b as StandardHandlerOptions } from '../shared/server.DpoO_ER_.js';
|
|
4
|
+
import { C as Context, G as ProcedureClientInterceptorOptions } from '../shared/server.BL2R5jcp.js';
|
|
6
5
|
import { Meta } from '@temporary-name/contract';
|
|
7
6
|
|
|
8
7
|
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.BL2R5jcp.mjs';
|
|
3
|
+
import { c as StandardHandleOptions } from './server.D6Qs_UcF.mjs';
|
|
4
4
|
|
|
5
5
|
type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
|
6
6
|
context?: T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorMap, ErrorMapItem, InferSchemaInput,
|
|
2
|
-
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
1
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, Meta, Schemas, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferProcedureClientInputs, InferSchemaOutput, EnhanceRouteOptions, MergedErrorMap, AnyContractProcedure, ContractRouter, AnySchema, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
|
+
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, StandardLazyRequest, 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>;
|
|
@@ -18,6 +18,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TErrorConstru
|
|
|
18
18
|
path: readonly string[];
|
|
19
19
|
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
20
20
|
signal?: AbortSignal;
|
|
21
|
+
request?: StandardLazyRequest;
|
|
21
22
|
lastEventId: string | undefined;
|
|
22
23
|
errors: TErrorConstructorMap;
|
|
23
24
|
}
|
|
@@ -54,25 +55,16 @@ type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
|
54
55
|
output: TOutput;
|
|
55
56
|
context: TOutContext;
|
|
56
57
|
}>;
|
|
57
|
-
type MiddlewareNextFnOptions<TOutContext extends Context> = Record<never, never> extends TOutContext ? {
|
|
58
|
-
context?: TOutContext;
|
|
59
|
-
} : {
|
|
60
|
-
context: TOutContext;
|
|
61
|
-
};
|
|
62
58
|
interface MiddlewareNextFn<TOutput> {
|
|
63
|
-
<U extends Context =
|
|
59
|
+
<U extends Context = {}>(options?: {
|
|
60
|
+
context?: U;
|
|
61
|
+
}): MiddlewareResult<U, TOutput>;
|
|
64
62
|
}
|
|
65
63
|
interface MiddlewareOutputFn<TOutput> {
|
|
66
64
|
(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
67
65
|
}
|
|
68
|
-
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
69
|
-
context: TInContext;
|
|
70
|
-
path: readonly string[];
|
|
71
|
-
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
72
|
-
signal?: AbortSignal;
|
|
73
|
-
lastEventId: string | undefined;
|
|
66
|
+
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> extends ProcedureHandlerOptions<TInContext, TErrorConstructorMap, TMeta> {
|
|
74
67
|
next: MiddlewareNextFn<TOutput>;
|
|
75
|
-
errors: TErrorConstructorMap;
|
|
76
68
|
}
|
|
77
69
|
/**
|
|
78
70
|
* A function that represents a middleware.
|
|
@@ -207,18 +199,12 @@ declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
|
207
199
|
}>;
|
|
208
200
|
|
|
209
201
|
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas, TErrorMap extends ErrorMap> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>, ErrorFromErrorMap<TErrorMap>>;
|
|
210
|
-
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
211
|
-
context: TInitialContext;
|
|
202
|
+
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends ProcedureHandlerOptions<TInitialContext, ORPCErrorConstructorMap<TErrorMap>, TMeta> {
|
|
212
203
|
input: {
|
|
213
204
|
path: unknown;
|
|
214
205
|
query: unknown;
|
|
215
206
|
body: unknown;
|
|
216
207
|
};
|
|
217
|
-
errors: ORPCErrorConstructorMap<TErrorMap>;
|
|
218
|
-
path: readonly string[];
|
|
219
|
-
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
220
|
-
signal?: AbortSignal;
|
|
221
|
-
lastEventId: string | undefined;
|
|
222
208
|
}
|
|
223
209
|
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
|
224
210
|
/**
|
|
@@ -238,5 +224,5 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
|
|
|
238
224
|
*/
|
|
239
225
|
declare function createProcedureClient<TInitialContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
240
226
|
|
|
241
|
-
export {
|
|
242
|
-
export type { AnyMiddleware as A, Context as C,
|
|
227
|
+
export { resolveContractProcedures as $, isProcedure as F, createProcedureClient as H, Procedure as P, getRouter as S, createAccessibleLazyRouter as U, enhanceRouter as V, traverseContractProcedures as _, unlazyRouter as a1, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazyInternal as q, lazy as r, isLazy as s, getLazyMeta as t, unlazy as u, middlewareOutputFn as z };
|
|
228
|
+
export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, EnhanceRouterOptions as E, ProcedureClientInterceptorOptions as G, InferRouterInitialContext as I, InferRouterInitialContexts as J, InferRouterCurrentContexts as K, Lazy as L, Middleware as M, InferRouterInputs as N, ORPCErrorConstructorMap as O, InferRouterOutputs as Q, Router as R, AccessibleLazyRouter as T, TraverseContractProceduresOptions as W, TraverseContractProcedureCallbackOptions as X, ContractProcedureCallbackOptions as Y, LazyTraverseContractProceduresOptions as Z, CreateProcedureClientOptions as a, UnlaziedRouter as a0, ProcedureClient as b, MergedInitialContext as c, MergedCurrentContext as d, ProcedureHandler as e, EnhancedRouter as f, MapInputMiddleware as g, AnyProcedure as h, Lazyable as i, AnyRouter as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as v, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorMap, ErrorMapItem, InferSchemaInput,
|
|
2
|
-
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, HTTPPath, ClientContext, Interceptor, PromiseWithError, Value, Client } from '@temporary-name/shared';
|
|
1
|
+
import { ErrorMap, ErrorMapItem, InferSchemaInput, Meta, Schemas, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferProcedureClientInputs, InferSchemaOutput, EnhanceRouteOptions, MergedErrorMap, AnyContractProcedure, ContractRouter, AnySchema, ErrorFromErrorMap } from '@temporary-name/contract';
|
|
2
|
+
import { ORPCErrorCode, MaybeOptionalOptions, ORPCErrorOptions, ORPCError, Promisable, StandardLazyRequest, 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>;
|
|
@@ -18,6 +18,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TErrorConstru
|
|
|
18
18
|
path: readonly string[];
|
|
19
19
|
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
20
20
|
signal?: AbortSignal;
|
|
21
|
+
request?: StandardLazyRequest;
|
|
21
22
|
lastEventId: string | undefined;
|
|
22
23
|
errors: TErrorConstructorMap;
|
|
23
24
|
}
|
|
@@ -54,25 +55,16 @@ type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
|
|
|
54
55
|
output: TOutput;
|
|
55
56
|
context: TOutContext;
|
|
56
57
|
}>;
|
|
57
|
-
type MiddlewareNextFnOptions<TOutContext extends Context> = Record<never, never> extends TOutContext ? {
|
|
58
|
-
context?: TOutContext;
|
|
59
|
-
} : {
|
|
60
|
-
context: TOutContext;
|
|
61
|
-
};
|
|
62
58
|
interface MiddlewareNextFn<TOutput> {
|
|
63
|
-
<U extends Context =
|
|
59
|
+
<U extends Context = {}>(options?: {
|
|
60
|
+
context?: U;
|
|
61
|
+
}): MiddlewareResult<U, TOutput>;
|
|
64
62
|
}
|
|
65
63
|
interface MiddlewareOutputFn<TOutput> {
|
|
66
64
|
(output: TOutput): MiddlewareResult<Record<never, never>, TOutput>;
|
|
67
65
|
}
|
|
68
|
-
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
|
|
69
|
-
context: TInContext;
|
|
70
|
-
path: readonly string[];
|
|
71
|
-
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
72
|
-
signal?: AbortSignal;
|
|
73
|
-
lastEventId: string | undefined;
|
|
66
|
+
interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> extends ProcedureHandlerOptions<TInContext, TErrorConstructorMap, TMeta> {
|
|
74
67
|
next: MiddlewareNextFn<TOutput>;
|
|
75
|
-
errors: TErrorConstructorMap;
|
|
76
68
|
}
|
|
77
69
|
/**
|
|
78
70
|
* A function that represents a middleware.
|
|
@@ -207,18 +199,12 @@ declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
|
207
199
|
}>;
|
|
208
200
|
|
|
209
201
|
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas, TErrorMap extends ErrorMap> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>, ErrorFromErrorMap<TErrorMap>>;
|
|
210
|
-
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
211
|
-
context: TInitialContext;
|
|
202
|
+
interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends ProcedureHandlerOptions<TInitialContext, ORPCErrorConstructorMap<TErrorMap>, TMeta> {
|
|
212
203
|
input: {
|
|
213
204
|
path: unknown;
|
|
214
205
|
query: unknown;
|
|
215
206
|
body: unknown;
|
|
216
207
|
};
|
|
217
|
-
errors: ORPCErrorConstructorMap<TErrorMap>;
|
|
218
|
-
path: readonly string[];
|
|
219
|
-
procedure: Procedure<Context, Context, Schemas, ErrorMap, TMeta>;
|
|
220
|
-
signal?: AbortSignal;
|
|
221
|
-
lastEventId: string | undefined;
|
|
222
208
|
}
|
|
223
209
|
type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext> = {
|
|
224
210
|
/**
|
|
@@ -238,5 +224,5 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
|
|
|
238
224
|
*/
|
|
239
225
|
declare function createProcedureClient<TInitialContext extends Context, TSchemas extends Schemas, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TSchemas['outputSchema'], TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TSchemas, TErrorMap>;
|
|
240
226
|
|
|
241
|
-
export {
|
|
242
|
-
export type { AnyMiddleware as A, Context as C,
|
|
227
|
+
export { resolveContractProcedures as $, isProcedure as F, createProcedureClient as H, Procedure as P, getRouter as S, createAccessibleLazyRouter as U, enhanceRouter as V, traverseContractProcedures as _, unlazyRouter as a1, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazyInternal as q, lazy as r, isLazy as s, getLazyMeta as t, unlazy as u, middlewareOutputFn as z };
|
|
228
|
+
export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, EnhanceRouterOptions as E, ProcedureClientInterceptorOptions as G, InferRouterInitialContext as I, InferRouterInitialContexts as J, InferRouterCurrentContexts as K, Lazy as L, Middleware as M, InferRouterInputs as N, ORPCErrorConstructorMap as O, InferRouterOutputs as Q, Router as R, AccessibleLazyRouter as T, TraverseContractProceduresOptions as W, TraverseContractProcedureCallbackOptions as X, ContractProcedureCallbackOptions as Y, LazyTraverseContractProceduresOptions as Z, CreateProcedureClientOptions as a, UnlaziedRouter as a0, ProcedureClient as b, MergedInitialContext as c, MergedCurrentContext as d, ProcedureHandler as e, EnhancedRouter as f, MapInputMiddleware as g, AnyProcedure as h, Lazyable as i, AnyRouter as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as v, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { stringifyJSON, isObject, isORPCErrorStatus, tryDecodeURIComponent, 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.
|
|
4
|
-
import { fallbackContractConfig } from '@temporary-name/contract';
|
|
5
|
-
import { d as deserialize, b as bracketNotationDeserialize, s as serialize
|
|
3
|
+
import { c as createProcedureClient } from './server.DmGicgbG.mjs';
|
|
4
|
+
import { fallbackContractConfig, standardizeHTTPPath } from '@temporary-name/contract';
|
|
5
|
+
import { d as deserialize, b as bracketNotationDeserialize, s as serialize } from './server.JtIZ8YG7.mjs';
|
|
6
6
|
import { traverseContractProcedures, isProcedure, getLazyMeta, unlazy, getRouter, createContractedProcedure } from '@temporary-name/server';
|
|
7
7
|
import { createRouter, addRoute, findRoute } from 'rou3';
|
|
8
8
|
|
|
@@ -221,6 +221,7 @@ class StandardHandler {
|
|
|
221
221
|
});
|
|
222
222
|
step = "call_procedure";
|
|
223
223
|
const output = await client(input, {
|
|
224
|
+
request: request2,
|
|
224
225
|
signal: request2.signal,
|
|
225
226
|
lastEventId: flattenHeader(request2.headers["last-event-id"])
|
|
226
227
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@temporary-name/contract';
|
|
2
|
-
import { HTTPPath, Interceptor } from '@temporary-name/shared';
|
|
3
|
-
import {
|
|
4
|
-
import { C as Context, R as Router, H as ProcedureClientInterceptorOptions } from './server.DecvGKtb.js';
|
|
2
|
+
import { HTTPPath, StandardLazyRequest, Interceptor, StandardResponse } from '@temporary-name/shared';
|
|
3
|
+
import { C as Context, R as Router, G as ProcedureClientInterceptorOptions } from './server.BL2R5jcp.mjs';
|
|
5
4
|
|
|
6
5
|
interface StandardHandlerPlugin<T extends Context> {
|
|
7
6
|
order?: number;
|
|
@@ -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.BL2R5jcp.js';
|
|
3
|
+
import { c as StandardHandleOptions } from './server.DpoO_ER_.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,6 @@
|
|
|
1
1
|
import { Meta } from '@temporary-name/contract';
|
|
2
|
-
import { HTTPPath, Interceptor } from '@temporary-name/shared';
|
|
3
|
-
import {
|
|
4
|
-
import { C as Context, R as Router, H as ProcedureClientInterceptorOptions } from './server.DecvGKtb.mjs';
|
|
2
|
+
import { HTTPPath, StandardLazyRequest, Interceptor, StandardResponse } from '@temporary-name/shared';
|
|
3
|
+
import { C as Context, R as Router, G as ProcedureClientInterceptorOptions } from './server.BL2R5jcp.js';
|
|
5
4
|
|
|
6
5
|
interface StandardHandlerPlugin<T extends Context> {
|
|
7
6
|
order?: number;
|
|
@@ -234,14 +234,4 @@ function deserialize(data) {
|
|
|
234
234
|
return data;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
|
|
239
|
-
}
|
|
240
|
-
function getDynamicParams(path) {
|
|
241
|
-
return path ? standardizeHTTPPath(path).match(/\/\{[^}]+\}/g)?.map((v) => ({
|
|
242
|
-
raw: v,
|
|
243
|
-
name: v.match(/\{\+?([^}]+)\}/)[1]
|
|
244
|
-
})) : void 0;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { standardizeHTTPPath as a, bracketNotationDeserialize as b, deserialize as d, getDynamicParams as g, jsonSerialize as j, serialize as s };
|
|
237
|
+
export { bracketNotationDeserialize as b, deserialize as d, jsonSerialize as j, serialize as s };
|
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.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
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/contract": "1.9.3-alpha.
|
|
77
|
-
"@temporary-name/
|
|
78
|
-
"@temporary-name/
|
|
79
|
-
"@temporary-name/shared": "1.9.3-alpha.
|
|
80
|
-
"@temporary-name/standard-server": "1.9.3-alpha.
|
|
81
|
-
"@temporary-name/standard-server-
|
|
82
|
-
"@temporary-name/standard-server
|
|
83
|
-
"@temporary-name/standard-server-node": "1.9.3-alpha.
|
|
84
|
-
"@temporary-name/zod": "1.9.3-alpha.
|
|
76
|
+
"@temporary-name/contract": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
77
|
+
"@temporary-name/json-schema": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
78
|
+
"@temporary-name/interop": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
79
|
+
"@temporary-name/shared": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
80
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
81
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
82
|
+
"@temporary-name/standard-server": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
83
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6",
|
|
84
|
+
"@temporary-name/zod": "1.9.3-alpha.21b0289906d115f2f3db137ea407a6d8d50b5ad6"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/supertest": "^6.0.3",
|