@orpc/server 0.0.0-next.1b15515 → 0.0.0-next.1d3318c
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 +4 -5
- package/dist/adapters/fetch/index.d.ts +4 -5
- package/dist/adapters/fetch/index.mjs +4 -4
- package/dist/adapters/hono/index.d.mts +2 -3
- package/dist/adapters/hono/index.d.ts +2 -3
- package/dist/adapters/hono/index.mjs +4 -4
- package/dist/adapters/next/index.d.mts +2 -3
- package/dist/adapters/next/index.d.ts +2 -3
- package/dist/adapters/next/index.mjs +4 -4
- package/dist/adapters/node/index.d.mts +4 -5
- package/dist/adapters/node/index.d.ts +4 -5
- package/dist/adapters/node/index.mjs +12 -9
- package/dist/adapters/standard/index.d.mts +8 -12
- package/dist/adapters/standard/index.d.ts +8 -12
- package/dist/adapters/standard/index.mjs +2 -3
- package/dist/index.d.mts +113 -103
- package/dist/index.d.ts +113 -103
- package/dist/index.mjs +31 -25
- package/dist/plugins/index.d.mts +6 -6
- package/dist/plugins/index.d.ts +6 -6
- package/dist/shared/{server.BBGuTxHE.mjs → server.3cSam35R.mjs} +11 -16
- package/dist/shared/{server.V6zT5iYQ.mjs → server.BFBhsdJr.mjs} +118 -152
- package/dist/shared/{server.D86dtDX_.d.mts → server.BZRSVRDu.d.ts} +14 -14
- package/dist/shared/server.CPteJIPP.d.mts +143 -0
- package/dist/shared/server.CPteJIPP.d.ts +143 -0
- package/dist/shared/server.CjB_m7jG.mjs +28 -0
- package/dist/shared/{server.dPmfqnQI.d.ts → server.iM8li30u.d.mts} +14 -14
- package/package.json +7 -7
- package/dist/shared/server.B_cAGti1.d.mts +0 -9
- package/dist/shared/server.CUE4Aija.mjs +0 -24
- package/dist/shared/server.Cn9ybJtE.d.mts +0 -152
- package/dist/shared/server.Cn9ybJtE.d.ts +0 -152
- package/dist/shared/server.CynXWJja.d.ts +0 -9
@@ -1,8 +1,7 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.B_cAGti1.mjs';
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CPteJIPP.mjs';
|
4
|
+
import { S as StandardHandleOptions, b as StandardHandlerOptions } from '../../shared/server.iM8li30u.mjs';
|
6
5
|
import '@orpc/client';
|
7
6
|
import '@orpc/contract';
|
8
7
|
import '@orpc/standard-server';
|
@@ -20,8 +19,8 @@ interface FetchHandler<T extends Context> {
|
|
20
19
|
|
21
20
|
declare class RPCHandler<T extends Context> implements FetchHandler<T> {
|
22
21
|
private readonly standardHandler;
|
23
|
-
constructor(router: Router<
|
24
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
22
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardHandlerOptions<T>>);
|
23
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
25
24
|
}
|
26
25
|
|
27
26
|
export { type FetchHandleResult, type FetchHandler, RPCHandler };
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.CynXWJja.js';
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CPteJIPP.js';
|
4
|
+
import { S as StandardHandleOptions, b as StandardHandlerOptions } from '../../shared/server.BZRSVRDu.js';
|
6
5
|
import '@orpc/client';
|
7
6
|
import '@orpc/contract';
|
8
7
|
import '@orpc/standard-server';
|
@@ -20,8 +19,8 @@ interface FetchHandler<T extends Context> {
|
|
20
19
|
|
21
20
|
declare class RPCHandler<T extends Context> implements FetchHandler<T> {
|
22
21
|
private readonly standardHandler;
|
23
|
-
constructor(router: Router<
|
24
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
22
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardHandlerOptions<T>>);
|
23
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
25
24
|
}
|
26
25
|
|
27
26
|
export { type FetchHandleResult, type FetchHandler, RPCHandler };
|
@@ -1,9 +1,9 @@
|
|
1
|
-
export { R as RPCHandler } from '../../shared/server.
|
1
|
+
export { R as RPCHandler } from '../../shared/server.CjB_m7jG.mjs';
|
2
|
+
import '@orpc/client/standard';
|
2
3
|
import '@orpc/standard-server-fetch';
|
3
|
-
import '../../shared/server.
|
4
|
+
import '../../shared/server.3cSam35R.mjs';
|
4
5
|
import '@orpc/client';
|
5
6
|
import '@orpc/shared';
|
6
7
|
import '../../shared/server.Q6ZmnTgO.mjs';
|
7
|
-
import '../../shared/server.
|
8
|
+
import '../../shared/server.BFBhsdJr.mjs';
|
8
9
|
import '@orpc/contract';
|
9
|
-
import '@orpc/client/standard';
|
@@ -2,10 +2,9 @@ import { FetchHandler } from '../fetch/index.mjs';
|
|
2
2
|
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
|
-
import { C as Context } from '../../shared/server.
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
+
import { C as Context } from '../../shared/server.CPteJIPP.mjs';
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.iM8li30u.mjs';
|
7
7
|
import '@orpc/standard-server-fetch';
|
8
|
-
import '../../shared/server.B_cAGti1.mjs';
|
9
8
|
import '@orpc/client';
|
10
9
|
import '@orpc/contract';
|
11
10
|
import '@orpc/standard-server';
|
@@ -2,10 +2,9 @@ import { FetchHandler } from '../fetch/index.js';
|
|
2
2
|
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
|
-
import { C as Context } from '../../shared/server.
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
+
import { C as Context } from '../../shared/server.CPteJIPP.js';
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.BZRSVRDu.js';
|
7
7
|
import '@orpc/standard-server-fetch';
|
8
|
-
import '../../shared/server.CynXWJja.js';
|
9
8
|
import '@orpc/client';
|
10
9
|
import '@orpc/contract';
|
11
10
|
import '@orpc/standard-server';
|
@@ -1,12 +1,12 @@
|
|
1
|
-
export { R as RPCHandler } from '../../shared/server.
|
1
|
+
export { R as RPCHandler } from '../../shared/server.CjB_m7jG.mjs';
|
2
2
|
import { value } from '@orpc/shared';
|
3
|
+
import '@orpc/client/standard';
|
3
4
|
import '@orpc/standard-server-fetch';
|
4
|
-
import '../../shared/server.
|
5
|
+
import '../../shared/server.3cSam35R.mjs';
|
5
6
|
import '@orpc/client';
|
6
7
|
import '../../shared/server.Q6ZmnTgO.mjs';
|
7
|
-
import '../../shared/server.
|
8
|
+
import '../../shared/server.BFBhsdJr.mjs';
|
8
9
|
import '@orpc/contract';
|
9
|
-
import '@orpc/client/standard';
|
10
10
|
|
11
11
|
function createMiddleware(handler, ...[options]) {
|
12
12
|
return async (c, next) => {
|
@@ -2,10 +2,9 @@ import { FetchHandler } from '../fetch/index.mjs';
|
|
2
2
|
export { FetchHandleResult, RPCHandler } from '../fetch/index.mjs';
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
4
4
|
import { NextRequest } from 'next/server';
|
5
|
-
import { C as Context } from '../../shared/server.
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
+
import { C as Context } from '../../shared/server.CPteJIPP.mjs';
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.iM8li30u.mjs';
|
7
7
|
import '@orpc/standard-server-fetch';
|
8
|
-
import '../../shared/server.B_cAGti1.mjs';
|
9
8
|
import '@orpc/client';
|
10
9
|
import '@orpc/contract';
|
11
10
|
import '@orpc/standard-server';
|
@@ -2,10 +2,9 @@ import { FetchHandler } from '../fetch/index.js';
|
|
2
2
|
export { FetchHandleResult, RPCHandler } from '../fetch/index.js';
|
3
3
|
import { Value, MaybeOptionalOptions } from '@orpc/shared';
|
4
4
|
import { NextRequest } from 'next/server';
|
5
|
-
import { C as Context } from '../../shared/server.
|
6
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
+
import { C as Context } from '../../shared/server.CPteJIPP.js';
|
6
|
+
import { S as StandardHandleOptions } from '../../shared/server.BZRSVRDu.js';
|
7
7
|
import '@orpc/standard-server-fetch';
|
8
|
-
import '../../shared/server.CynXWJja.js';
|
9
8
|
import '@orpc/client';
|
10
9
|
import '@orpc/contract';
|
11
10
|
import '@orpc/standard-server';
|
@@ -1,12 +1,12 @@
|
|
1
|
-
export { R as RPCHandler } from '../../shared/server.
|
1
|
+
export { R as RPCHandler } from '../../shared/server.CjB_m7jG.mjs';
|
2
2
|
import { value } from '@orpc/shared';
|
3
|
+
import '@orpc/client/standard';
|
3
4
|
import '@orpc/standard-server-fetch';
|
4
|
-
import '../../shared/server.
|
5
|
+
import '../../shared/server.3cSam35R.mjs';
|
5
6
|
import '@orpc/client';
|
6
7
|
import '../../shared/server.Q6ZmnTgO.mjs';
|
7
|
-
import '../../shared/server.
|
8
|
+
import '../../shared/server.BFBhsdJr.mjs';
|
8
9
|
import '@orpc/contract';
|
9
|
-
import '@orpc/client/standard';
|
10
10
|
|
11
11
|
function serve(handler, ...[options]) {
|
12
12
|
const main = async (req) => {
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { SendStandardResponseOptions } from '@orpc/standard-server-node';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.B_cAGti1.mjs';
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CPteJIPP.mjs';
|
4
|
+
import { S as StandardHandleOptions, b as StandardHandlerOptions } from '../../shared/server.iM8li30u.mjs';
|
6
5
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
7
6
|
import { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
|
8
7
|
import '@orpc/client';
|
@@ -28,8 +27,8 @@ interface NodeHttpHandler<T extends Context> {
|
|
28
27
|
|
29
28
|
declare class RPCHandler<T extends Context> implements NodeHttpHandler<T> {
|
30
29
|
private readonly standardHandler;
|
31
|
-
constructor(router: Router<
|
32
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
30
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardHandlerOptions<T>>);
|
31
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
33
32
|
}
|
34
33
|
|
35
34
|
export { type NodeHttpHandleResult, type NodeHttpHandler, type NodeHttpRequest, type NodeHttpResponse, RPCHandler };
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { SendStandardResponseOptions } from '@orpc/standard-server-node';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import { S as StandardHandleOptions } from '../../shared/server.
|
5
|
-
import { R as RPCHandlerOptions } from '../../shared/server.CynXWJja.js';
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CPteJIPP.js';
|
4
|
+
import { S as StandardHandleOptions, b as StandardHandlerOptions } from '../../shared/server.BZRSVRDu.js';
|
6
5
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
7
6
|
import { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
|
8
7
|
import '@orpc/client';
|
@@ -28,8 +27,8 @@ interface NodeHttpHandler<T extends Context> {
|
|
28
27
|
|
29
28
|
declare class RPCHandler<T extends Context> implements NodeHttpHandler<T> {
|
30
29
|
private readonly standardHandler;
|
31
|
-
constructor(router: Router<
|
32
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
30
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardHandlerOptions<T>>);
|
31
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
33
32
|
}
|
34
33
|
|
35
34
|
export { type NodeHttpHandleResult, type NodeHttpHandler, type NodeHttpRequest, type NodeHttpResponse, RPCHandler };
|
@@ -1,21 +1,24 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { RPCSerializer } from '@orpc/client/standard';
|
2
|
+
import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-node';
|
3
|
+
import { S as StandardHandler, a as RPCMatcher, R as RPCCodec } from '../../shared/server.3cSam35R.mjs';
|
3
4
|
import '@orpc/client';
|
4
5
|
import '@orpc/shared';
|
5
6
|
import '../../shared/server.Q6ZmnTgO.mjs';
|
6
|
-
import '../../shared/server.
|
7
|
+
import '../../shared/server.BFBhsdJr.mjs';
|
7
8
|
import '@orpc/contract';
|
8
|
-
import '@orpc/client/standard';
|
9
9
|
|
10
10
|
class RPCHandler {
|
11
11
|
standardHandler;
|
12
|
-
constructor(router, options) {
|
13
|
-
const
|
14
|
-
const matcher =
|
12
|
+
constructor(router, options = {}) {
|
13
|
+
const serializer = new RPCSerializer();
|
14
|
+
const matcher = new RPCMatcher();
|
15
|
+
const codec = new RPCCodec(serializer);
|
15
16
|
this.standardHandler = new StandardHandler(router, matcher, codec, options);
|
16
17
|
}
|
17
|
-
async handle(req, res, ...[
|
18
|
-
|
18
|
+
async handle(req, res, ...[
|
19
|
+
options = {}
|
20
|
+
]) {
|
21
|
+
const standardRequest = toStandardLazyRequest(req, res);
|
19
22
|
const result = await this.standardHandler.handle(standardRequest, options);
|
20
23
|
if (!result.matched) {
|
21
24
|
return { matched: false };
|
@@ -1,20 +1,16 @@
|
|
1
|
-
import { c as StandardCodec,
|
2
|
-
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler,
|
1
|
+
import { c as StandardCodec, d as StandardParams, e as StandardMatcher, f as StandardMatchResult } from '../../shared/server.iM8li30u.mjs';
|
2
|
+
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, a as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.iM8li30u.mjs';
|
3
3
|
import { ORPCError } from '@orpc/client';
|
4
|
-
import { StandardRequest, StandardResponse } from '@orpc/standard-server';
|
5
|
-
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.Cn9ybJtE.mjs';
|
6
4
|
import { RPCSerializer } from '@orpc/client/standard';
|
7
|
-
|
5
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
6
|
+
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.CPteJIPP.mjs';
|
8
7
|
import { HTTPPath } from '@orpc/contract';
|
9
8
|
import '@orpc/shared';
|
10
9
|
|
11
|
-
interface StandardCodecOptions {
|
12
|
-
serializer?: RPCSerializer;
|
13
|
-
}
|
14
10
|
declare class RPCCodec implements StandardCodec {
|
15
11
|
private readonly serializer;
|
16
|
-
constructor(
|
17
|
-
decode(request:
|
12
|
+
constructor(serializer: RPCSerializer);
|
13
|
+
decode(request: StandardLazyRequest, _params: StandardParams | undefined, _procedure: AnyProcedure): Promise<unknown>;
|
18
14
|
encode(output: unknown, _procedure: AnyProcedure): StandardResponse;
|
19
15
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
20
16
|
}
|
@@ -22,8 +18,8 @@ declare class RPCCodec implements StandardCodec {
|
|
22
18
|
declare class RPCMatcher implements StandardMatcher {
|
23
19
|
private readonly tree;
|
24
20
|
private pendingRouters;
|
25
|
-
init(router: AnyRouter, path?: string[]): void;
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
26
22
|
match(_method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
27
23
|
}
|
28
24
|
|
29
|
-
export { RPCCodec, RPCMatcher, StandardCodec,
|
25
|
+
export { RPCCodec, RPCMatcher, StandardCodec, StandardMatchResult, StandardMatcher, StandardParams };
|
@@ -1,20 +1,16 @@
|
|
1
|
-
import { c as StandardCodec,
|
2
|
-
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler,
|
1
|
+
import { c as StandardCodec, d as StandardParams, e as StandardMatcher, f as StandardMatchResult } from '../../shared/server.BZRSVRDu.js';
|
2
|
+
export { S as StandardHandleOptions, g as StandardHandleResult, h as StandardHandler, a as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, W as WellStandardHandleOptions } from '../../shared/server.BZRSVRDu.js';
|
3
3
|
import { ORPCError } from '@orpc/client';
|
4
|
-
import { StandardRequest, StandardResponse } from '@orpc/standard-server';
|
5
|
-
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.Cn9ybJtE.js';
|
6
4
|
import { RPCSerializer } from '@orpc/client/standard';
|
7
|
-
|
5
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
6
|
+
import { A as AnyProcedure, a as AnyRouter } from '../../shared/server.CPteJIPP.js';
|
8
7
|
import { HTTPPath } from '@orpc/contract';
|
9
8
|
import '@orpc/shared';
|
10
9
|
|
11
|
-
interface StandardCodecOptions {
|
12
|
-
serializer?: RPCSerializer;
|
13
|
-
}
|
14
10
|
declare class RPCCodec implements StandardCodec {
|
15
11
|
private readonly serializer;
|
16
|
-
constructor(
|
17
|
-
decode(request:
|
12
|
+
constructor(serializer: RPCSerializer);
|
13
|
+
decode(request: StandardLazyRequest, _params: StandardParams | undefined, _procedure: AnyProcedure): Promise<unknown>;
|
18
14
|
encode(output: unknown, _procedure: AnyProcedure): StandardResponse;
|
19
15
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
20
16
|
}
|
@@ -22,8 +18,8 @@ declare class RPCCodec implements StandardCodec {
|
|
22
18
|
declare class RPCMatcher implements StandardMatcher {
|
23
19
|
private readonly tree;
|
24
20
|
private pendingRouters;
|
25
|
-
init(router: AnyRouter, path?: string[]): void;
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
26
22
|
match(_method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
27
23
|
}
|
28
24
|
|
29
|
-
export { RPCCodec, RPCMatcher, StandardCodec,
|
25
|
+
export { RPCCodec, RPCMatcher, StandardCodec, StandardMatchResult, StandardMatcher, StandardParams };
|
@@ -1,7 +1,6 @@
|
|
1
|
-
export { R as RPCCodec, a as RPCMatcher, S as StandardHandler } from '../../shared/server.
|
1
|
+
export { R as RPCCodec, a as RPCMatcher, S as StandardHandler } from '../../shared/server.3cSam35R.mjs';
|
2
2
|
import '@orpc/client';
|
3
3
|
import '@orpc/shared';
|
4
4
|
import '../../shared/server.Q6ZmnTgO.mjs';
|
5
|
-
import '../../shared/server.
|
5
|
+
import '../../shared/server.BFBhsdJr.mjs';
|
6
6
|
import '@orpc/contract';
|
7
|
-
import '@orpc/client/standard';
|