@replit/river 0.26.0 → 0.26.1
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-BNNELZM4.js → chunk-4W5LENT2.js} +2 -2
- package/dist/{chunk-5FDAIAQ5.js → chunk-6UVTCZ6K.js} +5 -5
- package/dist/chunk-6UVTCZ6K.js.map +1 -0
- package/dist/{chunk-KP4UB5NW.js → chunk-AYIMQWS7.js} +2 -2
- package/dist/{chunk-7ETNUCOL.js → chunk-IVNX5H6C.js} +19 -8
- package/dist/chunk-IVNX5H6C.js.map +1 -0
- package/dist/{chunk-JSU2KACV.js → chunk-M43R4RPL.js} +10 -4
- package/dist/chunk-M43R4RPL.js.map +1 -0
- package/dist/{chunk-CCUYKR5C.js → chunk-UQOD22AN.js} +2 -2
- package/dist/{chunk-CCUYKR5C.js.map → chunk-UQOD22AN.js.map} +1 -1
- package/dist/{chunk-5S64PXTU.js → chunk-XRI2BXMM.js} +23 -9
- package/dist/chunk-XRI2BXMM.js.map +1 -0
- package/dist/{client-162c509c.d.ts → client-0f636b3a.d.ts} +2 -2
- package/dist/{connection-6a404bb8.d.ts → connection-07e97a79.d.ts} +1 -1
- package/dist/{handshake-3342bb94.d.ts → handshake-8752f79e.d.ts} +9 -5
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/{message-1a434848.d.ts → message-57296605.d.ts} +2 -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-1b695374.d.ts → server-e304daec.d.ts} +2 -2
- package/dist/{services-c17f7eff.d.ts → services-fc99aae1.d.ts} +3 -3
- package/dist/transport/impls/ws/client.cjs +30 -10
- 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 +5 -5
- package/dist/transport/impls/ws/server.cjs +26 -9
- 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 +5 -5
- package/dist/transport/index.cjs +45 -14
- 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 +5 -5
- package/dist/util/testHelpers.cjs +9 -3
- 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-5FDAIAQ5.js.map +0 -1
- package/dist/chunk-5S64PXTU.js.map +0 -1
- package/dist/chunk-7ETNUCOL.js.map +0 -1
- package/dist/chunk-JSU2KACV.js.map +0 -1
- /package/dist/{chunk-BNNELZM4.js.map → chunk-4W5LENT2.js.map} +0 -0
- /package/dist/{chunk-KP4UB5NW.js.map → chunk-AYIMQWS7.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-fc99aae1.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-fc99aae1.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-8752f79e.js';
|
|
6
|
+
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-8752f79e.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-e304daec.js';
|
|
8
|
+
import '../message-57296605.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-0f636b3a.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.26.
|
|
48
|
+
var version = "0.26.1";
|
|
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-fc99aae1.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-fc99aae1.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-8752f79e.js';
|
|
6
|
+
export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-8752f79e.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-e304daec.js';
|
|
8
|
+
import '../message-57296605.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-0f636b3a.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.26.
|
|
48
|
+
var version = "0.26.1";
|
|
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-4W5LENT2.js";
|
|
14
14
|
import {
|
|
15
15
|
version
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-UQOD22AN.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 SessionHandshakingListeners, A as CommonSessionProps, T as Transport, B as ServerTransportOptions, s as ServerHandshakeOptions, t as ParsedMetadata, D as ServerSession, c as ProvidedServerTransportOptions } from './handshake-
|
|
2
|
-
import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-
|
|
1
|
+
import { C as Connection, y as CommonSession, d as SessionState, z as SessionHandshakingListeners, A as CommonSessionProps, T as Transport, B as ServerTransportOptions, s as ServerHandshakeOptions, t as ParsedMetadata, D as ServerSession, c as ProvidedServerTransportOptions } from './handshake-8752f79e.js';
|
|
2
|
+
import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-57296605.js';
|
|
3
3
|
|
|
4
4
|
interface SessionWaitingForHandshakeProps<ConnType extends Connection> extends CommonSessionProps {
|
|
5
5
|
conn: ConnType;
|
|
@@ -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-8752f79e.js';
|
|
4
|
+
import { c as TransportClientId } from './message-57296605.js';
|
|
5
|
+
import { C as ClientTransport } from './client-0f636b3a.js';
|
|
6
6
|
|
|
7
7
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
8
8
|
/**
|
|
@@ -608,7 +608,7 @@ var SessionNoConnection = class extends IdentifiedSession {
|
|
|
608
608
|
var import_api = require("@opentelemetry/api");
|
|
609
609
|
|
|
610
610
|
// package.json
|
|
611
|
-
var version = "0.26.
|
|
611
|
+
var version = "0.26.1";
|
|
612
612
|
|
|
613
613
|
// tracing/index.ts
|
|
614
614
|
function getPropagationContext(ctx) {
|
|
@@ -659,7 +659,10 @@ var SessionWaitingForHandshake = class extends CommonSession {
|
|
|
659
659
|
onHandshakeData = (msg) => {
|
|
660
660
|
const parsedMsg = this.parseMsg(msg);
|
|
661
661
|
if (parsedMsg === null) {
|
|
662
|
-
this.listeners.onInvalidHandshake(
|
|
662
|
+
this.listeners.onInvalidHandshake(
|
|
663
|
+
"could not parse message",
|
|
664
|
+
"MALFORMED_HANDSHAKE"
|
|
665
|
+
);
|
|
663
666
|
return;
|
|
664
667
|
}
|
|
665
668
|
this.listeners.onHandshake(parsedMsg);
|
|
@@ -705,7 +708,10 @@ var SessionHandshaking = class extends IdentifiedSession {
|
|
|
705
708
|
onHandshakeData = (msg) => {
|
|
706
709
|
const parsedMsg = this.parseMsg(msg);
|
|
707
710
|
if (parsedMsg === null) {
|
|
708
|
-
this.listeners.onInvalidHandshake(
|
|
711
|
+
this.listeners.onInvalidHandshake(
|
|
712
|
+
"could not parse message",
|
|
713
|
+
"MALFORMED_HANDSHAKE"
|
|
714
|
+
);
|
|
709
715
|
return;
|
|
710
716
|
}
|
|
711
717
|
this.listeners.onHandshake(parsedMsg);
|
|
@@ -1195,8 +1201,8 @@ var Transport = class {
|
|
|
1195
1201
|
removeEventListener(type, handler) {
|
|
1196
1202
|
this.eventDispatcher.removeEventListener(type, handler);
|
|
1197
1203
|
}
|
|
1198
|
-
protocolError(
|
|
1199
|
-
this.eventDispatcher.dispatchEvent("protocolError",
|
|
1204
|
+
protocolError(message) {
|
|
1205
|
+
this.eventDispatcher.dispatchEvent("protocolError", message);
|
|
1200
1206
|
}
|
|
1201
1207
|
/**
|
|
1202
1208
|
* Default close implementation for transports. You should override this in the downstream
|
|
@@ -1390,13 +1396,17 @@ var ClientTransport = class extends Transport {
|
|
|
1390
1396
|
onHandshake: (msg) => {
|
|
1391
1397
|
this.onHandshakeResponse(handshakingSession, msg);
|
|
1392
1398
|
},
|
|
1393
|
-
onInvalidHandshake: (reason) => {
|
|
1399
|
+
onInvalidHandshake: (reason, code) => {
|
|
1394
1400
|
this.log?.error(
|
|
1395
1401
|
`invalid handshake: ${reason}`,
|
|
1396
1402
|
handshakingSession.loggingMetadata
|
|
1397
1403
|
);
|
|
1398
1404
|
this.deleteSession(session);
|
|
1399
|
-
this.protocolError(
|
|
1405
|
+
this.protocolError({
|
|
1406
|
+
type: ProtocolError.HandshakeFailed,
|
|
1407
|
+
code,
|
|
1408
|
+
message: reason
|
|
1409
|
+
});
|
|
1400
1410
|
},
|
|
1401
1411
|
onHandshakeTimeout: () => {
|
|
1402
1412
|
this.log?.error(
|
|
@@ -1445,7 +1455,11 @@ var ClientTransport = class extends Transport {
|
|
|
1445
1455
|
this.tryReconnecting(session.to);
|
|
1446
1456
|
} else {
|
|
1447
1457
|
this.deleteSession(session);
|
|
1448
|
-
this.protocolError(
|
|
1458
|
+
this.protocolError({
|
|
1459
|
+
type: ProtocolError.HandshakeFailed,
|
|
1460
|
+
code: msg.payload.status.code,
|
|
1461
|
+
message: reason
|
|
1462
|
+
});
|
|
1449
1463
|
}
|
|
1450
1464
|
return;
|
|
1451
1465
|
}
|
|
@@ -1479,7 +1493,10 @@ var ClientTransport = class extends Transport {
|
|
|
1479
1493
|
onMessage: (msg2) => this.handleMsg(msg2),
|
|
1480
1494
|
onInvalidMessage: (reason) => {
|
|
1481
1495
|
this.deleteSession(connectedSession);
|
|
1482
|
-
this.protocolError(
|
|
1496
|
+
this.protocolError({
|
|
1497
|
+
type: ProtocolError.MessageOrderingViolated,
|
|
1498
|
+
message: reason
|
|
1499
|
+
});
|
|
1483
1500
|
}
|
|
1484
1501
|
});
|
|
1485
1502
|
this.updateSession(connectedSession);
|
|
@@ -1510,7 +1527,10 @@ var ClientTransport = class extends Transport {
|
|
|
1510
1527
|
const budgetConsumed = this.retryBudget.getBudgetConsumed();
|
|
1511
1528
|
const errMsg = `tried to connect to ${to} but retry budget exceeded (more than ${budgetConsumed} attempts in the last ${this.retryBudget.totalBudgetRestoreTime}ms)`;
|
|
1512
1529
|
this.log?.error(errMsg, session.loggingMetadata);
|
|
1513
|
-
this.protocolError(
|
|
1530
|
+
this.protocolError({
|
|
1531
|
+
type: ProtocolError.RetriesExceeded,
|
|
1532
|
+
message: errMsg
|
|
1533
|
+
});
|
|
1514
1534
|
return;
|
|
1515
1535
|
}
|
|
1516
1536
|
const backoffMs = this.retryBudget.getBackoffMs();
|