@orpc/server 0.0.0-next.e710b76 → 0.0.0-next.e788265
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/README.md +1 -1
- package/dist/adapters/aws-lambda/index.d.mts +7 -6
- package/dist/adapters/aws-lambda/index.d.ts +7 -6
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/bun-ws/index.d.mts +12 -11
- package/dist/adapters/bun-ws/index.d.ts +12 -11
- package/dist/adapters/bun-ws/index.mjs +13 -12
- package/dist/adapters/crossws/index.d.mts +8 -5
- package/dist/adapters/crossws/index.d.ts +8 -5
- package/dist/adapters/crossws/index.mjs +10 -9
- package/dist/adapters/fetch/index.d.mts +5 -4
- package/dist/adapters/fetch/index.d.ts +5 -4
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/message-port/index.d.mts +11 -8
- package/dist/adapters/message-port/index.d.ts +11 -8
- package/dist/adapters/message-port/index.mjs +12 -12
- package/dist/adapters/node/index.d.mts +5 -4
- package/dist/adapters/node/index.d.ts +5 -4
- package/dist/adapters/node/index.mjs +1 -1
- package/dist/adapters/standard/index.d.mts +8 -13
- package/dist/adapters/standard/index.d.ts +8 -13
- package/dist/adapters/standard/index.mjs +2 -1
- package/dist/adapters/standard-peer/index.d.mts +14 -0
- package/dist/adapters/standard-peer/index.d.ts +14 -0
- package/dist/adapters/standard-peer/index.mjs +7 -0
- package/dist/adapters/websocket/index.d.mts +15 -12
- package/dist/adapters/websocket/index.d.ts +15 -12
- package/dist/adapters/websocket/index.mjs +14 -14
- package/dist/adapters/ws/index.d.mts +11 -8
- package/dist/adapters/ws/index.d.ts +11 -8
- package/dist/adapters/ws/index.mjs +14 -14
- package/dist/hibernation/index.d.mts +2 -2
- package/dist/hibernation/index.d.ts +2 -2
- package/dist/index.d.mts +8 -39
- package/dist/index.d.ts +8 -39
- package/dist/index.mjs +1 -1
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/{server.CB8Snncu.mjs → server.Aqc4pYFD.mjs} +11 -3
- package/dist/shared/{server.-ACo36I0.d.ts → server.BX8Iro5z.d.ts} +3 -3
- package/dist/shared/server.Bi2_bIHo.d.ts +42 -0
- package/dist/shared/server.C-F_fMXW.d.mts +32 -0
- package/dist/shared/server.C6Q5sqYw.mjs +20 -0
- package/dist/shared/server.CPC5w4d2.d.ts +32 -0
- package/dist/shared/{server.DD2C4ujN.d.mts → server.CRejaM08.d.mts} +2 -2
- package/dist/shared/{server.DD2C4ujN.d.ts → server.CRejaM08.d.ts} +2 -2
- package/dist/shared/{server.Dq8xr7PQ.d.mts → server.De2J-WNx.d.mts} +3 -3
- package/dist/shared/server.DrG30u7a.d.mts +42 -0
- package/dist/shared/server.VjZAmjFs.d.mts +12 -0
- package/dist/shared/server.mGrd7l1v.d.ts +12 -0
- package/package.json +16 -11
- package/dist/shared/server.BPAWobQg.d.ts +0 -12
- package/dist/shared/server.Bd52nNaH.d.mts +0 -12
- package/dist/shared/server.BliFSTnG.d.mts +0 -10
- package/dist/shared/server.IG2MjhrD.d.ts +0 -10
@@ -1,12 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
export { C as CompositeStandardHandlerPlugin,
|
3
|
-
import { ORPCError
|
1
|
+
import { S as StandardCodec, a as StandardParams } from '../../shared/server.BX8Iro5z.js';
|
2
|
+
export { C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, c as StandardHandleResult, f as StandardHandler, d as StandardHandlerInterceptorOptions, e as StandardHandlerOptions, g as StandardHandlerPlugin, h as StandardMatchResult, i as StandardMatcher } from '../../shared/server.BX8Iro5z.js';
|
3
|
+
import { ORPCError } from '@orpc/client';
|
4
4
|
import { StandardRPCSerializer } from '@orpc/client/standard';
|
5
5
|
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
6
|
-
import {
|
7
|
-
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions } from '../../shared/server.
|
6
|
+
import { A as AnyProcedure } from '../../shared/server.CRejaM08.js';
|
7
|
+
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions, c as StandardRPCMatcher, b as StandardRPCMatcherOptions } from '../../shared/server.CPC5w4d2.js';
|
8
|
+
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.mGrd7l1v.js';
|
8
9
|
import '@orpc/contract';
|
9
10
|
import '@orpc/shared';
|
11
|
+
import '../../shared/server.Bi2_bIHo.js';
|
10
12
|
|
11
13
|
declare class StandardRPCCodec implements StandardCodec {
|
12
14
|
private readonly serializer;
|
@@ -16,11 +18,4 @@ declare class StandardRPCCodec implements StandardCodec {
|
|
16
18
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
17
19
|
}
|
18
20
|
|
19
|
-
|
20
|
-
private readonly tree;
|
21
|
-
private pendingRouters;
|
22
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
23
|
-
match(_method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
24
|
-
}
|
25
|
-
|
26
|
-
export { StandardCodec, StandardMatchResult, StandardMatcher, StandardParams, StandardRPCCodec, StandardRPCMatcher };
|
21
|
+
export { StandardCodec, StandardParams, StandardRPCCodec };
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardRPCCodec, b as StandardRPCHandler, c as StandardRPCMatcher } from '../../shared/server.
|
1
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, a as StandardRPCCodec, b as StandardRPCHandler, c as StandardRPCMatcher } from '../../shared/server.Aqc4pYFD.mjs';
|
2
|
+
export { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
2
3
|
import '@orpc/client/standard';
|
3
4
|
import '@orpc/client';
|
4
5
|
import '@orpc/shared';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ServerPeer, EncodedMessage } from '@orpc/standard-server-peer';
|
2
|
+
import { C as Context } from '../../shared/server.CRejaM08.mjs';
|
3
|
+
import { f as StandardHandler } from '../../shared/server.De2J-WNx.mjs';
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.VjZAmjFs.mjs';
|
5
|
+
import '@orpc/client';
|
6
|
+
import '@orpc/contract';
|
7
|
+
import '@orpc/shared';
|
8
|
+
import '@orpc/standard-server';
|
9
|
+
|
10
|
+
type HandleStandardServerPeerMessageOptions<T extends Context> = Omit<FriendlyStandardHandleOptions<T>, 'prefix'>;
|
11
|
+
declare function handleStandardServerPeerMessage<T extends Context>(handler: StandardHandler<T>, peer: ServerPeer, message: EncodedMessage, options: HandleStandardServerPeerMessageOptions<T>): Promise<void>;
|
12
|
+
|
13
|
+
export { handleStandardServerPeerMessage };
|
14
|
+
export type { HandleStandardServerPeerMessageOptions };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ServerPeer, EncodedMessage } from '@orpc/standard-server-peer';
|
2
|
+
import { C as Context } from '../../shared/server.CRejaM08.js';
|
3
|
+
import { f as StandardHandler } from '../../shared/server.BX8Iro5z.js';
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.mGrd7l1v.js';
|
5
|
+
import '@orpc/client';
|
6
|
+
import '@orpc/contract';
|
7
|
+
import '@orpc/shared';
|
8
|
+
import '@orpc/standard-server';
|
9
|
+
|
10
|
+
type HandleStandardServerPeerMessageOptions<T extends Context> = Omit<FriendlyStandardHandleOptions<T>, 'prefix'>;
|
11
|
+
declare function handleStandardServerPeerMessage<T extends Context>(handler: StandardHandler<T>, peer: ServerPeer, message: EncodedMessage, options: HandleStandardServerPeerMessageOptions<T>): Promise<void>;
|
12
|
+
|
13
|
+
export { handleStandardServerPeerMessage };
|
14
|
+
export type { HandleStandardServerPeerMessageOptions };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export { h as handleStandardServerPeerMessage } from '../../shared/server.C6Q5sqYw.mjs';
|
2
|
+
import '@orpc/client';
|
3
|
+
import '@orpc/shared';
|
4
|
+
import '@orpc/standard-server';
|
5
|
+
import '@orpc/contract';
|
6
|
+
import '@orpc/client/standard';
|
7
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
@@ -1,15 +1,18 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
|
-
import { C as Context, R as Router } from '../../shared/server.
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
2
|
+
import { C as Context, R as Router } from '../../shared/server.CRejaM08.mjs';
|
3
|
+
import { f as StandardHandler } from '../../shared/server.De2J-WNx.mjs';
|
4
|
+
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.C-F_fMXW.mjs';
|
6
6
|
import '@orpc/client';
|
7
7
|
import '@orpc/contract';
|
8
8
|
import '@orpc/standard-server';
|
9
|
+
import '@orpc/standard-server-peer';
|
10
|
+
import '../../shared/server.VjZAmjFs.mjs';
|
9
11
|
import '@orpc/client/standard';
|
12
|
+
import '../../shared/server.DrG30u7a.mjs';
|
10
13
|
|
11
|
-
type
|
12
|
-
declare class
|
14
|
+
type MinimalWebsocket = Pick<WebSocket, 'addEventListener' | 'send'>;
|
15
|
+
declare class WebsocketHandler<T extends Context> {
|
13
16
|
#private;
|
14
17
|
constructor(standardHandler: StandardHandler<T>);
|
15
18
|
/**
|
@@ -19,7 +22,7 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
19
22
|
*
|
20
23
|
* @warning Do not use this method if you're using `.message()` or `.close()`
|
21
24
|
*/
|
22
|
-
upgrade(ws:
|
25
|
+
upgrade(ws: MinimalWebsocket, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): void;
|
23
26
|
/**
|
24
27
|
* Handles a single message received from a WebSocket.
|
25
28
|
*
|
@@ -28,13 +31,13 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
28
31
|
* @param ws The WebSocket instance
|
29
32
|
* @param data The message payload, usually place in `event.data`
|
30
33
|
*/
|
31
|
-
message(ws:
|
34
|
+
message(ws: MinimalWebsocket, data: string | ArrayBuffer | Blob, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
32
35
|
/**
|
33
36
|
* Closes the WebSocket peer and cleans up.
|
34
37
|
*
|
35
38
|
* @warning Avoid calling this directly if `.upgrade()` is used.
|
36
39
|
*/
|
37
|
-
close(ws:
|
40
|
+
close(ws: MinimalWebsocket): void;
|
38
41
|
}
|
39
42
|
|
40
43
|
/**
|
@@ -43,9 +46,9 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
43
46
|
* @see {@link https://orpc.unnoq.com/docs/rpc-handler RPC Handler Docs}
|
44
47
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
45
48
|
*/
|
46
|
-
declare class
|
49
|
+
declare class RPCHandler<T extends Context> extends WebsocketHandler<T> {
|
47
50
|
constructor(router: Router<any, T>, options?: NoInfer<StandardRPCHandlerOptions<T>>);
|
48
51
|
}
|
49
52
|
|
50
|
-
export {
|
51
|
-
export type {
|
53
|
+
export { RPCHandler, WebsocketHandler };
|
54
|
+
export type { MinimalWebsocket };
|
@@ -1,15 +1,18 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
|
-
import { C as Context, R as Router } from '../../shared/server.
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
2
|
+
import { C as Context, R as Router } from '../../shared/server.CRejaM08.js';
|
3
|
+
import { f as StandardHandler } from '../../shared/server.BX8Iro5z.js';
|
4
|
+
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CPC5w4d2.js';
|
6
6
|
import '@orpc/client';
|
7
7
|
import '@orpc/contract';
|
8
8
|
import '@orpc/standard-server';
|
9
|
+
import '@orpc/standard-server-peer';
|
10
|
+
import '../../shared/server.mGrd7l1v.js';
|
9
11
|
import '@orpc/client/standard';
|
12
|
+
import '../../shared/server.Bi2_bIHo.js';
|
10
13
|
|
11
|
-
type
|
12
|
-
declare class
|
14
|
+
type MinimalWebsocket = Pick<WebSocket, 'addEventListener' | 'send'>;
|
15
|
+
declare class WebsocketHandler<T extends Context> {
|
13
16
|
#private;
|
14
17
|
constructor(standardHandler: StandardHandler<T>);
|
15
18
|
/**
|
@@ -19,7 +22,7 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
19
22
|
*
|
20
23
|
* @warning Do not use this method if you're using `.message()` or `.close()`
|
21
24
|
*/
|
22
|
-
upgrade(ws:
|
25
|
+
upgrade(ws: MinimalWebsocket, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): void;
|
23
26
|
/**
|
24
27
|
* Handles a single message received from a WebSocket.
|
25
28
|
*
|
@@ -28,13 +31,13 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
28
31
|
* @param ws The WebSocket instance
|
29
32
|
* @param data The message payload, usually place in `event.data`
|
30
33
|
*/
|
31
|
-
message(ws:
|
34
|
+
message(ws: MinimalWebsocket, data: string | ArrayBuffer | Blob, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
32
35
|
/**
|
33
36
|
* Closes the WebSocket peer and cleans up.
|
34
37
|
*
|
35
38
|
* @warning Avoid calling this directly if `.upgrade()` is used.
|
36
39
|
*/
|
37
|
-
close(ws:
|
40
|
+
close(ws: MinimalWebsocket): void;
|
38
41
|
}
|
39
42
|
|
40
43
|
/**
|
@@ -43,9 +46,9 @@ declare class experimental_WebsocketHandler<T extends Context> {
|
|
43
46
|
* @see {@link https://orpc.unnoq.com/docs/rpc-handler RPC Handler Docs}
|
44
47
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
45
48
|
*/
|
46
|
-
declare class
|
49
|
+
declare class RPCHandler<T extends Context> extends WebsocketHandler<T> {
|
47
50
|
constructor(router: Router<any, T>, options?: NoInfer<StandardRPCHandlerOptions<T>>);
|
48
51
|
}
|
49
52
|
|
50
|
-
export {
|
51
|
-
export type {
|
53
|
+
export { RPCHandler, WebsocketHandler };
|
54
|
+
export type { MinimalWebsocket };
|
@@ -1,14 +1,15 @@
|
|
1
|
-
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
1
|
+
import { readAsBuffer, resolveMaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ServerPeer } from '@orpc/standard-server-peer';
|
3
|
-
import {
|
3
|
+
import { h as handleStandardServerPeerMessage } from '../../shared/server.C6Q5sqYw.mjs';
|
4
4
|
import '@orpc/client';
|
5
5
|
import '@orpc/standard-server';
|
6
6
|
import '@orpc/contract';
|
7
|
-
import { b as StandardRPCHandler } from '../../shared/server.
|
7
|
+
import { b as StandardRPCHandler } from '../../shared/server.Aqc4pYFD.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
9
10
|
import '../../shared/server.DLJzqnSX.mjs';
|
10
11
|
|
11
|
-
class
|
12
|
+
class WebsocketHandler {
|
12
13
|
#peers = /* @__PURE__ */ new WeakMap();
|
13
14
|
#handler;
|
14
15
|
constructor(standardHandler) {
|
@@ -38,14 +39,13 @@ class experimental_WebsocketHandler {
|
|
38
39
|
if (!peer) {
|
39
40
|
this.#peers.set(ws, peer = new ServerPeer(ws.send.bind(ws)));
|
40
41
|
}
|
41
|
-
const message = data instanceof Blob ? await data
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
await peer.response(id, response ?? { status: 404, headers: {}, body: "No procedure matched" });
|
42
|
+
const message = data instanceof Blob ? await readAsBuffer(data) : data;
|
43
|
+
await handleStandardServerPeerMessage(
|
44
|
+
this.#handler,
|
45
|
+
peer,
|
46
|
+
message,
|
47
|
+
resolveMaybeOptionalOptions(rest)
|
48
|
+
);
|
49
49
|
}
|
50
50
|
/**
|
51
51
|
* Closes the WebSocket peer and cleans up.
|
@@ -60,10 +60,10 @@ class experimental_WebsocketHandler {
|
|
60
60
|
}
|
61
61
|
}
|
62
62
|
|
63
|
-
class
|
63
|
+
class RPCHandler extends WebsocketHandler {
|
64
64
|
constructor(router, options = {}) {
|
65
65
|
super(new StandardRPCHandler(router, options));
|
66
66
|
}
|
67
67
|
}
|
68
68
|
|
69
|
-
export {
|
69
|
+
export { RPCHandler, WebsocketHandler };
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { WebSocket } from 'ws';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CRejaM08.mjs';
|
4
|
+
import { f as StandardHandler } from '../../shared/server.De2J-WNx.mjs';
|
5
|
+
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.C-F_fMXW.mjs';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
10
|
+
import '@orpc/standard-server-peer';
|
11
|
+
import '../../shared/server.VjZAmjFs.mjs';
|
10
12
|
import '@orpc/client/standard';
|
13
|
+
import '../../shared/server.DrG30u7a.mjs';
|
11
14
|
|
12
|
-
declare class
|
15
|
+
declare class WsHandler<T extends Context> {
|
13
16
|
private readonly standardHandler;
|
14
17
|
constructor(standardHandler: StandardHandler<T>);
|
15
|
-
upgrade(ws: Pick<WebSocket, 'addEventListener' | 'send'>, ...rest: MaybeOptionalOptions<
|
18
|
+
upgrade(ws: Pick<WebSocket, 'addEventListener' | 'send'>, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
16
19
|
}
|
17
20
|
|
18
21
|
/**
|
@@ -21,8 +24,8 @@ declare class experimental_WsHandler<T extends Context> {
|
|
21
24
|
* @see {@link https://orpc.unnoq.com/docs/rpc-handler RPC Handler Docs}
|
22
25
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
23
26
|
*/
|
24
|
-
declare class
|
27
|
+
declare class RPCHandler<T extends Context> extends WsHandler<T> {
|
25
28
|
constructor(router: Router<any, T>, options?: NoInfer<StandardRPCHandlerOptions<T>>);
|
26
29
|
}
|
27
30
|
|
28
|
-
export {
|
31
|
+
export { RPCHandler, WsHandler };
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { WebSocket } from 'ws';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CRejaM08.js';
|
4
|
+
import { f as StandardHandler } from '../../shared/server.BX8Iro5z.js';
|
5
|
+
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CPC5w4d2.js';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
10
|
+
import '@orpc/standard-server-peer';
|
11
|
+
import '../../shared/server.mGrd7l1v.js';
|
10
12
|
import '@orpc/client/standard';
|
13
|
+
import '../../shared/server.Bi2_bIHo.js';
|
11
14
|
|
12
|
-
declare class
|
15
|
+
declare class WsHandler<T extends Context> {
|
13
16
|
private readonly standardHandler;
|
14
17
|
constructor(standardHandler: StandardHandler<T>);
|
15
|
-
upgrade(ws: Pick<WebSocket, 'addEventListener' | 'send'>, ...rest: MaybeOptionalOptions<
|
18
|
+
upgrade(ws: Pick<WebSocket, 'addEventListener' | 'send'>, ...rest: MaybeOptionalOptions<HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
16
19
|
}
|
17
20
|
|
18
21
|
/**
|
@@ -21,8 +24,8 @@ declare class experimental_WsHandler<T extends Context> {
|
|
21
24
|
* @see {@link https://orpc.unnoq.com/docs/rpc-handler RPC Handler Docs}
|
22
25
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
23
26
|
*/
|
24
|
-
declare class
|
27
|
+
declare class RPCHandler<T extends Context> extends WsHandler<T> {
|
25
28
|
constructor(router: Router<any, T>, options?: NoInfer<StandardRPCHandlerOptions<T>>);
|
26
29
|
}
|
27
30
|
|
28
|
-
export {
|
31
|
+
export { RPCHandler, WsHandler };
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
1
|
+
import { readAsBuffer, resolveMaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ServerPeer } from '@orpc/standard-server-peer';
|
3
|
-
import {
|
3
|
+
import { h as handleStandardServerPeerMessage } from '../../shared/server.C6Q5sqYw.mjs';
|
4
4
|
import '@orpc/client';
|
5
5
|
import '@orpc/standard-server';
|
6
6
|
import '@orpc/contract';
|
7
|
-
import { b as StandardRPCHandler } from '../../shared/server.
|
7
|
+
import { b as StandardRPCHandler } from '../../shared/server.Aqc4pYFD.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
9
10
|
import '../../shared/server.DLJzqnSX.mjs';
|
10
11
|
|
11
|
-
class
|
12
|
+
class WsHandler {
|
12
13
|
constructor(standardHandler) {
|
13
14
|
this.standardHandler = standardHandler;
|
14
15
|
}
|
15
16
|
async upgrade(ws, ...rest) {
|
16
17
|
const peer = new ServerPeer(ws.send.bind(ws));
|
17
18
|
ws.addEventListener("message", async (event) => {
|
18
|
-
const message = Array.isArray(event.data) ? await new Blob(event.data)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
await peer.response(id, response ?? { status: 404, headers: {}, body: "No procedure matched" });
|
19
|
+
const message = Array.isArray(event.data) ? await readAsBuffer(new Blob(event.data)) : event.data;
|
20
|
+
await handleStandardServerPeerMessage(
|
21
|
+
this.standardHandler,
|
22
|
+
peer,
|
23
|
+
message,
|
24
|
+
resolveMaybeOptionalOptions(rest)
|
25
|
+
);
|
26
26
|
});
|
27
27
|
ws.addEventListener("close", () => {
|
28
28
|
peer.close();
|
@@ -30,10 +30,10 @@ class experimental_WsHandler {
|
|
30
30
|
}
|
31
31
|
}
|
32
32
|
|
33
|
-
class
|
33
|
+
class RPCHandler extends WsHandler {
|
34
34
|
constructor(router, options = {}) {
|
35
35
|
super(new StandardRPCHandler(router, options));
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
-
export {
|
39
|
+
export { RPCHandler, WsHandler };
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
|
2
|
-
import {
|
2
|
+
import { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.De2J-WNx.mjs';
|
3
3
|
import { experimental_HibernationEventIterator } from '@orpc/standard-server';
|
4
4
|
export { experimental_HibernationEventIterator, experimental_HibernationEventIteratorCallback } from '@orpc/standard-server';
|
5
|
-
import { C as Context, R as Router } from '../shared/server.
|
5
|
+
import { C as Context, R as Router } from '../shared/server.CRejaM08.mjs';
|
6
6
|
import '@orpc/client';
|
7
7
|
import '@orpc/contract';
|
8
8
|
import '@orpc/shared';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
|
2
|
-
import {
|
2
|
+
import { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.BX8Iro5z.js';
|
3
3
|
import { experimental_HibernationEventIterator } from '@orpc/standard-server';
|
4
4
|
export { experimental_HibernationEventIterator, experimental_HibernationEventIteratorCallback } from '@orpc/standard-server';
|
5
|
-
import { C as Context, R as Router } from '../shared/server.
|
5
|
+
import { C as Context, R as Router } from '../shared/server.CRejaM08.js';
|
6
6
|
import '@orpc/client';
|
7
7
|
import '@orpc/contract';
|
8
8
|
import '@orpc/shared';
|
package/dist/index.d.mts
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import { ORPCErrorJSON, ORPCError, Client, ClientContext, HTTPPath, HTTPMethod, ClientOptions, ClientPromiseResult } from '@orpc/client';
|
2
2
|
export { ClientContext, HTTPMethod, HTTPPath, ORPCError, isDefinedError, safe } from '@orpc/client';
|
3
|
-
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route,
|
3
|
+
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route, Schema, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure } from '@orpc/contract';
|
4
4
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type } from '@orpc/contract';
|
5
5
|
import { ThrowableError, IntersectPick, MaybeOptionalOptions } from '@orpc/shared';
|
6
|
-
export { EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, onError, onFinish, onStart, onSuccess } from '@orpc/shared';
|
7
|
-
import { C as Context, P as Procedure,
|
8
|
-
export { J as InferRouterCurrentContexts, H as InferRouterInitialContexts, K as InferRouterInputs, N as InferRouterOutputs,
|
6
|
+
export { EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
7
|
+
import { C as Context, P as Procedure, e as Middleware, O as ORPCErrorConstructorMap, M as MergedInitialContext, f as MergedCurrentContext, g as MapInputMiddleware, h as CreateProcedureClientOptions, i as ProcedureClient, j as ProcedureHandler, R as Router, c as Lazy, a as AnyMiddleware, b as AnyRouter, A as AnyProcedure, L as Lazyable, I as InferRouterInitialContext } from './shared/server.CRejaM08.mjs';
|
8
|
+
export { J as InferRouterCurrentContexts, H as InferRouterInitialContexts, K as InferRouterInputs, N as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, x as MiddlewareNextFn, w as MiddlewareNextFnOptions, z as MiddlewareOptions, y as MiddlewareOutputFn, t as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, d as ProcedureClientInterceptorOptions, E as ProcedureDef, D as ProcedureHandlerOptions, n as createORPCErrorConstructorMap, G as createProcedureClient, s as getLazyMeta, r as isLazy, F as isProcedure, q as lazy, m as mergeCurrentContext, B as middlewareOutputFn, u as unlazy, v as validateORPCError } from './shared/server.CRejaM08.mjs';
|
9
|
+
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.DrG30u7a.mjs';
|
10
|
+
export { A as AccessibleLazyRouter, C as ContractProcedureCallbackOptions, L as LazyTraverseContractProceduresOptions, T as TraverseContractProcedureCallbackOptions, b as TraverseContractProceduresOptions, U as UnlaziedRouter, c as createAccessibleLazyRouter, e as enhanceRouter, g as getRouter, r as resolveContractProcedures, t as traverseContractProcedures, u as unlazyRouter } from './shared/server.DrG30u7a.mjs';
|
9
11
|
export { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
10
12
|
|
11
13
|
type ActionableError<T> = T extends ORPCError<infer U, infer V> ? ORPCErrorJSON<U, V> & {
|
@@ -80,39 +82,6 @@ declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContex
|
|
80
82
|
actionable(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, Record<never, never>>>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> & ProcedureActionableClient<TInputSchema, TOutputSchema, TErrorMap>;
|
81
83
|
}
|
82
84
|
|
83
|
-
declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
|
84
|
-
type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
|
85
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
86
|
-
};
|
87
|
-
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
88
|
-
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends Procedure<infer UInitialContext, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
89
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
|
90
|
-
};
|
91
|
-
interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
|
92
|
-
middlewares: readonly AnyMiddleware[];
|
93
|
-
errorMap: TErrorMap;
|
94
|
-
dedupeLeadingMiddlewares: boolean;
|
95
|
-
}
|
96
|
-
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
|
97
|
-
interface TraverseContractProceduresOptions {
|
98
|
-
router: AnyContractRouter | AnyRouter;
|
99
|
-
path: readonly string[];
|
100
|
-
}
|
101
|
-
interface ContractProcedureCallbackOptions {
|
102
|
-
contract: AnyContractProcedure;
|
103
|
-
path: readonly string[];
|
104
|
-
}
|
105
|
-
interface LazyTraverseContractProceduresOptions {
|
106
|
-
router: Lazy<AnyRouter>;
|
107
|
-
path: readonly string[];
|
108
|
-
}
|
109
|
-
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: ContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
110
|
-
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: ContractProcedureCallbackOptions) => void): Promise<void>;
|
111
|
-
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
112
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
113
|
-
};
|
114
|
-
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
115
|
-
|
116
85
|
interface BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
117
86
|
/**
|
118
87
|
* This property holds the defined options.
|
@@ -830,5 +799,5 @@ declare function createRouterClient<T extends AnyRouter, TClientContext extends
|
|
830
799
|
declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router: T, contract: AnyContractRouter): T;
|
831
800
|
declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
|
832
801
|
|
833
|
-
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call,
|
834
|
-
export type {
|
802
|
+
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createActionableClient, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, fallbackConfig, getHiddenRouterContract, implement, implementerInternal, inferRPCMethodFromRouter, isStartWithMiddlewares, mergeMiddlewares, os, setHiddenRouterContract };
|
803
|
+
export type { ActionableClient, ActionableClientRest, ActionableClientResult, ActionableError, BuilderConfig, BuilderDef, BuilderWithMiddlewares, Config, DecoratedMiddleware, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, ProcedureActionableClient, ProcedureBuilder, ProcedureBuilderWithInput, ProcedureBuilderWithInputOutput, ProcedureBuilderWithOutput, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, UnactionableError };
|
package/dist/index.d.ts
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import { ORPCErrorJSON, ORPCError, Client, ClientContext, HTTPPath, HTTPMethod, ClientOptions, ClientPromiseResult } from '@orpc/client';
|
2
2
|
export { ClientContext, HTTPMethod, HTTPPath, ORPCError, isDefinedError, safe } from '@orpc/client';
|
3
|
-
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route,
|
3
|
+
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route, Schema, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure } from '@orpc/contract';
|
4
4
|
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type } from '@orpc/contract';
|
5
5
|
import { ThrowableError, IntersectPick, MaybeOptionalOptions } from '@orpc/shared';
|
6
|
-
export { EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, onError, onFinish, onStart, onSuccess } from '@orpc/shared';
|
7
|
-
import { C as Context, P as Procedure,
|
8
|
-
export { J as InferRouterCurrentContexts, H as InferRouterInitialContexts, K as InferRouterInputs, N as InferRouterOutputs,
|
6
|
+
export { EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
7
|
+
import { C as Context, P as Procedure, e as Middleware, O as ORPCErrorConstructorMap, M as MergedInitialContext, f as MergedCurrentContext, g as MapInputMiddleware, h as CreateProcedureClientOptions, i as ProcedureClient, j as ProcedureHandler, R as Router, c as Lazy, a as AnyMiddleware, b as AnyRouter, A as AnyProcedure, L as Lazyable, I as InferRouterInitialContext } from './shared/server.CRejaM08.js';
|
8
|
+
export { J as InferRouterCurrentContexts, H as InferRouterInitialContexts, K as InferRouterInputs, N as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, x as MiddlewareNextFn, w as MiddlewareNextFnOptions, z as MiddlewareOptions, y as MiddlewareOutputFn, t as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, d as ProcedureClientInterceptorOptions, E as ProcedureDef, D as ProcedureHandlerOptions, n as createORPCErrorConstructorMap, G as createProcedureClient, s as getLazyMeta, r as isLazy, F as isProcedure, q as lazy, m as mergeCurrentContext, B as middlewareOutputFn, u as unlazy, v as validateORPCError } from './shared/server.CRejaM08.js';
|
9
|
+
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.Bi2_bIHo.js';
|
10
|
+
export { A as AccessibleLazyRouter, C as ContractProcedureCallbackOptions, L as LazyTraverseContractProceduresOptions, T as TraverseContractProcedureCallbackOptions, b as TraverseContractProceduresOptions, U as UnlaziedRouter, c as createAccessibleLazyRouter, e as enhanceRouter, g as getRouter, r as resolveContractProcedures, t as traverseContractProcedures, u as unlazyRouter } from './shared/server.Bi2_bIHo.js';
|
9
11
|
export { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
10
12
|
|
11
13
|
type ActionableError<T> = T extends ORPCError<infer U, infer V> ? ORPCErrorJSON<U, V> & {
|
@@ -80,39 +82,6 @@ declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContex
|
|
80
82
|
actionable(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, Record<never, never>>>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> & ProcedureActionableClient<TInputSchema, TOutputSchema, TErrorMap>;
|
81
83
|
}
|
82
84
|
|
83
|
-
declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
|
84
|
-
type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
|
85
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
|
86
|
-
};
|
87
|
-
declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
|
88
|
-
type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends Procedure<infer UInitialContext, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
89
|
-
[K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
|
90
|
-
};
|
91
|
-
interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
|
92
|
-
middlewares: readonly AnyMiddleware[];
|
93
|
-
errorMap: TErrorMap;
|
94
|
-
dedupeLeadingMiddlewares: boolean;
|
95
|
-
}
|
96
|
-
declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
|
97
|
-
interface TraverseContractProceduresOptions {
|
98
|
-
router: AnyContractRouter | AnyRouter;
|
99
|
-
path: readonly string[];
|
100
|
-
}
|
101
|
-
interface ContractProcedureCallbackOptions {
|
102
|
-
contract: AnyContractProcedure;
|
103
|
-
path: readonly string[];
|
104
|
-
}
|
105
|
-
interface LazyTraverseContractProceduresOptions {
|
106
|
-
router: Lazy<AnyRouter>;
|
107
|
-
path: readonly string[];
|
108
|
-
}
|
109
|
-
declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: ContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
|
110
|
-
declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: ContractProcedureCallbackOptions) => void): Promise<void>;
|
111
|
-
type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
|
112
|
-
[K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
|
113
|
-
};
|
114
|
-
declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
|
115
|
-
|
116
85
|
interface BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
117
86
|
/**
|
118
87
|
* This property holds the defined options.
|
@@ -830,5 +799,5 @@ declare function createRouterClient<T extends AnyRouter, TClientContext extends
|
|
830
799
|
declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router: T, contract: AnyContractRouter): T;
|
831
800
|
declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
|
832
801
|
|
833
|
-
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call,
|
834
|
-
export type {
|
802
|
+
export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, Context, CreateProcedureClientOptions, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createActionableClient, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, fallbackConfig, getHiddenRouterContract, implement, implementerInternal, inferRPCMethodFromRouter, isStartWithMiddlewares, mergeMiddlewares, os, setHiddenRouterContract };
|
803
|
+
export type { ActionableClient, ActionableClientRest, ActionableClientResult, ActionableError, BuilderConfig, BuilderDef, BuilderWithMiddlewares, Config, DecoratedMiddleware, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, ProcedureActionableClient, ProcedureBuilder, ProcedureBuilderWithInput, ProcedureBuilderWithInputOutput, ProcedureBuilderWithOutput, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, UnactionableError };
|
package/dist/index.mjs
CHANGED
@@ -5,7 +5,7 @@ export { L as LAZY_SYMBOL, p as call, r as createAccessibleLazyRouter, a as crea
|
|
5
5
|
import { toORPCError } from '@orpc/client';
|
6
6
|
export { ORPCError, isDefinedError, safe } from '@orpc/client';
|
7
7
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
8
|
-
export { EventPublisher, onError, onFinish, onStart, onSuccess } from '@orpc/shared';
|
8
|
+
export { EventPublisher, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
9
9
|
export { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
10
10
|
|
11
11
|
const DEFAULT_CONFIG = {
|
package/dist/plugins/index.d.mts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Value, Promisable } from '@orpc/shared';
|
2
2
|
import { StandardRequest, StandardHeaders } from '@orpc/standard-server';
|
3
3
|
import { BatchResponseBodyItem } from '@orpc/standard-server/batch';
|
4
|
-
import {
|
5
|
-
import { C as Context,
|
4
|
+
import { d as StandardHandlerInterceptorOptions, g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.De2J-WNx.mjs';
|
5
|
+
import { C as Context, d as ProcedureClientInterceptorOptions } from '../shared/server.CRejaM08.mjs';
|
6
6
|
import { Meta, ORPCError as ORPCError$1 } from '@orpc/contract';
|
7
7
|
import { ORPCError } from '@orpc/client';
|
8
8
|
|