@replit/river 0.25.1 → 0.25.2

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.
Files changed (50) hide show
  1. package/dist/{chunk-SZ5NBBX7.js → chunk-EHD2JJBW.js} +2 -2
  2. package/dist/{chunk-SZ5NBBX7.js.map → chunk-EHD2JJBW.js.map} +1 -1
  3. package/dist/{chunk-SGSRNAWJ.js → chunk-GDHQCPWW.js} +2 -2
  4. package/dist/{chunk-5CNNIOAO.js → chunk-ONIPHO7J.js} +102 -95
  5. package/dist/chunk-ONIPHO7J.js.map +1 -0
  6. package/dist/{chunk-D5O3ERJU.js → chunk-PF74DCPQ.js} +3 -3
  7. package/dist/chunk-PF74DCPQ.js.map +1 -0
  8. package/dist/{chunk-YM5Y4NAT.js → chunk-Q3PZBJXR.js} +199 -117
  9. package/dist/chunk-Q3PZBJXR.js.map +1 -0
  10. package/dist/{chunk-PCBPPTXH.js → chunk-QXMZJ7LF.js} +17 -26
  11. package/dist/chunk-QXMZJ7LF.js.map +1 -0
  12. package/dist/{chunk-MBMEJIPU.js → chunk-ZWMWRM23.js} +2 -2
  13. package/dist/{client-1321630c.d.ts → client-edc8e2de.d.ts} +3 -1
  14. package/dist/{connection-bd907ca6.d.ts → connection-ef50ac3a.d.ts} +1 -1
  15. package/dist/{handshake-3772d7ca.d.ts → handshake-12d57161.d.ts} +131 -83
  16. package/dist/router/index.cjs +1 -1
  17. package/dist/router/index.cjs.map +1 -1
  18. package/dist/router/index.d.cts +7 -7
  19. package/dist/router/index.d.ts +7 -7
  20. package/dist/router/index.js +2 -2
  21. package/dist/{server-f0fd2b98.d.ts → server-f8228636.d.ts} +8 -3
  22. package/dist/{services-8d14ae16.d.ts → services-4b9e5232.d.ts} +2 -2
  23. package/dist/transport/impls/ws/client.cjs +291 -205
  24. package/dist/transport/impls/ws/client.cjs.map +1 -1
  25. package/dist/transport/impls/ws/client.d.cts +3 -3
  26. package/dist/transport/impls/ws/client.d.ts +3 -3
  27. package/dist/transport/impls/ws/client.js +5 -5
  28. package/dist/transport/impls/ws/server.cjs +206 -136
  29. package/dist/transport/impls/ws/server.cjs.map +1 -1
  30. package/dist/transport/impls/ws/server.d.cts +3 -3
  31. package/dist/transport/impls/ws/server.d.ts +3 -3
  32. package/dist/transport/impls/ws/server.js +5 -5
  33. package/dist/transport/index.cjs +304 -226
  34. package/dist/transport/index.cjs.map +1 -1
  35. package/dist/transport/index.d.cts +3 -3
  36. package/dist/transport/index.d.ts +3 -3
  37. package/dist/transport/index.js +5 -5
  38. package/dist/util/testHelpers.cjs +197 -115
  39. package/dist/util/testHelpers.cjs.map +1 -1
  40. package/dist/util/testHelpers.d.cts +5 -4
  41. package/dist/util/testHelpers.d.ts +5 -4
  42. package/dist/util/testHelpers.js +6 -3
  43. package/dist/util/testHelpers.js.map +1 -1
  44. package/package.json +14 -13
  45. package/dist/chunk-5CNNIOAO.js.map +0 -1
  46. package/dist/chunk-D5O3ERJU.js.map +0 -1
  47. package/dist/chunk-PCBPPTXH.js.map +0 -1
  48. package/dist/chunk-YM5Y4NAT.js.map +0 -1
  49. /package/dist/{chunk-SGSRNAWJ.js.map → chunk-GDHQCPWW.js.map} +0 -0
  50. /package/dist/{chunk-MBMEJIPU.js.map → chunk-ZWMWRM23.js.map} +0 -0
@@ -1,14 +1,14 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-8d14ae16.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-8d14ae16.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-4b9e5232.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-4b9e5232.js';
3
3
  import { Static } from '@sinclair/typebox';
4
4
  import { Pushable } from 'it-pushable';
5
- import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-3772d7ca.js';
6
- export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-3772d7ca.js';
7
- import { S as ServerTransport } from '../server-f0fd2b98.js';
5
+ import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-12d57161.js';
6
+ export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-12d57161.js';
7
+ import { S as ServerTransport } from '../server-f8228636.js';
8
8
  import '../message-e6c560fd.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
- import '../client-1321630c.js';
11
+ import '../client-edc8e2de.js';
12
12
  import '../types-3e5768ec.js';
13
13
 
14
14
  /**
@@ -45,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
45
45
  extendedContext?: Omit<ServiceContext, 'state'>;
46
46
  }>): Server<Services>;
47
47
 
48
- var version = "0.25.1";
48
+ var version = "0.25.2";
49
49
 
50
50
  export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
@@ -1,14 +1,14 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-8d14ae16.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-8d14ae16.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-4b9e5232.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-4b9e5232.js';
3
3
  import { Static } from '@sinclair/typebox';
4
4
  import { Pushable } from 'it-pushable';
5
- import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../handshake-3772d7ca.js';
6
- export { r as ParsedMetadata, s as ServiceContextWithState, t as ServiceContextWithTransportInfo, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../handshake-3772d7ca.js';
7
- import { S as ServerTransport } from '../server-f0fd2b98.js';
5
+ import { C as Connection, s as ServerHandshakeOptions, o as ServiceContext } from '../handshake-12d57161.js';
6
+ export { t as ParsedMetadata, u as ServiceContextWithState, v as ServiceContextWithTransportInfo, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../handshake-12d57161.js';
7
+ import { S as ServerTransport } from '../server-f8228636.js';
8
8
  import '../message-e6c560fd.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
- import '../client-1321630c.js';
11
+ import '../client-edc8e2de.js';
12
12
  import '../types-3e5768ec.js';
13
13
 
14
14
  /**
@@ -45,6 +45,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
45
45
  extendedContext?: Omit<ServiceContext, 'state'>;
46
46
  }>): Server<Services>;
47
47
 
48
- var version = "0.25.1";
48
+ var version = "0.25.2";
49
49
 
50
50
  export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
@@ -10,10 +10,10 @@ import {
10
10
  createServer,
11
11
  createServerHandshakeOptions,
12
12
  serializeSchema
13
- } from "../chunk-SGSRNAWJ.js";
13
+ } from "../chunk-GDHQCPWW.js";
14
14
  import {
15
15
  version
16
- } from "../chunk-SZ5NBBX7.js";
16
+ } from "../chunk-EHD2JJBW.js";
17
17
  export {
18
18
  Err,
19
19
  Ok,
@@ -1,12 +1,16 @@
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-3772d7ca.js';
1
+ import { C as Connection, y as CommonSession, d as SessionState, z as SessionHandshakingListeners, A as CommonSessionProps, T as Transport, B as ServerTransportOptions, s as ServerHandshakeOptions, t as ParsedMetadata, D as ServerSession, c as ProvidedServerTransportOptions } from './handshake-12d57161.js';
2
2
  import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-e6c560fd.js';
3
3
 
4
+ interface SessionWaitingForHandshakeProps<ConnType extends Connection> extends CommonSessionProps {
5
+ conn: ConnType;
6
+ listeners: SessionHandshakingListeners;
7
+ }
4
8
  declare class SessionWaitingForHandshake<ConnType extends Connection> extends CommonSession {
5
9
  readonly state: SessionState.WaitingForHandshake;
6
10
  conn: ConnType;
7
11
  listeners: SessionHandshakingListeners;
8
12
  handshakeTimeout?: ReturnType<typeof setTimeout>;
9
- constructor(conn: ConnType, listeners: SessionHandshakingListeners, ...args: ConstructorParameters<typeof CommonSession>);
13
+ constructor(props: SessionWaitingForHandshakeProps<ConnType>);
10
14
  onHandshakeData: (msg: Uint8Array) => void;
11
15
  get loggingMetadata(): MessageMetadata;
12
16
  sendHandshake(msg: TransportMessage): boolean;
@@ -27,12 +31,13 @@ declare abstract class ServerTransport<ConnType extends Connection> extends Tran
27
31
  * A map of session handshake data for each session.
28
32
  */
29
33
  sessionHandshakeMetadata: Map<string, ParsedMetadata>;
34
+ sessions: Map<string, ServerSession<ConnType>>;
30
35
  pendingSessions: Set<SessionWaitingForHandshake<ConnType>>;
31
36
  constructor(clientId: TransportClientId, providedOptions?: ProvidedServerTransportOptions);
32
37
  extendHandshake(options: ServerHandshakeOptions): void;
33
38
  send(to: string, msg: PartialTransportMessage): string;
34
39
  protected deletePendingSession(pendingSession: SessionWaitingForHandshake<ConnType>): void;
35
- protected deleteSession(session: Session<ConnType>): void;
40
+ protected deleteSession(session: ServerSession<ConnType>): void;
36
41
  protected handleConnection(conn: ConnType): void;
37
42
  private rejectHandshakeRequest;
38
43
  protected onHandshakeRequest(session: SessionWaitingForHandshake<ConnType>, msg: OpaqueTransportMessage): Promise<void>;
@@ -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, p as ClientHandshakeOptions, t as ServiceContextWithTransportInfo, n as ServiceContext } from './handshake-3772d7ca.js';
3
+ import { C as Connection, p as ClientHandshakeOptions, v as ServiceContextWithTransportInfo, o as ServiceContext } from './handshake-12d57161.js';
4
4
  import { c as TransportClientId } from './message-e6c560fd.js';
5
- import { C as ClientTransport } from './client-1321630c.js';
5
+ import { C as ClientTransport } from './client-edc8e2de.js';
6
6
 
7
7
  type AsyncIter<T> = AsyncGenerator<T, T>;
8
8
  /**