@replit/river 0.208.1 → 0.208.2
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-f2b6e211.d.ts → adapter-ChksXKVN.d.ts} +2 -2
- package/dist/adapter-Cuc4JtfV.d.cts +46 -0
- package/dist/{chunk-2WFRHXDZ.js → chunk-2OE32RBD.js} +11 -16
- package/dist/{chunk-2WFRHXDZ.js.map → chunk-2OE32RBD.js.map} +1 -1
- package/dist/{chunk-BXKBENJE.js → chunk-XB663LV7.js} +2 -2
- package/dist/{chunk-EVAQ2QMB.js → chunk-XS6CNYUH.js} +21 -25
- package/dist/{chunk-EVAQ2QMB.js.map → chunk-XS6CNYUH.js.map} +1 -1
- package/dist/codec/index.d.cts +3 -3
- package/dist/codec/index.d.ts +3 -3
- package/dist/codec/index.js +2 -2
- package/dist/connection-BF4zg6Qv.d.cts +35 -0
- package/dist/{connection-098d4aad.d.ts → connection-Donr3JRB.d.ts} +4 -4
- package/dist/index-C9tpZjBN.d.cts +37 -0
- package/dist/{index-02554794.d.ts → index-D8IOd3LG.d.ts} +2 -2
- package/dist/logging/index.d.cts +2 -2
- package/dist/logging/index.d.ts +2 -2
- package/dist/{message-01c3e85a.d.ts → message-Di94OL80.d.cts} +1 -1
- package/dist/message-Di94OL80.d.ts +108 -0
- package/dist/router/index.cjs +5 -9
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +7 -7
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +1 -1
- package/dist/testUtil/index.cjs +7 -13
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +5 -5
- package/dist/testUtil/index.d.ts +5 -5
- package/dist/testUtil/index.js +4 -5
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +5 -9
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +6 -6
- package/dist/transport/impls/ws/client.d.ts +6 -6
- package/dist/transport/impls/ws/client.js +3 -3
- package/dist/transport/impls/ws/server.cjs +6 -11
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +6 -6
- package/dist/transport/impls/ws/server.d.ts +6 -6
- package/dist/transport/impls/ws/server.js +3 -3
- package/dist/transport/index.cjs +6 -11
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +6 -6
- package/dist/transport/index.d.ts +6 -6
- package/dist/transport/index.js +3 -3
- package/dist/transport-CCaWx1Rb.d.cts +1566 -0
- package/dist/{services-44be1b6b.d.ts → transport-CZb3vdB4.d.ts} +323 -323
- package/dist/{wslike-e0b32dd5.d.ts → wslike-Dng9H1C7.d.cts} +1 -1
- package/dist/wslike-Dng9H1C7.d.ts +40 -0
- package/package.json +2 -2
- /package/dist/{chunk-BXKBENJE.js.map → chunk-XB663LV7.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OpaqueTransportMessage } from './message-
|
|
1
|
+
import { O as OpaqueTransportMessage } from './message-Di94OL80.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Codec interface for encoding and decoding objects to and from Uint8 buffers.
|
|
@@ -43,4 +43,4 @@ declare class CodecMessageAdapter {
|
|
|
43
43
|
fromBuffer(buf: Uint8Array): DeserializeResult;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export { Codec as C, SendResult as S, CodecMessageAdapter as a, SendBufferResult as b };
|
|
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 };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseLogger,
|
|
3
|
+
createLogProxy
|
|
4
|
+
} from "./chunk-CC7RN7GI.js";
|
|
1
5
|
import {
|
|
2
6
|
ControlMessageHandshakeRequestSchema,
|
|
3
7
|
ControlMessageHandshakeResponseSchema,
|
|
@@ -16,11 +20,7 @@ import {
|
|
|
16
20
|
handshakeResponseMessage,
|
|
17
21
|
isAcceptedProtocolVersion,
|
|
18
22
|
isAck
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
BaseLogger,
|
|
22
|
-
createLogProxy
|
|
23
|
-
} from "./chunk-CC7RN7GI.js";
|
|
23
|
+
} from "./chunk-XS6CNYUH.js";
|
|
24
24
|
|
|
25
25
|
// transport/events.ts
|
|
26
26
|
var ProtocolError = {
|
|
@@ -355,13 +355,11 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
|
|
|
355
355
|
this.listeners = props.listeners;
|
|
356
356
|
this.connPromise.then(
|
|
357
357
|
(conn) => {
|
|
358
|
-
if (this._isConsumed)
|
|
359
|
-
return;
|
|
358
|
+
if (this._isConsumed) return;
|
|
360
359
|
this.listeners.onConnectionEstablished(conn);
|
|
361
360
|
},
|
|
362
361
|
(err) => {
|
|
363
|
-
if (this._isConsumed)
|
|
364
|
-
return;
|
|
362
|
+
if (this._isConsumed) return;
|
|
365
363
|
this.listeners.onConnectionFailed(err);
|
|
366
364
|
}
|
|
367
365
|
);
|
|
@@ -1130,8 +1128,7 @@ var Transport = class {
|
|
|
1130
1128
|
* @param message The received message.
|
|
1131
1129
|
*/
|
|
1132
1130
|
handleMsg(message) {
|
|
1133
|
-
if (this.getStatus() !== "open")
|
|
1134
|
-
return;
|
|
1131
|
+
if (this.getStatus() !== "open") return;
|
|
1135
1132
|
this.eventDispatcher.dispatchEvent("message", message);
|
|
1136
1133
|
}
|
|
1137
1134
|
/**
|
|
@@ -1219,8 +1216,7 @@ var Transport = class {
|
|
|
1219
1216
|
});
|
|
1220
1217
|
}
|
|
1221
1218
|
deleteSession(session, options) {
|
|
1222
|
-
if (session._isConsumed)
|
|
1223
|
-
return;
|
|
1219
|
+
if (session._isConsumed) return;
|
|
1224
1220
|
const loggingMetadata = session.loggingMetadata;
|
|
1225
1221
|
if (loggingMetadata.tags && options?.unhealthy) {
|
|
1226
1222
|
loggingMetadata.tags.push("unhealthy-session");
|
|
@@ -1798,8 +1794,7 @@ var ServerTransport = class extends Transport {
|
|
|
1798
1794
|
super.deleteSession(session, options);
|
|
1799
1795
|
}
|
|
1800
1796
|
handleConnection(conn) {
|
|
1801
|
-
if (this.getStatus() !== "open")
|
|
1802
|
-
return;
|
|
1797
|
+
if (this.getStatus() !== "open") return;
|
|
1803
1798
|
this.log?.info(`new incoming connection`, {
|
|
1804
1799
|
...conn.loggingMetadata,
|
|
1805
1800
|
clientId: this.clientId
|
|
@@ -2240,4 +2235,4 @@ export {
|
|
|
2240
2235
|
Connection,
|
|
2241
2236
|
CodecMessageAdapter
|
|
2242
2237
|
};
|
|
2243
|
-
//# sourceMappingURL=chunk-
|
|
2238
|
+
//# sourceMappingURL=chunk-2OE32RBD.js.map
|