@replit/river 0.200.3 → 0.200.5

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 (53) hide show
  1. package/dist/{chunk-HYPTZTEZ.js → chunk-3FMY7VTM.js} +2 -2
  2. package/dist/{chunk-QHMZKXXG.js → chunk-64J442AK.js} +2 -2
  3. package/dist/{chunk-QHMZKXXG.js.map → chunk-64J442AK.js.map} +1 -1
  4. package/dist/{chunk-HFW27CAC.js → chunk-7Z5MSOKL.js} +4 -4
  5. package/dist/{chunk-YTMS7OP6.js → chunk-LHH5LQ7C.js} +1 -1
  6. package/dist/chunk-LHH5LQ7C.js.map +1 -0
  7. package/dist/{chunk-O2VICK2U.js → chunk-MSJGPQRT.js} +4 -4
  8. package/dist/{chunk-YOC4BXQ5.js → chunk-WN7GEBMX.js} +4 -4
  9. package/dist/{chunk-FX5DKRIK.js → chunk-Z7Q5CDXD.js} +2 -2
  10. package/dist/chunk-Z7Q5CDXD.js.map +1 -0
  11. package/dist/{client-9292552a.d.ts → client-ba6815ae.d.ts} +2 -2
  12. package/dist/{connection-94dea547.d.ts → connection-d217c989.d.ts} +4 -4
  13. package/dist/{context-69f37ac1.d.ts → context-8d1ed9a1.d.ts} +3 -3
  14. package/dist/logging/index.cjs.map +1 -1
  15. package/dist/logging/index.d.cts +1 -1
  16. package/dist/logging/index.d.ts +1 -1
  17. package/dist/logging/index.js +1 -1
  18. package/dist/{message-57bb8187.d.ts → message-45658364.d.ts} +2 -2
  19. package/dist/router/index.cjs +10 -9
  20. package/dist/router/index.cjs.map +1 -1
  21. package/dist/router/index.d.cts +8 -8
  22. package/dist/router/index.d.ts +8 -8
  23. package/dist/router/index.js +10 -9
  24. package/dist/router/index.js.map +1 -1
  25. package/dist/{server-8fdd7fb2.d.ts → server-eb7d2cfd.d.ts} +3 -3
  26. package/dist/{services-c8fe49bf.d.ts → services-94e0afc3.d.ts} +3 -3
  27. package/dist/transport/impls/ws/client.cjs +1 -1
  28. package/dist/transport/impls/ws/client.cjs.map +1 -1
  29. package/dist/transport/impls/ws/client.d.cts +4 -4
  30. package/dist/transport/impls/ws/client.d.ts +4 -4
  31. package/dist/transport/impls/ws/client.js +6 -6
  32. package/dist/transport/impls/ws/server.cjs +1 -1
  33. package/dist/transport/impls/ws/server.cjs.map +1 -1
  34. package/dist/transport/impls/ws/server.d.cts +4 -4
  35. package/dist/transport/impls/ws/server.d.ts +4 -4
  36. package/dist/transport/impls/ws/server.js +6 -6
  37. package/dist/transport/index.cjs +1 -1
  38. package/dist/transport/index.cjs.map +1 -1
  39. package/dist/transport/index.d.cts +4 -4
  40. package/dist/transport/index.d.ts +4 -4
  41. package/dist/transport/index.js +6 -6
  42. package/dist/util/testHelpers.cjs +1 -1
  43. package/dist/util/testHelpers.cjs.map +1 -1
  44. package/dist/util/testHelpers.d.cts +5 -5
  45. package/dist/util/testHelpers.d.ts +5 -5
  46. package/dist/util/testHelpers.js +2 -2
  47. package/package.json +1 -1
  48. package/dist/chunk-FX5DKRIK.js.map +0 -1
  49. package/dist/chunk-YTMS7OP6.js.map +0 -1
  50. /package/dist/{chunk-HYPTZTEZ.js.map → chunk-3FMY7VTM.js.map} +0 -0
  51. /package/dist/{chunk-HFW27CAC.js.map → chunk-7Z5MSOKL.js.map} +0 -0
  52. /package/dist/{chunk-O2VICK2U.js.map → chunk-MSJGPQRT.js.map} +0 -0
  53. /package/dist/{chunk-YOC4BXQ5.js.map → chunk-WN7GEBMX.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-c8fe49bf.js';
2
- export { B as BaseErrorSchemaType, H as CANCEL_CODE, K as Client, L as Err, N as ErrResult, G as INVALID_REQUEST_CODE, O as Ok, Q as OkResult, P as PayloadType, m as ProcErrors, i as ProcHandler, j as ProcInit, k as ProcRequest, l as ProcResponse, n as ProcType, d as Procedure, c as ProcedureErrorSchemaType, x as ProcedureMap, y as RPCProcedure, R as Readable, f as ReaderErrorSchema, Y as ResponseData, e as Result, X as ResultUnwrapErr, T as ResultUnwrapOk, r as SerializedProcedureSchema, w as SerializedProcedureSchemaProtocolv1, p as SerializedServerSchema, u as SerializedServerSchemaProtocolv1, q as SerializedServiceSchema, v as SerializedServiceSchemaProtocolv1, S as Service, h as ServiceConfiguration, o as ServiceSchema, C as StreamProcedure, z as SubscriptionProcedure, E as UNCAUGHT_ERROR_CODE, F as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, J as createClient, D as flattenErrorType, s as serializeSchema, t as serializeSchemaV1Compat, M as unwrapOrThrow } from '../services-c8fe49bf.js';
3
- import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-57bb8187.js';
4
- import { t as ParsedMetadata, C as Connection, u as ServerHandshakeOptions, p as ServiceContext } from '../context-69f37ac1.js';
5
- export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-69f37ac1.js';
6
- import { S as ServerTransport } from '../server-8fdd7fb2.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-94e0afc3.js';
2
+ export { B as BaseErrorSchemaType, H as CANCEL_CODE, K as Client, L as Err, N as ErrResult, G as INVALID_REQUEST_CODE, O as Ok, Q as OkResult, P as PayloadType, m as ProcErrors, i as ProcHandler, j as ProcInit, k as ProcRequest, l as ProcResponse, n as ProcType, d as Procedure, c as ProcedureErrorSchemaType, x as ProcedureMap, y as RPCProcedure, R as Readable, f as ReaderErrorSchema, Y as ResponseData, e as Result, X as ResultUnwrapErr, T as ResultUnwrapOk, r as SerializedProcedureSchema, w as SerializedProcedureSchemaProtocolv1, p as SerializedServerSchema, u as SerializedServerSchemaProtocolv1, q as SerializedServiceSchema, v as SerializedServiceSchemaProtocolv1, S as Service, h as ServiceConfiguration, o as ServiceSchema, C as StreamProcedure, z as SubscriptionProcedure, E as UNCAUGHT_ERROR_CODE, F as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, J as createClient, D as flattenErrorType, s as serializeSchema, t as serializeSchemaV1Compat, M as unwrapOrThrow } from '../services-94e0afc3.js';
3
+ import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-45658364.js';
4
+ import { t as ParsedMetadata, C as Connection, u as ServerHandshakeOptions, p as ServiceContext } from '../context-8d1ed9a1.js';
5
+ export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-8d1ed9a1.js';
6
+ import { S as ServerTransport } from '../server-eb7d2cfd.js';
7
7
  import '@sinclair/typebox';
8
- import '../client-9292552a.js';
8
+ import '../client-ba6815ae.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
11
  import '@sinclair/typebox/errors';
@@ -55,6 +55,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
55
55
  maxCancelledStreamTombstonesPerSession?: number;
56
56
  }>): Server<Services>;
57
57
 
58
- var version = "0.200.3";
58
+ var version = "0.200.5";
59
59
 
60
60
  export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
@@ -1,11 +1,11 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-c8fe49bf.js';
2
- export { B as BaseErrorSchemaType, H as CANCEL_CODE, K as Client, L as Err, N as ErrResult, G as INVALID_REQUEST_CODE, O as Ok, Q as OkResult, P as PayloadType, m as ProcErrors, i as ProcHandler, j as ProcInit, k as ProcRequest, l as ProcResponse, n as ProcType, d as Procedure, c as ProcedureErrorSchemaType, x as ProcedureMap, y as RPCProcedure, R as Readable, f as ReaderErrorSchema, Y as ResponseData, e as Result, X as ResultUnwrapErr, T as ResultUnwrapOk, r as SerializedProcedureSchema, w as SerializedProcedureSchemaProtocolv1, p as SerializedServerSchema, u as SerializedServerSchemaProtocolv1, q as SerializedServiceSchema, v as SerializedServiceSchemaProtocolv1, S as Service, h as ServiceConfiguration, o as ServiceSchema, C as StreamProcedure, z as SubscriptionProcedure, E as UNCAUGHT_ERROR_CODE, F as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, J as createClient, D as flattenErrorType, s as serializeSchema, t as serializeSchemaV1Compat, M as unwrapOrThrow } from '../services-c8fe49bf.js';
3
- import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-57bb8187.js';
4
- import { t as ParsedMetadata, C as Connection, u as ServerHandshakeOptions, p as ServiceContext } from '../context-69f37ac1.js';
5
- export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-69f37ac1.js';
6
- import { S as ServerTransport } from '../server-8fdd7fb2.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-94e0afc3.js';
2
+ export { B as BaseErrorSchemaType, H as CANCEL_CODE, K as Client, L as Err, N as ErrResult, G as INVALID_REQUEST_CODE, O as Ok, Q as OkResult, P as PayloadType, m as ProcErrors, i as ProcHandler, j as ProcInit, k as ProcRequest, l as ProcResponse, n as ProcType, d as Procedure, c as ProcedureErrorSchemaType, x as ProcedureMap, y as RPCProcedure, R as Readable, f as ReaderErrorSchema, Y as ResponseData, e as Result, X as ResultUnwrapErr, T as ResultUnwrapOk, r as SerializedProcedureSchema, w as SerializedProcedureSchemaProtocolv1, p as SerializedServerSchema, u as SerializedServerSchemaProtocolv1, q as SerializedServiceSchema, v as SerializedServiceSchemaProtocolv1, S as Service, h as ServiceConfiguration, o as ServiceSchema, C as StreamProcedure, z as SubscriptionProcedure, E as UNCAUGHT_ERROR_CODE, F as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, J as createClient, D as flattenErrorType, s as serializeSchema, t as serializeSchemaV1Compat, M as unwrapOrThrow } from '../services-94e0afc3.js';
3
+ import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-45658364.js';
4
+ import { t as ParsedMetadata, C as Connection, u as ServerHandshakeOptions, p as ServiceContext } from '../context-8d1ed9a1.js';
5
+ export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-8d1ed9a1.js';
6
+ import { S as ServerTransport } from '../server-eb7d2cfd.js';
7
7
  import '@sinclair/typebox';
8
- import '../client-9292552a.js';
8
+ import '../client-ba6815ae.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
11
  import '@sinclair/typebox/errors';
@@ -55,6 +55,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
55
55
  maxCancelledStreamTombstonesPerSession?: number;
56
56
  }>): Server<Services>;
57
57
 
58
- var version = "0.200.3";
58
+ var version = "0.200.5";
59
59
 
60
60
  export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
@@ -27,7 +27,7 @@ import {
27
27
  isStreamClose,
28
28
  isStreamOpen,
29
29
  version
30
- } from "../chunk-QHMZKXXG.js";
30
+ } from "../chunk-64J442AK.js";
31
31
 
32
32
  // router/services.ts
33
33
  import { Type, Kind } from "@sinclair/typebox";
@@ -715,11 +715,10 @@ var RiverServer = class {
715
715
  if (!newStreamProps) {
716
716
  return;
717
717
  }
718
- const newStream = this.createNewProcStream({
718
+ this.createNewProcStream({
719
719
  ...newStreamProps,
720
720
  ...message
721
721
  });
722
- this.streams.set(streamId, newStream);
723
722
  };
724
723
  const handleSessionStatus = (evt) => {
725
724
  if (evt.status !== "disconnect")
@@ -852,6 +851,7 @@ var RiverServer = class {
852
851
  message: errMessage
853
852
  });
854
853
  };
854
+ const finishedController = new AbortController();
855
855
  const procStream = {
856
856
  from,
857
857
  streamId,
@@ -893,7 +893,6 @@ var RiverServer = class {
893
893
  resWritable.close();
894
894
  cancelStream(streamId, result);
895
895
  };
896
- const finishedController = new AbortController();
897
896
  const cleanup = () => {
898
897
  finishedController.abort();
899
898
  this.streams.delete(streamId);
@@ -955,8 +954,10 @@ var RiverServer = class {
955
954
  serviceName
956
955
  },
957
956
  extras: {
958
- error: errorMsg
959
- }
957
+ error: errorMsg,
958
+ originalException: err
959
+ },
960
+ tags: ["uncaught-handler-error"]
960
961
  }
961
962
  );
962
963
  onServerCancel({
@@ -966,8 +967,6 @@ var RiverServer = class {
966
967
  };
967
968
  if (procClosesWithInit) {
968
969
  closeReadable();
969
- } else if (procedure.type === "rpc" || procedure.type === "subscription") {
970
- this.log?.warn("sent an init without a stream close", loggingMetadata);
971
970
  }
972
971
  const handlerContext = {
973
972
  ...serviceContext,
@@ -1080,7 +1079,9 @@ var RiverServer = class {
1080
1079
  );
1081
1080
  break;
1082
1081
  }
1083
- return procStream;
1082
+ if (!finishedController.signal.aborted) {
1083
+ this.streams.set(streamId, procStream);
1084
+ }
1084
1085
  }
1085
1086
  getContext(service, serviceName) {
1086
1087
  const context = this.contextMap.get(service);