@replit/river 0.18.1 → 0.18.3

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.
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-VH3NGOXQ.js";
7
7
  import {
8
8
  log
9
- } from "./chunk-XCQF55SQ.js";
9
+ } from "./chunk-WER2DWCP.js";
10
10
 
11
11
  // router/services.ts
12
12
  import { Type } from "@sinclair/typebox";
@@ -1240,6 +1240,9 @@ function createServer(transport, services, extendedContext) {
1240
1240
  return new RiverServer(transport, services, extendedContext);
1241
1241
  }
1242
1242
 
1243
+ // package.json
1244
+ var version = "0.18.3";
1245
+
1243
1246
  export {
1244
1247
  ServiceSchema,
1245
1248
  Procedure,
@@ -1249,5 +1252,6 @@ export {
1249
1252
  Ok,
1250
1253
  Err,
1251
1254
  createClient,
1252
- createServer
1255
+ createServer,
1256
+ version
1253
1257
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Connection
3
- } from "./chunk-UNTGVPI6.js";
3
+ } from "./chunk-UABIFWM7.js";
4
4
 
5
5
  // transport/impls/ws/connection.ts
6
6
  var WebSocketConnection = class extends Connection {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Connection
3
- } from "./chunk-UNTGVPI6.js";
3
+ } from "./chunk-UABIFWM7.js";
4
4
 
5
5
  // transport/transforms/messageFraming.ts
6
6
  import { Transform } from "node:stream";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-VH3NGOXQ.js";
11
11
  import {
12
12
  log
13
- } from "./chunk-XCQF55SQ.js";
13
+ } from "./chunk-WER2DWCP.js";
14
14
  import {
15
15
  NaiveJsonCodec
16
16
  } from "./chunk-GZ7HCLLM.js";
@@ -33,7 +33,7 @@ var BaseLogger = class {
33
33
  }
34
34
  }
35
35
  };
36
- var stringLogger = (msg, _ctx, level) => {
36
+ var stringLogger = (msg, _ctx, level = "info") => {
37
37
  console.log(`[river:${level}] ${msg}`);
38
38
  };
39
39
  var colorMap = {
@@ -42,8 +42,8 @@ var colorMap = {
42
42
  warn: "\x1B[33m",
43
43
  error: "\x1B[31m"
44
44
  };
45
- var coloredStringLogger = (msg, _ctx, level) => {
46
- const color = colorMap[level ?? "info"];
45
+ var coloredStringLogger = (msg, _ctx, level = "info") => {
46
+ const color = colorMap[level];
47
47
  console.log(`[river:${color}${level}\x1B[0m] ${msg}`);
48
48
  };
49
49
  var jsonLogger = (msg, ctx, level) => {
@@ -55,7 +55,7 @@ function bindLogger(fn, level) {
55
55
  log = void 0;
56
56
  return;
57
57
  }
58
- if (fn instanceof Function) {
58
+ if (typeof fn === "function") {
59
59
  log = new BaseLogger(fn, level);
60
60
  return log;
61
61
  }
@@ -62,7 +62,7 @@ var BaseLogger = class {
62
62
  }
63
63
  }
64
64
  };
65
- var stringLogger = (msg, _ctx, level) => {
65
+ var stringLogger = (msg, _ctx, level = "info") => {
66
66
  console.log(`[river:${level}] ${msg}`);
67
67
  };
68
68
  var colorMap = {
@@ -71,8 +71,8 @@ var colorMap = {
71
71
  warn: "\x1B[33m",
72
72
  error: "\x1B[31m"
73
73
  };
74
- var coloredStringLogger = (msg, _ctx, level) => {
75
- const color = colorMap[level ?? "info"];
74
+ var coloredStringLogger = (msg, _ctx, level = "info") => {
75
+ const color = colorMap[level];
76
76
  console.log(`[river:${color}${level}\x1B[0m] ${msg}`);
77
77
  };
78
78
  var jsonLogger = (msg, ctx, level) => {
@@ -84,7 +84,7 @@ function bindLogger(fn, level) {
84
84
  log = void 0;
85
85
  return;
86
86
  }
87
- if (fn instanceof Function) {
87
+ if (typeof fn === "function") {
88
88
  log = new BaseLogger(fn, level);
89
89
  return log;
90
90
  }
@@ -3,7 +3,7 @@ import {
3
3
  coloredStringLogger,
4
4
  jsonLogger,
5
5
  stringLogger
6
- } from "../chunk-XCQF55SQ.js";
6
+ } from "../chunk-WER2DWCP.js";
7
7
  export {
8
8
  bindLogger,
9
9
  coloredStringLogger,
@@ -23,6 +23,7 @@ __export(router_exports, {
23
23
  Err: () => Err,
24
24
  Ok: () => Ok,
25
25
  Procedure: () => Procedure,
26
+ RIVER_VERSION: () => version,
26
27
  RiverUncaughtSchema: () => RiverUncaughtSchema,
27
28
  ServiceSchema: () => ServiceSchema,
28
29
  UNCAUGHT_ERROR: () => UNCAUGHT_ERROR,
@@ -1334,11 +1335,15 @@ var RiverServer = class {
1334
1335
  function createServer(transport, services, extendedContext) {
1335
1336
  return new RiverServer(transport, services, extendedContext);
1336
1337
  }
1338
+
1339
+ // package.json
1340
+ var version = "0.18.3";
1337
1341
  // Annotate the CommonJS export names for ESM import in node:
1338
1342
  0 && (module.exports = {
1339
1343
  Err,
1340
1344
  Ok,
1341
1345
  Procedure,
1346
+ RIVER_VERSION,
1342
1347
  RiverUncaughtSchema,
1343
1348
  ServiceSchema,
1344
1349
  UNCAUGHT_ERROR,
@@ -412,4 +412,6 @@ type SerializedServerSchema = Record<string, SerializedServiceSchema>;
412
412
  */
413
413
  declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
414
414
 
415
- export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
415
+ var version = "0.18.3";
416
+
417
+ export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
@@ -412,4 +412,6 @@ type SerializedServerSchema = Record<string, SerializedServiceSchema>;
412
412
  */
413
413
  declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
414
414
 
415
- export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
415
+ var version = "0.18.3";
416
+
417
+ export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
@@ -6,14 +6,16 @@ import {
6
6
  ServiceSchema,
7
7
  UNCAUGHT_ERROR,
8
8
  createClient,
9
- createServer
10
- } from "../chunk-QBGGJSQM.js";
9
+ createServer,
10
+ version
11
+ } from "../chunk-7OS34AWW.js";
11
12
  import "../chunk-VH3NGOXQ.js";
12
- import "../chunk-XCQF55SQ.js";
13
+ import "../chunk-WER2DWCP.js";
13
14
  export {
14
15
  Err,
15
16
  Ok,
16
17
  Procedure,
18
+ version as RIVER_VERSION,
17
19
  RiverUncaughtSchema,
18
20
  ServiceSchema,
19
21
  UNCAUGHT_ERROR,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  UdsConnection
3
- } from "../../../chunk-O36533OC.js";
3
+ } from "../../../chunk-PUX3U2SZ.js";
4
4
  import {
5
5
  ClientTransport
6
- } from "../../../chunk-UNTGVPI6.js";
6
+ } from "../../../chunk-UABIFWM7.js";
7
7
  import "../../../chunk-VH3NGOXQ.js";
8
8
  import {
9
9
  log
10
- } from "../../../chunk-XCQF55SQ.js";
10
+ } from "../../../chunk-WER2DWCP.js";
11
11
  import "../../../chunk-GZ7HCLLM.js";
12
12
 
13
13
  // transport/impls/uds/client.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  UdsConnection
3
- } from "../../../chunk-O36533OC.js";
3
+ } from "../../../chunk-PUX3U2SZ.js";
4
4
  import {
5
5
  ServerTransport
6
- } from "../../../chunk-UNTGVPI6.js";
6
+ } from "../../../chunk-UABIFWM7.js";
7
7
  import "../../../chunk-VH3NGOXQ.js";
8
- import "../../../chunk-XCQF55SQ.js";
8
+ import "../../../chunk-WER2DWCP.js";
9
9
  import "../../../chunk-GZ7HCLLM.js";
10
10
 
11
11
  // transport/impls/uds/server.ts
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  WebSocketConnection
3
- } from "../../../chunk-5YDJDYVB.js";
3
+ } from "../../../chunk-K7CUSLWL.js";
4
4
  import {
5
5
  ClientTransport
6
- } from "../../../chunk-UNTGVPI6.js";
6
+ } from "../../../chunk-UABIFWM7.js";
7
7
  import "../../../chunk-VH3NGOXQ.js";
8
8
  import {
9
9
  log
10
- } from "../../../chunk-XCQF55SQ.js";
10
+ } from "../../../chunk-WER2DWCP.js";
11
11
  import "../../../chunk-GZ7HCLLM.js";
12
12
 
13
13
  // transport/impls/ws/client.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WebSocketConnection
3
- } from "../../../chunk-5YDJDYVB.js";
3
+ } from "../../../chunk-K7CUSLWL.js";
4
4
  import {
5
5
  ServerTransport
6
- } from "../../../chunk-UNTGVPI6.js";
6
+ } from "../../../chunk-UABIFWM7.js";
7
7
  import "../../../chunk-VH3NGOXQ.js";
8
- import "../../../chunk-XCQF55SQ.js";
8
+ import "../../../chunk-WER2DWCP.js";
9
9
  import "../../../chunk-GZ7HCLLM.js";
10
10
 
11
11
  // transport/impls/ws/server.ts
@@ -6,12 +6,12 @@ import {
6
6
  ServerTransport,
7
7
  Session,
8
8
  Transport
9
- } from "../chunk-UNTGVPI6.js";
9
+ } from "../chunk-UABIFWM7.js";
10
10
  import {
11
11
  OpaqueTransportMessageSchema,
12
12
  TransportMessageSchema
13
13
  } from "../chunk-VH3NGOXQ.js";
14
- import "../chunk-XCQF55SQ.js";
14
+ import "../chunk-WER2DWCP.js";
15
15
  import "../chunk-GZ7HCLLM.js";
16
16
  export {
17
17
  ClientTransport,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  UNCAUGHT_ERROR,
3
3
  pushable
4
- } from "../chunk-QBGGJSQM.js";
4
+ } from "../chunk-7OS34AWW.js";
5
5
  import "../chunk-RPIDSIQG.js";
6
6
  import {
7
7
  Session,
8
8
  defaultTransportOptions
9
- } from "../chunk-UNTGVPI6.js";
9
+ } from "../chunk-UABIFWM7.js";
10
10
  import {
11
11
  coerceErrorString
12
12
  } from "../chunk-VH3NGOXQ.js";
13
- import "../chunk-XCQF55SQ.js";
13
+ import "../chunk-WER2DWCP.js";
14
14
  import "../chunk-GZ7HCLLM.js";
15
15
 
16
16
  // util/testHelpers.ts
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.18.1",
4
+ "version": "0.18.3",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {