@replit/river 0.207.2 → 0.208.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/dist/adapter-ChksXKVN.d.ts +46 -0
- package/dist/adapter-Cuc4JtfV.d.cts +46 -0
- package/dist/chunk-2JNVDUMN.js +2238 -0
- package/dist/chunk-2JNVDUMN.js.map +1 -0
- package/dist/{chunk-4HE7UYRL.js → chunk-DKW3GC3M.js} +6 -5
- package/dist/{chunk-4HE7UYRL.js.map → chunk-DKW3GC3M.js.map} +1 -1
- package/dist/{chunk-46IVOKJU.js → chunk-ETZAHFGQ.js} +80 -61
- package/dist/chunk-ETZAHFGQ.js.map +1 -0
- package/dist/codec/index.cjs +157 -23
- package/dist/codec/index.cjs.map +1 -1
- package/dist/codec/index.d.cts +5 -1
- package/dist/codec/index.d.ts +5 -1
- package/dist/codec/index.js +6 -20
- package/dist/codec/index.js.map +1 -1
- package/dist/connection-BF4zg6Qv.d.cts +35 -0
- package/dist/{connection-a18e31d5.d.ts → connection-Donr3JRB.d.ts} +4 -3
- package/dist/index-C9tpZjBN.d.cts +37 -0
- package/dist/index-D8IOd3LG.d.ts +37 -0
- package/dist/logging/index.d.cts +2 -1
- package/dist/logging/index.d.ts +2 -1
- package/dist/{message-ffacb98a.d.ts → message-Di94OL80.d.cts} +1 -35
- package/dist/message-Di94OL80.d.ts +108 -0
- package/dist/router/index.cjs +62 -43
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +27 -7
- package/dist/router/index.d.ts +27 -7
- package/dist/router/index.js +1 -1
- package/dist/testUtil/index.cjs +828 -725
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +5 -4
- package/dist/testUtil/index.d.ts +5 -4
- package/dist/testUtil/index.js +23 -25
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +293 -233
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +6 -5
- package/dist/transport/impls/ws/client.d.ts +6 -5
- package/dist/transport/impls/ws/client.js +5 -7
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +269 -200
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +6 -5
- package/dist/transport/impls/ws/server.d.ts +6 -5
- package/dist/transport/impls/ws/server.js +5 -7
- package/dist/transport/impls/ws/server.js.map +1 -1
- package/dist/transport/index.cjs +438 -342
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +7 -6
- package/dist/transport/index.d.ts +7 -6
- package/dist/transport/index.js +5 -10
- package/dist/transport-CCaWx1Rb.d.cts +1566 -0
- package/dist/{services-43528f4b.d.ts → transport-CZb3vdB4.d.ts} +294 -293
- package/dist/{wslike-e0b32dd5.d.ts → wslike-Dng9H1C7.d.cts} +1 -1
- package/dist/wslike-Dng9H1C7.d.ts +40 -0
- package/package.json +3 -3
- package/dist/chunk-24EWYOGK.js +0 -1287
- package/dist/chunk-24EWYOGK.js.map +0 -1
- package/dist/chunk-46IVOKJU.js.map +0 -1
- package/dist/chunk-A7RGOVRV.js +0 -438
- package/dist/chunk-A7RGOVRV.js.map +0 -1
- package/dist/chunk-AJGIY2UB.js +0 -56
- package/dist/chunk-AJGIY2UB.js.map +0 -1
- package/dist/chunk-XV4RQ62N.js +0 -377
- package/dist/chunk-XV4RQ62N.js.map +0 -1
- package/dist/types-3e5768ec.d.ts +0 -20
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { O as OpaqueTransportMessage } from './message-Di94OL80.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Codec interface for encoding and decoding objects to and from Uint8 buffers.
|
|
5
|
+
* Used to prepare messages for use by the transport layer.
|
|
6
|
+
*/
|
|
7
|
+
interface Codec {
|
|
8
|
+
/**
|
|
9
|
+
* Encodes an object to a Uint8 buffer.
|
|
10
|
+
* @param obj - The object to encode.
|
|
11
|
+
* @returns The encoded Uint8 buffer.
|
|
12
|
+
*/
|
|
13
|
+
toBuffer(obj: object): Uint8Array;
|
|
14
|
+
/**
|
|
15
|
+
* Decodes an object from a Uint8 buffer.
|
|
16
|
+
* @param buf - The Uint8 buffer to decode.
|
|
17
|
+
* @returns The decoded object, or null if decoding failed.
|
|
18
|
+
*/
|
|
19
|
+
fromBuffer(buf: Uint8Array): object;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type SessionApiResult<T> = {
|
|
23
|
+
ok: true;
|
|
24
|
+
value: T;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
29
|
+
type SendResult = SessionApiResult<string>;
|
|
30
|
+
type SendBufferResult = SessionApiResult<undefined>;
|
|
31
|
+
type SerializeResult = SessionApiResult<Uint8Array>;
|
|
32
|
+
type DeserializeResult = SessionApiResult<OpaqueTransportMessage>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Adapts a {@link Codec} to the {@link OpaqueTransportMessage} format,
|
|
36
|
+
* accounting for fallibility of toBuffer and fromBuffer and wrapping
|
|
37
|
+
* it with a Result type.
|
|
38
|
+
*/
|
|
39
|
+
declare class CodecMessageAdapter {
|
|
40
|
+
private readonly codec;
|
|
41
|
+
constructor(codec: Codec);
|
|
42
|
+
toBuffer(msg: OpaqueTransportMessage): SerializeResult;
|
|
43
|
+
fromBuffer(buf: Uint8Array): DeserializeResult;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { type Codec as C, type SendResult as S, CodecMessageAdapter as a, type SendBufferResult as b };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { O as OpaqueTransportMessage } from './message-Di94OL80.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Codec interface for encoding and decoding objects to and from Uint8 buffers.
|
|
5
|
+
* Used to prepare messages for use by the transport layer.
|
|
6
|
+
*/
|
|
7
|
+
interface Codec {
|
|
8
|
+
/**
|
|
9
|
+
* Encodes an object to a Uint8 buffer.
|
|
10
|
+
* @param obj - The object to encode.
|
|
11
|
+
* @returns The encoded Uint8 buffer.
|
|
12
|
+
*/
|
|
13
|
+
toBuffer(obj: object): Uint8Array;
|
|
14
|
+
/**
|
|
15
|
+
* Decodes an object from a Uint8 buffer.
|
|
16
|
+
* @param buf - The Uint8 buffer to decode.
|
|
17
|
+
* @returns The decoded object, or null if decoding failed.
|
|
18
|
+
*/
|
|
19
|
+
fromBuffer(buf: Uint8Array): object;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type SessionApiResult<T> = {
|
|
23
|
+
ok: true;
|
|
24
|
+
value: T;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
29
|
+
type SendResult = SessionApiResult<string>;
|
|
30
|
+
type SendBufferResult = SessionApiResult<undefined>;
|
|
31
|
+
type SerializeResult = SessionApiResult<Uint8Array>;
|
|
32
|
+
type DeserializeResult = SessionApiResult<OpaqueTransportMessage>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Adapts a {@link Codec} to the {@link OpaqueTransportMessage} format,
|
|
36
|
+
* accounting for fallibility of toBuffer and fromBuffer and wrapping
|
|
37
|
+
* it with a Result type.
|
|
38
|
+
*/
|
|
39
|
+
declare class CodecMessageAdapter {
|
|
40
|
+
private readonly codec;
|
|
41
|
+
constructor(codec: Codec);
|
|
42
|
+
toBuffer(msg: OpaqueTransportMessage): SerializeResult;
|
|
43
|
+
fromBuffer(buf: Uint8Array): DeserializeResult;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { type Codec as C, type SendResult as S, CodecMessageAdapter as a, type SendBufferResult as b };
|