@replit/river 0.202.0 → 0.203.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.
Files changed (44) hide show
  1. package/dist/{chunk-2T22KY5X.js → chunk-D5EIDBUT.js} +3 -3
  2. package/dist/{chunk-NSH4D6OB.js → chunk-DGT3MPD4.js} +13 -3
  3. package/dist/chunk-DGT3MPD4.js.map +1 -0
  4. package/dist/{chunk-W4AGHFXK.js → chunk-FG22HHCY.js} +11 -4
  5. package/dist/chunk-FG22HHCY.js.map +1 -0
  6. package/dist/{chunk-QMXUCLGE.js → chunk-SZHNMLKC.js} +2 -2
  7. package/dist/{chunk-QMXUCLGE.js.map → chunk-SZHNMLKC.js.map} +1 -1
  8. package/dist/{chunk-BDUOHZMF.js → chunk-XBPEUVWN.js} +2 -2
  9. package/dist/{client-a32692b0.d.ts → client-5d2e41a3.d.ts} +7 -1
  10. package/dist/{connection-48d021ca.d.ts → connection-11a4af0f.d.ts} +1 -1
  11. package/dist/{context-8d263a7f.d.ts → context-d6dd8a1a.d.ts} +14 -0
  12. package/dist/router/index.cjs +8 -7
  13. package/dist/router/index.cjs.map +1 -1
  14. package/dist/router/index.d.cts +7 -7
  15. package/dist/router/index.d.ts +7 -7
  16. package/dist/router/index.js +8 -7
  17. package/dist/router/index.js.map +1 -1
  18. package/dist/{server-48d90a77.d.ts → server-e46399f9.d.ts} +1 -1
  19. package/dist/{services-a05f5174.d.ts → services-56cbea0d.d.ts} +2 -2
  20. package/dist/testUtil/index.cjs +20 -3
  21. package/dist/testUtil/index.cjs.map +1 -1
  22. package/dist/testUtil/index.d.cts +5 -5
  23. package/dist/testUtil/index.d.ts +5 -5
  24. package/dist/testUtil/index.js +4 -4
  25. package/dist/transport/impls/ws/client.cjs +20 -3
  26. package/dist/transport/impls/ws/client.cjs.map +1 -1
  27. package/dist/transport/impls/ws/client.d.cts +3 -3
  28. package/dist/transport/impls/ws/client.d.ts +3 -3
  29. package/dist/transport/impls/ws/client.js +4 -4
  30. package/dist/transport/impls/ws/server.cjs +10 -3
  31. package/dist/transport/impls/ws/server.cjs.map +1 -1
  32. package/dist/transport/impls/ws/server.d.cts +3 -3
  33. package/dist/transport/impls/ws/server.d.ts +3 -3
  34. package/dist/transport/impls/ws/server.js +4 -4
  35. package/dist/transport/index.cjs +20 -3
  36. package/dist/transport/index.cjs.map +1 -1
  37. package/dist/transport/index.d.cts +4 -4
  38. package/dist/transport/index.d.ts +4 -4
  39. package/dist/transport/index.js +4 -4
  40. package/package.json +1 -1
  41. package/dist/chunk-NSH4D6OB.js.map +0 -1
  42. package/dist/chunk-W4AGHFXK.js.map +0 -1
  43. /package/dist/{chunk-2T22KY5X.js.map → chunk-D5EIDBUT.js.map} +0 -0
  44. /package/dist/{chunk-BDUOHZMF.js.map → chunk-XBPEUVWN.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, a as AnyProcedure } from '../services-a05f5174.js';
2
- export { E as BaseErrorSchemaType, C as CANCEL_CODE, G as Client, H as Err, L as ErrResult, B as INVALID_REQUEST_CODE, O as Ok, M as OkResult, p as PayloadType, f as ProcErrors, P as ProcHandler, c as ProcInit, d as ProcRequest, e as ProcResponse, g as ProcType, v as Procedure, w as ProcedureErrorSchemaType, q as ProcedureMap, R as RPCProcedure, u as Readable, D as ReaderErrorSchema, T as ResponseData, K as Result, Q as ResultUnwrapErr, N as ResultUnwrapOk, k as SerializedProcedureSchema, o as SerializedProcedureSchemaProtocolv1, i as SerializedServerSchema, m as SerializedServerSchemaProtocolv1, j as SerializedServiceSchema, n as SerializedServiceSchemaProtocolv1, S as Service, b as ServiceConfiguration, h as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, y as UNCAUGHT_ERROR_CODE, z as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, F as createClient, x as flattenErrorType, s as serializeSchema, l as serializeSchemaV1Compat, J as unwrapOrThrow } from '../services-a05f5174.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, a as AnyProcedure } from '../services-56cbea0d.js';
2
+ export { E as BaseErrorSchemaType, C as CANCEL_CODE, G as Client, H as Err, L as ErrResult, B as INVALID_REQUEST_CODE, O as Ok, M as OkResult, p as PayloadType, f as ProcErrors, P as ProcHandler, c as ProcInit, d as ProcRequest, e as ProcResponse, g as ProcType, v as Procedure, w as ProcedureErrorSchemaType, q as ProcedureMap, R as RPCProcedure, u as Readable, D as ReaderErrorSchema, T as ResponseData, K as Result, Q as ResultUnwrapErr, N as ResultUnwrapOk, k as SerializedProcedureSchema, o as SerializedProcedureSchemaProtocolv1, i as SerializedServerSchema, m as SerializedServerSchemaProtocolv1, j as SerializedServiceSchema, n as SerializedServiceSchemaProtocolv1, S as Service, b as ServiceConfiguration, h as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, y as UNCAUGHT_ERROR_CODE, z as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, F as createClient, x as flattenErrorType, s as serializeSchema, l as serializeSchemaV1Compat, J as unwrapOrThrow } from '../services-56cbea0d.js';
3
3
  import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-3def9ded.js';
4
- import { q as ParsedMetadata, C as Connection, r as ServerHandshakeOptions, s as ServiceContext } from '../context-8d263a7f.js';
5
- export { t as ProcedureHandlerContext, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../context-8d263a7f.js';
6
- import { S as ServerTransport } from '../server-48d90a77.js';
4
+ import { q as ParsedMetadata, C as Connection, r as ServerHandshakeOptions, s as ServiceContext } from '../context-d6dd8a1a.js';
5
+ export { t as ProcedureHandlerContext, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../context-d6dd8a1a.js';
6
+ import { S as ServerTransport } from '../server-e46399f9.js';
7
7
  import '@sinclair/typebox';
8
- import '../client-a32692b0.js';
8
+ import '../client-5d2e41a3.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
11
  import '@sinclair/typebox/errors';
@@ -56,6 +56,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
56
56
  maxCancelledStreamTombstonesPerSession?: number;
57
57
  }>): Server<Services>;
58
58
 
59
- var version = "0.202.0";
59
+ var version = "0.203.0";
60
60
 
61
61
  export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
@@ -1,11 +1,11 @@
1
- import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, a as AnyProcedure } from '../services-a05f5174.js';
2
- export { E as BaseErrorSchemaType, C as CANCEL_CODE, G as Client, H as Err, L as ErrResult, B as INVALID_REQUEST_CODE, O as Ok, M as OkResult, p as PayloadType, f as ProcErrors, P as ProcHandler, c as ProcInit, d as ProcRequest, e as ProcResponse, g as ProcType, v as Procedure, w as ProcedureErrorSchemaType, q as ProcedureMap, R as RPCProcedure, u as Readable, D as ReaderErrorSchema, T as ResponseData, K as Result, Q as ResultUnwrapErr, N as ResultUnwrapOk, k as SerializedProcedureSchema, o as SerializedProcedureSchemaProtocolv1, i as SerializedServerSchema, m as SerializedServerSchemaProtocolv1, j as SerializedServiceSchema, n as SerializedServiceSchemaProtocolv1, S as Service, b as ServiceConfiguration, h as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, y as UNCAUGHT_ERROR_CODE, z as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, F as createClient, x as flattenErrorType, s as serializeSchema, l as serializeSchemaV1Compat, J as unwrapOrThrow } from '../services-a05f5174.js';
1
+ import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, a as AnyProcedure } from '../services-56cbea0d.js';
2
+ export { E as BaseErrorSchemaType, C as CANCEL_CODE, G as Client, H as Err, L as ErrResult, B as INVALID_REQUEST_CODE, O as Ok, M as OkResult, p as PayloadType, f as ProcErrors, P as ProcHandler, c as ProcInit, d as ProcRequest, e as ProcResponse, g as ProcType, v as Procedure, w as ProcedureErrorSchemaType, q as ProcedureMap, R as RPCProcedure, u as Readable, D as ReaderErrorSchema, T as ResponseData, K as Result, Q as ResultUnwrapErr, N as ResultUnwrapOk, k as SerializedProcedureSchema, o as SerializedProcedureSchemaProtocolv1, i as SerializedServerSchema, m as SerializedServerSchemaProtocolv1, j as SerializedServiceSchema, n as SerializedServiceSchemaProtocolv1, S as Service, b as ServiceConfiguration, h as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, y as UNCAUGHT_ERROR_CODE, z as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, F as createClient, x as flattenErrorType, s as serializeSchema, l as serializeSchemaV1Compat, J as unwrapOrThrow } from '../services-56cbea0d.js';
3
3
  import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-3def9ded.js';
4
- import { q as ParsedMetadata, C as Connection, r as ServerHandshakeOptions, s as ServiceContext } from '../context-8d263a7f.js';
5
- export { t as ProcedureHandlerContext, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../context-8d263a7f.js';
6
- import { S as ServerTransport } from '../server-48d90a77.js';
4
+ import { q as ParsedMetadata, C as Connection, r as ServerHandshakeOptions, s as ServiceContext } from '../context-d6dd8a1a.js';
5
+ export { t as ProcedureHandlerContext, u as createClientHandshakeOptions, v as createServerHandshakeOptions } from '../context-d6dd8a1a.js';
6
+ import { S as ServerTransport } from '../server-e46399f9.js';
7
7
  import '@sinclair/typebox';
8
- import '../client-a32692b0.js';
8
+ import '../client-5d2e41a3.js';
9
9
  import '@sinclair/typebox/value';
10
10
  import '@opentelemetry/api';
11
11
  import '@sinclair/typebox/errors';
@@ -56,6 +56,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
56
56
  maxCancelledStreamTombstonesPerSession?: number;
57
57
  }>): Server<Services>;
58
58
 
59
- var version = "0.202.0";
59
+ var version = "0.203.0";
60
60
 
61
61
  export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
@@ -12,7 +12,7 @@ import {
12
12
  isStreamClose,
13
13
  isStreamOpen,
14
14
  version
15
- } from "../chunk-QMXUCLGE.js";
15
+ } from "../chunk-SZHNMLKC.js";
16
16
 
17
17
  // router/services.ts
18
18
  import { Type as Type2, Kind as Kind2 } from "@sinclair/typebox";
@@ -1256,11 +1256,12 @@ var RiverServer = class {
1256
1256
  if (procClosesWithInit) {
1257
1257
  closeReadable();
1258
1258
  }
1259
- const handlerContext = {
1259
+ const handlerContextWithSpan = (span) => ({
1260
1260
  ...serviceContext,
1261
1261
  from,
1262
1262
  sessionId,
1263
1263
  metadata: sessionMetadata,
1264
+ span,
1264
1265
  cancel: () => {
1265
1266
  onServerCancel({
1266
1267
  code: CANCEL_CODE,
@@ -1268,7 +1269,7 @@ var RiverServer = class {
1268
1269
  });
1269
1270
  },
1270
1271
  signal: finishedController.signal
1271
- };
1272
+ });
1272
1273
  switch (procedure.type) {
1273
1274
  case "rpc":
1274
1275
  void createHandlerSpan(
@@ -1280,7 +1281,7 @@ var RiverServer = class {
1280
1281
  async (span) => {
1281
1282
  try {
1282
1283
  const responsePayload = await procedure.handler({
1283
- ctx: handlerContext,
1284
+ ctx: handlerContextWithSpan(span),
1284
1285
  reqInit: initPayload
1285
1286
  });
1286
1287
  if (resWritable.isClosed()) {
@@ -1305,7 +1306,7 @@ var RiverServer = class {
1305
1306
  async (span) => {
1306
1307
  try {
1307
1308
  await procedure.handler({
1308
- ctx: handlerContext,
1309
+ ctx: handlerContextWithSpan(span),
1309
1310
  reqInit: initPayload,
1310
1311
  reqReadable,
1311
1312
  resWritable
@@ -1328,7 +1329,7 @@ var RiverServer = class {
1328
1329
  async (span) => {
1329
1330
  try {
1330
1331
  await procedure.handler({
1331
- ctx: handlerContext,
1332
+ ctx: handlerContextWithSpan(span),
1332
1333
  reqInit: initPayload,
1333
1334
  resWritable
1334
1335
  });
@@ -1350,7 +1351,7 @@ var RiverServer = class {
1350
1351
  async (span) => {
1351
1352
  try {
1352
1353
  const responsePayload = await procedure.handler({
1353
- ctx: handlerContext,
1354
+ ctx: handlerContextWithSpan(span),
1354
1355
  reqInit: initPayload,
1355
1356
  reqReadable
1356
1357
  });