@replit/river 0.20.1 → 0.21.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/README.md +1 -9
- package/dist/{chunk-FNK44ZN3.js → chunk-3Y7AB5EB.js} +5 -4
- package/dist/chunk-3Y7AB5EB.js.map +1 -0
- package/dist/{chunk-MJR36SUY.js → chunk-FDLAPYCK.js} +2 -2
- package/dist/{chunk-QU2EE6YU.js → chunk-JMXO5L2X.js} +21 -14
- package/dist/chunk-JMXO5L2X.js.map +1 -0
- package/dist/{chunk-DP5X7CCT.js → chunk-NCXUFDVL.js} +14 -9
- package/dist/{chunk-DP5X7CCT.js.map → chunk-NCXUFDVL.js.map} +1 -1
- package/dist/{chunk-DT5JS6TM.js → chunk-OTQNCLFH.js} +1 -1
- package/dist/chunk-OTQNCLFH.js.map +1 -0
- package/dist/{connection-dba95bc8.d.ts → connection-76c5ed01.d.ts} +2 -2
- package/dist/{connection-d49d5d56.d.ts → connection-975b25c9.d.ts} +1 -1
- package/dist/{index-3ac92295.d.ts → index-dfad460e.d.ts} +2 -0
- 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/router/index.cjs +12 -7
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +4 -4
- package/dist/router/index.d.ts +4 -4
- package/dist/router/index.js +2 -2
- package/dist/{services-abc077db.d.ts → services-7b716dcf.d.ts} +1 -1
- package/dist/{services-8496d6e8.d.ts → services-9c496c6e.d.ts} +1 -1
- package/dist/transport/impls/uds/client.cjs +17 -11
- 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 +17 -11
- 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 +39 -21
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +7 -6
- package/dist/transport/impls/ws/client.d.ts +7 -6
- package/dist/transport/impls/ws/client.js +12 -11
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +30 -13
- 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 +3 -3
- package/dist/transport/impls/ws/server.js.map +1 -1
- package/dist/transport/index.cjs +19 -12
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js +2 -2
- package/dist/util/testHelpers.cjs +15 -31
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +11 -15
- package/dist/util/testHelpers.d.ts +11 -15
- package/dist/util/testHelpers.js +5 -17
- package/dist/util/testHelpers.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-DT5JS6TM.js.map +0 -1
- package/dist/chunk-FNK44ZN3.js.map +0 -1
- package/dist/chunk-QU2EE6YU.js.map +0 -1
- /package/dist/{chunk-MJR36SUY.js.map → chunk-FDLAPYCK.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../services-
|
|
2
|
-
export { C as Client, E as Err, O as Ok, B as Output, k as ProcErrors, g as ProcHandler, h as ProcInit, i as ProcInput, j as ProcOutput, l as ProcType, a as Procedure, o as ProcedureMap, d as ProcedureResult, p as RPCProcedure, z as ResultUnwrapErr, y as ResultUnwrapOk, x as RiverErrorSchema, c as RiverUncaughtSchema, n as SerializedServerSchema, e as Service, f as ServiceConfiguration, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, m as ServiceSchema, r as StreamProcedure, q as SubscriptionProcedure, w as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, t as createClient, s as serializeSchema } from '../services-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../services-7b716dcf.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, B as Output, k as ProcErrors, g as ProcHandler, h as ProcInit, i as ProcInput, j as ProcOutput, l as ProcType, a as Procedure, o as ProcedureMap, d as ProcedureResult, p as RPCProcedure, z as ResultUnwrapErr, y as ResultUnwrapOk, x as RiverErrorSchema, c as RiverUncaughtSchema, n as SerializedServerSchema, e as Service, f as ServiceConfiguration, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, m as ServiceSchema, r as StreamProcedure, q as SubscriptionProcedure, w as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, t as createClient, s as serializeSchema } from '../services-7b716dcf.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { ServerTransport } from '../transport/index.cjs';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
|
-
import { C as Connection } from '../index-
|
|
6
|
+
import { C as Connection } from '../index-dfad460e.js';
|
|
7
7
|
import '../types-3e5768ec.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -36,6 +36,6 @@ interface ProcStream {
|
|
|
36
36
|
*/
|
|
37
37
|
declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
|
|
38
38
|
|
|
39
|
-
var version = "0.
|
|
39
|
+
var version = "0.21.1";
|
|
40
40
|
|
|
41
41
|
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../services-
|
|
2
|
-
export { C as Client, E as Err, O as Ok, B as Output, k as ProcErrors, g as ProcHandler, h as ProcInit, i as ProcInput, j as ProcOutput, l as ProcType, a as Procedure, o as ProcedureMap, d as ProcedureResult, p as RPCProcedure, z as ResultUnwrapErr, y as ResultUnwrapOk, x as RiverErrorSchema, c as RiverUncaughtSchema, n as SerializedServerSchema, e as Service, f as ServiceConfiguration, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, m as ServiceSchema, r as StreamProcedure, q as SubscriptionProcedure, w as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, t as createClient, s as serializeSchema } from '../services-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../services-9c496c6e.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, B as Output, k as ProcErrors, g as ProcHandler, h as ProcInit, i as ProcInput, j as ProcOutput, l as ProcType, a as Procedure, o as ProcedureMap, d as ProcedureResult, p as RPCProcedure, z as ResultUnwrapErr, y as ResultUnwrapOk, x as RiverErrorSchema, c as RiverUncaughtSchema, n as SerializedServerSchema, e as Service, f as ServiceConfiguration, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, m as ServiceSchema, r as StreamProcedure, q as SubscriptionProcedure, w as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, t as createClient, s as serializeSchema } from '../services-9c496c6e.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { ServerTransport } from '../transport/index.js';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
|
-
import { C as Connection } from '../index-
|
|
6
|
+
import { C as Connection } from '../index-dfad460e.js';
|
|
7
7
|
import '../types-3e5768ec.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -36,6 +36,6 @@ interface ProcStream {
|
|
|
36
36
|
*/
|
|
37
37
|
declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
|
|
38
38
|
|
|
39
|
-
var version = "0.
|
|
39
|
+
var version = "0.21.1";
|
|
40
40
|
|
|
41
41
|
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Static, TObject, TUnion, TString, TSchema, TNever, TLiteral } from '@sinclair/typebox';
|
|
2
2
|
import { ClientTransport } from './transport/index.cjs';
|
|
3
3
|
import { Pushable } from 'it-pushable';
|
|
4
|
-
import { C as Connection, T as TransportClientId, a as Session, b as ParsedHandshakeMetadata } from './index-
|
|
4
|
+
import { C as Connection, T as TransportClientId, a as Session, b as ParsedHandshakeMetadata } from './index-dfad460e.js';
|
|
5
5
|
|
|
6
6
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Static, TObject, TUnion, TString, TSchema, TNever, TLiteral } from '@sinclair/typebox';
|
|
2
2
|
import { ClientTransport } from './transport/index.js';
|
|
3
3
|
import { Pushable } from 'it-pushable';
|
|
4
|
-
import { C as Connection, T as TransportClientId, a as Session, b as ParsedHandshakeMetadata } from './index-
|
|
4
|
+
import { C as Connection, T as TransportClientId, a as Session, b as ParsedHandshakeMetadata } from './index-dfad460e.js';
|
|
5
5
|
|
|
6
6
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
7
7
|
/**
|
|
@@ -265,18 +265,20 @@ var Session = class {
|
|
|
265
265
|
log?.error(errMsg, {
|
|
266
266
|
...this.loggingMetadata,
|
|
267
267
|
fullTransportMessage: msg,
|
|
268
|
-
connId: conn.debugId
|
|
268
|
+
connId: conn.debugId,
|
|
269
|
+
tags: ["invariant-violation"]
|
|
269
270
|
});
|
|
270
|
-
|
|
271
|
+
conn.close();
|
|
272
|
+
return;
|
|
271
273
|
}
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
updateBookkeeping(ack, seq) {
|
|
275
277
|
if (seq + 1 < this.ack) {
|
|
276
|
-
log?.error(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
);
|
|
278
|
+
log?.error(`received stale seq ${seq} + 1 < ${this.ack}`, {
|
|
279
|
+
...this.loggingMetadata,
|
|
280
|
+
tags: ["invariant-violation"]
|
|
281
|
+
});
|
|
280
282
|
return;
|
|
281
283
|
}
|
|
282
284
|
this.sendBuffer = this.sendBuffer.filter((unacked) => unacked.seq >= ack);
|
|
@@ -797,9 +799,10 @@ var Transport = class {
|
|
|
797
799
|
return;
|
|
798
800
|
const session = this.sessions.get(msg.from);
|
|
799
801
|
if (!session) {
|
|
800
|
-
log?.error(`
|
|
802
|
+
log?.error(`no existing session for ${msg.from}`, {
|
|
801
803
|
clientId: this.clientId,
|
|
802
|
-
fullTransportMessage: msg
|
|
804
|
+
fullTransportMessage: msg,
|
|
805
|
+
tags: ["invariant-violation"]
|
|
803
806
|
});
|
|
804
807
|
return;
|
|
805
808
|
}
|
|
@@ -818,7 +821,8 @@ var Transport = class {
|
|
|
818
821
|
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
819
822
|
log?.error(`${errMsg}, marking connection as dead`, {
|
|
820
823
|
clientId: this.clientId,
|
|
821
|
-
fullTransportMessage: msg
|
|
824
|
+
fullTransportMessage: msg,
|
|
825
|
+
tags: ["invariant-violation"]
|
|
822
826
|
});
|
|
823
827
|
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
824
828
|
session.close();
|
|
@@ -862,7 +866,8 @@ var Transport = class {
|
|
|
862
866
|
const err = "transport is destroyed, cant send";
|
|
863
867
|
log?.error(err, {
|
|
864
868
|
clientId: this.clientId,
|
|
865
|
-
partialTransportMessage: msg
|
|
869
|
+
partialTransportMessage: msg,
|
|
870
|
+
tags: ["invariant-violation"]
|
|
866
871
|
});
|
|
867
872
|
this.protocolError(ProtocolError.UseAfterDestroy, err);
|
|
868
873
|
return void 0;
|
|
@@ -1197,7 +1202,8 @@ var ClientTransport = class extends Transport {
|
|
|
1197
1202
|
if (!import_value.Value.Check(this.options.handshake.schema, metadata)) {
|
|
1198
1203
|
log?.error(`handshake metadata did not match schema`, {
|
|
1199
1204
|
clientId: this.clientId,
|
|
1200
|
-
connectedTo: to
|
|
1205
|
+
connectedTo: to,
|
|
1206
|
+
tags: ["invariant-violation"]
|
|
1201
1207
|
});
|
|
1202
1208
|
this.protocolError(
|
|
1203
1209
|
ProtocolError.HandshakeFailed,
|