@replit/river 0.207.2 → 0.207.3
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/adapter-f2b6e211.d.ts +46 -0
- package/dist/{chunk-4HE7UYRL.js → chunk-B7REV3ZV.js} +6 -5
- package/dist/{chunk-4HE7UYRL.js.map → chunk-B7REV3ZV.js.map} +1 -1
- package/dist/{chunk-24EWYOGK.js → chunk-BO7MFCO6.js} +1136 -143
- package/dist/chunk-BO7MFCO6.js.map +1 -0
- package/dist/{chunk-46IVOKJU.js → chunk-QGPYCXV4.js} +2 -2
- package/dist/{chunk-46IVOKJU.js.map → chunk-QGPYCXV4.js.map} +1 -1
- package/dist/codec/index.cjs +157 -23
- package/dist/codec/index.cjs.map +1 -1
- package/dist/codec/index.d.cts +5 -1
- package/dist/codec/index.d.ts +5 -1
- package/dist/codec/index.js +6 -20
- package/dist/codec/index.js.map +1 -1
- package/dist/{connection-a18e31d5.d.ts → connection-06d72f2e.d.ts} +3 -2
- package/dist/index-02554794.d.ts +37 -0
- package/dist/logging/index.d.cts +2 -1
- package/dist/logging/index.d.ts +2 -1
- package/dist/{message-ffacb98a.d.ts → message-01c3e85a.d.ts} +1 -35
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +6 -5
- package/dist/router/index.d.ts +6 -5
- package/dist/router/index.js +1 -1
- package/dist/{services-43528f4b.d.ts → services-87887bc5.d.ts} +16 -12
- package/dist/testUtil/index.cjs +809 -657
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +4 -3
- package/dist/testUtil/index.d.ts +4 -3
- package/dist/testUtil/index.js +18 -13
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +293 -204
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +5 -4
- package/dist/transport/impls/ws/client.d.ts +5 -4
- package/dist/transport/impls/ws/client.js +5 -7
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +230 -128
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +5 -4
- package/dist/transport/impls/ws/server.d.ts +5 -4
- package/dist/transport/impls/ws/server.js +5 -7
- package/dist/transport/impls/ws/server.js.map +1 -1
- package/dist/transport/index.cjs +408 -270
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +7 -6
- package/dist/transport/index.d.ts +7 -6
- package/dist/transport/index.js +4 -9
- package/package.json +1 -1
- package/dist/chunk-24EWYOGK.js.map +0 -1
- package/dist/chunk-A7RGOVRV.js +0 -438
- package/dist/chunk-A7RGOVRV.js.map +0 -1
- package/dist/chunk-AJGIY2UB.js +0 -56
- package/dist/chunk-AJGIY2UB.js.map +0 -1
- package/dist/chunk-XV4RQ62N.js +0 -377
- package/dist/chunk-XV4RQ62N.js.map +0 -1
- package/dist/types-3e5768ec.d.ts +0 -20
package/dist/router/index.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, c as ParsedMetadata, d as AnyProcedure, b as Connection, S as ServerHandshakeOptions, e as ServiceContext } from '../services-
|
|
2
|
-
export { M as BaseErrorSchemaType, K as CANCEL_CODE, O as Client, X as Err, Z as ErrResult, J as INVALID_REQUEST_CODE, T as Ok, _ as OkResult, w as PayloadType, l as ProcErrors, h as ProcHandler, i as ProcInit, j as ProcRequest, k as ProcResponse, m as ProcType, D as Procedure, E as ProcedureErrorSchemaType, Q as ProcedureHandlerContext, x as ProcedureMap, R as RPCProcedure, B as Readable, L as ReaderErrorSchema, a1 as ResponseData, Y as Result, a0 as ResultUnwrapErr, $ as ResultUnwrapOk, q as SerializedProcedureSchema, v as SerializedProcedureSchemaProtocolv1, o as SerializedServerSchema, t as SerializedServerSchemaProtocolv1, p as SerializedServiceSchema, u as SerializedServiceSchemaProtocolv1, f as Service, g as ServiceConfiguration, n as ServiceSchema, z as StreamProcedure, y as SubscriptionProcedure, G as UNCAUGHT_ERROR_CODE, H as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, N as createClient, a2 as createClientHandshakeOptions, a3 as createServerHandshakeOptions, F as flattenErrorType, s as serializeSchema, r as serializeSchemaV1Compat } from '../services-
|
|
3
|
-
import { T as TransportClientId, O as OpaqueTransportMessage } from '../message-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, c as ParsedMetadata, d as AnyProcedure, b as Connection, S as ServerHandshakeOptions, e as ServiceContext } from '../services-87887bc5.js';
|
|
2
|
+
export { M as BaseErrorSchemaType, K as CANCEL_CODE, O as Client, X as Err, Z as ErrResult, J as INVALID_REQUEST_CODE, T as Ok, _ as OkResult, w as PayloadType, l as ProcErrors, h as ProcHandler, i as ProcInit, j as ProcRequest, k as ProcResponse, m as ProcType, D as Procedure, E as ProcedureErrorSchemaType, Q as ProcedureHandlerContext, x as ProcedureMap, R as RPCProcedure, B as Readable, L as ReaderErrorSchema, a1 as ResponseData, Y as Result, a0 as ResultUnwrapErr, $ as ResultUnwrapOk, q as SerializedProcedureSchema, v as SerializedProcedureSchemaProtocolv1, o as SerializedServerSchema, t as SerializedServerSchemaProtocolv1, p as SerializedServiceSchema, u as SerializedServiceSchemaProtocolv1, f as Service, g as ServiceConfiguration, n as ServiceSchema, z as StreamProcedure, y as SubscriptionProcedure, G as UNCAUGHT_ERROR_CODE, H as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, N as createClient, a2 as createClientHandshakeOptions, a3 as createServerHandshakeOptions, F as flattenErrorType, s as serializeSchema, r as serializeSchemaV1Compat } from '../services-87887bc5.js';
|
|
3
|
+
import { T as TransportClientId, O as OpaqueTransportMessage } from '../message-01c3e85a.js';
|
|
4
4
|
import { ServerTransport } from '../transport/index.cjs';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import '@opentelemetry/api';
|
|
7
|
-
import '../
|
|
7
|
+
import '../index-02554794.js';
|
|
8
|
+
import '../adapter-f2b6e211.js';
|
|
8
9
|
|
|
9
10
|
type StreamId = string;
|
|
10
11
|
/**
|
|
@@ -51,6 +52,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
51
52
|
maxCancelledStreamTombstonesPerSession?: number;
|
|
52
53
|
}>): Server<Services>;
|
|
53
54
|
|
|
54
|
-
var version = "0.207.
|
|
55
|
+
var version = "0.207.3";
|
|
55
56
|
|
|
56
57
|
export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, c as ParsedMetadata, d as AnyProcedure, b as Connection, S as ServerHandshakeOptions, e as ServiceContext } from '../services-
|
|
2
|
-
export { M as BaseErrorSchemaType, K as CANCEL_CODE, O as Client, X as Err, Z as ErrResult, J as INVALID_REQUEST_CODE, T as Ok, _ as OkResult, w as PayloadType, l as ProcErrors, h as ProcHandler, i as ProcInit, j as ProcRequest, k as ProcResponse, m as ProcType, D as Procedure, E as ProcedureErrorSchemaType, Q as ProcedureHandlerContext, x as ProcedureMap, R as RPCProcedure, B as Readable, L as ReaderErrorSchema, a1 as ResponseData, Y as Result, a0 as ResultUnwrapErr, $ as ResultUnwrapOk, q as SerializedProcedureSchema, v as SerializedProcedureSchemaProtocolv1, o as SerializedServerSchema, t as SerializedServerSchemaProtocolv1, p as SerializedServiceSchema, u as SerializedServiceSchemaProtocolv1, f as Service, g as ServiceConfiguration, n as ServiceSchema, z as StreamProcedure, y as SubscriptionProcedure, G as UNCAUGHT_ERROR_CODE, H as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, N as createClient, a2 as createClientHandshakeOptions, a3 as createServerHandshakeOptions, F as flattenErrorType, s as serializeSchema, r as serializeSchemaV1Compat } from '../services-
|
|
3
|
-
import { T as TransportClientId, O as OpaqueTransportMessage } from '../message-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, c as ParsedMetadata, d as AnyProcedure, b as Connection, S as ServerHandshakeOptions, e as ServiceContext } from '../services-87887bc5.js';
|
|
2
|
+
export { M as BaseErrorSchemaType, K as CANCEL_CODE, O as Client, X as Err, Z as ErrResult, J as INVALID_REQUEST_CODE, T as Ok, _ as OkResult, w as PayloadType, l as ProcErrors, h as ProcHandler, i as ProcInit, j as ProcRequest, k as ProcResponse, m as ProcType, D as Procedure, E as ProcedureErrorSchemaType, Q as ProcedureHandlerContext, x as ProcedureMap, R as RPCProcedure, B as Readable, L as ReaderErrorSchema, a1 as ResponseData, Y as Result, a0 as ResultUnwrapErr, $ as ResultUnwrapOk, q as SerializedProcedureSchema, v as SerializedProcedureSchemaProtocolv1, o as SerializedServerSchema, t as SerializedServerSchemaProtocolv1, p as SerializedServiceSchema, u as SerializedServiceSchemaProtocolv1, f as Service, g as ServiceConfiguration, n as ServiceSchema, z as StreamProcedure, y as SubscriptionProcedure, G as UNCAUGHT_ERROR_CODE, H as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, N as createClient, a2 as createClientHandshakeOptions, a3 as createServerHandshakeOptions, F as flattenErrorType, s as serializeSchema, r as serializeSchemaV1Compat } from '../services-87887bc5.js';
|
|
3
|
+
import { T as TransportClientId, O as OpaqueTransportMessage } from '../message-01c3e85a.js';
|
|
4
4
|
import { ServerTransport } from '../transport/index.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import '@opentelemetry/api';
|
|
7
|
-
import '../
|
|
7
|
+
import '../index-02554794.js';
|
|
8
|
+
import '../adapter-f2b6e211.js';
|
|
8
9
|
|
|
9
10
|
type StreamId = string;
|
|
10
11
|
/**
|
|
@@ -51,6 +52,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
51
52
|
maxCancelledStreamTombstonesPerSession?: number;
|
|
52
53
|
}>): Server<Services>;
|
|
53
54
|
|
|
54
|
-
var version = "0.207.
|
|
55
|
+
var version = "0.207.3";
|
|
55
56
|
|
|
56
57
|
export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
2
2
|
import { Static, TSchema, TObject, TString, TUnion, TLiteral, TNever } from '@sinclair/typebox';
|
|
3
3
|
import { Tracer, Span } from '@opentelemetry/api';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { b as TelemetryInfo, T as TransportClientId, P as ProtocolVersion, O as OpaqueTransportMessage, a as PartialTransportMessage, c as TransportMessage, H as HandshakeErrorResponseCodes, d as HandshakeErrorCustomHandlerFatalResponseCodes } from './message-01c3e85a.js';
|
|
5
|
+
import { M as MessageMetadata, L as Logger, T as Tags, a as LogFn, b as LoggingLevel } from './index-02554794.js';
|
|
6
|
+
import { C as Codec, a as CodecMessageAdapter, S as SendResult, b as SendBufferResult } from './adapter-f2b6e211.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* A connection is the actual raw underlying transport connection.
|
|
@@ -124,17 +125,18 @@ interface SessionOptions {
|
|
|
124
125
|
interface CommonSessionProps {
|
|
125
126
|
from: TransportClientId;
|
|
126
127
|
options: SessionOptions;
|
|
128
|
+
codec: CodecMessageAdapter;
|
|
127
129
|
tracer: Tracer;
|
|
128
130
|
log: Logger | undefined;
|
|
129
131
|
}
|
|
130
132
|
declare abstract class CommonSession extends StateMachineState {
|
|
131
133
|
readonly from: TransportClientId;
|
|
132
134
|
readonly options: SessionOptions;
|
|
135
|
+
readonly codec: CodecMessageAdapter;
|
|
133
136
|
tracer: Tracer;
|
|
134
137
|
log?: Logger;
|
|
135
138
|
abstract get loggingMetadata(): MessageMetadata;
|
|
136
|
-
constructor({ from, options, log, tracer }: CommonSessionProps);
|
|
137
|
-
parseMsg(msg: Uint8Array): OpaqueTransportMessage | null;
|
|
139
|
+
constructor({ from, options, log, tracer, codec }: CommonSessionProps);
|
|
138
140
|
}
|
|
139
141
|
type SessionId = string;
|
|
140
142
|
interface IdentifiedSessionProps extends CommonSessionProps {
|
|
@@ -169,7 +171,7 @@ declare abstract class IdentifiedSession extends CommonSession {
|
|
|
169
171
|
get loggingMetadata(): MessageMetadata;
|
|
170
172
|
constructMsg<Payload>(partialMsg: PartialTransportMessage<Payload>): TransportMessage<Payload>;
|
|
171
173
|
nextSeq(): number;
|
|
172
|
-
send(msg: PartialTransportMessage):
|
|
174
|
+
send(msg: PartialTransportMessage): SendResult;
|
|
173
175
|
_handleStateExit(): void;
|
|
174
176
|
_handleClose(): void;
|
|
175
177
|
}
|
|
@@ -251,7 +253,7 @@ declare class SessionHandshaking<ConnType extends Connection> extends Identified
|
|
|
251
253
|
extras?: Record<string, unknown> | undefined;
|
|
252
254
|
};
|
|
253
255
|
onHandshakeData: (msg: Uint8Array) => void;
|
|
254
|
-
sendHandshake(msg: TransportMessage):
|
|
256
|
+
sendHandshake(msg: TransportMessage): SendResult;
|
|
255
257
|
_handleStateExit(): void;
|
|
256
258
|
_handleClose(): void;
|
|
257
259
|
}
|
|
@@ -260,6 +262,7 @@ interface SessionConnectedListeners {
|
|
|
260
262
|
onConnectionErrored: (err: unknown) => void;
|
|
261
263
|
onConnectionClosed: () => void;
|
|
262
264
|
onMessage: (msg: OpaqueTransportMessage) => void;
|
|
265
|
+
onMessageSendFailure: (msg: PartialTransportMessage, reason: string) => void;
|
|
263
266
|
onInvalidMessage: (reason: string) => void;
|
|
264
267
|
}
|
|
265
268
|
interface SessionConnectedProps<ConnType extends Connection> extends IdentifiedSessionProps {
|
|
@@ -271,14 +274,13 @@ declare class SessionConnected<ConnType extends Connection> extends IdentifiedSe
|
|
|
271
274
|
conn: ConnType;
|
|
272
275
|
listeners: SessionConnectedListeners;
|
|
273
276
|
private heartbeatHandle?;
|
|
274
|
-
private
|
|
275
|
-
isActivelyHeartbeating
|
|
276
|
-
private lastConstructedMsgs;
|
|
277
|
-
private pushLastConstructedMsgs;
|
|
277
|
+
private heartbeatMissTimeout?;
|
|
278
|
+
private isActivelyHeartbeating;
|
|
278
279
|
updateBookkeeping(ack: number, seq: number): void;
|
|
279
280
|
private assertSendOrdering;
|
|
280
|
-
send(msg: PartialTransportMessage):
|
|
281
|
+
send(msg: PartialTransportMessage): SendResult;
|
|
281
282
|
constructor(props: SessionConnectedProps<ConnType>);
|
|
283
|
+
sendBufferedMessages(): SendBufferResult;
|
|
282
284
|
get loggingMetadata(): {
|
|
283
285
|
protocolVersion?: ProtocolVersion | undefined;
|
|
284
286
|
clientId?: string | undefined;
|
|
@@ -297,6 +299,7 @@ declare class SessionConnected<ConnType extends Connection> extends IdentifiedSe
|
|
|
297
299
|
} | undefined;
|
|
298
300
|
extras?: Record<string, unknown> | undefined;
|
|
299
301
|
};
|
|
302
|
+
startMissingHeartbeatTimeout(): void;
|
|
300
303
|
startActiveHeartbeat(): void;
|
|
301
304
|
private sendHeartbeat;
|
|
302
305
|
onMessageData: (msg: Uint8Array) => void;
|
|
@@ -329,6 +332,7 @@ declare const ProtocolError: {
|
|
|
329
332
|
readonly HandshakeFailed: "handshake_failed";
|
|
330
333
|
readonly MessageOrderingViolated: "message_ordering_violated";
|
|
331
334
|
readonly InvalidMessage: "invalid_message";
|
|
335
|
+
readonly MessageSendFailure: "message_send_failure";
|
|
332
336
|
};
|
|
333
337
|
type ProtocolErrorType = (typeof ProtocolError)[keyof typeof ProtocolError];
|
|
334
338
|
interface EventMap {
|
|
@@ -447,7 +451,7 @@ type TransportStatus = 'open' | 'closed';
|
|
|
447
451
|
interface DeleteSessionOptions {
|
|
448
452
|
unhealthy: boolean;
|
|
449
453
|
}
|
|
450
|
-
type SessionBoundSendFn = (msg: PartialTransportMessage) => string
|
|
454
|
+
type SessionBoundSendFn = (msg: PartialTransportMessage) => string;
|
|
451
455
|
/**
|
|
452
456
|
* Transports manage the lifecycle (creation/deletion) of sessions
|
|
453
457
|
*
|