@replit/river 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -11
- package/dist/{chunk-Q6WPGM3K.js → chunk-7IQO434V.js} +11 -3
- package/dist/{chunk-7SPCAA6Q.js → chunk-LQMPJI3S.js} +101 -97
- package/dist/{chunk-GFRAOY75.js → chunk-VH3NGOXQ.js} +8 -17
- package/dist/{chunk-L65XWBX2.js → chunk-VJRLJ3JU.js} +1 -1
- package/dist/{chunk-XLJGKNV2.js → chunk-Y6DLSCKU.js} +1 -1
- package/dist/{connection-94896f3b.d.ts → connection-0767dc6b.d.ts} +1 -1
- package/dist/{connection-99346822.d.ts → connection-f31edbcd.d.ts} +1 -1
- package/dist/{index-2e402bb8.d.ts → index-8df0bdfb.d.ts} +27 -31
- package/dist/{procedures-f0226890.d.ts → procedures-b5ddb54d.d.ts} +1 -1
- package/dist/router/index.cjs +12 -4
- package/dist/router/index.d.cts +8 -4
- package/dist/router/index.d.ts +8 -4
- package/dist/router/index.js +2 -2
- package/dist/transport/impls/uds/client.cjs +80 -69
- package/dist/transport/impls/uds/client.d.cts +2 -2
- package/dist/transport/impls/uds/client.d.ts +2 -2
- package/dist/transport/impls/uds/client.js +3 -3
- package/dist/transport/impls/uds/server.cjs +82 -94
- package/dist/transport/impls/uds/server.d.cts +2 -2
- package/dist/transport/impls/uds/server.d.ts +2 -2
- package/dist/transport/impls/uds/server.js +3 -3
- package/dist/transport/impls/ws/client.cjs +80 -69
- package/dist/transport/impls/ws/client.d.cts +2 -2
- package/dist/transport/impls/ws/client.d.ts +2 -2
- package/dist/transport/impls/ws/client.js +3 -3
- package/dist/transport/impls/ws/server.cjs +82 -94
- package/dist/transport/impls/ws/server.d.cts +2 -2
- package/dist/transport/impls/ws/server.d.ts +2 -2
- package/dist/transport/impls/ws/server.js +3 -3
- package/dist/transport/index.cjs +107 -115
- package/dist/transport/index.d.cts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +2 -2
- package/dist/util/testHelpers.cjs +45 -18
- package/dist/util/testHelpers.d.cts +4 -9
- package/dist/util/testHelpers.d.ts +4 -9
- package/dist/util/testHelpers.js +8 -14
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-b5ddb54d.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-8df0bdfb.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
|
-
import { C as Codec } from '../types-3e5768ec.js';
|
|
6
5
|
import WebSocket from 'isomorphic-ws';
|
|
7
6
|
import http from 'node:http';
|
|
8
7
|
import net from 'node:net';
|
|
8
|
+
import '../types-3e5768ec.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Creates a WebSocket server instance using the provided HTTP server.
|
|
@@ -48,12 +48,7 @@ declare function createDummyTransportMessage(): PartialTransportMessage<{
|
|
|
48
48
|
* @returns A promise that resolves with the payload of the first message that passes the filter.
|
|
49
49
|
*/
|
|
50
50
|
declare function waitForMessage(t: Transport<Connection>, filter?: (msg: OpaqueTransportMessage) => boolean, rejectMismatch?: boolean): Promise<unknown>;
|
|
51
|
-
declare const testingSessionOptions:
|
|
52
|
-
heartbeatIntervalMs: number;
|
|
53
|
-
heartbeatsUntilDead: number;
|
|
54
|
-
sessionDisconnectGraceMs: number;
|
|
55
|
-
codec: Codec;
|
|
56
|
-
};
|
|
51
|
+
declare const testingSessionOptions: SessionOptions;
|
|
57
52
|
declare function asClientRpc<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError, Init extends PayloadType | null = null>(state: State, proc: Procedure<State, 'rpc', I, O, E, Init>, extendedContext?: Omit<ServiceContext, 'state'>): (msg: Static<I>) => Promise<Result<Static<O>, Static<E> | Static<typeof RiverUncaughtSchema>>>;
|
|
58
53
|
declare function asClientStream<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError, Init extends PayloadType | null = null>(state: State, proc: Procedure<State, 'stream', I, O, E, Init>, init?: Init extends PayloadType ? Static<Init> : null, extendedContext?: Omit<ServiceContext, 'state'>): readonly [it_pushable.Pushable<Static<I>, void, unknown>, it_pushable.Pushable<Result<Static<O>, Static<E>>, void, unknown>];
|
|
59
54
|
declare function asClientSubscription<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError>(state: State, proc: Procedure<State, 'subscription', I, O, E>, extendedContext?: Omit<ServiceContext, 'state'>): (msg: Static<I>) => it_pushable.Pushable<Result<Static<O>, Static<E>>, void, unknown>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-b5ddb54d.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-8df0bdfb.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
|
-
import { C as Codec } from '../types-3e5768ec.js';
|
|
6
5
|
import WebSocket from 'isomorphic-ws';
|
|
7
6
|
import http from 'node:http';
|
|
8
7
|
import net from 'node:net';
|
|
8
|
+
import '../types-3e5768ec.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Creates a WebSocket server instance using the provided HTTP server.
|
|
@@ -48,12 +48,7 @@ declare function createDummyTransportMessage(): PartialTransportMessage<{
|
|
|
48
48
|
* @returns A promise that resolves with the payload of the first message that passes the filter.
|
|
49
49
|
*/
|
|
50
50
|
declare function waitForMessage(t: Transport<Connection>, filter?: (msg: OpaqueTransportMessage) => boolean, rejectMismatch?: boolean): Promise<unknown>;
|
|
51
|
-
declare const testingSessionOptions:
|
|
52
|
-
heartbeatIntervalMs: number;
|
|
53
|
-
heartbeatsUntilDead: number;
|
|
54
|
-
sessionDisconnectGraceMs: number;
|
|
55
|
-
codec: Codec;
|
|
56
|
-
};
|
|
51
|
+
declare const testingSessionOptions: SessionOptions;
|
|
57
52
|
declare function asClientRpc<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError, Init extends PayloadType | null = null>(state: State, proc: Procedure<State, 'rpc', I, O, E, Init>, extendedContext?: Omit<ServiceContext, 'state'>): (msg: Static<I>) => Promise<Result<Static<O>, Static<E> | Static<typeof RiverUncaughtSchema>>>;
|
|
58
53
|
declare function asClientStream<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError, Init extends PayloadType | null = null>(state: State, proc: Procedure<State, 'stream', I, O, E, Init>, init?: Init extends PayloadType ? Static<Init> : null, extendedContext?: Omit<ServiceContext, 'state'>): readonly [it_pushable.Pushable<Static<I>, void, unknown>, it_pushable.Pushable<Result<Static<O>, Static<E>>, void, unknown>];
|
|
59
54
|
declare function asClientSubscription<State extends object, I extends PayloadType, O extends PayloadType, E extends RiverError>(state: State, proc: Procedure<State, 'subscription', I, O, E>, extendedContext?: Omit<ServiceContext, 'state'>): (msg: Static<I>) => it_pushable.Pushable<Result<Static<O>, Static<E>>, void, unknown>;
|
package/dist/util/testHelpers.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UNCAUGHT_ERROR,
|
|
3
3
|
pushable
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7IQO434V.js";
|
|
5
5
|
import "../chunk-RPIDSIQG.js";
|
|
6
6
|
import {
|
|
7
|
-
Session
|
|
8
|
-
|
|
7
|
+
Session,
|
|
8
|
+
defaultTransportOptions
|
|
9
|
+
} from "../chunk-LQMPJI3S.js";
|
|
9
10
|
import {
|
|
10
11
|
coerceErrorString
|
|
11
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-VH3NGOXQ.js";
|
|
12
13
|
import "../chunk-H4BYJELI.js";
|
|
13
|
-
import
|
|
14
|
-
NaiveJsonCodec
|
|
15
|
-
} from "../chunk-GZ7HCLLM.js";
|
|
14
|
+
import "../chunk-GZ7HCLLM.js";
|
|
16
15
|
|
|
17
16
|
// util/testHelpers.ts
|
|
18
17
|
import WebSocket from "isomorphic-ws";
|
|
@@ -86,17 +85,12 @@ function catchProcError(err) {
|
|
|
86
85
|
}
|
|
87
86
|
};
|
|
88
87
|
}
|
|
89
|
-
var testingSessionOptions =
|
|
90
|
-
heartbeatIntervalMs: 1e3,
|
|
91
|
-
heartbeatsUntilDead: 2,
|
|
92
|
-
sessionDisconnectGraceMs: 5e3,
|
|
93
|
-
codec: NaiveJsonCodec
|
|
94
|
-
};
|
|
88
|
+
var testingSessionOptions = defaultTransportOptions;
|
|
95
89
|
function dummyCtx(state, extendedContext) {
|
|
96
90
|
const session = new Session(
|
|
91
|
+
void 0,
|
|
97
92
|
"client",
|
|
98
93
|
"SERVER",
|
|
99
|
-
void 0,
|
|
100
94
|
testingSessionOptions
|
|
101
95
|
);
|
|
102
96
|
return {
|
package/package.json
CHANGED