@replit/river 0.26.5 → 0.26.6
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-IPOUVVKT.js → chunk-3NZ73HXL.js} +12 -7
- package/dist/chunk-3NZ73HXL.js.map +1 -0
- package/dist/{chunk-QEWSUVWV.js → chunk-5INVLQT5.js} +2 -2
- package/dist/{chunk-FA2IRWCM.js → chunk-APGOIQC4.js} +2 -2
- package/dist/{chunk-PZEYFHAB.js → chunk-CER7XNCN.js} +11 -8
- package/dist/chunk-CER7XNCN.js.map +1 -0
- package/dist/{chunk-7KB7DHFZ.js → chunk-H2RVJ32Z.js} +2 -2
- package/dist/{chunk-7KB7DHFZ.js.map → chunk-H2RVJ32Z.js.map} +1 -1
- package/dist/{chunk-XRZ52TYH.js → chunk-H677UET6.js} +15 -7
- package/dist/chunk-H677UET6.js.map +1 -0
- package/dist/{chunk-AZ3ILPXP.js → chunk-J7AQMYUQ.js} +8 -8
- package/dist/chunk-J7AQMYUQ.js.map +1 -0
- package/dist/{chunk-TAH2GVTJ.js → chunk-MZM234IB.js} +1 -1
- package/dist/chunk-MZM234IB.js.map +1 -0
- package/dist/{client-6c67339a.d.ts → client-96810511.d.ts} +2 -2
- package/dist/{connection-03ffb583.d.ts → connection-48133ec3.d.ts} +1 -1
- package/dist/{handshake-154a0bb2.d.ts → handshake-65e0e848.d.ts} +8 -3
- package/dist/logging/index.cjs.map +1 -1
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/{message-ff78a233.d.ts → message-e917ee98.d.ts} +1 -1
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +8 -8
- package/dist/router/index.d.ts +8 -8
- package/dist/router/index.js +2 -2
- package/dist/{server-1f5eb427.d.ts → server-b8aaf116.d.ts} +3 -3
- package/dist/{services-6140f578.d.ts → services-40e7c5cf.d.ts} +3 -3
- package/dist/transport/impls/ws/client.cjs +29 -13
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +4 -4
- package/dist/transport/impls/ws/client.d.ts +4 -4
- package/dist/transport/impls/ws/client.js +6 -6
- package/dist/transport/impls/ws/server.cjs +26 -13
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +4 -4
- package/dist/transport/impls/ws/server.d.ts +4 -4
- package/dist/transport/impls/ws/server.js +6 -6
- package/dist/transport/index.cjs +33 -17
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +4 -4
- package/dist/transport/index.d.ts +4 -4
- package/dist/transport/index.js +6 -6
- package/dist/util/testHelpers.cjs +14 -6
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -4
- package/dist/util/testHelpers.d.ts +4 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-AZ3ILPXP.js.map +0 -1
- package/dist/chunk-IPOUVVKT.js.map +0 -1
- package/dist/chunk-PZEYFHAB.js.map +0 -1
- package/dist/chunk-TAH2GVTJ.js.map +0 -1
- package/dist/chunk-XRZ52TYH.js.map +0 -1
- /package/dist/{chunk-QEWSUVWV.js.map → chunk-5INVLQT5.js.map} +0 -0
- /package/dist/{chunk-FA2IRWCM.js.map → chunk-APGOIQC4.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-40e7c5cf.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-40e7c5cf.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-
|
|
6
|
-
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
8
|
-
import '../message-
|
|
5
|
+
import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-65e0e848.js';
|
|
6
|
+
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-65e0e848.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-b8aaf116.js';
|
|
8
|
+
import '../message-e917ee98.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-96810511.js';
|
|
12
12
|
import '@sinclair/typebox/errors';
|
|
13
13
|
import '../types-3e5768ec.js';
|
|
14
14
|
|
|
@@ -46,6 +46,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
46
46
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
47
47
|
}>): Server<Services>;
|
|
48
48
|
|
|
49
|
-
var version = "0.26.
|
|
49
|
+
var version = "0.26.6";
|
|
50
50
|
|
|
51
51
|
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-40e7c5cf.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-40e7c5cf.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-
|
|
6
|
-
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
8
|
-
import '../message-
|
|
5
|
+
import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-65e0e848.js';
|
|
6
|
+
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-65e0e848.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-b8aaf116.js';
|
|
8
|
+
import '../message-e917ee98.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-96810511.js';
|
|
12
12
|
import '@sinclair/typebox/errors';
|
|
13
13
|
import '../types-3e5768ec.js';
|
|
14
14
|
|
|
@@ -46,6 +46,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
46
46
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
47
47
|
}>): Server<Services>;
|
|
48
48
|
|
|
49
|
-
var version = "0.26.
|
|
49
|
+
var version = "0.26.6";
|
|
50
50
|
|
|
51
51
|
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-APGOIQC4.js";
|
|
14
14
|
import {
|
|
15
15
|
version
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-H2RVJ32Z.js";
|
|
17
17
|
export {
|
|
18
18
|
Err,
|
|
19
19
|
Ok,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Connection, y as CommonSession, d as SessionState, z as CommonSessionProps, T as Transport, A as ServerTransportOptions, s as ServerHandshakeOptions, t as ParsedMetadata, B as ServerSession, c as ProvidedServerTransportOptions } from './handshake-
|
|
2
|
-
import { b as OpaqueTransportMessage, e as Tags, a as TransportMessage, H as HandshakeErrorResponseCodes, c as TransportClientId, P as PartialTransportMessage } from './message-
|
|
1
|
+
import { C as Connection, y as CommonSession, d as SessionState, z as CommonSessionProps, T as Transport, A as ServerTransportOptions, s as ServerHandshakeOptions, t as ParsedMetadata, B as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './handshake-65e0e848.js';
|
|
2
|
+
import { b as OpaqueTransportMessage, e as Tags, a as TransportMessage, H as HandshakeErrorResponseCodes, c as TransportClientId, P as PartialTransportMessage } from './message-e917ee98.js';
|
|
3
3
|
import * as _sinclair_typebox_errors from '@sinclair/typebox/errors';
|
|
4
4
|
import { Static } from '@sinclair/typebox';
|
|
5
5
|
|
|
@@ -59,7 +59,7 @@ declare abstract class ServerTransport<ConnType extends Connection> extends Tran
|
|
|
59
59
|
extendHandshake(options: ServerHandshakeOptions): void;
|
|
60
60
|
send(to: string, msg: PartialTransportMessage): string;
|
|
61
61
|
protected deletePendingSession(pendingSession: SessionWaitingForHandshake<ConnType>): void;
|
|
62
|
-
protected deleteSession(session: ServerSession<ConnType
|
|
62
|
+
protected deleteSession(session: ServerSession<ConnType>, options?: DeleteSessionOptions): void;
|
|
63
63
|
protected handleConnection(conn: ConnType): void;
|
|
64
64
|
private rejectHandshakeRequest;
|
|
65
65
|
protected onHandshakeRequest(session: SessionWaitingForHandshake<ConnType>, msg: OpaqueTransportMessage): Promise<void>;
|
|
@@ -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, v as ServiceContextWithTransportInfo, o as ServiceContext } from './handshake-
|
|
4
|
-
import { c as TransportClientId } from './message-
|
|
5
|
-
import { C as ClientTransport } from './client-
|
|
3
|
+
import { C as Connection, p as ClientHandshakeOptions, v as ServiceContextWithTransportInfo, o as ServiceContext } from './handshake-65e0e848.js';
|
|
4
|
+
import { c as TransportClientId } from './message-e917ee98.js';
|
|
5
|
+
import { C as ClientTransport } from './client-96810511.js';
|
|
6
6
|
|
|
7
7
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
8
8
|
/**
|
|
@@ -355,7 +355,8 @@ var createLogProxy = (log) => ({
|
|
|
355
355
|
var ProtocolError = {
|
|
356
356
|
RetriesExceeded: "conn_retry_exceeded",
|
|
357
357
|
HandshakeFailed: "handshake_failed",
|
|
358
|
-
MessageOrderingViolated: "message_ordering_violated"
|
|
358
|
+
MessageOrderingViolated: "message_ordering_violated",
|
|
359
|
+
InvalidMessage: "invalid_message"
|
|
359
360
|
};
|
|
360
361
|
var EventDispatcher = class {
|
|
361
362
|
eventListeners = {};
|
|
@@ -631,7 +632,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
|
|
|
631
632
|
var import_api = require("@opentelemetry/api");
|
|
632
633
|
|
|
633
634
|
// package.json
|
|
634
|
-
var version = "0.26.
|
|
635
|
+
var version = "0.26.6";
|
|
635
636
|
|
|
636
637
|
// tracing/index.ts
|
|
637
638
|
function getPropagationContext(ctx) {
|
|
@@ -841,6 +842,12 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
841
842
|
}
|
|
842
843
|
});
|
|
843
844
|
}
|
|
845
|
+
closeConnection() {
|
|
846
|
+
this.conn.removeDataListener(this.onMessageData);
|
|
847
|
+
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
848
|
+
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
849
|
+
this.conn.close();
|
|
850
|
+
}
|
|
844
851
|
onMessageData = (msg) => {
|
|
845
852
|
const parsedMsg = this.parseMsg(msg);
|
|
846
853
|
if (parsedMsg === null) {
|
|
@@ -857,8 +864,8 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
857
864
|
}
|
|
858
865
|
);
|
|
859
866
|
} else {
|
|
860
|
-
const reason = `received out-of-order msg (got seq: ${parsedMsg.seq}, wanted seq: ${this.ack})`;
|
|
861
|
-
this.log?.
|
|
867
|
+
const reason = `received out-of-order msg, closing connection (got seq: ${parsedMsg.seq}, wanted seq: ${this.ack})`;
|
|
868
|
+
this.log?.warn(reason, {
|
|
862
869
|
...this.loggingMetadata,
|
|
863
870
|
transportMessage: parsedMsg,
|
|
864
871
|
tags: ["invariant-violation"]
|
|
@@ -867,7 +874,7 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
867
874
|
code: import_api2.SpanStatusCode.ERROR,
|
|
868
875
|
message: reason
|
|
869
876
|
});
|
|
870
|
-
this.
|
|
877
|
+
this.closeConnection();
|
|
871
878
|
}
|
|
872
879
|
return;
|
|
873
880
|
}
|
|
@@ -893,8 +900,10 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
893
900
|
this.conn.removeDataListener(this.onMessageData);
|
|
894
901
|
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
895
902
|
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
896
|
-
|
|
897
|
-
|
|
903
|
+
if (this.heartbeatHandle) {
|
|
904
|
+
clearInterval(this.heartbeatHandle);
|
|
905
|
+
this.heartbeatHandle = void 0;
|
|
906
|
+
}
|
|
898
907
|
}
|
|
899
908
|
_handleClose() {
|
|
900
909
|
super._handleClose();
|
|
@@ -1323,8 +1332,12 @@ var Transport = class {
|
|
|
1323
1332
|
return session;
|
|
1324
1333
|
}
|
|
1325
1334
|
// state transitions
|
|
1326
|
-
deleteSession(session) {
|
|
1327
|
-
|
|
1335
|
+
deleteSession(session, options) {
|
|
1336
|
+
const loggingMetadata = session.loggingMetadata;
|
|
1337
|
+
if (loggingMetadata.tags && options?.unhealthy) {
|
|
1338
|
+
loggingMetadata.tags.push("unhealthy-session");
|
|
1339
|
+
}
|
|
1340
|
+
session.log?.info(`closing session ${session.id}`, loggingMetadata);
|
|
1328
1341
|
this.eventDispatcher.dispatchEvent("sessionStatus", {
|
|
1329
1342
|
status: "disconnect",
|
|
1330
1343
|
session
|
|
@@ -1486,7 +1499,7 @@ var ClientTransport = class extends Transport {
|
|
|
1486
1499
|
`invalid handshake: ${reason}`,
|
|
1487
1500
|
handshakingSession.loggingMetadata
|
|
1488
1501
|
);
|
|
1489
|
-
this.deleteSession(session);
|
|
1502
|
+
this.deleteSession(session, { unhealthy: true });
|
|
1490
1503
|
this.protocolError({
|
|
1491
1504
|
type: ProtocolError.HandshakeFailed,
|
|
1492
1505
|
code,
|
|
@@ -1515,7 +1528,7 @@ var ClientTransport = class extends Transport {
|
|
|
1515
1528
|
message: reason
|
|
1516
1529
|
});
|
|
1517
1530
|
this.log?.warn(reason, metadata);
|
|
1518
|
-
this.deleteSession(session);
|
|
1531
|
+
this.deleteSession(session, { unhealthy: true });
|
|
1519
1532
|
}
|
|
1520
1533
|
onHandshakeResponse(session, msg) {
|
|
1521
1534
|
if (!import_value2.Value.Check(ControlMessageHandshakeResponseSchema, msg.payload)) {
|
|
@@ -1580,9 +1593,9 @@ var ClientTransport = class extends Transport {
|
|
|
1580
1593
|
},
|
|
1581
1594
|
onMessage: (msg2) => this.handleMsg(msg2),
|
|
1582
1595
|
onInvalidMessage: (reason) => {
|
|
1583
|
-
this.deleteSession(connectedSession);
|
|
1596
|
+
this.deleteSession(connectedSession, { unhealthy: true });
|
|
1584
1597
|
this.protocolError({
|
|
1585
|
-
type: ProtocolError.
|
|
1598
|
+
type: ProtocolError.InvalidMessage,
|
|
1586
1599
|
message: reason
|
|
1587
1600
|
});
|
|
1588
1601
|
}
|
|
@@ -1694,6 +1707,9 @@ var ClientTransport = class extends Transport {
|
|
|
1694
1707
|
if (this.handshakeExtensions) {
|
|
1695
1708
|
metadata = await this.handshakeExtensions.construct();
|
|
1696
1709
|
}
|
|
1710
|
+
if (session._isConsumed) {
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1697
1713
|
const requestMsg = handshakeRequestMessage({
|
|
1698
1714
|
from: this.clientId,
|
|
1699
1715
|
to: session.to,
|