@orpc/server 0.0.0-next.de766b3 → 0.0.0-next.de7ca70
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 +4 -4
- package/dist/adapters/aws-lambda/index.d.ts +4 -4
- package/dist/adapters/aws-lambda/index.mjs +2 -2
- package/dist/adapters/bun-ws/index.d.mts +8 -8
- package/dist/adapters/bun-ws/index.d.ts +8 -8
- package/dist/adapters/bun-ws/index.mjs +11 -10
- package/dist/adapters/crossws/index.d.mts +7 -5
- package/dist/adapters/crossws/index.d.ts +7 -5
- package/dist/adapters/crossws/index.mjs +11 -10
- package/dist/adapters/fetch/index.d.mts +4 -4
- package/dist/adapters/fetch/index.d.ts +4 -4
- package/dist/adapters/fetch/index.mjs +2 -2
- package/dist/adapters/message-port/index.d.mts +7 -5
- package/dist/adapters/message-port/index.d.ts +7 -5
- package/dist/adapters/message-port/index.mjs +10 -10
- package/dist/adapters/node/index.d.mts +4 -4
- package/dist/adapters/node/index.d.ts +4 -4
- package/dist/adapters/node/index.mjs +2 -2
- package/dist/adapters/standard/index.d.mts +5 -4
- package/dist/adapters/standard/index.d.ts +5 -4
- package/dist/adapters/standard/index.mjs +3 -2
- 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 +32 -6
- package/dist/adapters/websocket/index.d.ts +32 -6
- package/dist/adapters/websocket/index.mjs +48 -18
- package/dist/adapters/ws/index.d.mts +7 -5
- package/dist/adapters/ws/index.d.ts +7 -5
- package/dist/adapters/ws/index.mjs +12 -12
- package/dist/hibernation/index.d.mts +44 -0
- package/dist/hibernation/index.d.ts +44 -0
- package/dist/hibernation/index.mjs +65 -0
- package/dist/index.d.mts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.mjs +3 -3
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/index.mjs +9 -3
- package/dist/shared/{server.DD2C4ujN.d.mts → server.6ohwBdwx.d.mts} +2 -2
- package/dist/shared/{server.DD2C4ujN.d.ts → server.6ohwBdwx.d.ts} +2 -2
- package/dist/shared/server.B3dVpAsJ.d.mts +12 -0
- package/dist/shared/{server.BPAWobQg.d.ts → server.B6GspgNq.d.ts} +2 -2
- package/dist/shared/{server.-ACo36I0.d.ts → server.BE3B4vij.d.ts} +3 -3
- package/dist/shared/{server.Dq8xr7PQ.d.mts → server.BtQsqpPB.d.mts} +3 -3
- package/dist/shared/{server.CHvOkcM3.mjs → server.CB8Snncu.mjs} +1 -1
- package/dist/shared/{server.Bd52nNaH.d.mts → server.CKafa5G2.d.mts} +2 -2
- package/dist/shared/server.CeW2jMCj.d.ts +12 -0
- package/dist/shared/{server.DG7Tamti.mjs → server.DLJzqnSX.mjs} +3 -2
- package/dist/shared/server.DxNFsvpM.mjs +20 -0
- package/package.json +22 -12
- package/dist/shared/server.BliFSTnG.d.mts +0 -10
- package/dist/shared/server.IG2MjhrD.d.ts +0 -10
package/README.md
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
- **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
|
31
31
|
- **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
|
32
32
|
- **📝 Contract-First Development**: Optionally define your API contract before implementation.
|
33
|
-
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
33
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
|
34
34
|
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
35
35
|
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
36
36
|
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@orpc/standard-server-aws-lambda';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.mjs';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B3dVpAsJ.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.mjs';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@orpc/standard-server-aws-lambda';
|
3
|
-
import { C as Context, R as Router } from '../../shared/server.
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.js';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CeW2jMCj.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.js';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -6,9 +6,9 @@ import '@orpc/standard-server/batch';
|
|
6
6
|
import '@orpc/client';
|
7
7
|
import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
|
8
8
|
import '@orpc/contract';
|
9
|
-
import { b as StandardRPCHandler } from '../../shared/server.
|
9
|
+
import { b as StandardRPCHandler } from '../../shared/server.CB8Snncu.mjs';
|
10
10
|
import '@orpc/client/standard';
|
11
|
-
import '../../shared/server.
|
11
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
12
12
|
|
13
13
|
class AwsLambdaHandler {
|
14
14
|
constructor(standardHandler, options = {}) {
|
@@ -1,23 +1,23 @@
|
|
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.6ohwBdwx.mjs';
|
3
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
4
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.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.B3dVpAsJ.mjs';
|
9
11
|
import '@orpc/client/standard';
|
10
12
|
|
11
13
|
interface ServerWebSocket {
|
12
|
-
send(message: string | ArrayBufferLike): number;
|
14
|
+
send(message: string | ArrayBufferLike | Uint8Array): number;
|
13
15
|
}
|
14
16
|
declare class experimental_BunWsHandler<T extends Context> {
|
15
17
|
private readonly standardHandler;
|
16
18
|
private readonly peers;
|
17
19
|
constructor(standardHandler: StandardHandler<T>);
|
18
|
-
message(ws: ServerWebSocket, message: string |
|
19
|
-
buffer: ArrayBufferLike;
|
20
|
-
}, ...rest: MaybeOptionalOptions<Omit<FriendlyStandardHandleOptions<T>, 'prefix'>>): Promise<void>;
|
20
|
+
message(ws: ServerWebSocket, message: string | ArrayBufferView, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
21
21
|
close(ws: ServerWebSocket): void;
|
22
22
|
}
|
23
23
|
|
@@ -1,23 +1,23 @@
|
|
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.6ohwBdwx.js';
|
3
|
+
import { a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
4
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.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.CeW2jMCj.js';
|
9
11
|
import '@orpc/client/standard';
|
10
12
|
|
11
13
|
interface ServerWebSocket {
|
12
|
-
send(message: string | ArrayBufferLike): number;
|
14
|
+
send(message: string | ArrayBufferLike | Uint8Array): number;
|
13
15
|
}
|
14
16
|
declare class experimental_BunWsHandler<T extends Context> {
|
15
17
|
private readonly standardHandler;
|
16
18
|
private readonly peers;
|
17
19
|
constructor(standardHandler: StandardHandler<T>);
|
18
|
-
message(ws: ServerWebSocket, message: string |
|
19
|
-
buffer: ArrayBufferLike;
|
20
|
-
}, ...rest: MaybeOptionalOptions<Omit<FriendlyStandardHandleOptions<T>, 'prefix'>>): Promise<void>;
|
20
|
+
message(ws: ServerWebSocket, message: string | ArrayBufferView, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
21
21
|
close(ws: ServerWebSocket): void;
|
22
22
|
}
|
23
23
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ServerPeer } from '@orpc/standard-server-peer';
|
3
|
-
import {
|
3
|
+
import { e as experimental_handleStandardServerPeerMessage } from '../../shared/server.DxNFsvpM.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.CB8Snncu.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
|
-
import '../../shared/server.
|
9
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
10
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
10
11
|
|
11
12
|
class experimental_BunWsHandler {
|
12
13
|
constructor(standardHandler) {
|
@@ -20,13 +21,13 @@ class experimental_BunWsHandler {
|
|
20
21
|
ws.send(message2);
|
21
22
|
}));
|
22
23
|
}
|
23
|
-
const
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
const encodedMessage = typeof message === "string" ? message : new Uint8Array(message.buffer, message.byteOffset, message.byteLength);
|
25
|
+
await experimental_handleStandardServerPeerMessage(
|
26
|
+
this.standardHandler,
|
27
|
+
peer,
|
28
|
+
encodedMessage,
|
29
|
+
resolveMaybeOptionalOptions(rest)
|
30
|
+
);
|
30
31
|
}
|
31
32
|
close(ws) {
|
32
33
|
const server = this.peers.get(ws);
|
@@ -1,19 +1,21 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { Peer, Message } from 'crossws';
|
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.6ohwBdwx.mjs';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
5
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.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.B3dVpAsJ.mjs';
|
10
12
|
import '@orpc/client/standard';
|
11
13
|
|
12
14
|
declare class experimental_CrosswsHandler<T extends Context> {
|
13
15
|
private readonly standardHandler;
|
14
16
|
private readonly peers;
|
15
17
|
constructor(standardHandler: StandardHandler<T>);
|
16
|
-
message(ws: Pick<Peer, 'send'>, message: Pick<Message, 'rawData' | 'uint8Array'>, ...rest: MaybeOptionalOptions<
|
18
|
+
message(ws: Pick<Peer, 'send'>, message: Pick<Message, 'rawData' | 'uint8Array'>, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
17
19
|
close(ws: Pick<Peer, 'send'>): void;
|
18
20
|
}
|
19
21
|
|
@@ -1,19 +1,21 @@
|
|
1
1
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { Peer, Message } from 'crossws';
|
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.6ohwBdwx.js';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
5
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.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.CeW2jMCj.js';
|
10
12
|
import '@orpc/client/standard';
|
11
13
|
|
12
14
|
declare class experimental_CrosswsHandler<T extends Context> {
|
13
15
|
private readonly standardHandler;
|
14
16
|
private readonly peers;
|
15
17
|
constructor(standardHandler: StandardHandler<T>);
|
16
|
-
message(ws: Pick<Peer, 'send'>, message: Pick<Message, 'rawData' | 'uint8Array'>, ...rest: MaybeOptionalOptions<
|
18
|
+
message(ws: Pick<Peer, 'send'>, message: Pick<Message, 'rawData' | 'uint8Array'>, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
17
19
|
close(ws: Pick<Peer, 'send'>): void;
|
18
20
|
}
|
19
21
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
2
2
|
import { ServerPeer } from '@orpc/standard-server-peer';
|
3
|
-
import {
|
3
|
+
import { e as experimental_handleStandardServerPeerMessage } from '../../shared/server.DxNFsvpM.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.CB8Snncu.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
|
-
import '../../shared/server.
|
9
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
10
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
10
11
|
|
11
12
|
class experimental_CrosswsHandler {
|
12
13
|
constructor(standardHandler) {
|
@@ -20,13 +21,13 @@ class experimental_CrosswsHandler {
|
|
20
21
|
ws.send(message2);
|
21
22
|
}));
|
22
23
|
}
|
23
|
-
const
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
const encodedMessage = typeof message.rawData === "string" ? message.rawData : message.uint8Array();
|
25
|
+
await experimental_handleStandardServerPeerMessage(
|
26
|
+
this.standardHandler,
|
27
|
+
peer,
|
28
|
+
encodedMessage,
|
29
|
+
resolveMaybeOptionalOptions(rest)
|
30
|
+
);
|
30
31
|
}
|
31
32
|
close(ws) {
|
32
33
|
const server = this.peers.get(ws);
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.mjs';
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
3
3
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
4
|
+
import { c as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B3dVpAsJ.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.mjs';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.js';
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
3
3
|
import { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
4
|
+
import { c as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CeW2jMCj.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.js';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -4,11 +4,11 @@ import { toStandardLazyRequest, toFetchResponse } from '@orpc/standard-server-fe
|
|
4
4
|
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
5
5
|
import '@orpc/standard-server';
|
6
6
|
import '@orpc/contract';
|
7
|
-
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.
|
7
|
+
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.CB8Snncu.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
9
|
import '@orpc/standard-server/batch';
|
10
10
|
import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
|
11
|
-
import '../../shared/server.
|
11
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
12
12
|
|
13
13
|
class BodyLimitPlugin {
|
14
14
|
maxBodySize;
|
@@ -1,18 +1,20 @@
|
|
1
1
|
import { SupportedMessagePort } from '@orpc/client/message-port';
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
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.6ohwBdwx.mjs';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
5
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.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.B3dVpAsJ.mjs';
|
10
12
|
import '@orpc/client/standard';
|
11
13
|
|
12
14
|
declare class experimental_MessagePortHandler<T extends Context> {
|
13
15
|
private readonly standardHandler;
|
14
16
|
constructor(standardHandler: StandardHandler<T>);
|
15
|
-
upgrade(port: SupportedMessagePort, ...rest: MaybeOptionalOptions<
|
17
|
+
upgrade(port: SupportedMessagePort, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): void;
|
16
18
|
}
|
17
19
|
|
18
20
|
/**
|
@@ -1,18 +1,20 @@
|
|
1
1
|
import { SupportedMessagePort } from '@orpc/client/message-port';
|
2
2
|
import { MaybeOptionalOptions } from '@orpc/shared';
|
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.6ohwBdwx.js';
|
4
|
+
import { a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
5
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.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.CeW2jMCj.js';
|
10
12
|
import '@orpc/client/standard';
|
11
13
|
|
12
14
|
declare class experimental_MessagePortHandler<T extends Context> {
|
13
15
|
private readonly standardHandler;
|
14
16
|
constructor(standardHandler: StandardHandler<T>);
|
15
|
-
upgrade(port: SupportedMessagePort, ...rest: MaybeOptionalOptions<
|
17
|
+
upgrade(port: SupportedMessagePort, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): void;
|
16
18
|
}
|
17
19
|
|
18
20
|
/**
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { postMessagePortMessage, onMessagePortMessage, onMessagePortClose } from '@orpc/client/message-port';
|
2
2
|
import { resolveMaybeOptionalOptions } from '@orpc/shared';
|
3
3
|
import { ServerPeer } from '@orpc/standard-server-peer';
|
4
|
-
import {
|
4
|
+
import { e as experimental_handleStandardServerPeerMessage } from '../../shared/server.DxNFsvpM.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.CB8Snncu.mjs';
|
9
9
|
import '@orpc/client/standard';
|
10
|
-
import '../../shared/server.
|
10
|
+
import '../../shared/server.DZ5BIITo.mjs';
|
11
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
11
12
|
|
12
13
|
class experimental_MessagePortHandler {
|
13
14
|
constructor(standardHandler) {
|
@@ -18,13 +19,12 @@ class experimental_MessagePortHandler {
|
|
18
19
|
return postMessagePortMessage(port, message);
|
19
20
|
});
|
20
21
|
onMessagePortMessage(port, async (message) => {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
await peer.response(id, response ?? { status: 404, headers: {}, body: "No procedure matched" });
|
22
|
+
await experimental_handleStandardServerPeerMessage(
|
23
|
+
this.standardHandler,
|
24
|
+
peer,
|
25
|
+
message,
|
26
|
+
resolveMaybeOptionalOptions(rest)
|
27
|
+
);
|
28
28
|
});
|
29
29
|
onMessagePortClose(port, () => {
|
30
30
|
peer.close();
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.mjs';
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@orpc/standard-server-node';
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
4
|
+
import { c as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B3dVpAsJ.mjs';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.mjs';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { C as Context, R as Router } from '../../shared/server.
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.6ohwBdwx.js';
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@orpc/shared';
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@orpc/standard-server-node';
|
4
|
-
import {
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
6
|
-
import { S as StandardRPCHandlerOptions } from '../../shared/server.
|
4
|
+
import { c as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CeW2jMCj.js';
|
6
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.js';
|
7
7
|
import '@orpc/client';
|
8
8
|
import '@orpc/contract';
|
9
9
|
import '@orpc/standard-server';
|
@@ -4,11 +4,11 @@ import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-serv
|
|
4
4
|
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
5
5
|
import '@orpc/standard-server';
|
6
6
|
import '@orpc/contract';
|
7
|
-
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.
|
7
|
+
import { C as CompositeStandardHandlerPlugin, b as StandardRPCHandler } from '../../shared/server.CB8Snncu.mjs';
|
8
8
|
import '@orpc/client/standard';
|
9
9
|
import '@orpc/standard-server/batch';
|
10
10
|
import { S as StrictGetMethodPlugin } from '../../shared/server.BW-nUGgA.mjs';
|
11
|
-
import '../../shared/server.
|
11
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
12
12
|
|
13
13
|
class BodyLimitPlugin {
|
14
14
|
maxBodySize;
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
export { C as CompositeStandardHandlerPlugin,
|
1
|
+
import { d as StandardCodec, e as StandardParams, f as StandardMatcher, g as StandardMatchResult } from '../../shared/server.BtQsqpPB.mjs';
|
2
|
+
export { C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, h as StandardHandleResult, a as StandardHandler, i as StandardHandlerInterceptorOptions, S as StandardHandlerOptions, c as StandardHandlerPlugin } from '../../shared/server.BtQsqpPB.mjs';
|
3
3
|
import { ORPCError, HTTPPath } 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, a as AnyRouter } from '../../shared/server.6ohwBdwx.mjs';
|
7
|
+
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.mjs';
|
8
|
+
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.B3dVpAsJ.mjs';
|
8
9
|
import '@orpc/contract';
|
9
10
|
import '@orpc/shared';
|
10
11
|
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
export { C as CompositeStandardHandlerPlugin,
|
1
|
+
import { d as StandardCodec, e as StandardParams, f as StandardMatcher, g as StandardMatchResult } from '../../shared/server.BE3B4vij.js';
|
2
|
+
export { C as CompositeStandardHandlerPlugin, b as StandardHandleOptions, h as StandardHandleResult, a as StandardHandler, i as StandardHandlerInterceptorOptions, S as StandardHandlerOptions, c as StandardHandlerPlugin } from '../../shared/server.BE3B4vij.js';
|
3
3
|
import { ORPCError, HTTPPath } 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, a as AnyRouter } from '../../shared/server.6ohwBdwx.js';
|
7
|
+
export { a as StandardRPCHandler, S as StandardRPCHandlerOptions } from '../../shared/server.B6GspgNq.js';
|
8
|
+
export { F as FriendlyStandardHandleOptions, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.CeW2jMCj.js';
|
8
9
|
import '@orpc/contract';
|
9
10
|
import '@orpc/shared';
|
10
11
|
|
@@ -1,7 +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.CB8Snncu.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';
|
5
6
|
import '@orpc/standard-server';
|
6
|
-
import '../../shared/server.
|
7
|
+
import '../../shared/server.DLJzqnSX.mjs';
|
7
8
|
import '@orpc/contract';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ServerPeer, EncodedMessage } from '@orpc/standard-server-peer';
|
2
|
+
import { C as Context } from '../../shared/server.6ohwBdwx.mjs';
|
3
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.B3dVpAsJ.mjs';
|
5
|
+
import '@orpc/client';
|
6
|
+
import '@orpc/contract';
|
7
|
+
import '@orpc/shared';
|
8
|
+
import '@orpc/standard-server';
|
9
|
+
|
10
|
+
type experimental_HandleStandardServerPeerMessageOptions<T extends Context> = Omit<FriendlyStandardHandleOptions<T>, 'prefix'>;
|
11
|
+
declare function experimental_handleStandardServerPeerMessage<T extends Context>(handler: StandardHandler<T>, peer: ServerPeer, message: EncodedMessage, options: experimental_HandleStandardServerPeerMessageOptions<T>): Promise<void>;
|
12
|
+
|
13
|
+
export { experimental_handleStandardServerPeerMessage };
|
14
|
+
export type { experimental_HandleStandardServerPeerMessageOptions };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ServerPeer, EncodedMessage } from '@orpc/standard-server-peer';
|
2
|
+
import { C as Context } from '../../shared/server.6ohwBdwx.js';
|
3
|
+
import { a as StandardHandler } from '../../shared/server.BE3B4vij.js';
|
4
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.CeW2jMCj.js';
|
5
|
+
import '@orpc/client';
|
6
|
+
import '@orpc/contract';
|
7
|
+
import '@orpc/shared';
|
8
|
+
import '@orpc/standard-server';
|
9
|
+
|
10
|
+
type experimental_HandleStandardServerPeerMessageOptions<T extends Context> = Omit<FriendlyStandardHandleOptions<T>, 'prefix'>;
|
11
|
+
declare function experimental_handleStandardServerPeerMessage<T extends Context>(handler: StandardHandler<T>, peer: ServerPeer, message: EncodedMessage, options: experimental_HandleStandardServerPeerMessageOptions<T>): Promise<void>;
|
12
|
+
|
13
|
+
export { experimental_handleStandardServerPeerMessage };
|
14
|
+
export type { experimental_HandleStandardServerPeerMessageOptions };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export { e as experimental_handleStandardServerPeerMessage } from '../../shared/server.DxNFsvpM.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,17 +1,42 @@
|
|
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.6ohwBdwx.mjs';
|
3
|
+
import { a as StandardHandler } from '../../shared/server.BtQsqpPB.mjs';
|
4
|
+
import { experimental_HandleStandardServerPeerMessageOptions } from '../standard-peer/index.mjs';
|
5
|
+
import { S as StandardRPCHandlerOptions } from '../../shared/server.CKafa5G2.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.B3dVpAsJ.mjs';
|
9
11
|
import '@orpc/client/standard';
|
10
12
|
|
13
|
+
type experimental_MinimalWebsocket = Pick<WebSocket, 'addEventListener' | 'send'>;
|
11
14
|
declare class experimental_WebsocketHandler<T extends Context> {
|
12
|
-
private
|
15
|
+
#private;
|
13
16
|
constructor(standardHandler: StandardHandler<T>);
|
14
|
-
|
17
|
+
/**
|
18
|
+
* Upgrades a WebSocket to enable handling
|
19
|
+
*
|
20
|
+
* This attaches the necessary 'message' and 'close' listeners to the WebSocket
|
21
|
+
*
|
22
|
+
* @warning Do not use this method if you're using `.message()` or `.close()`
|
23
|
+
*/
|
24
|
+
upgrade(ws: experimental_MinimalWebsocket, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): void;
|
25
|
+
/**
|
26
|
+
* Handles a single message received from a WebSocket.
|
27
|
+
*
|
28
|
+
* @warning Avoid calling this directly if `.upgrade()` is used.
|
29
|
+
*
|
30
|
+
* @param ws The WebSocket instance
|
31
|
+
* @param data The message payload, usually place in `event.data`
|
32
|
+
*/
|
33
|
+
message(ws: experimental_MinimalWebsocket, data: string | ArrayBuffer | Blob, ...rest: MaybeOptionalOptions<experimental_HandleStandardServerPeerMessageOptions<T>>): Promise<void>;
|
34
|
+
/**
|
35
|
+
* Closes the WebSocket peer and cleans up.
|
36
|
+
*
|
37
|
+
* @warning Avoid calling this directly if `.upgrade()` is used.
|
38
|
+
*/
|
39
|
+
close(ws: experimental_MinimalWebsocket): void;
|
15
40
|
}
|
16
41
|
|
17
42
|
/**
|
@@ -25,3 +50,4 @@ declare class experimental_RPCHandler<T extends Context> extends experimental_We
|
|
25
50
|
}
|
26
51
|
|
27
52
|
export { experimental_RPCHandler, experimental_WebsocketHandler };
|
53
|
+
export type { experimental_MinimalWebsocket };
|