@replit/river 0.201.0 → 0.203.0
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-UBUD2LMZ.js → chunk-D5EIDBUT.js} +3 -3
- package/dist/{chunk-OZ3ITXW5.js → chunk-DGT3MPD4.js} +13 -3
- package/dist/chunk-DGT3MPD4.js.map +1 -0
- package/dist/{chunk-PJ4GJ5CU.js → chunk-FG22HHCY.js} +11 -4
- package/dist/chunk-FG22HHCY.js.map +1 -0
- package/dist/{chunk-7IUEEQP7.js → chunk-SZHNMLKC.js} +2 -2
- package/dist/{chunk-7IUEEQP7.js.map → chunk-SZHNMLKC.js.map} +1 -1
- package/dist/{chunk-52DVJUVZ.js → chunk-XBPEUVWN.js} +2 -2
- package/dist/{client-a32692b0.d.ts → client-5d2e41a3.d.ts} +7 -1
- package/dist/{connection-48d021ca.d.ts → connection-11a4af0f.d.ts} +1 -1
- package/dist/{context-8d263a7f.d.ts → context-d6dd8a1a.d.ts} +14 -0
- package/dist/router/index.cjs +27 -9
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +9 -8
- package/dist/router/index.d.ts +9 -8
- package/dist/router/index.js +27 -9
- package/dist/router/index.js.map +1 -1
- package/dist/{server-48d90a77.d.ts → server-e46399f9.d.ts} +1 -1
- package/dist/{services-e71ea921.d.ts → services-56cbea0d.d.ts} +9 -4
- package/dist/testUtil/index.cjs +20 -3
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +5 -5
- package/dist/testUtil/index.d.ts +5 -5
- package/dist/testUtil/index.js +4 -4
- package/dist/transport/impls/ws/client.cjs +20 -3
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- package/dist/transport/impls/ws/client.js +4 -4
- package/dist/transport/impls/ws/server.cjs +10 -3
- 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 +4 -4
- package/dist/transport/index.cjs +20 -3
- 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 +4 -4
- package/package.json +1 -1
- package/dist/chunk-OZ3ITXW5.js.map +0 -1
- package/dist/chunk-PJ4GJ5CU.js.map +0 -1
- /package/dist/{chunk-UBUD2LMZ.js.map → chunk-D5EIDBUT.js.map} +0 -0
- /package/dist/{chunk-52DVJUVZ.js.map → chunk-XBPEUVWN.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Connection, w as CommonSession, d as SessionState, x as CommonSessionProps, T as Transport, y as ServerTransportOptions, r as ServerHandshakeOptions, q as ParsedMetadata, z as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './context-
|
|
1
|
+
import { C as Connection, w as CommonSession, d as SessionState, x as CommonSessionProps, T as Transport, y as ServerTransportOptions, r as ServerHandshakeOptions, q as ParsedMetadata, z as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './context-d6dd8a1a.js';
|
|
2
2
|
import { P as ProtocolVersion, b as OpaqueTransportMessage, e as Tags, a as TransportMessage, H as HandshakeErrorResponseCodes, c as TransportClientId } from './message-3def9ded.js';
|
|
3
3
|
import * as _sinclair_typebox_errors from '@sinclair/typebox/errors';
|
|
4
4
|
import { Static } from '@sinclair/typebox';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TObject, TString, TSchema, TUnion, TLiteral, TNever, Static } from '@sinclair/typebox';
|
|
2
|
-
import { C as Connection, n as ClientHandshakeOptions, t as ProcedureHandlerContext, s as ServiceContext } from './context-
|
|
2
|
+
import { C as Connection, n as ClientHandshakeOptions, t as ProcedureHandlerContext, s as ServiceContext } from './context-d6dd8a1a.js';
|
|
3
3
|
import { c as TransportClientId } from './message-3def9ded.js';
|
|
4
|
-
import { C as ClientTransport } from './client-
|
|
4
|
+
import { C as ClientTransport } from './client-5d2e41a3.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* {@link UNCAUGHT_ERROR_CODE} is the code that is used when an error is thrown
|
|
@@ -504,6 +504,7 @@ declare const Procedure: {
|
|
|
504
504
|
interface Service<State extends object, Procs extends ProcedureMap<State>> {
|
|
505
505
|
readonly state: State;
|
|
506
506
|
readonly procedures: Procs;
|
|
507
|
+
[Symbol.asyncDispose]: () => Promise<void>;
|
|
507
508
|
}
|
|
508
509
|
/**
|
|
509
510
|
* Represents any {@link Service} object.
|
|
@@ -567,6 +568,10 @@ type ProcType<S extends AnyService, ProcName extends keyof S['procedures']> = S[
|
|
|
567
568
|
* was created via the {@link Procedure} constructors.
|
|
568
569
|
*/
|
|
569
570
|
type BrandedProcedureMap<State> = Record<string, Branded<AnyProcedure<State>>>;
|
|
571
|
+
type MaybeDisposable<State extends object> = State & {
|
|
572
|
+
[Symbol.asyncDispose]?: () => Promise<void>;
|
|
573
|
+
[Symbol.dispose]?: () => void;
|
|
574
|
+
};
|
|
570
575
|
/**
|
|
571
576
|
* The configuration for a service.
|
|
572
577
|
*/
|
|
@@ -574,7 +579,7 @@ interface ServiceConfiguration<State extends object> {
|
|
|
574
579
|
/**
|
|
575
580
|
* A factory function for creating a fresh state.
|
|
576
581
|
*/
|
|
577
|
-
initializeState: (extendedContext: ServiceContext) => State
|
|
582
|
+
initializeState: (extendedContext: ServiceContext) => MaybeDisposable<State>;
|
|
578
583
|
}
|
|
579
584
|
interface SerializedProcedureSchemaProtocolv1 {
|
|
580
585
|
init?: PayloadType;
|
|
@@ -636,7 +641,7 @@ declare class ServiceSchema<State extends object, Procedures extends ProcedureMa
|
|
|
636
641
|
/**
|
|
637
642
|
* Factory function for creating a fresh state.
|
|
638
643
|
*/
|
|
639
|
-
protected readonly initializeState: (extendedContext: ServiceContext) => State
|
|
644
|
+
protected readonly initializeState: (extendedContext: ServiceContext) => MaybeDisposable<State>;
|
|
640
645
|
/**
|
|
641
646
|
* The procedures for this service.
|
|
642
647
|
*/
|
package/dist/testUtil/index.cjs
CHANGED
|
@@ -289,6 +289,14 @@ var StateMachineState = class {
|
|
|
289
289
|
* and we've moved on to another state
|
|
290
290
|
*/
|
|
291
291
|
_isConsumed;
|
|
292
|
+
/**
|
|
293
|
+
* Cleanup this state machine state and mark it as consumed.
|
|
294
|
+
* After calling close, it is an error to access any properties on the state.
|
|
295
|
+
* You should never need to call this as a consumer.
|
|
296
|
+
*
|
|
297
|
+
* If you're looking to close the session from the client,
|
|
298
|
+
* use `.hardDisconnect` on the client transport.
|
|
299
|
+
*/
|
|
292
300
|
close() {
|
|
293
301
|
this._handleClose();
|
|
294
302
|
}
|
|
@@ -343,9 +351,8 @@ var CommonSession = class extends StateMachineState {
|
|
|
343
351
|
parseMsg(msg) {
|
|
344
352
|
const parsedMsg = this.options.codec.fromBuffer(msg);
|
|
345
353
|
if (parsedMsg === null) {
|
|
346
|
-
const decodedBuffer = new TextDecoder().decode(Buffer.from(msg));
|
|
347
354
|
this.log?.error(
|
|
348
|
-
`received malformed msg: ${
|
|
355
|
+
`received malformed msg: ${Buffer.from(msg).toString("base64")}`,
|
|
349
356
|
this.loggingMetadata
|
|
350
357
|
);
|
|
351
358
|
return null;
|
|
@@ -525,7 +532,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
|
|
|
525
532
|
var import_api = require("@opentelemetry/api");
|
|
526
533
|
|
|
527
534
|
// package.json
|
|
528
|
-
var version = "0.
|
|
535
|
+
var version = "0.203.0";
|
|
529
536
|
|
|
530
537
|
// tracing/index.ts
|
|
531
538
|
function getPropagationContext(ctx) {
|
|
@@ -1757,6 +1764,16 @@ var ClientTransport = class extends Transport {
|
|
|
1757
1764
|
);
|
|
1758
1765
|
this.updateSession(backingOffSession);
|
|
1759
1766
|
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Manually kills all sessions to the server (including all pending state).
|
|
1769
|
+
* This is useful for when you want to close all connections to a server
|
|
1770
|
+
* and don't want to wait for the grace period to elapse.
|
|
1771
|
+
*/
|
|
1772
|
+
hardDisconnect() {
|
|
1773
|
+
for (const session of this.sessions.values()) {
|
|
1774
|
+
this.deleteSession(session);
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1760
1777
|
onBackoffFinished(session) {
|
|
1761
1778
|
const connPromise = tracing_default.startActiveSpan("connect", async (span) => {
|
|
1762
1779
|
try {
|