@orpc/server 0.0.0-next.3b7800f → 0.0.0-next.3bec7fc
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 +5 -1
- package/dist/adapters/aws-lambda/index.d.mts +5 -5
- package/dist/adapters/aws-lambda/index.d.ts +5 -5
- package/dist/adapters/aws-lambda/index.mjs +3 -3
- package/dist/adapters/bun-ws/index.d.mts +5 -5
- package/dist/adapters/bun-ws/index.d.ts +5 -5
- package/dist/adapters/bun-ws/index.mjs +2 -2
- package/dist/adapters/crossws/index.d.mts +5 -5
- package/dist/adapters/crossws/index.d.ts +5 -5
- package/dist/adapters/crossws/index.mjs +2 -2
- package/dist/adapters/fastify/index.d.mts +53 -0
- package/dist/adapters/fastify/index.d.ts +53 -0
- package/dist/adapters/fastify/index.mjs +54 -0
- package/dist/adapters/fetch/index.d.mts +7 -7
- package/dist/adapters/fetch/index.d.ts +7 -7
- package/dist/adapters/fetch/index.mjs +5 -4
- package/dist/adapters/message-port/index.d.mts +35 -9
- package/dist/adapters/message-port/index.d.ts +35 -9
- package/dist/adapters/message-port/index.mjs +28 -12
- package/dist/adapters/node/index.d.mts +8 -8
- package/dist/adapters/node/index.d.ts +8 -8
- package/dist/adapters/node/index.mjs +3 -3
- package/dist/adapters/standard/index.d.mts +6 -6
- package/dist/adapters/standard/index.d.ts +6 -6
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/adapters/standard-peer/index.d.mts +3 -3
- package/dist/adapters/standard-peer/index.d.ts +3 -3
- package/dist/adapters/websocket/index.d.mts +9 -7
- package/dist/adapters/websocket/index.d.ts +9 -7
- package/dist/adapters/websocket/index.mjs +2 -2
- package/dist/adapters/ws/index.d.mts +5 -5
- package/dist/adapters/ws/index.d.ts +5 -5
- package/dist/adapters/ws/index.mjs +2 -2
- package/dist/helpers/index.d.mts +16 -1
- package/dist/helpers/index.d.ts +16 -1
- package/dist/helpers/index.mjs +11 -1
- package/dist/hibernation/index.d.mts +2 -2
- package/dist/hibernation/index.d.ts +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +8 -5
- package/dist/plugins/index.d.mts +5 -2
- package/dist/plugins/index.d.ts +5 -2
- package/dist/plugins/index.mjs +13 -11
- package/dist/shared/{server.CYNGeoCm.d.mts → server.B4BGqy3Y.d.mts} +2 -3
- package/dist/shared/{server.CYNGeoCm.d.ts → server.B4BGqy3Y.d.ts} +2 -3
- package/dist/shared/{server.CYRYFTxo.mjs → server.Bxx6tqNe.mjs} +1 -1
- package/dist/shared/{server.D0H-iaY3.d.ts → server.COL12UTb.d.ts} +3 -3
- package/dist/shared/{server.BEFBl-Cb.d.mts → server.CVKCo60T.d.mts} +2 -2
- package/dist/shared/{server.jMTkVNIb.d.ts → server.Cb6yD7DZ.d.ts} +1 -1
- package/dist/shared/{server.BU4WI18A.d.mts → server.Ck-gOLzq.d.mts} +3 -3
- package/dist/shared/{server.gqRxT-yN.d.mts → server.DBCUJijK.d.mts} +1 -1
- package/dist/shared/{server.B7b2w3_i.d.ts → server.DNtJ-p60.d.ts} +2 -2
- package/dist/shared/{server.Bmh5xd4n.d.ts → server.DPIFWpxG.d.ts} +1 -1
- package/dist/shared/{server.B_fj3X5m.mjs → server.Ds4HPpvH.mjs} +31 -30
- package/dist/shared/{server.DhJj-1X9.d.mts → server.DzV1hr3z.d.mts} +1 -1
- package/dist/shared/{server.BW-nUGgA.mjs → server.TEVCLCFC.mjs} +3 -0
- package/package.json +21 -12
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import { postMessagePortMessage, onMessagePortMessage, onMessagePortClose } from '@orpc/client/message-port';
|
|
2
|
-
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
3
|
-
import {
|
|
2
|
+
import { value, resolveMaybeOptionalOptions, isObject } from '@orpc/shared';
|
|
3
|
+
import { experimental_ServerPeerWithoutCodec, serializeResponseMessage, encodeResponseMessage, deserializeRequestMessage, decodeRequestMessage } from '@orpc/standard-server-peer';
|
|
4
4
|
import { c as createServerPeerHandleRequestFn } from '../../shared/server.UVMTOWrk.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/standard-server';
|
|
7
7
|
import '@orpc/contract';
|
|
8
|
-
import { b as StandardRPCHandler } from '../../shared/server.
|
|
8
|
+
import { b as StandardRPCHandler } from '../../shared/server.Bxx6tqNe.mjs';
|
|
9
9
|
import '@orpc/client/standard';
|
|
10
10
|
import '../../shared/server.DZ5BIITo.mjs';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.Ds4HPpvH.mjs';
|
|
12
12
|
|
|
13
13
|
class MessagePortHandler {
|
|
14
|
-
constructor(standardHandler) {
|
|
14
|
+
constructor(standardHandler, options = {}) {
|
|
15
15
|
this.standardHandler = standardHandler;
|
|
16
|
+
this.transfer = options.experimental_transfer;
|
|
16
17
|
}
|
|
18
|
+
transfer;
|
|
17
19
|
upgrade(port, ...rest) {
|
|
18
|
-
const peer = new
|
|
19
|
-
|
|
20
|
+
const peer = new experimental_ServerPeerWithoutCodec(async (message) => {
|
|
21
|
+
const [id, type, payload] = message;
|
|
22
|
+
const transfer = await value(this.transfer, message, port);
|
|
23
|
+
if (transfer) {
|
|
24
|
+
postMessagePortMessage(port, serializeResponseMessage(id, type, payload), transfer);
|
|
25
|
+
} else {
|
|
26
|
+
postMessagePortMessage(port, await encodeResponseMessage(id, type, payload));
|
|
27
|
+
}
|
|
20
28
|
});
|
|
21
29
|
onMessagePortMessage(port, async (message) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
const handleFn = createServerPeerHandleRequestFn(this.standardHandler, resolveMaybeOptionalOptions(rest));
|
|
31
|
+
if (isObject(message)) {
|
|
32
|
+
await peer.message(
|
|
33
|
+
deserializeRequestMessage(message),
|
|
34
|
+
handleFn
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
await peer.message(
|
|
38
|
+
await decodeRequestMessage(message),
|
|
39
|
+
handleFn
|
|
40
|
+
);
|
|
41
|
+
}
|
|
26
42
|
});
|
|
27
43
|
onMessagePortClose(port, () => {
|
|
28
44
|
peer.close();
|
|
@@ -32,7 +48,7 @@ class MessagePortHandler {
|
|
|
32
48
|
|
|
33
49
|
class RPCHandler extends MessagePortHandler {
|
|
34
50
|
constructor(router, options = {}) {
|
|
35
|
-
super(new StandardRPCHandler(router, options));
|
|
51
|
+
super(new StandardRPCHandler(router, options), options);
|
|
36
52
|
}
|
|
37
53
|
}
|
|
38
54
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@orpc/standard-server-node';
|
|
4
|
-
import { g as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, f as StandardHandler } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { g as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, f as StandardHandler } from '../../shared/server.DBCUJijK.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CVKCo60T.mjs';
|
|
6
6
|
import compression from '@orpc/interop/compression';
|
|
7
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
7
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.Ck-gOLzq.mjs';
|
|
8
8
|
import '@orpc/client';
|
|
9
9
|
import '@orpc/contract';
|
|
10
10
|
import '@orpc/standard-server';
|
|
11
11
|
import '@orpc/client/standard';
|
|
12
|
-
import '../../shared/server.
|
|
12
|
+
import '../../shared/server.DzV1hr3z.mjs';
|
|
13
13
|
|
|
14
14
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
15
15
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -32,7 +32,7 @@ interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponse
|
|
|
32
32
|
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, Promise<NodeHttpHandleResult>>[];
|
|
33
33
|
plugins?: NodeHttpHandlerPlugin<T>[];
|
|
34
34
|
}
|
|
35
|
-
declare class NodeHttpHandler<T extends Context>
|
|
35
|
+
declare class NodeHttpHandler<T extends Context> {
|
|
36
36
|
private readonly standardHandler;
|
|
37
37
|
private readonly sendStandardResponseOptions;
|
|
38
38
|
private readonly adapterInterceptors;
|
|
@@ -77,14 +77,14 @@ declare class CompressionPlugin<T extends Context> implements NodeHttpHandlerPlu
|
|
|
77
77
|
initRuntimeAdapter(options: NodeHttpHandlerOptions<T>): void;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
interface RPCHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardRPCHandlerOptions<T>, 'plugins'> {
|
|
81
81
|
/**
|
|
82
82
|
* Enables or disables the StrictGetMethodPlugin.
|
|
83
83
|
*
|
|
84
84
|
* @default true
|
|
85
85
|
*/
|
|
86
86
|
strictGetMethodPluginEnabled?: boolean;
|
|
87
|
-
}
|
|
87
|
+
}
|
|
88
88
|
/**
|
|
89
89
|
* RPC Handler for Node.js HTTP Server
|
|
90
90
|
*
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@orpc/standard-server-node';
|
|
4
|
-
import { g as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, f as StandardHandler } from '../../shared/server.
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
+
import { g as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, f as StandardHandler } from '../../shared/server.DPIFWpxG.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DNtJ-p60.js';
|
|
6
6
|
import compression from '@orpc/interop/compression';
|
|
7
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
7
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.COL12UTb.js';
|
|
8
8
|
import '@orpc/client';
|
|
9
9
|
import '@orpc/contract';
|
|
10
10
|
import '@orpc/standard-server';
|
|
11
11
|
import '@orpc/client/standard';
|
|
12
|
-
import '../../shared/server.
|
|
12
|
+
import '../../shared/server.Cb6yD7DZ.js';
|
|
13
13
|
|
|
14
14
|
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
15
15
|
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
@@ -32,7 +32,7 @@ interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponse
|
|
|
32
32
|
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, Promise<NodeHttpHandleResult>>[];
|
|
33
33
|
plugins?: NodeHttpHandlerPlugin<T>[];
|
|
34
34
|
}
|
|
35
|
-
declare class NodeHttpHandler<T extends Context>
|
|
35
|
+
declare class NodeHttpHandler<T extends Context> {
|
|
36
36
|
private readonly standardHandler;
|
|
37
37
|
private readonly sendStandardResponseOptions;
|
|
38
38
|
private readonly adapterInterceptors;
|
|
@@ -77,14 +77,14 @@ declare class CompressionPlugin<T extends Context> implements NodeHttpHandlerPlu
|
|
|
77
77
|
initRuntimeAdapter(options: NodeHttpHandlerOptions<T>): void;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
interface RPCHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardRPCHandlerOptions<T>, 'plugins'> {
|
|
81
81
|
/**
|
|
82
82
|
* Enables or disables the StrictGetMethodPlugin.
|
|
83
83
|
*
|
|
84
84
|
* @default true
|
|
85
85
|
*/
|
|
86
86
|
strictGetMethodPluginEnabled?: boolean;
|
|
87
|
-
}
|
|
87
|
+
}
|
|
88
88
|
/**
|
|
89
89
|
* RPC Handler for Node.js HTTP Server
|
|
90
90
|
*
|
|
@@ -5,12 +5,12 @@ import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-serv
|
|
|
5
5
|
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
|
6
6
|
import '@orpc/standard-server';
|
|
7
7
|
import '@orpc/contract';
|
|
8
|
-
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.
|
|
8
|
+
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.Bxx6tqNe.mjs';
|
|
9
9
|
import '@orpc/client/standard';
|
|
10
10
|
import '@orpc/standard-server/batch';
|
|
11
11
|
import '@orpc/standard-server-fetch';
|
|
12
|
-
import { S as StrictGetMethodPlugin } from '../../shared/server.
|
|
13
|
-
import '../../shared/server.
|
|
12
|
+
import { S as StrictGetMethodPlugin } from '../../shared/server.TEVCLCFC.mjs';
|
|
13
|
+
import '../../shared/server.Ds4HPpvH.mjs';
|
|
14
14
|
|
|
15
15
|
class BodyLimitPlugin {
|
|
16
16
|
maxBodySize;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { S as StandardCodec, a as StandardParams } from '../../shared/server.
|
|
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.
|
|
1
|
+
import { S as StandardCodec, a as StandardParams } from '../../shared/server.DBCUJijK.mjs';
|
|
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.DBCUJijK.mjs';
|
|
3
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 { A as AnyProcedure } from '../../shared/server.
|
|
7
|
-
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions, c as StandardRPCMatcher, b as StandardRPCMatcherOptions } from '../../shared/server.
|
|
8
|
-
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { A as AnyProcedure } from '../../shared/server.B4BGqy3Y.mjs';
|
|
7
|
+
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions, c as StandardRPCMatcher, b as StandardRPCMatcherOptions } from '../../shared/server.Ck-gOLzq.mjs';
|
|
8
|
+
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CVKCo60T.mjs';
|
|
9
9
|
import '@orpc/contract';
|
|
10
10
|
import '@orpc/shared';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.DzV1hr3z.mjs';
|
|
12
12
|
|
|
13
13
|
declare class StandardRPCCodec implements StandardCodec {
|
|
14
14
|
private readonly serializer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { S as StandardCodec, a as StandardParams } from '../../shared/server.
|
|
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.
|
|
1
|
+
import { S as StandardCodec, a as StandardParams } from '../../shared/server.DPIFWpxG.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.DPIFWpxG.js';
|
|
3
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 { A as AnyProcedure } from '../../shared/server.
|
|
7
|
-
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions, c as StandardRPCMatcher, b as StandardRPCMatcherOptions } from '../../shared/server.
|
|
8
|
-
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
6
|
+
import { A as AnyProcedure } from '../../shared/server.B4BGqy3Y.js';
|
|
7
|
+
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions, c as StandardRPCMatcher, b as StandardRPCMatcherOptions } from '../../shared/server.COL12UTb.js';
|
|
8
|
+
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DNtJ-p60.js';
|
|
9
9
|
import '@orpc/contract';
|
|
10
10
|
import '@orpc/shared';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.Cb6yD7DZ.js';
|
|
12
12
|
|
|
13
13
|
declare class StandardRPCCodec implements StandardCodec {
|
|
14
14
|
private readonly serializer;
|
|
@@ -1,8 +1,8 @@
|
|
|
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.Bxx6tqNe.mjs';
|
|
2
2
|
export { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
|
3
3
|
import '@orpc/client/standard';
|
|
4
4
|
import '@orpc/client';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@orpc/standard-server';
|
|
7
|
-
import '../../shared/server.
|
|
7
|
+
import '../../shared/server.Ds4HPpvH.mjs';
|
|
8
8
|
import '@orpc/contract';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerPeer, EncodedMessage, ServerPeerHandleRequestFn } from '@orpc/standard-server-peer';
|
|
2
|
-
import { C as Context } from '../../shared/server.
|
|
3
|
-
import { f as StandardHandler } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
2
|
+
import { C as Context } from '../../shared/server.B4BGqy3Y.mjs';
|
|
3
|
+
import { f as StandardHandler } from '../../shared/server.DBCUJijK.mjs';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CVKCo60T.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/contract';
|
|
7
7
|
import '@orpc/shared';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerPeer, EncodedMessage, ServerPeerHandleRequestFn } from '@orpc/standard-server-peer';
|
|
2
|
-
import { C as Context } from '../../shared/server.
|
|
3
|
-
import { f as StandardHandler } from '../../shared/server.
|
|
4
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
2
|
+
import { C as Context } from '../../shared/server.B4BGqy3Y.js';
|
|
3
|
+
import { f as StandardHandler } from '../../shared/server.DPIFWpxG.js';
|
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.DNtJ-p60.js';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/contract';
|
|
7
7
|
import '@orpc/shared';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
3
|
-
import { f as StandardHandler } from '../../shared/server.
|
|
2
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.mjs';
|
|
3
|
+
import { f as StandardHandler } from '../../shared/server.DBCUJijK.mjs';
|
|
4
4
|
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
|
5
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.Ck-gOLzq.mjs';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
import '@orpc/standard-server';
|
|
9
9
|
import '@orpc/standard-server-peer';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.CVKCo60T.mjs';
|
|
11
11
|
import '@orpc/client/standard';
|
|
12
|
-
import '../../shared/server.
|
|
12
|
+
import '../../shared/server.DzV1hr3z.mjs';
|
|
13
13
|
|
|
14
14
|
type MinimalWebsocket = Pick<WebSocket, 'addEventListener' | 'send'>;
|
|
15
15
|
declare class WebsocketHandler<T extends Context> {
|
|
@@ -40,6 +40,8 @@ declare class WebsocketHandler<T extends Context> {
|
|
|
40
40
|
close(ws: MinimalWebsocket): void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
interface RPCHandlerOptions<T extends Context> extends StandardRPCHandlerOptions<T> {
|
|
44
|
+
}
|
|
43
45
|
/**
|
|
44
46
|
* RPC Handler for Websocket adapter
|
|
45
47
|
*
|
|
@@ -47,8 +49,8 @@ declare class WebsocketHandler<T extends Context> {
|
|
|
47
49
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
|
48
50
|
*/
|
|
49
51
|
declare class RPCHandler<T extends Context> extends WebsocketHandler<T> {
|
|
50
|
-
constructor(router: Router<any, T>, options?: NoInfer<
|
|
52
|
+
constructor(router: Router<any, T>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export { RPCHandler, WebsocketHandler };
|
|
54
|
-
export type { MinimalWebsocket };
|
|
56
|
+
export type { MinimalWebsocket, RPCHandlerOptions };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
|
2
|
-
import { C as Context, R as Router } from '../../shared/server.
|
|
3
|
-
import { f as StandardHandler } from '../../shared/server.
|
|
2
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.js';
|
|
3
|
+
import { f as StandardHandler } from '../../shared/server.DPIFWpxG.js';
|
|
4
4
|
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
|
5
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.COL12UTb.js';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
import '@orpc/standard-server';
|
|
9
9
|
import '@orpc/standard-server-peer';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.DNtJ-p60.js';
|
|
11
11
|
import '@orpc/client/standard';
|
|
12
|
-
import '../../shared/server.
|
|
12
|
+
import '../../shared/server.Cb6yD7DZ.js';
|
|
13
13
|
|
|
14
14
|
type MinimalWebsocket = Pick<WebSocket, 'addEventListener' | 'send'>;
|
|
15
15
|
declare class WebsocketHandler<T extends Context> {
|
|
@@ -40,6 +40,8 @@ declare class WebsocketHandler<T extends Context> {
|
|
|
40
40
|
close(ws: MinimalWebsocket): void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
interface RPCHandlerOptions<T extends Context> extends StandardRPCHandlerOptions<T> {
|
|
44
|
+
}
|
|
43
45
|
/**
|
|
44
46
|
* RPC Handler for Websocket adapter
|
|
45
47
|
*
|
|
@@ -47,8 +49,8 @@ declare class WebsocketHandler<T extends Context> {
|
|
|
47
49
|
* @see {@link https://orpc.unnoq.com/docs/adapters/websocket Websocket Adapter Docs}
|
|
48
50
|
*/
|
|
49
51
|
declare class RPCHandler<T extends Context> extends WebsocketHandler<T> {
|
|
50
|
-
constructor(router: Router<any, T>, options?: NoInfer<
|
|
52
|
+
constructor(router: Router<any, T>, options?: NoInfer<RPCHandlerOptions<T>>);
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export { RPCHandler, WebsocketHandler };
|
|
54
|
-
export type { MinimalWebsocket };
|
|
56
|
+
export type { MinimalWebsocket, RPCHandlerOptions };
|
|
@@ -4,10 +4,10 @@ import { c as createServerPeerHandleRequestFn } from '../../shared/server.UVMTOW
|
|
|
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.Bxx6tqNe.mjs';
|
|
8
8
|
import '@orpc/client/standard';
|
|
9
9
|
import '../../shared/server.DZ5BIITo.mjs';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.Ds4HPpvH.mjs';
|
|
11
11
|
|
|
12
12
|
class WebsocketHandler {
|
|
13
13
|
#peers = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,16 +1,16 @@
|
|
|
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 { f as StandardHandler } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.mjs';
|
|
4
|
+
import { f as StandardHandler } from '../../shared/server.DBCUJijK.mjs';
|
|
5
5
|
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.Ck-gOLzq.mjs';
|
|
7
7
|
import '@orpc/client';
|
|
8
8
|
import '@orpc/contract';
|
|
9
9
|
import '@orpc/standard-server';
|
|
10
10
|
import '@orpc/standard-server-peer';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.CVKCo60T.mjs';
|
|
12
12
|
import '@orpc/client/standard';
|
|
13
|
-
import '../../shared/server.
|
|
13
|
+
import '../../shared/server.DzV1hr3z.mjs';
|
|
14
14
|
|
|
15
15
|
declare class WsHandler<T extends Context> {
|
|
16
16
|
private readonly standardHandler;
|
|
@@ -1,16 +1,16 @@
|
|
|
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 { f as StandardHandler } from '../../shared/server.
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.B4BGqy3Y.js';
|
|
4
|
+
import { f as StandardHandler } from '../../shared/server.DPIFWpxG.js';
|
|
5
5
|
import { HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.COL12UTb.js';
|
|
7
7
|
import '@orpc/client';
|
|
8
8
|
import '@orpc/contract';
|
|
9
9
|
import '@orpc/standard-server';
|
|
10
10
|
import '@orpc/standard-server-peer';
|
|
11
|
-
import '../../shared/server.
|
|
11
|
+
import '../../shared/server.DNtJ-p60.js';
|
|
12
12
|
import '@orpc/client/standard';
|
|
13
|
-
import '../../shared/server.
|
|
13
|
+
import '../../shared/server.Cb6yD7DZ.js';
|
|
14
14
|
|
|
15
15
|
declare class WsHandler<T extends Context> {
|
|
16
16
|
private readonly standardHandler;
|
|
@@ -4,10 +4,10 @@ import { c as createServerPeerHandleRequestFn } from '../../shared/server.UVMTOW
|
|
|
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.Bxx6tqNe.mjs';
|
|
8
8
|
import '@orpc/client/standard';
|
|
9
9
|
import '../../shared/server.DZ5BIITo.mjs';
|
|
10
|
-
import '../../shared/server.
|
|
10
|
+
import '../../shared/server.Ds4HPpvH.mjs';
|
|
11
11
|
|
|
12
12
|
class WsHandler {
|
|
13
13
|
constructor(standardHandler) {
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -129,6 +129,21 @@ declare function sign(value: string, secret: string): Promise<string>;
|
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
131
|
declare function unsign(signedValue: string | undefined | null, secret: string): Promise<string | undefined>;
|
|
132
|
+
/**
|
|
133
|
+
* Extracts the value part from a signed string without verification.
|
|
134
|
+
*
|
|
135
|
+
* This function simply extracts the original value from a signed string
|
|
136
|
+
* without performing any signature verification. It's useful when you need
|
|
137
|
+
* to access the value quickly without the overhead of cryptographic verification.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const signedValue = "user123.oneQsU0r5dvwQFHFEjjV1uOI_IR3gZfkYHij3TRauVA"
|
|
142
|
+
* const value = getSignedValue(signedValue)
|
|
143
|
+
* expect(value).toEqual("user123")
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
declare function getSignedValue(signedValue: string | undefined | null): string | undefined;
|
|
132
147
|
|
|
133
|
-
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, setCookie, sign, unsign };
|
|
148
|
+
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, getSignedValue, setCookie, sign, unsign };
|
|
134
149
|
export type { GetCookieOptions, SetCookieOptions };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -129,6 +129,21 @@ declare function sign(value: string, secret: string): Promise<string>;
|
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
131
|
declare function unsign(signedValue: string | undefined | null, secret: string): Promise<string | undefined>;
|
|
132
|
+
/**
|
|
133
|
+
* Extracts the value part from a signed string without verification.
|
|
134
|
+
*
|
|
135
|
+
* This function simply extracts the original value from a signed string
|
|
136
|
+
* without performing any signature verification. It's useful when you need
|
|
137
|
+
* to access the value quickly without the overhead of cryptographic verification.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const signedValue = "user123.oneQsU0r5dvwQFHFEjjV1uOI_IR3gZfkYHij3TRauVA"
|
|
142
|
+
* const value = getSignedValue(signedValue)
|
|
143
|
+
* expect(value).toEqual("user123")
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
declare function getSignedValue(signedValue: string | undefined | null): string | undefined;
|
|
132
147
|
|
|
133
|
-
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, setCookie, sign, unsign };
|
|
148
|
+
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, getSignedValue, setCookie, sign, unsign };
|
|
134
149
|
export type { GetCookieOptions, SetCookieOptions };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -184,5 +184,15 @@ async function unsign(signedValue, secret) {
|
|
|
184
184
|
);
|
|
185
185
|
return isValid ? value : void 0;
|
|
186
186
|
}
|
|
187
|
+
function getSignedValue(signedValue) {
|
|
188
|
+
if (typeof signedValue !== "string") {
|
|
189
|
+
return void 0;
|
|
190
|
+
}
|
|
191
|
+
const lastDotIndex = signedValue.lastIndexOf(".");
|
|
192
|
+
if (lastDotIndex === -1) {
|
|
193
|
+
return void 0;
|
|
194
|
+
}
|
|
195
|
+
return signedValue.slice(0, lastDotIndex);
|
|
196
|
+
}
|
|
187
197
|
|
|
188
|
-
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, setCookie, sign, unsign };
|
|
198
|
+
export { decodeBase64url, decrypt, deleteCookie, encodeBase64url, encrypt, getCookie, getSignedValue, setCookie, sign, unsign };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
|
|
2
|
-
import { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.
|
|
2
|
+
import { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.DBCUJijK.mjs';
|
|
3
3
|
import { HibernationEventIterator } from '@orpc/standard-server';
|
|
4
4
|
export { HibernationEventIterator, 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.B4BGqy3Y.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 { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.
|
|
2
|
+
import { g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.DPIFWpxG.js';
|
|
3
3
|
import { HibernationEventIterator } from '@orpc/standard-server';
|
|
4
4
|
export { HibernationEventIterator, 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.B4BGqy3Y.js';
|
|
6
6
|
import '@orpc/client';
|
|
7
7
|
import '@orpc/contract';
|
|
8
8
|
import '@orpc/shared';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +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
3
|
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route, Schema, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure } from '@orpc/contract';
|
|
4
|
-
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type } from '@orpc/contract';
|
|
4
|
+
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type, validateORPCError } from '@orpc/contract';
|
|
5
5
|
import { ThrowableError, IntersectPick, MaybeOptionalOptions } from '@orpc/shared';
|
|
6
|
-
export { AsyncIteratorClass, 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.
|
|
8
|
-
export {
|
|
9
|
-
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.
|
|
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.
|
|
6
|
+
export { AsyncIteratorClass, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, 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.B4BGqy3Y.mjs';
|
|
8
|
+
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, w as MiddlewareNextFn, v as MiddlewareNextFnOptions, y as MiddlewareOptions, x as MiddlewareOutputFn, t as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, d as ProcedureClientInterceptorOptions, D as ProcedureDef, B as ProcedureHandlerOptions, n as createORPCErrorConstructorMap, F as createProcedureClient, s as getLazyMeta, r as isLazy, E as isProcedure, q as lazy, m as mergeCurrentContext, z as middlewareOutputFn, u as unlazy } from './shared/server.B4BGqy3Y.mjs';
|
|
9
|
+
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.DzV1hr3z.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.DzV1hr3z.mjs';
|
|
11
11
|
export { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
|
12
12
|
|
|
13
13
|
type ActionableError<T> = T extends ORPCError<infer U, infer V> ? ORPCErrorJSON<U, V> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +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
3
|
import { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, ErrorFromErrorMap, Meta, MergedErrorMap, Route, Schema, ContractRouter, ContractProcedureDef, AnyContractRouter, ContractProcedure, InferContractRouterErrorMap, InferContractRouterMeta, AnyContractProcedure } from '@orpc/contract';
|
|
4
|
-
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type } from '@orpc/contract';
|
|
4
|
+
export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type, validateORPCError } from '@orpc/contract';
|
|
5
5
|
import { ThrowableError, IntersectPick, MaybeOptionalOptions } from '@orpc/shared';
|
|
6
|
-
export { AsyncIteratorClass, 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.
|
|
8
|
-
export {
|
|
9
|
-
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.
|
|
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.
|
|
6
|
+
export { AsyncIteratorClass, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, IntersectPick, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, 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.B4BGqy3Y.js';
|
|
8
|
+
export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, o as LAZY_SYMBOL, p as LazyMeta, w as MiddlewareNextFn, v as MiddlewareNextFnOptions, y as MiddlewareOptions, x as MiddlewareOutputFn, t as MiddlewareResult, l as ORPCErrorConstructorMapItem, k as ORPCErrorConstructorMapItemOptions, d as ProcedureClientInterceptorOptions, D as ProcedureDef, B as ProcedureHandlerOptions, n as createORPCErrorConstructorMap, F as createProcedureClient, s as getLazyMeta, r as isLazy, E as isProcedure, q as lazy, m as mergeCurrentContext, z as middlewareOutputFn, u as unlazy } from './shared/server.B4BGqy3Y.js';
|
|
9
|
+
import { E as EnhanceRouterOptions, a as EnhancedRouter } from './shared/server.Cb6yD7DZ.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.Cb6yD7DZ.js';
|
|
11
11
|
export { getEventMeta, withEventMeta } from '@orpc/standard-server';
|
|
12
12
|
|
|
13
13
|
type ActionableError<T> = T extends ORPCError<infer U, infer V> ? ORPCErrorJSON<U, V> & {
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { mergeErrorMap, mergeMeta, mergeRoute, mergePrefix, mergeTags, isContractProcedure, getContractRouter, fallbackContractConfig } from '@orpc/contract';
|
|
2
|
-
export { ValidationError, eventIterator, type } from '@orpc/contract';
|
|
3
|
-
import { P as Procedure, b as addMiddleware, c as createProcedureClient, e as enhanceRouter, l as lazy, s as setHiddenRouterContract, u as unlazy, g as getRouter, i as isProcedure, d as isLazy, f as createAssertedLazyProcedure } from './shared/server.
|
|
4
|
-
export { L as LAZY_SYMBOL, p as call, r as createAccessibleLazyRouter, a as createContractedProcedure, h as createORPCErrorConstructorMap, q as getHiddenRouterContract, j as getLazyMeta, n as isStartWithMiddlewares, m as mergeCurrentContext, o as mergeMiddlewares, k as middlewareOutputFn,
|
|
2
|
+
export { ValidationError, eventIterator, type, validateORPCError } from '@orpc/contract';
|
|
3
|
+
import { P as Procedure, b as addMiddleware, c as createProcedureClient, e as enhanceRouter, l as lazy, s as setHiddenRouterContract, u as unlazy, g as getRouter, i as isProcedure, d as isLazy, f as createAssertedLazyProcedure } from './shared/server.Ds4HPpvH.mjs';
|
|
4
|
+
export { L as LAZY_SYMBOL, p as call, r as createAccessibleLazyRouter, a as createContractedProcedure, h as createORPCErrorConstructorMap, q as getHiddenRouterContract, j as getLazyMeta, n as isStartWithMiddlewares, m as mergeCurrentContext, o as mergeMiddlewares, k as middlewareOutputFn, v as resolveContractProcedures, t as traverseContractProcedures, w as unlazyRouter } from './shared/server.Ds4HPpvH.mjs';
|
|
5
5
|
import { toORPCError } from '@orpc/client';
|
|
6
6
|
export { ORPCError, isDefinedError, safe } from '@orpc/client';
|
|
7
|
-
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
8
|
-
export { AsyncIteratorClass, EventPublisher, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@orpc/shared';
|
|
7
|
+
import { isObject, resolveMaybeOptionalOptions } from '@orpc/shared';
|
|
8
|
+
export { AsyncIteratorClass, EventPublisher, asyncIteratorToStream as eventIteratorToStream, asyncIteratorToUnproxiedDataStream as eventIteratorToUnproxiedDataStream, 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 = {
|
|
@@ -54,6 +54,9 @@ function createActionableClient(client) {
|
|
|
54
54
|
if (error instanceof Error && "digest" in error && typeof error.digest === "string" && error.digest.startsWith("NEXT_")) {
|
|
55
55
|
throw error;
|
|
56
56
|
}
|
|
57
|
+
if (error instanceof Response && "options" in error && isObject(error.options) || isObject(error) && error.isNotFound === true) {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
57
60
|
return [toORPCError(error).toJSON(), void 0];
|
|
58
61
|
}
|
|
59
62
|
};
|
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 { d as StandardHandlerInterceptorOptions, g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.
|
|
5
|
-
import { C as Context, d as ProcedureClientInterceptorOptions } from '../shared/server.
|
|
4
|
+
import { d as StandardHandlerInterceptorOptions, g as StandardHandlerPlugin, e as StandardHandlerOptions } from '../shared/server.DBCUJijK.mjs';
|
|
5
|
+
import { C as Context, d as ProcedureClientInterceptorOptions } from '../shared/server.B4BGqy3Y.mjs';
|
|
6
6
|
import { Meta, ORPCError as ORPCError$1 } from '@orpc/contract';
|
|
7
7
|
import { ORPCError } from '@orpc/client';
|
|
8
8
|
|
|
@@ -160,6 +160,9 @@ interface StrictGetMethodPluginOptions {
|
|
|
160
160
|
*/
|
|
161
161
|
declare class StrictGetMethodPlugin<T extends Context> implements StandardHandlerPlugin<T> {
|
|
162
162
|
private readonly error;
|
|
163
|
+
/**
|
|
164
|
+
* make sure execute before batch plugin to get real method
|
|
165
|
+
*/
|
|
163
166
|
order: number;
|
|
164
167
|
constructor(options?: StrictGetMethodPluginOptions);
|
|
165
168
|
init(options: StandardHandlerOptions<T>): void;
|