@replit/river 0.13.3 → 0.13.4

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.
@@ -1,6 +1,6 @@
1
1
  import { TObject, TUnion, TString, TSchema, TNever, TLiteral, Static } from '@sinclair/typebox';
2
2
  import { Pushable } from 'it-pushable';
3
- import { b as TransportClientId, d as Session, C as Connection } from './index-1c1493df.js';
3
+ import { b as TransportClientId, d as Session, C as Connection } from './index-5c55c0d3.js';
4
4
 
5
5
  /**
6
6
  * The context for services/procedures. This is used only on
@@ -200,9 +200,8 @@ declare class ServiceBuilder<T extends Service<string, object, ProcListing>> {
200
200
  private constructor();
201
201
  /**
202
202
  * Finalizes the schema for the service.
203
- * @returns {T} The finalized schema for the service.
204
203
  */
205
- finalize(): T;
204
+ finalize(): Readonly<T>;
206
205
  /**
207
206
  * Sets the initial state for the service.
208
207
  * @template InitState The type of the initial state.
@@ -41,10 +41,9 @@ var ServiceBuilder = class _ServiceBuilder {
41
41
  }
42
42
  /**
43
43
  * Finalizes the schema for the service.
44
- * @returns {T} The finalized schema for the service.
45
44
  */
46
45
  finalize() {
47
- return this.schema;
46
+ return Object.freeze(this.schema);
48
47
  }
49
48
  /**
50
49
  * Sets the initial state for the service.
@@ -1,4 +1,4 @@
1
- import { C as Connection } from './index-1c1493df.js';
1
+ import { C as Connection } from './index-5c55c0d3.js';
2
2
  import { Socket } from 'node:net';
3
3
  import stream, { Transform, TransformCallback, TransformOptions } from 'node:stream';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import WebSocket from 'isomorphic-ws';
2
- import { C as Connection } from './index-1c1493df.js';
2
+ import { C as Connection } from './index-5c55c0d3.js';
3
3
 
4
4
  declare class WebSocketConnection extends Connection {
5
5
  ws: WebSocket;
@@ -421,4 +421,4 @@ declare abstract class ServerTransport<ConnType extends Connection> extends Tran
421
421
  };
422
422
  }
423
423
 
424
- export { Connection as C, EventMap as E, OpaqueTransportMessage as O, PartialTransportMessage as P, ServerTransport as S, Transport as T, ClientTransport as a, TransportClientId as b, TransportOptions as c, Session as d, TransportMessageSchema as e, OpaqueTransportMessageSchema as f, TransportMessage as g, isStreamClose as h, isStreamOpen as i, EventTypes as j, EventHandler as k };
424
+ export { Connection as C, EventMap as E, OpaqueTransportMessage as O, PartialTransportMessage as P, ServerTransport as S, Transport as T, ClientTransport as a, TransportClientId as b, TransportOptions as c, Session as d, TransportStatus as e, TransportMessageSchema as f, OpaqueTransportMessageSchema as g, TransportMessage as h, isStreamOpen as i, isStreamClose as j, EventTypes as k, EventHandler as l };
@@ -65,10 +65,9 @@ var ServiceBuilder = class _ServiceBuilder {
65
65
  }
66
66
  /**
67
67
  * Finalizes the schema for the service.
68
- * @returns {T} The finalized schema for the service.
69
68
  */
70
69
  finalize() {
71
- return this.schema;
70
+ return Object.freeze(this.schema);
72
71
  }
73
72
  /**
74
73
  * Sets the initial state for the service.
@@ -1,6 +1,6 @@
1
- import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-d649690f.js';
2
- export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-d649690f.js';
3
- import { S as ServerTransport, C as Connection, a as ClientTransport } from '../index-1c1493df.js';
1
+ import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-6f4630d0.js';
2
+ export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-6f4630d0.js';
3
+ import { S as ServerTransport, C as Connection, a as ClientTransport } from '../index-5c55c0d3.js';
4
4
  import { Pushable } from 'it-pushable';
5
5
  import { Static } from '@sinclair/typebox';
6
6
  import '../types-3e5768ec.js';
@@ -1,6 +1,6 @@
1
- import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-d649690f.js';
2
- export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-d649690f.js';
3
- import { S as ServerTransport, C as Connection, a as ClientTransport } from '../index-1c1493df.js';
1
+ import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-6f4630d0.js';
2
+ export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-6f4630d0.js';
3
+ import { S as ServerTransport, C as Connection, a as ClientTransport } from '../index-5c55c0d3.js';
4
4
  import { Pushable } from 'it-pushable';
5
5
  import { Static } from '@sinclair/typebox';
6
6
  import '../types-3e5768ec.js';
@@ -8,7 +8,7 @@ import {
8
8
  createClient,
9
9
  createServer,
10
10
  serializeService
11
- } from "../chunk-67M47YPQ.js";
11
+ } from "../chunk-ASZ3VDCS.js";
12
12
  import "../chunk-GFRAOY75.js";
13
13
  import "../chunk-H4BYJELI.js";
14
14
  export {
@@ -1,5 +1,5 @@
1
- import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
2
- import { U as UdsConnection } from '../../../connection-6222fd0b.js';
1
+ import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
2
+ import { U as UdsConnection } from '../../../connection-8d0efae0.js';
3
3
  import '../../../types-3e5768ec.js';
4
4
  import '@sinclair/typebox';
5
5
  import 'node:net';
@@ -1,5 +1,5 @@
1
- import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
2
- import { U as UdsConnection } from '../../../connection-6222fd0b.js';
1
+ import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
2
+ import { U as UdsConnection } from '../../../connection-8d0efae0.js';
3
3
  import '../../../types-3e5768ec.js';
4
4
  import '@sinclair/typebox';
5
5
  import 'node:net';
@@ -1,6 +1,6 @@
1
1
  import { Server, Socket } from 'node:net';
2
- import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
3
- import { U as UdsConnection } from '../../../connection-6222fd0b.js';
2
+ import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
3
+ import { U as UdsConnection } from '../../../connection-8d0efae0.js';
4
4
  import '../../../types-3e5768ec.js';
5
5
  import '@sinclair/typebox';
6
6
  import 'node:stream';
@@ -1,6 +1,6 @@
1
1
  import { Server, Socket } from 'node:net';
2
- import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
3
- import { U as UdsConnection } from '../../../connection-6222fd0b.js';
2
+ import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
3
+ import { U as UdsConnection } from '../../../connection-8d0efae0.js';
4
4
  import '../../../types-3e5768ec.js';
5
5
  import '@sinclair/typebox';
6
6
  import 'node:stream';
@@ -1,6 +1,6 @@
1
1
  import WebSocket from 'isomorphic-ws';
2
- import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
3
- import { W as WebSocketConnection } from '../../../connection-2b55cc7f.js';
2
+ import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
3
+ import { W as WebSocketConnection } from '../../../connection-fe33e684.js';
4
4
  import '../../../types-3e5768ec.js';
5
5
  import '@sinclair/typebox';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import WebSocket from 'isomorphic-ws';
2
- import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
3
- import { W as WebSocketConnection } from '../../../connection-2b55cc7f.js';
2
+ import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
3
+ import { W as WebSocketConnection } from '../../../connection-fe33e684.js';
4
4
  import '../../../types-3e5768ec.js';
5
5
  import '@sinclair/typebox';
6
6
 
@@ -1,7 +1,7 @@
1
- import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
1
+ import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
2
2
  import { WebSocketServer } from 'ws';
3
3
  import { WebSocket } from 'isomorphic-ws';
4
- import { W as WebSocketConnection } from '../../../connection-2b55cc7f.js';
4
+ import { W as WebSocketConnection } from '../../../connection-fe33e684.js';
5
5
  import '../../../types-3e5768ec.js';
6
6
  import '@sinclair/typebox';
7
7
 
@@ -1,7 +1,7 @@
1
- import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-1c1493df.js';
1
+ import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-5c55c0d3.js';
2
2
  import { WebSocketServer } from 'ws';
3
3
  import { WebSocket } from 'isomorphic-ws';
4
- import { W as WebSocketConnection } from '../../../connection-2b55cc7f.js';
4
+ import { W as WebSocketConnection } from '../../../connection-fe33e684.js';
5
5
  import '../../../types-3e5768ec.js';
6
6
  import '@sinclair/typebox';
7
7
 
@@ -1,3 +1,3 @@
1
- export { a as ClientTransport, C as Connection, k as EventHandler, E as EventMap, j as EventTypes, O as OpaqueTransportMessage, f as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, g as TransportMessage, e as TransportMessageSchema, h as isStreamClose, i as isStreamOpen } from '../index-1c1493df.js';
1
+ export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-5c55c0d3.js';
2
2
  import '../types-3e5768ec.js';
3
3
  import '@sinclair/typebox';
@@ -1,3 +1,3 @@
1
- export { a as ClientTransport, C as Connection, k as EventHandler, E as EventMap, j as EventTypes, O as OpaqueTransportMessage, f as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, g as TransportMessage, e as TransportMessageSchema, h as isStreamClose, i as isStreamOpen } from '../index-1c1493df.js';
1
+ export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-5c55c0d3.js';
2
2
  import '../types-3e5768ec.js';
3
3
  import '@sinclair/typebox';
@@ -1,8 +1,8 @@
1
1
  import * as it_pushable from 'it-pushable';
2
2
  import WebSocket from 'isomorphic-ws';
3
3
  import http from 'node:http';
4
- import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-1c1493df.js';
5
- import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-d649690f.js';
4
+ import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-5c55c0d3.js';
5
+ import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-6f4630d0.js';
6
6
  import { Static } from '@sinclair/typebox';
7
7
  import net from 'node:net';
8
8
  import '../types-3e5768ec.js';
@@ -1,8 +1,8 @@
1
1
  import * as it_pushable from 'it-pushable';
2
2
  import WebSocket from 'isomorphic-ws';
3
3
  import http from 'node:http';
4
- import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-1c1493df.js';
5
- import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-d649690f.js';
4
+ import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-5c55c0d3.js';
5
+ import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-6f4630d0.js';
6
6
  import { Static } from '@sinclair/typebox';
7
7
  import net from 'node:net';
8
8
  import '../types-3e5768ec.js';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  UNCAUGHT_ERROR,
3
3
  pushable
4
- } from "../chunk-67M47YPQ.js";
4
+ } from "../chunk-ASZ3VDCS.js";
5
5
  import "../chunk-5IZ2UHWV.js";
6
6
  import {
7
7
  Session,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@replit/river",
3
3
  "description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!",
4
- "version": "0.13.3",
4
+ "version": "0.13.4",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {