@replit/river 0.23.9 → 0.23.11
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/{chunk-YGW5PYGV.js → chunk-EOJMKMDO.js} +55 -73
- package/dist/chunk-EOJMKMDO.js.map +1 -0
- package/dist/{chunk-XKVIPKMR.js → chunk-HM7VDTDJ.js} +2 -2
- package/dist/{chunk-XUVTMFTJ.js → chunk-MEHCOYKJ.js} +2 -2
- package/dist/chunk-MEHCOYKJ.js.map +1 -0
- package/dist/{chunk-KIWWKSRI.js → chunk-T6YEMFUF.js} +2 -2
- package/dist/{chunk-U4CSF3SQ.js → chunk-ZSKCZYVU.js} +473 -15
- package/dist/chunk-ZSKCZYVU.js.map +1 -0
- package/dist/{connection-afa08cf1.d.ts → connection-261eee8f.d.ts} +1 -1
- package/dist/{connection-f5fb7805.d.ts → connection-c1eeb95d.d.ts} +1 -1
- package/dist/router/index.cjs +473 -14
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +45 -7
- package/dist/router/index.d.ts +45 -7
- package/dist/router/index.js +4 -2
- package/dist/{services-49b1b43d.d.ts → services-524bab79.d.ts} +2 -2
- package/dist/transport/impls/uds/client.cjs +52 -70
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- 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 +31 -60
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- 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 +55 -70
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- 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 +6 -3
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +31 -60
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- 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 +54 -72
- package/dist/transport/index.cjs.map +1 -1
- 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/{transport-3d0ba1da.d.ts → transport-c8f36f6d.d.ts} +15 -21
- package/dist/util/testHelpers.cjs +4 -21
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +3 -3
- package/package.json +3 -3
- package/dist/chunk-U4CSF3SQ.js.map +0 -1
- package/dist/chunk-XUVTMFTJ.js.map +0 -1
- package/dist/chunk-YGW5PYGV.js.map +0 -1
- /package/dist/{chunk-XKVIPKMR.js.map → chunk-HM7VDTDJ.js.map} +0 -0
- /package/dist/{chunk-KIWWKSRI.js.map → chunk-T6YEMFUF.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Codec } from './types-3e5768ec.js';
|
|
2
1
|
import { a as TelemetryInfo, M as MessageMetadata, T as TransportClientId, b as PropagationContext, L as Logger, P as PartialTransportMessage, c as TransportMessage, O as OpaqueTransportMessage, g as LogFn, h as LoggingLevel } from './index-60f03cb7.js';
|
|
2
|
+
import { C as Codec } from './types-3e5768ec.js';
|
|
3
3
|
import { TSchema, Static } from '@sinclair/typebox';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -144,9 +144,7 @@ declare class Session<ConnType extends Connection> {
|
|
|
144
144
|
replaceWithNewConnection(newConn: ConnType): void;
|
|
145
145
|
replaceWithNewHandshakingConnection(newConn: ConnType): void;
|
|
146
146
|
beginGrace(cb: () => void): void;
|
|
147
|
-
cancelGrace(
|
|
148
|
-
keepHeartbeatMisses: boolean;
|
|
149
|
-
}): void;
|
|
147
|
+
cancelGrace(): void;
|
|
150
148
|
/**
|
|
151
149
|
* Used to close the handshaking connection, if set.
|
|
152
150
|
*/
|
|
@@ -162,7 +160,6 @@ type ConnectionStatus = 'connect' | 'disconnect';
|
|
|
162
160
|
declare const ProtocolError: {
|
|
163
161
|
readonly RetriesExceeded: "conn_retry_exceeded";
|
|
164
162
|
readonly HandshakeFailed: "handshake_failed";
|
|
165
|
-
readonly UseAfterDestroy: "use_after_destroy";
|
|
166
163
|
readonly MessageOrderingViolated: "message_ordering_violated";
|
|
167
164
|
};
|
|
168
165
|
type ProtocolErrorType = (typeof ProtocolError)[keyof typeof ProtocolError];
|
|
@@ -180,11 +177,15 @@ interface EventMap {
|
|
|
180
177
|
type: ProtocolErrorType;
|
|
181
178
|
message: string;
|
|
182
179
|
};
|
|
180
|
+
transportStatus: {
|
|
181
|
+
status: TransportStatus;
|
|
182
|
+
};
|
|
183
183
|
}
|
|
184
184
|
type EventTypes = keyof EventMap;
|
|
185
185
|
type EventHandler<K extends EventTypes> = (event: EventMap[K]) => unknown;
|
|
186
186
|
declare class EventDispatcher<T extends EventTypes> {
|
|
187
187
|
private eventListeners;
|
|
188
|
+
removeAllListeners(): void;
|
|
188
189
|
numberOfListeners<K extends T>(eventType: K): number;
|
|
189
190
|
addEventListener<K extends T>(eventType: K, handler: EventHandler<K>): void;
|
|
190
191
|
removeEventListener<K extends T>(eventType: K, handler: EventHandler<K>): void;
|
|
@@ -290,7 +291,7 @@ type ServiceContextWithState<State> = ServiceContext & {
|
|
|
290
291
|
state: State;
|
|
291
292
|
};
|
|
292
293
|
type ServiceContextWithTransportInfo<State> = ServiceContext & {
|
|
293
|
-
state:
|
|
294
|
+
state: State;
|
|
294
295
|
to: TransportClientId;
|
|
295
296
|
from: TransportClientId;
|
|
296
297
|
streamId: string;
|
|
@@ -336,10 +337,9 @@ declare function createServerHandshakeOptions<MetadataSchema extends TSchema = T
|
|
|
336
337
|
/**
|
|
337
338
|
* Represents the possible states of a transport.
|
|
338
339
|
* @property {'open'} open - The transport is open and operational (note that this doesn't mean it is actively connected)
|
|
339
|
-
* @property {'closed'} closed - The transport is closed and
|
|
340
|
-
* @property {'destroyed'} destroyed - The transport is permanently destroyed and cannot be reopened.
|
|
340
|
+
* @property {'closed'} closed - The transport is permanently closed and cannot be reopened.
|
|
341
341
|
*/
|
|
342
|
-
type TransportStatus = 'open' | 'closed'
|
|
342
|
+
type TransportStatus = 'open' | 'closed';
|
|
343
343
|
type TransportOptions = SessionOptions;
|
|
344
344
|
type ProvidedTransportOptions = Partial<TransportOptions>;
|
|
345
345
|
type ClientTransportOptions = TransportOptions & ConnectionRetryOptions;
|
|
@@ -378,10 +378,9 @@ type ProvidedServerTransportOptions = Partial<ServerTransportOptions>;
|
|
|
378
378
|
*/
|
|
379
379
|
declare abstract class Transport<ConnType extends Connection> {
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
382
|
-
* A destroyed transport will not attempt to reconnect and cannot be used again.
|
|
381
|
+
* The status of the transport.
|
|
383
382
|
*/
|
|
384
|
-
|
|
383
|
+
private status;
|
|
385
384
|
/**
|
|
386
385
|
* The {@link Codec} used to encode and decode messages.
|
|
387
386
|
*/
|
|
@@ -429,7 +428,7 @@ declare abstract class Transport<ConnType extends Connection> {
|
|
|
429
428
|
* and we know the identity of the connected client.
|
|
430
429
|
* @param conn The connection object.
|
|
431
430
|
*/
|
|
432
|
-
protected onConnect(conn: ConnType,
|
|
431
|
+
protected onConnect(conn: ConnType, session: Session<ConnType>, isReconnect: boolean): void;
|
|
433
432
|
protected createSession(to: TransportClientId, conn?: ConnType, propagationCtx?: PropagationContext): Session<ConnType>;
|
|
434
433
|
protected getOrCreateSession({ to, conn, handshakingConn, sessionId, propagationCtx, }: {
|
|
435
434
|
to: TransportClientId;
|
|
@@ -482,8 +481,8 @@ declare abstract class Transport<ConnType extends Connection> {
|
|
|
482
481
|
* @param msg The message to send.
|
|
483
482
|
* @returns The ID of the sent message or undefined if it wasn't sent
|
|
484
483
|
*/
|
|
485
|
-
send(to: TransportClientId, msg: PartialTransportMessage): string
|
|
486
|
-
sendCloseStream(to: TransportClientId, streamId: string): string
|
|
484
|
+
send(to: TransportClientId, msg: PartialTransportMessage): string;
|
|
485
|
+
sendCloseStream(to: TransportClientId, streamId: string): string;
|
|
487
486
|
protected protocolError(type: ProtocolErrorType, message: string): void;
|
|
488
487
|
/**
|
|
489
488
|
* Default close implementation for transports. You should override this in the downstream
|
|
@@ -491,12 +490,7 @@ declare abstract class Transport<ConnType extends Connection> {
|
|
|
491
490
|
* Closes the transport. Any messages sent while the transport is closed will be silently discarded.
|
|
492
491
|
*/
|
|
493
492
|
close(): void;
|
|
494
|
-
|
|
495
|
-
* Default destroy implementation for transports. You should override this in the downstream
|
|
496
|
-
* implementation if you need to do any additional cleanup and call super.destroy() at the end.
|
|
497
|
-
* Destroys the transport. Any messages sent while the transport is destroyed will throw an error.
|
|
498
|
-
*/
|
|
499
|
-
destroy(): void;
|
|
493
|
+
getStatus(): TransportStatus;
|
|
500
494
|
}
|
|
501
495
|
declare abstract class ClientTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
502
496
|
/**
|
|
@@ -353,7 +353,7 @@ function Err(error) {
|
|
|
353
353
|
var import_api = require("@opentelemetry/api");
|
|
354
354
|
|
|
355
355
|
// package.json
|
|
356
|
-
var version = "0.23.
|
|
356
|
+
var version = "0.23.11";
|
|
357
357
|
|
|
358
358
|
// tracing/index.ts
|
|
359
359
|
function createSessionTelemetryInfo(session, propagationCtx) {
|
|
@@ -597,19 +597,8 @@ var Session = class {
|
|
|
597
597
|
`starting ${this.options.sessionDisconnectGraceMs}ms grace period until session to ${this.to} is closed`,
|
|
598
598
|
this.loggingMetadata
|
|
599
599
|
);
|
|
600
|
-
this.cancelGrace(
|
|
600
|
+
this.cancelGrace();
|
|
601
601
|
this.disconnectionGrace = setTimeout(() => {
|
|
602
|
-
if (this.connection !== void 0) {
|
|
603
|
-
this.log?.warn(
|
|
604
|
-
`grace period for ${this.to} elapsed while connected. not calling callback`,
|
|
605
|
-
{
|
|
606
|
-
...this.loggingMetadata,
|
|
607
|
-
connId: this.connection.id,
|
|
608
|
-
tags: ["invariant-violation"]
|
|
609
|
-
}
|
|
610
|
-
);
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
602
|
this.log?.info(
|
|
614
603
|
`grace period for ${this.to} elapsed`,
|
|
615
604
|
this.loggingMetadata
|
|
@@ -618,14 +607,8 @@ var Session = class {
|
|
|
618
607
|
}, this.options.sessionDisconnectGraceMs);
|
|
619
608
|
}
|
|
620
609
|
// called on reconnect of the underlying session
|
|
621
|
-
cancelGrace(
|
|
622
|
-
|
|
623
|
-
}) {
|
|
624
|
-
if (!keepHeartbeatMisses) {
|
|
625
|
-
this.heartbeatMisses = 0;
|
|
626
|
-
}
|
|
627
|
-
if (this.disconnectionGrace === void 0)
|
|
628
|
-
return;
|
|
610
|
+
cancelGrace() {
|
|
611
|
+
this.heartbeatMisses = 0;
|
|
629
612
|
clearTimeout(this.disconnectionGrace);
|
|
630
613
|
this.disconnectionGrace = void 0;
|
|
631
614
|
}
|