@replit/river 0.24.3 → 0.25.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/{chunk-XKHLA5MP.js → chunk-4GCILF7L.js} +4 -4
- package/dist/{chunk-DZNP3EI5.js → chunk-6NPQ43ZP.js} +2 -2
- package/dist/{chunk-DZNP3EI5.js.map → chunk-6NPQ43ZP.js.map} +1 -1
- package/dist/{chunk-EHXKU4TW.js → chunk-BMSEVPGM.js} +2 -2
- package/dist/{chunk-FKBXIWWN.js → chunk-FEMGSUEE.js} +3 -3
- package/dist/{chunk-LSHUPI6U.js → chunk-JTZVFCMT.js} +2 -2
- package/dist/{chunk-W3CY6PNC.js → chunk-N2UT2H2D.js} +28 -23
- package/dist/chunk-N2UT2H2D.js.map +1 -0
- package/dist/{chunk-KVLCQ24J.js → chunk-XVGZYVNR.js} +34 -13
- package/dist/chunk-XVGZYVNR.js.map +1 -0
- package/dist/{client-2ba72e89.d.ts → client-1321630c.d.ts} +1 -1
- package/dist/{connection-55cba970.d.ts → connection-bd907ca6.d.ts} +1 -1
- package/dist/{handshake-0b88e8fc.d.ts → handshake-3772d7ca.d.ts} +4 -2
- package/dist/router/index.cjs +1 -1
- 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 +2 -2
- package/dist/{server-732e7014.d.ts → server-f0fd2b98.d.ts} +1 -1
- package/dist/{services-adfd0bc3.d.ts → services-8d14ae16.d.ts} +2 -2
- package/dist/transport/impls/ws/client.cjs +33 -12
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- package/dist/transport/impls/ws/client.js +7 -7
- package/dist/transport/impls/ws/server.cjs +57 -31
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +3 -3
- package/dist/transport/impls/ws/server.d.ts +3 -3
- package/dist/transport/impls/ws/server.js +5 -5
- package/dist/transport/index.cjs +57 -31
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +3 -3
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +7 -7
- package/dist/util/testHelpers.cjs +33 -27
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -7
- package/dist/util/testHelpers.d.ts +4 -7
- package/dist/util/testHelpers.js +3 -14
- package/dist/util/testHelpers.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KVLCQ24J.js.map +0 -1
- package/dist/chunk-TDFWZIXR.js +0 -106
- package/dist/chunk-TDFWZIXR.js.map +0 -1
- package/dist/chunk-W3CY6PNC.js.map +0 -1
- package/dist/connection-c6db05d9.d.ts +0 -31
- package/dist/transport/impls/uds/client.cjs +0 -1684
- package/dist/transport/impls/uds/client.cjs.map +0 -1
- package/dist/transport/impls/uds/client.d.cts +0 -18
- package/dist/transport/impls/uds/client.d.ts +0 -18
- package/dist/transport/impls/uds/client.js +0 -38
- package/dist/transport/impls/uds/client.js.map +0 -1
- package/dist/transport/impls/uds/server.cjs +0 -1650
- package/dist/transport/impls/uds/server.cjs.map +0 -1
- package/dist/transport/impls/uds/server.d.cts +0 -19
- package/dist/transport/impls/uds/server.d.ts +0 -19
- package/dist/transport/impls/uds/server.js +0 -33
- package/dist/transport/impls/uds/server.js.map +0 -1
- /package/dist/{chunk-XKHLA5MP.js.map → chunk-4GCILF7L.js.map} +0 -0
- /package/dist/{chunk-EHXKU4TW.js.map → chunk-BMSEVPGM.js.map} +0 -0
- /package/dist/{chunk-FKBXIWWN.js.map → chunk-FEMGSUEE.js.map} +0 -0
- /package/dist/{chunk-LSHUPI6U.js.map → chunk-JTZVFCMT.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-
|
|
2
|
-
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-8d14ae16.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-8d14ae16.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-
|
|
6
|
-
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-3772d7ca.js';
|
|
6
|
+
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-3772d7ca.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-f0fd2b98.js';
|
|
8
8
|
import '../message-e6c560fd.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-1321630c.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -45,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
45
45
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
46
46
|
}>): Server<Services>;
|
|
47
47
|
|
|
48
|
-
var version = "0.
|
|
48
|
+
var version = "0.25.0";
|
|
49
49
|
|
|
50
50
|
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-
|
|
2
|
-
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-8d14ae16.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-8d14ae16.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-
|
|
6
|
-
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-3772d7ca.js';
|
|
6
|
+
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-3772d7ca.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-f0fd2b98.js';
|
|
8
8
|
import '../message-e6c560fd.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-1321630c.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -45,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
45
45
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
46
46
|
}>): Server<Services>;
|
|
47
47
|
|
|
48
|
-
var version = "0.
|
|
48
|
+
var version = "0.25.0";
|
|
49
49
|
|
|
50
50
|
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
createServer,
|
|
11
11
|
createServerHandshakeOptions,
|
|
12
12
|
serializeSchema
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-JTZVFCMT.js";
|
|
14
14
|
import {
|
|
15
15
|
version
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-6NPQ43ZP.js";
|
|
17
17
|
export {
|
|
18
18
|
Err,
|
|
19
19
|
Ok,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Connection, w as CommonSession, d as SessionState, x as SessionHandshakingListeners, T as Transport, y as ServerTransportOptions, q as ServerHandshakeOptions, r as ParsedMetadata, c as ProvidedServerTransportOptions, S as Session } from './handshake-
|
|
1
|
+
import { C as Connection, w as CommonSession, d as SessionState, x as SessionHandshakingListeners, T as Transport, y as ServerTransportOptions, q as ServerHandshakeOptions, r as ParsedMetadata, c as ProvidedServerTransportOptions, S as Session } from './handshake-3772d7ca.js';
|
|
2
2
|
import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-e6c560fd.js';
|
|
3
3
|
|
|
4
4
|
declare class SessionWaitingForHandshake<ConnType extends Connection> extends CommonSession {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Static, TObject, TUnion, TString, TSchema, TNever, TLiteral } from '@sinclair/typebox';
|
|
2
2
|
import { Pushable } from 'it-pushable';
|
|
3
|
-
import { C as Connection, p as ClientHandshakeOptions, t as ServiceContextWithTransportInfo, n as ServiceContext } from './handshake-
|
|
3
|
+
import { C as Connection, p as ClientHandshakeOptions, t as ServiceContextWithTransportInfo, n as ServiceContext } from './handshake-3772d7ca.js';
|
|
4
4
|
import { c as TransportClientId } from './message-e6c560fd.js';
|
|
5
|
-
import { C as ClientTransport } from './client-
|
|
5
|
+
import { C as ClientTransport } from './client-1321630c.js';
|
|
6
6
|
|
|
7
7
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
8
8
|
/**
|
|
@@ -602,7 +602,7 @@ var SessionNoConnection = class extends IdentifiedSession {
|
|
|
602
602
|
var import_api = require("@opentelemetry/api");
|
|
603
603
|
|
|
604
604
|
// package.json
|
|
605
|
-
var version = "0.
|
|
605
|
+
var version = "0.25.0";
|
|
606
606
|
|
|
607
607
|
// tracing/index.ts
|
|
608
608
|
function getPropagationContext(ctx) {
|
|
@@ -726,15 +726,16 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
726
726
|
state = "Connected" /* Connected */;
|
|
727
727
|
conn;
|
|
728
728
|
listeners;
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
activeHeartbeatHandle;
|
|
730
|
+
activeHeartbeatMisses = 0;
|
|
731
|
+
passiveHeartbeatHandle;
|
|
731
732
|
get isActivelyHeartbeating() {
|
|
732
|
-
return this.
|
|
733
|
+
return this.activeHeartbeatHandle !== void 0;
|
|
733
734
|
}
|
|
734
735
|
updateBookkeeping(ack, seq) {
|
|
735
736
|
this.sendBuffer = this.sendBuffer.filter((unacked) => unacked.seq >= ack);
|
|
736
737
|
this.ack = seq + 1;
|
|
737
|
-
this.
|
|
738
|
+
this.activeHeartbeatMisses = 0;
|
|
738
739
|
}
|
|
739
740
|
send(msg) {
|
|
740
741
|
const constructedMsg = this.constructMsg(msg);
|
|
@@ -760,8 +761,8 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
760
761
|
}
|
|
761
762
|
}
|
|
762
763
|
startActiveHeartbeat() {
|
|
763
|
-
this.
|
|
764
|
-
const misses = this.
|
|
764
|
+
this.activeHeartbeatHandle = setInterval(() => {
|
|
765
|
+
const misses = this.activeHeartbeatMisses;
|
|
765
766
|
const missDuration = misses * this.options.heartbeatIntervalMs;
|
|
766
767
|
if (misses >= this.options.heartbeatsUntilDead) {
|
|
767
768
|
this.log?.info(
|
|
@@ -770,15 +771,32 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
770
771
|
);
|
|
771
772
|
this.telemetry.span.addEvent("closing connection due to inactivity");
|
|
772
773
|
this.conn.close();
|
|
773
|
-
clearInterval(this.
|
|
774
|
-
this.
|
|
774
|
+
clearInterval(this.activeHeartbeatHandle);
|
|
775
|
+
this.activeHeartbeatHandle = void 0;
|
|
775
776
|
return;
|
|
776
777
|
}
|
|
777
778
|
this.sendHeartbeat();
|
|
778
|
-
this.
|
|
779
|
+
this.activeHeartbeatMisses++;
|
|
779
780
|
}, this.options.heartbeatIntervalMs);
|
|
780
781
|
}
|
|
782
|
+
waitForNextHeartbeat() {
|
|
783
|
+
const duration = this.options.heartbeatsUntilDead * this.options.heartbeatIntervalMs;
|
|
784
|
+
if (this.passiveHeartbeatHandle) {
|
|
785
|
+
clearTimeout(this.passiveHeartbeatHandle);
|
|
786
|
+
this.passiveHeartbeatHandle = void 0;
|
|
787
|
+
}
|
|
788
|
+
this.passiveHeartbeatHandle = setTimeout(() => {
|
|
789
|
+
this.log?.info(
|
|
790
|
+
`closing connection to ${this.to} due to not receiving a heartbeat in the last ${duration}ms`,
|
|
791
|
+
this.loggingMetadata
|
|
792
|
+
);
|
|
793
|
+
this.telemetry.span.addEvent("closing connection due to inactivity");
|
|
794
|
+
this.conn.close();
|
|
795
|
+
this.passiveHeartbeatHandle = void 0;
|
|
796
|
+
}, duration);
|
|
797
|
+
}
|
|
781
798
|
sendHeartbeat() {
|
|
799
|
+
this.log?.debug("sending heartbeat", this.loggingMetadata);
|
|
782
800
|
this.send({
|
|
783
801
|
streamId: "heartbeat",
|
|
784
802
|
controlFlags: 1 /* AckBit */,
|
|
@@ -830,6 +848,7 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
830
848
|
});
|
|
831
849
|
if (!this.isActivelyHeartbeating) {
|
|
832
850
|
this.sendHeartbeat();
|
|
851
|
+
this.waitForNextHeartbeat();
|
|
833
852
|
}
|
|
834
853
|
};
|
|
835
854
|
_handleStateExit() {
|
|
@@ -837,8 +856,10 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
837
856
|
this.conn.removeDataListener(this.onMessageData);
|
|
838
857
|
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
839
858
|
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
840
|
-
clearInterval(this.
|
|
841
|
-
this.
|
|
859
|
+
clearInterval(this.activeHeartbeatHandle);
|
|
860
|
+
clearTimeout(this.passiveHeartbeatHandle);
|
|
861
|
+
this.activeHeartbeatHandle = void 0;
|
|
862
|
+
this.passiveHeartbeatHandle = void 0;
|
|
842
863
|
}
|
|
843
864
|
_handleClose() {
|
|
844
865
|
super._handleClose();
|