@replit/river 0.22.0 → 0.23.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-ZPBWKBM5.js → chunk-AUH7GO52.js} +84 -88
- package/dist/chunk-AUH7GO52.js.map +1 -0
- package/dist/{chunk-GCLEWC26.js → chunk-IKKP6BZG.js} +34 -18
- package/dist/chunk-IKKP6BZG.js.map +1 -0
- package/dist/{chunk-S3YKQT4J.js → chunk-KA5T736W.js} +2 -2
- package/dist/{chunk-3MFX6NXA.js → chunk-RBH47IKH.js} +2 -2
- package/dist/chunk-RBH47IKH.js.map +1 -0
- package/dist/{chunk-HUBFYN37.js → chunk-XTVPDTQD.js} +2 -2
- package/dist/{connection-8b059ac4.d.ts → connection-5685d817.d.ts} +1 -1
- package/dist/{connection-bbfe1147.d.ts → connection-7582fb92.d.ts} +1 -1
- package/dist/{index-2ece5234.d.ts → index-a6fe0edd.d.ts} +40 -53
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/router/index.cjs +33 -17
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +11 -6
- package/dist/router/index.d.ts +11 -6
- package/dist/router/index.js +2 -2
- package/dist/{services-cb01a7a8.d.ts → services-95cb17b9.d.ts} +23 -52
- package/dist/{services-acbcc441.d.ts → services-e95a89d6.d.ts} +23 -52
- package/dist/transport/impls/uds/client.cjs +14 -13
- 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 +71 -82
- 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 +14 -13
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +2 -2
- package/dist/transport/impls/ws/client.d.ts +2 -2
- package/dist/transport/impls/ws/client.js +3 -3
- package/dist/transport/impls/ws/server.cjs +71 -82
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +2 -2
- package/dist/transport/impls/ws/server.d.ts +2 -2
- package/dist/transport/impls/ws/server.js +3 -3
- package/dist/transport/index.cjs +83 -87
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +22 -11
- package/dist/transport/index.d.ts +22 -11
- package/dist/transport/index.js +2 -2
- package/dist/util/testHelpers.cjs +4 -9
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +5 -4
- package/dist/util/testHelpers.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-3MFX6NXA.js.map +0 -1
- package/dist/chunk-GCLEWC26.js.map +0 -1
- package/dist/chunk-ZPBWKBM5.js.map +0 -1
- /package/dist/{chunk-S3YKQT4J.js.map → chunk-KA5T736W.js.map} +0 -0
- /package/dist/{chunk-HUBFYN37.js.map → chunk-XTVPDTQD.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as Codec } from '../types-3e5768ec.js';
|
|
2
|
-
import { O as OpaqueTransportMessage, C as Connection,
|
|
3
|
-
export {
|
|
4
|
-
import '@sinclair/typebox';
|
|
2
|
+
import { O as OpaqueTransportMessage, C as Connection, b as Session, T as TransportClientId, l as PropagationContext, P as PartialTransportMessage, f as ClientHandshakeOptions, c as ServerHandshakeOptions, m as ParsedMetadata, S as SessionOptions } from '../index-a6fe0edd.js';
|
|
3
|
+
export { h as OpaqueTransportMessageSchema, i as TransportMessage, g as TransportMessageSchema, k as isStreamClose, j as isStreamOpen } from '../index-a6fe0edd.js';
|
|
4
|
+
import { TSchema } from '@sinclair/typebox';
|
|
5
5
|
import '@opentelemetry/api';
|
|
6
6
|
|
|
7
7
|
type ConnectionStatus = 'connect' | 'disconnect';
|
|
@@ -98,13 +98,9 @@ declare class LeakyBucketRateLimit {
|
|
|
98
98
|
type TransportStatus = 'open' | 'closed' | 'destroyed';
|
|
99
99
|
type TransportOptions = SessionOptions;
|
|
100
100
|
type ProvidedTransportOptions = Partial<TransportOptions>;
|
|
101
|
-
type ClientTransportOptions = TransportOptions & ConnectionRetryOptions
|
|
102
|
-
handshake?: ClientHandshakeOptions;
|
|
103
|
-
};
|
|
101
|
+
type ClientTransportOptions = TransportOptions & ConnectionRetryOptions;
|
|
104
102
|
type ProvidedClientTransportOptions = Partial<ClientTransportOptions>;
|
|
105
|
-
type ServerTransportOptions = TransportOptions
|
|
106
|
-
handshake?: ServerHandshakeOptions;
|
|
107
|
-
};
|
|
103
|
+
type ServerTransportOptions = TransportOptions;
|
|
108
104
|
type ProvidedServerTransportOptions = Partial<ServerTransportOptions>;
|
|
109
105
|
/**
|
|
110
106
|
* Transports manage the lifecycle (creation/deletion) of sessions and connections. Its responsibilities include:
|
|
@@ -246,7 +242,7 @@ declare abstract class Transport<ConnType extends Connection> {
|
|
|
246
242
|
*/
|
|
247
243
|
destroy(): void;
|
|
248
244
|
}
|
|
249
|
-
declare abstract class ClientTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
245
|
+
declare abstract class ClientTransport<ConnType extends Connection, HandshakeMetadata extends TSchema = TSchema> extends Transport<ConnType> {
|
|
250
246
|
/**
|
|
251
247
|
* The options for this transport.
|
|
252
248
|
*/
|
|
@@ -263,7 +259,12 @@ declare abstract class ClientTransport<ConnType extends Connection> extends Tran
|
|
|
263
259
|
* tests or a special case where you don't want to reconnect.
|
|
264
260
|
*/
|
|
265
261
|
reconnectOnConnectionDrop: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Optional handshake options for this client.
|
|
264
|
+
*/
|
|
265
|
+
handshakeExtensions?: ClientHandshakeOptions<HandshakeMetadata>;
|
|
266
266
|
constructor(clientId: TransportClientId, providedOptions?: ProvidedClientTransportOptions);
|
|
267
|
+
extendHandshake(options: ClientHandshakeOptions<HandshakeMetadata>): void;
|
|
267
268
|
protected handleConnection(conn: ConnType, to: TransportClientId): void;
|
|
268
269
|
receiveHandshakeResponseMessage(data: Uint8Array, conn: ConnType): Session<ConnType> | false;
|
|
269
270
|
/**
|
|
@@ -284,13 +285,23 @@ declare abstract class ClientTransport<ConnType extends Connection> extends Tran
|
|
|
284
285
|
protected sendHandshake(to: TransportClientId, conn: ConnType): Promise<boolean>;
|
|
285
286
|
close(): void;
|
|
286
287
|
}
|
|
287
|
-
declare abstract class ServerTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
288
|
+
declare abstract class ServerTransport<ConnType extends Connection, CustomMetadataSchema extends TSchema = TSchema> extends Transport<ConnType> {
|
|
288
289
|
/**
|
|
289
290
|
* The options for this transport.
|
|
290
291
|
*/
|
|
291
292
|
protected options: ServerTransportOptions;
|
|
293
|
+
/**
|
|
294
|
+
* Optional handshake options for the server.
|
|
295
|
+
*/
|
|
296
|
+
handshakeExtensions?: ServerHandshakeOptions<CustomMetadataSchema>;
|
|
297
|
+
/**
|
|
298
|
+
* A map of session handshake data for each session.
|
|
299
|
+
*/
|
|
300
|
+
sessionHandshakeMetadata: WeakMap<Session<ConnType>, ParsedMetadata>;
|
|
292
301
|
constructor(clientId: TransportClientId, providedOptions?: ProvidedServerTransportOptions);
|
|
302
|
+
extendHandshake(options: ServerHandshakeOptions<CustomMetadataSchema>): void;
|
|
293
303
|
protected handleConnection(conn: ConnType): void;
|
|
304
|
+
private validateHandshakeMetadata;
|
|
294
305
|
receiveHandshakeRequestMessage(data: Uint8Array, conn: ConnType): Promise<Session<ConnType> | false>;
|
|
295
306
|
}
|
|
296
307
|
|
package/dist/transport/index.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
ServerTransport,
|
|
6
6
|
Session,
|
|
7
7
|
Transport
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-AUH7GO52.js";
|
|
9
9
|
import {
|
|
10
10
|
OpaqueTransportMessageSchema,
|
|
11
11
|
TransportMessageSchema
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-RBH47IKH.js";
|
|
13
13
|
import "../chunk-OTQNCLFH.js";
|
|
14
14
|
import "../chunk-3AW3IXVD.js";
|
|
15
15
|
export {
|
|
@@ -355,7 +355,7 @@ var log = void 0;
|
|
|
355
355
|
var import_api = require("@opentelemetry/api");
|
|
356
356
|
|
|
357
357
|
// package.json
|
|
358
|
-
var version = "0.
|
|
358
|
+
var version = "0.23.1";
|
|
359
359
|
|
|
360
360
|
// tracing/index.ts
|
|
361
361
|
function createSessionTelemetryInfo(session, propagationCtx) {
|
|
@@ -415,12 +415,6 @@ var Session = class {
|
|
|
415
415
|
* for this session.
|
|
416
416
|
*/
|
|
417
417
|
advertisedSessionId;
|
|
418
|
-
/**
|
|
419
|
-
* The metadata for this session, as parsed from the handshake.
|
|
420
|
-
*
|
|
421
|
-
* Will only ever be populated on the server side.
|
|
422
|
-
*/
|
|
423
|
-
metadata;
|
|
424
418
|
/**
|
|
425
419
|
* Number of messages we've sent along this session (excluding handshake and acks)
|
|
426
420
|
*/
|
|
@@ -578,8 +572,8 @@ var Session = class {
|
|
|
578
572
|
replaceWithNewConnection(newConn) {
|
|
579
573
|
this.closeStaleConnection(newConn);
|
|
580
574
|
this.cancelGrace();
|
|
581
|
-
this.connection = newConn;
|
|
582
575
|
this.sendBufferedMessages(newConn);
|
|
576
|
+
this.connection = newConn;
|
|
583
577
|
}
|
|
584
578
|
beginGrace(cb) {
|
|
585
579
|
log?.info(
|
|
@@ -786,7 +780,8 @@ function dummyCtx(state, session, extendedContext) {
|
|
|
786
780
|
to: session.to,
|
|
787
781
|
from: session.from,
|
|
788
782
|
streamId: (0, import_nanoid2.nanoid)(),
|
|
789
|
-
session
|
|
783
|
+
session,
|
|
784
|
+
metadata: {}
|
|
790
785
|
};
|
|
791
786
|
}
|
|
792
787
|
function asClientRpc(state, proc, extendedContext, session = dummySession()) {
|