@orpc/server 0.45.0 → 0.46.0
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/fetch/index.d.mts +3 -3
- package/dist/adapters/fetch/index.d.ts +3 -3
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/hono/index.d.mts +2 -2
- package/dist/adapters/hono/index.d.ts +2 -2
- package/dist/adapters/hono/index.mjs +1 -1
- package/dist/adapters/next/index.d.mts +2 -2
- package/dist/adapters/next/index.d.ts +2 -2
- package/dist/adapters/next/index.mjs +1 -1
- package/dist/adapters/node/index.d.mts +3 -3
- package/dist/adapters/node/index.d.ts +3 -3
- package/dist/adapters/node/index.mjs +5 -3
- package/dist/adapters/standard/index.d.mts +5 -5
- package/dist/adapters/standard/index.d.ts +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{server.dPmfqnQI.d.ts → server.B-ewprcf.d.ts} +4 -4
- package/dist/shared/{server.B_cAGti1.d.mts → server.CA-o8cUY.d.mts} +1 -1
- package/dist/shared/{server.D86dtDX_.d.mts → server.DJrh0Ceu.d.mts} +4 -4
- package/dist/shared/{server.CynXWJja.d.ts → server.DPQt9YYq.d.ts} +1 -1
- package/dist/shared/{server.CUE4Aija.mjs → server.KwueCzFr.mjs} +5 -3
- package/package.json +7 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
|
3
3
|
import { C as Context, R as Router } from '../../shared/server.Cn9ybJtE.mjs';
|
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.
|
|
4
|
+
import { S as StandardHandleOptions } from '../../shared/server.DJrh0Ceu.mjs';
|
|
5
|
+
import { R as RPCHandlerOptions } from '../../shared/server.CA-o8cUY.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
import '@orpc/standard-server';
|
|
@@ -21,7 +21,7 @@ interface FetchHandler<T extends Context> {
|
|
|
21
21
|
declare class RPCHandler<T extends Context> implements FetchHandler<T> {
|
|
22
22
|
private readonly standardHandler;
|
|
23
23
|
constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
24
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
|
24
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { type FetchHandleResult, type FetchHandler, RPCHandler };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
|
3
3
|
import { C as Context, R as Router } from '../../shared/server.Cn9ybJtE.js';
|
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.
|
|
4
|
+
import { S as StandardHandleOptions } from '../../shared/server.B-ewprcf.js';
|
|
5
|
+
import { R as RPCHandlerOptions } from '../../shared/server.DPQt9YYq.js';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
import '@orpc/standard-server';
|
|
@@ -21,7 +21,7 @@ interface FetchHandler<T extends Context> {
|
|
|
21
21
|
declare class RPCHandler<T extends Context> implements FetchHandler<T> {
|
|
22
22
|
private readonly standardHandler;
|
|
23
23
|
constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
24
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
|
24
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { type FetchHandleResult, type FetchHandler, RPCHandler };
|
|
@@ -3,9 +3,9 @@ export { FetchHandleResult, RPCHandler } from '../fetch/index.mjs';
|
|
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
import { Context as Context$1, MiddlewareHandler } from 'hono';
|
|
5
5
|
import { C as Context } from '../../shared/server.Cn9ybJtE.mjs';
|
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.DJrh0Ceu.mjs';
|
|
7
7
|
import '@orpc/standard-server-fetch';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.CA-o8cUY.mjs';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
import '@orpc/contract';
|
|
11
11
|
import '@orpc/standard-server';
|
|
@@ -3,9 +3,9 @@ export { FetchHandleResult, RPCHandler } from '../fetch/index.js';
|
|
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
import { Context as Context$1, MiddlewareHandler } from 'hono';
|
|
5
5
|
import { C as Context } from '../../shared/server.Cn9ybJtE.js';
|
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.B-ewprcf.js';
|
|
7
7
|
import '@orpc/standard-server-fetch';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.DPQt9YYq.js';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
import '@orpc/contract';
|
|
11
11
|
import '@orpc/standard-server';
|
|
@@ -3,9 +3,9 @@ export { FetchHandleResult, RPCHandler } from '../fetch/index.mjs';
|
|
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
import { NextRequest } from 'next/server';
|
|
5
5
|
import { C as Context } from '../../shared/server.Cn9ybJtE.mjs';
|
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.DJrh0Ceu.mjs';
|
|
7
7
|
import '@orpc/standard-server-fetch';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.CA-o8cUY.mjs';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
import '@orpc/contract';
|
|
11
11
|
import '@orpc/standard-server';
|
|
@@ -3,9 +3,9 @@ export { FetchHandleResult, RPCHandler } from '../fetch/index.js';
|
|
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
|
4
4
|
import { NextRequest } from 'next/server';
|
|
5
5
|
import { C as Context } from '../../shared/server.Cn9ybJtE.js';
|
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.B-ewprcf.js';
|
|
7
7
|
import '@orpc/standard-server-fetch';
|
|
8
|
-
import '../../shared/server.
|
|
8
|
+
import '../../shared/server.DPQt9YYq.js';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
import '@orpc/contract';
|
|
11
11
|
import '@orpc/standard-server';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { SendStandardResponseOptions } from '@orpc/standard-server-node';
|
|
3
3
|
import { C as Context, R as Router } from '../../shared/server.Cn9ybJtE.mjs';
|
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.
|
|
4
|
+
import { S as StandardHandleOptions } from '../../shared/server.DJrh0Ceu.mjs';
|
|
5
|
+
import { R as RPCHandlerOptions } from '../../shared/server.CA-o8cUY.mjs';
|
|
6
6
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
7
|
import { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
|
|
8
8
|
import '@orpc/client';
|
|
@@ -29,7 +29,7 @@ interface NodeHttpHandler<T extends Context> {
|
|
|
29
29
|
declare class RPCHandler<T extends Context> implements NodeHttpHandler<T> {
|
|
30
30
|
private readonly standardHandler;
|
|
31
31
|
constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
32
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
|
32
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export { type NodeHttpHandleResult, type NodeHttpHandler, type NodeHttpRequest, type NodeHttpResponse, RPCHandler };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
2
|
import { SendStandardResponseOptions } from '@orpc/standard-server-node';
|
|
3
3
|
import { C as Context, R as Router } from '../../shared/server.Cn9ybJtE.js';
|
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.
|
|
4
|
+
import { S as StandardHandleOptions } from '../../shared/server.B-ewprcf.js';
|
|
5
|
+
import { R as RPCHandlerOptions } from '../../shared/server.DPQt9YYq.js';
|
|
6
6
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
7
|
import { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
|
|
8
8
|
import '@orpc/client';
|
|
@@ -29,7 +29,7 @@ interface NodeHttpHandler<T extends Context> {
|
|
|
29
29
|
declare class RPCHandler<T extends Context> implements NodeHttpHandler<T> {
|
|
30
30
|
private readonly standardHandler;
|
|
31
31
|
constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
32
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
|
32
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export { type NodeHttpHandleResult, type NodeHttpHandler, type NodeHttpRequest, type NodeHttpResponse, RPCHandler };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-node';
|
|
2
2
|
import { R as RPCCodec, a as RPCMatcher, S as StandardHandler } from '../../shared/server.BBGuTxHE.mjs';
|
|
3
3
|
import '@orpc/client';
|
|
4
4
|
import '@orpc/shared';
|
|
@@ -14,8 +14,10 @@ class RPCHandler {
|
|
|
14
14
|
const matcher = options?.matcher ?? new RPCMatcher();
|
|
15
15
|
this.standardHandler = new StandardHandler(router, matcher, codec, options);
|
|
16
16
|
}
|
|
17
|
-
async handle(req, res, ...[
|
|
18
|
-
|
|
17
|
+
async handle(req, res, ...[
|
|
18
|
+
options = {}
|
|
19
|
+
]) {
|
|
20
|
+
const standardRequest = toStandardLazyRequest(req, res);
|
|
19
21
|
const result = await this.standardHandler.handle(standardRequest, options);
|
|
20
22
|
if (!result.matched) {
|
|
21
23
|
return { matched: false };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as StandardCodec, e as StandardParams, b as StandardMatcher, f as StandardMatchResult } from '../../shared/server.
|
|
2
|
-
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, d as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.
|
|
1
|
+
import { c as StandardCodec, e as StandardParams, b as StandardMatcher, f as StandardMatchResult } from '../../shared/server.DJrh0Ceu.mjs';
|
|
2
|
+
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, d as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.DJrh0Ceu.mjs';
|
|
3
3
|
import { ORPCError } from '@orpc/client';
|
|
4
|
-
import {
|
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
|
5
5
|
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.Cn9ybJtE.mjs';
|
|
6
6
|
import { RPCSerializer } from '@orpc/client/standard';
|
|
7
|
-
export { R as RPCHandlerOptions } from '../../shared/server.
|
|
7
|
+
export { R as RPCHandlerOptions } from '../../shared/server.CA-o8cUY.mjs';
|
|
8
8
|
import { HTTPPath } from '@orpc/contract';
|
|
9
9
|
import '@orpc/shared';
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ interface StandardCodecOptions {
|
|
|
14
14
|
declare class RPCCodec implements StandardCodec {
|
|
15
15
|
private readonly serializer;
|
|
16
16
|
constructor(options?: StandardCodecOptions);
|
|
17
|
-
decode(request:
|
|
17
|
+
decode(request: StandardLazyRequest, _params: StandardParams | undefined, _procedure: AnyProcedure): Promise<unknown>;
|
|
18
18
|
encode(output: unknown, _procedure: AnyProcedure): StandardResponse;
|
|
19
19
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
20
20
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as StandardCodec, e as StandardParams, b as StandardMatcher, f as StandardMatchResult } from '../../shared/server.
|
|
2
|
-
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, d as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.
|
|
1
|
+
import { c as StandardCodec, e as StandardParams, b as StandardMatcher, f as StandardMatchResult } from '../../shared/server.B-ewprcf.js';
|
|
2
|
+
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, d as StandardHandlerInterceptorOptions, a as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.B-ewprcf.js';
|
|
3
3
|
import { ORPCError } from '@orpc/client';
|
|
4
|
-
import {
|
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
|
5
5
|
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.Cn9ybJtE.js';
|
|
6
6
|
import { RPCSerializer } from '@orpc/client/standard';
|
|
7
|
-
export { R as RPCHandlerOptions } from '../../shared/server.
|
|
7
|
+
export { R as RPCHandlerOptions } from '../../shared/server.DPQt9YYq.js';
|
|
8
8
|
import { HTTPPath } from '@orpc/contract';
|
|
9
9
|
import '@orpc/shared';
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ interface StandardCodecOptions {
|
|
|
14
14
|
declare class RPCCodec implements StandardCodec {
|
|
15
15
|
private readonly serializer;
|
|
16
16
|
constructor(options?: StandardCodecOptions);
|
|
17
|
-
decode(request:
|
|
17
|
+
decode(request: StandardLazyRequest, _params: StandardParams | undefined, _procedure: AnyProcedure): Promise<unknown>;
|
|
18
18
|
encode(output: unknown, _procedure: AnyProcedure): StandardResponse;
|
|
19
19
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
20
20
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema, ErrorMap, Meta, MergedErrorMap, Route, SchemaOutput, SchemaInput, HTTPPath, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, ContractRouterToErrorMap, ContractRouterToMeta, ErrorFromErrorMap, AnyContractProcedure } from '@orpc/contract';
|
|
2
|
-
export { ValidationError, eventIterator, type } from '@orpc/contract';
|
|
2
|
+
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, HTTPMethod, HTTPPath, InputStructure, Meta, ORPCErrorFromErrorMap, OutputStructure, Route, Schema, SchemaInput, SchemaOutput, ValidationError, eventIterator, type } from '@orpc/contract';
|
|
3
3
|
import { L as Lazy, A as AnyProcedure, C as Context, b as Procedure, M as Middleware, O as ORPCErrorConstructorMap, c as ConflictContextGuard, d as MergedContext, e as MapInputMiddleware, f as CreateProcedureClientOptions, g as ProcedureClient, h as ProcedureHandler, i as AdaptRouterOptions, R as Router, j as AdaptedRouter, k as AnyMiddleware, a as AnyRouter, l as Lazyable, I as InferRouterInitialContext } from './shared/server.Cn9ybJtE.mjs';
|
|
4
4
|
export { K as AccessibleLazyRouter, F as InferRouterInputs, G as InferRouterOutputs, n as LAZY_LOADER_SYMBOL, o as LazyMeta, p as LazyOptions, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, P as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, H as adaptRouter, N as createAccessibleLazyRouter, E as createProcedureClient, J as getRouterChild, r as isLazy, D as isProcedure, q as lazy, m as mergeContext, y as middlewareOutputFn, u as unlazy } from './shared/server.Cn9ybJtE.mjs';
|
|
5
5
|
import { ClientContext, ClientRest, ClientPromiseResult } from '@orpc/client';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema, ErrorMap, Meta, MergedErrorMap, Route, SchemaOutput, SchemaInput, HTTPPath, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, ContractRouterToErrorMap, ContractRouterToMeta, ErrorFromErrorMap, AnyContractProcedure } from '@orpc/contract';
|
|
2
|
-
export { ValidationError, eventIterator, type } from '@orpc/contract';
|
|
2
|
+
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, HTTPMethod, HTTPPath, InputStructure, Meta, ORPCErrorFromErrorMap, OutputStructure, Route, Schema, SchemaInput, SchemaOutput, ValidationError, eventIterator, type } from '@orpc/contract';
|
|
3
3
|
import { L as Lazy, A as AnyProcedure, C as Context, b as Procedure, M as Middleware, O as ORPCErrorConstructorMap, c as ConflictContextGuard, d as MergedContext, e as MapInputMiddleware, f as CreateProcedureClientOptions, g as ProcedureClient, h as ProcedureHandler, i as AdaptRouterOptions, R as Router, j as AdaptedRouter, k as AnyMiddleware, a as AnyRouter, l as Lazyable, I as InferRouterInitialContext } from './shared/server.Cn9ybJtE.js';
|
|
4
4
|
export { K as AccessibleLazyRouter, F as InferRouterInputs, G as InferRouterOutputs, n as LAZY_LOADER_SYMBOL, o as LazyMeta, p as LazyOptions, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, P as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, H as adaptRouter, N as createAccessibleLazyRouter, E as createProcedureClient, J as getRouterChild, r as isLazy, D as isProcedure, q as lazy, m as mergeContext, y as middlewareOutputFn, u as unlazy } from './shared/server.Cn9ybJtE.js';
|
|
5
5
|
import { ClientContext, ClientRest, ClientPromiseResult } from '@orpc/client';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as StandardHandlerInterceptorOptions, P as Plugin, a as StandardHandlerOptions } from '../shared/server.
|
|
2
|
-
export { C as CompositePlugin } from '../shared/server.
|
|
1
|
+
import { d as StandardHandlerInterceptorOptions, P as Plugin, a as StandardHandlerOptions } from '../shared/server.DJrh0Ceu.mjs';
|
|
2
|
+
export { C as CompositePlugin } from '../shared/server.DJrh0Ceu.mjs';
|
|
3
3
|
import { Value } from '@orpc/shared';
|
|
4
4
|
import { C as Context } from '../shared/server.Cn9ybJtE.mjs';
|
|
5
5
|
import '@orpc/contract';
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as StandardHandlerInterceptorOptions, P as Plugin, a as StandardHandlerOptions } from '../shared/server.
|
|
2
|
-
export { C as CompositePlugin } from '../shared/server.
|
|
1
|
+
import { d as StandardHandlerInterceptorOptions, P as Plugin, a as StandardHandlerOptions } from '../shared/server.B-ewprcf.js';
|
|
2
|
+
export { C as CompositePlugin } from '../shared/server.B-ewprcf.js';
|
|
3
3
|
import { Value } from '@orpc/shared';
|
|
4
4
|
import { C as Context } from '../shared/server.Cn9ybJtE.js';
|
|
5
5
|
import '@orpc/contract';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTTPPath, Schema, Meta, SchemaOutput, ErrorFromErrorMap } from '@orpc/contract';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
|
3
|
-
import { StandardResponse,
|
|
3
|
+
import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
|
|
4
4
|
import { a as AnyRouter, A as AnyProcedure, C as Context, P as ProcedureClientInterceptorOptions, R as Router } from './server.Cn9ybJtE.js';
|
|
5
5
|
import { ORPCError } from '@orpc/client';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ interface StandardMatcher {
|
|
|
17
17
|
interface StandardCodec {
|
|
18
18
|
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
19
19
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
20
|
-
decode(request:
|
|
20
|
+
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
type StandardHandleOptions<T extends Context> = {
|
|
@@ -38,7 +38,7 @@ type StandardHandleResult = {
|
|
|
38
38
|
response: undefined;
|
|
39
39
|
};
|
|
40
40
|
type StandardHandlerInterceptorOptions<TContext extends Context> = WellStandardHandleOptions<TContext> & {
|
|
41
|
-
request:
|
|
41
|
+
request: StandardLazyRequest;
|
|
42
42
|
};
|
|
43
43
|
interface StandardHandlerOptions<TContext extends Context> {
|
|
44
44
|
plugins?: Plugin<TContext>[];
|
|
@@ -62,7 +62,7 @@ declare class StandardHandler<T extends Context> {
|
|
|
62
62
|
private readonly options;
|
|
63
63
|
private readonly plugin;
|
|
64
64
|
constructor(router: Router<T, any>, matcher: StandardMatcher, codec: StandardCodec, options?: NoInfer<StandardHandlerOptions<T>>);
|
|
65
|
-
handle(request:
|
|
65
|
+
handle(request: StandardLazyRequest, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<StandardHandleResult>;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
interface Plugin<TContext extends Context> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as Context } from './server.Cn9ybJtE.mjs';
|
|
2
|
-
import { a as StandardHandlerOptions, b as StandardMatcher, c as StandardCodec } from './server.
|
|
2
|
+
import { a as StandardHandlerOptions, b as StandardMatcher, c as StandardCodec } from './server.DJrh0Ceu.mjs';
|
|
3
3
|
|
|
4
4
|
interface RPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T> {
|
|
5
5
|
matcher?: StandardMatcher;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTTPPath, Schema, Meta, SchemaOutput, ErrorFromErrorMap } from '@orpc/contract';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
|
3
|
-
import { StandardResponse,
|
|
3
|
+
import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
|
|
4
4
|
import { a as AnyRouter, A as AnyProcedure, C as Context, P as ProcedureClientInterceptorOptions, R as Router } from './server.Cn9ybJtE.mjs';
|
|
5
5
|
import { ORPCError } from '@orpc/client';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ interface StandardMatcher {
|
|
|
17
17
|
interface StandardCodec {
|
|
18
18
|
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
19
19
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
20
|
-
decode(request:
|
|
20
|
+
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
type StandardHandleOptions<T extends Context> = {
|
|
@@ -38,7 +38,7 @@ type StandardHandleResult = {
|
|
|
38
38
|
response: undefined;
|
|
39
39
|
};
|
|
40
40
|
type StandardHandlerInterceptorOptions<TContext extends Context> = WellStandardHandleOptions<TContext> & {
|
|
41
|
-
request:
|
|
41
|
+
request: StandardLazyRequest;
|
|
42
42
|
};
|
|
43
43
|
interface StandardHandlerOptions<TContext extends Context> {
|
|
44
44
|
plugins?: Plugin<TContext>[];
|
|
@@ -62,7 +62,7 @@ declare class StandardHandler<T extends Context> {
|
|
|
62
62
|
private readonly options;
|
|
63
63
|
private readonly plugin;
|
|
64
64
|
constructor(router: Router<T, any>, matcher: StandardMatcher, codec: StandardCodec, options?: NoInfer<StandardHandlerOptions<T>>);
|
|
65
|
-
handle(request:
|
|
65
|
+
handle(request: StandardLazyRequest, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<StandardHandleResult>;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
interface Plugin<TContext extends Context> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as Context } from './server.Cn9ybJtE.js';
|
|
2
|
-
import { a as StandardHandlerOptions, b as StandardMatcher, c as StandardCodec } from './server.
|
|
2
|
+
import { a as StandardHandlerOptions, b as StandardMatcher, c as StandardCodec } from './server.B-ewprcf.js';
|
|
3
3
|
|
|
4
4
|
interface RPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T> {
|
|
5
5
|
matcher?: StandardMatcher;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toStandardLazyRequest, toFetchResponse } from '@orpc/standard-server-fetch';
|
|
2
2
|
import { a as RPCMatcher, R as RPCCodec, S as StandardHandler } from './server.BBGuTxHE.mjs';
|
|
3
3
|
|
|
4
4
|
class RPCHandler {
|
|
@@ -8,8 +8,10 @@ class RPCHandler {
|
|
|
8
8
|
const codec = options?.codec ?? new RPCCodec();
|
|
9
9
|
this.standardHandler = new StandardHandler(router, matcher, codec, options);
|
|
10
10
|
}
|
|
11
|
-
async handle(request, ...[
|
|
12
|
-
|
|
11
|
+
async handle(request, ...[
|
|
12
|
+
options = {}
|
|
13
|
+
]) {
|
|
14
|
+
const standardRequest = toStandardLazyRequest(request);
|
|
13
15
|
const result = await this.standardHandler.handle(standardRequest, options);
|
|
14
16
|
if (!result.matched) {
|
|
15
17
|
return result;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.46.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"next": ">=14.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@orpc/client": "0.
|
|
62
|
-
"@orpc/contract": "0.
|
|
63
|
-
"@orpc/
|
|
64
|
-
"@orpc/standard-server": "0.
|
|
65
|
-
"@orpc/
|
|
66
|
-
"@orpc/standard-server-
|
|
61
|
+
"@orpc/client": "0.46.0",
|
|
62
|
+
"@orpc/contract": "0.46.0",
|
|
63
|
+
"@orpc/standard-server": "0.46.0",
|
|
64
|
+
"@orpc/standard-server-fetch": "0.46.0",
|
|
65
|
+
"@orpc/shared": "0.46.0",
|
|
66
|
+
"@orpc/standard-server-node": "0.46.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"light-my-request": "^6.5.1"
|