@replit/river 0.23.18 → 0.24.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/README.md +17 -16
- package/dist/{chunk-AVL32IMG.js → chunk-AASMR3CQ.js} +20 -16
- package/dist/chunk-AASMR3CQ.js.map +1 -0
- package/dist/chunk-JA57I7MG.js +653 -0
- package/dist/chunk-JA57I7MG.js.map +1 -0
- package/dist/chunk-KX5PQRVN.js +382 -0
- package/dist/chunk-KX5PQRVN.js.map +1 -0
- package/dist/{chunk-EV5HW4IC.js → chunk-KYYB4DUR.js} +65 -53
- package/dist/chunk-KYYB4DUR.js.map +1 -0
- package/dist/chunk-NLQPPDOT.js +399 -0
- package/dist/chunk-NLQPPDOT.js.map +1 -0
- package/dist/{chunk-R2HAS3GM.js → chunk-PJGGC3LV.js} +55 -41
- package/dist/chunk-PJGGC3LV.js.map +1 -0
- package/dist/{chunk-7MJYOL32.js → chunk-RXJLI2OP.js} +15 -23
- package/dist/chunk-RXJLI2OP.js.map +1 -0
- package/dist/{chunk-6LCL2ZZF.js → chunk-TAH2GVTJ.js} +1 -1
- package/dist/chunk-TAH2GVTJ.js.map +1 -0
- package/dist/chunk-ZAT3R4CU.js +277 -0
- package/dist/chunk-ZAT3R4CU.js.map +1 -0
- package/dist/{client-5776a6bb.d.ts → client-ba0d3315.d.ts} +12 -15
- package/dist/{connection-bd35d442.d.ts → connection-c3a96d09.d.ts} +1 -5
- package/dist/connection-d33e3246.d.ts +11 -0
- package/dist/{handshake-a947c234.d.ts → handshake-cdead82a.d.ts} +148 -183
- 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/{index-ea74cdbb.d.ts → message-e6c560fd.d.ts} +2 -2
- package/dist/router/index.cjs +104 -63
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +11 -10
- package/dist/router/index.d.ts +11 -10
- package/dist/router/index.js +2 -2
- package/dist/server-2ef5e6ec.d.ts +42 -0
- package/dist/{services-38b3f758.d.ts → services-e1417b33.d.ts} +3 -3
- package/dist/transport/impls/uds/client.cjs +1246 -1230
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- package/dist/transport/impls/uds/client.d.cts +4 -4
- package/dist/transport/impls/uds/client.d.ts +4 -4
- package/dist/transport/impls/uds/client.js +7 -13
- package/dist/transport/impls/uds/client.js.map +1 -1
- package/dist/transport/impls/uds/server.cjs +1298 -1151
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- package/dist/transport/impls/uds/server.d.cts +4 -4
- package/dist/transport/impls/uds/server.d.ts +4 -4
- package/dist/transport/impls/uds/server.js +6 -6
- package/dist/transport/impls/ws/client.cjs +976 -965
- 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 +6 -7
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +1182 -1047
- 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 +6 -6
- package/dist/transport/index.cjs +1433 -1360
- 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 +9 -9
- package/dist/util/testHelpers.cjs +743 -310
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +9 -6
- package/dist/util/testHelpers.d.ts +9 -6
- package/dist/util/testHelpers.js +33 -10
- package/dist/util/testHelpers.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6LCL2ZZF.js.map +0 -1
- package/dist/chunk-7MJYOL32.js.map +0 -1
- package/dist/chunk-AVL32IMG.js.map +0 -1
- package/dist/chunk-DPKOJQWF.js +0 -476
- package/dist/chunk-DPKOJQWF.js.map +0 -1
- package/dist/chunk-EV5HW4IC.js.map +0 -1
- package/dist/chunk-J6N6H2WU.js +0 -476
- package/dist/chunk-J6N6H2WU.js.map +0 -1
- package/dist/chunk-MW5JXLHY.js +0 -348
- package/dist/chunk-MW5JXLHY.js.map +0 -1
- package/dist/chunk-R2HAS3GM.js.map +0 -1
- package/dist/chunk-RJOWZIWB.js +0 -335
- package/dist/chunk-RJOWZIWB.js.map +0 -1
- package/dist/connection-df85db7e.d.ts +0 -17
- package/dist/server-53cd5b7e.d.ts +0 -24
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-e1417b33.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-e1417b33.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection,
|
|
6
|
-
export {
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
8
|
-
import '../
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-cdead82a.js';
|
|
6
|
+
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-cdead82a.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-2ef5e6ec.js';
|
|
8
|
+
import '../message-e6c560fd.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-ba0d3315.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -17,10 +17,11 @@ import '../types-3e5768ec.js';
|
|
|
17
17
|
*/
|
|
18
18
|
interface Server<Services extends AnyServiceSchemaMap> {
|
|
19
19
|
services: InstantiatedServiceSchemaMap<Services>;
|
|
20
|
-
streams: Map<
|
|
20
|
+
streams: Map<StreamId, ProcStream>;
|
|
21
21
|
}
|
|
22
|
+
type StreamId = string;
|
|
22
23
|
interface ProcStream {
|
|
23
|
-
id:
|
|
24
|
+
id: StreamId;
|
|
24
25
|
serviceName: string;
|
|
25
26
|
procedureName: string;
|
|
26
27
|
incoming: Pushable<PayloadType>;
|
|
@@ -44,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
44
45
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
45
46
|
}>): Server<Services>;
|
|
46
47
|
|
|
47
|
-
var version = "0.
|
|
48
|
+
var version = "0.24.0";
|
|
48
49
|
|
|
49
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-e1417b33.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-e1417b33.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection,
|
|
6
|
-
export {
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
8
|
-
import '../
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-cdead82a.js';
|
|
6
|
+
export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-cdead82a.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-2ef5e6ec.js';
|
|
8
|
+
import '../message-e6c560fd.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-ba0d3315.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -17,10 +17,11 @@ import '../types-3e5768ec.js';
|
|
|
17
17
|
*/
|
|
18
18
|
interface Server<Services extends AnyServiceSchemaMap> {
|
|
19
19
|
services: InstantiatedServiceSchemaMap<Services>;
|
|
20
|
-
streams: Map<
|
|
20
|
+
streams: Map<StreamId, ProcStream>;
|
|
21
21
|
}
|
|
22
|
+
type StreamId = string;
|
|
22
23
|
interface ProcStream {
|
|
23
|
-
id:
|
|
24
|
+
id: StreamId;
|
|
24
25
|
serviceName: string;
|
|
25
26
|
procedureName: string;
|
|
26
27
|
incoming: Pushable<PayloadType>;
|
|
@@ -44,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
44
45
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
45
46
|
}>): Server<Services>;
|
|
46
47
|
|
|
47
|
-
var version = "0.
|
|
48
|
+
var version = "0.24.0";
|
|
48
49
|
|
|
49
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-KYYB4DUR.js";
|
|
14
14
|
import {
|
|
15
15
|
version
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-PJGGC3LV.js";
|
|
17
17
|
export {
|
|
18
18
|
Err,
|
|
19
19
|
Ok,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { C as Connection, w as CommonSession, d as SessionState, x as SessionHandshakingListeners, T as Transport, y as ServerTransportOptions, q as ServerHandshakeOptions, r as ParsedMetadata, c as ProvidedServerTransportOptions, S as Session } from './handshake-cdead82a.js';
|
|
2
|
+
import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-e6c560fd.js';
|
|
3
|
+
|
|
4
|
+
declare class SessionWaitingForHandshake<ConnType extends Connection> extends CommonSession {
|
|
5
|
+
readonly state: SessionState.WaitingForHandshake;
|
|
6
|
+
conn: ConnType;
|
|
7
|
+
listeners: SessionHandshakingListeners;
|
|
8
|
+
handshakeTimeout?: ReturnType<typeof setTimeout>;
|
|
9
|
+
constructor(conn: ConnType, listeners: SessionHandshakingListeners, ...args: ConstructorParameters<typeof CommonSession>);
|
|
10
|
+
onHandshakeData: (msg: Uint8Array) => void;
|
|
11
|
+
get loggingMetadata(): MessageMetadata;
|
|
12
|
+
sendHandshake(msg: TransportMessage): boolean;
|
|
13
|
+
_handleStateExit(): void;
|
|
14
|
+
_handleClose(): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare abstract class ServerTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
18
|
+
/**
|
|
19
|
+
* The options for this transport.
|
|
20
|
+
*/
|
|
21
|
+
protected options: ServerTransportOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Optional handshake options for the server.
|
|
24
|
+
*/
|
|
25
|
+
handshakeExtensions?: ServerHandshakeOptions;
|
|
26
|
+
/**
|
|
27
|
+
* A map of session handshake data for each session.
|
|
28
|
+
*/
|
|
29
|
+
sessionHandshakeMetadata: Map<string, ParsedMetadata>;
|
|
30
|
+
pendingSessions: Set<SessionWaitingForHandshake<ConnType>>;
|
|
31
|
+
constructor(clientId: TransportClientId, providedOptions?: ProvidedServerTransportOptions);
|
|
32
|
+
extendHandshake(options: ServerHandshakeOptions): void;
|
|
33
|
+
send(to: string, msg: PartialTransportMessage): string;
|
|
34
|
+
protected deletePendingSession(pendingSession: SessionWaitingForHandshake<ConnType>): void;
|
|
35
|
+
protected deleteSession(session: Session<ConnType>): void;
|
|
36
|
+
protected handleConnection(conn: ConnType): void;
|
|
37
|
+
private rejectHandshakeRequest;
|
|
38
|
+
protected onHandshakeRequest(session: SessionWaitingForHandshake<ConnType>, msg: OpaqueTransportMessage): Promise<void>;
|
|
39
|
+
private validateHandshakeMetadata;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { ServerTransport as S, SessionWaitingForHandshake as a };
|
|
@@ -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,
|
|
4
|
-
import { c as TransportClientId } from './
|
|
5
|
-
import { C as ClientTransport } from './client-
|
|
3
|
+
import { C as Connection, p as ClientHandshakeOptions, t as ServiceContextWithTransportInfo, n as ServiceContext } from './handshake-cdead82a.js';
|
|
4
|
+
import { c as TransportClientId } from './message-e6c560fd.js';
|
|
5
|
+
import { C as ClientTransport } from './client-ba0d3315.js';
|
|
6
6
|
|
|
7
7
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
8
8
|
/**
|