@replit/river 0.203.1 → 0.204.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.
- package/dist/{chunk-T4WWG42M.js → chunk-3V7VMJNA.js} +19 -16
- package/dist/chunk-3V7VMJNA.js.map +1 -0
- package/dist/{chunk-TMOCPK63.js → chunk-6YUDEFCS.js} +42 -8
- package/dist/chunk-6YUDEFCS.js.map +1 -0
- package/dist/chunk-LJCR3ADI.js +1955 -0
- package/dist/chunk-LJCR3ADI.js.map +1 -0
- package/dist/{chunk-2FHJVQBE.js → chunk-QSW7AWEP.js} +5 -11
- package/dist/chunk-QSW7AWEP.js.map +1 -0
- package/dist/{chunk-7MKTFUJO.js → chunk-YODW2ZMU.js} +4 -3
- package/dist/chunk-YODW2ZMU.js.map +1 -0
- package/dist/{client-5d2e41a3.d.ts → client-0c0a4a5e.d.ts} +1 -1
- package/dist/{connection-11a4af0f.d.ts → connection-7b62dfec.d.ts} +1 -1
- package/dist/{context-d6dd8a1a.d.ts → context-3cf1ed4e.d.ts} +8 -2
- package/dist/router/index.cjs +23 -12
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +7 -7
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +18 -1611
- package/dist/router/index.js.map +1 -1
- package/dist/{server-e46399f9.d.ts → server-a287de55.d.ts} +1 -1
- package/dist/{services-56cbea0d.d.ts → services-51980ecd.d.ts} +2 -2
- package/dist/testUtil/index.cjs +72 -32
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +4 -4
- package/dist/testUtil/index.d.ts +4 -4
- package/dist/testUtil/index.js +8 -6
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +72 -40
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- package/dist/transport/impls/ws/client.js +4 -4
- package/dist/transport/impls/ws/server.cjs +58 -28
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +3 -3
- package/dist/transport/impls/ws/server.d.ts +3 -3
- package/dist/transport/impls/ws/server.js +4 -4
- package/dist/transport/index.cjs +70 -31
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +3 -3
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +4 -4
- package/package.json +2 -2
- package/dist/chunk-2FHJVQBE.js.map +0 -1
- package/dist/chunk-7MKTFUJO.js.map +0 -1
- package/dist/chunk-AK7NTFAM.js +0 -331
- package/dist/chunk-AK7NTFAM.js.map +0 -1
- package/dist/chunk-T4WWG42M.js.map +0 -1
- package/dist/chunk-TMOCPK63.js.map +0 -1
package/dist/router/index.cjs
CHANGED
|
@@ -609,11 +609,6 @@ function unwrapOrThrow(result) {
|
|
|
609
609
|
|
|
610
610
|
// tracing/index.ts
|
|
611
611
|
var import_api = require("@opentelemetry/api");
|
|
612
|
-
|
|
613
|
-
// package.json
|
|
614
|
-
var version = "0.203.1";
|
|
615
|
-
|
|
616
|
-
// tracing/index.ts
|
|
617
612
|
function getPropagationContext(ctx) {
|
|
618
613
|
const tracing = {
|
|
619
614
|
traceparent: "",
|
|
@@ -622,10 +617,10 @@ function getPropagationContext(ctx) {
|
|
|
622
617
|
import_api.propagation.inject(ctx, tracing);
|
|
623
618
|
return tracing;
|
|
624
619
|
}
|
|
625
|
-
function createProcTelemetryInfo(session, kind, serviceName, procedureName, streamId) {
|
|
620
|
+
function createProcTelemetryInfo(tracer, session, kind, serviceName, procedureName, streamId) {
|
|
626
621
|
const baseCtx = import_api.context.active();
|
|
627
622
|
const span = tracer.startSpan(
|
|
628
|
-
`
|
|
623
|
+
`river.client.${serviceName}.${procedureName}`,
|
|
629
624
|
{
|
|
630
625
|
attributes: {
|
|
631
626
|
component: "river",
|
|
@@ -657,10 +652,10 @@ function createProcTelemetryInfo(session, kind, serviceName, procedureName, stre
|
|
|
657
652
|
session.log?.info(`invoked ${serviceName}.${procedureName}`, metadata);
|
|
658
653
|
return { span, ctx };
|
|
659
654
|
}
|
|
660
|
-
function createHandlerSpan(session, kind, serviceName, procedureName, streamId, tracing, fn) {
|
|
655
|
+
function createHandlerSpan(tracer, session, kind, serviceName, procedureName, streamId, tracing, fn) {
|
|
661
656
|
const ctx = tracing ? import_api.propagation.extract(import_api.context.active(), tracing) : import_api.context.active();
|
|
662
657
|
return tracer.startActiveSpan(
|
|
663
|
-
`
|
|
658
|
+
`river.server.${serviceName}.${procedureName}`,
|
|
664
659
|
{
|
|
665
660
|
attributes: {
|
|
666
661
|
component: "river",
|
|
@@ -677,7 +672,16 @@ function createHandlerSpan(session, kind, serviceName, procedureName, streamId,
|
|
|
677
672
|
fn
|
|
678
673
|
);
|
|
679
674
|
}
|
|
680
|
-
|
|
675
|
+
function recordRiverError(span, error) {
|
|
676
|
+
span.setStatus({
|
|
677
|
+
code: import_api.SpanStatusCode.ERROR,
|
|
678
|
+
message: error.message
|
|
679
|
+
});
|
|
680
|
+
span.setAttributes({
|
|
681
|
+
"river.error_code": error.code,
|
|
682
|
+
"river.error_message": error.message
|
|
683
|
+
});
|
|
684
|
+
}
|
|
681
685
|
|
|
682
686
|
// router/streams.ts
|
|
683
687
|
var ReadableBrokenError = {
|
|
@@ -952,6 +956,7 @@ function handleProc(procType, transport, serverId, init, serviceName, procedureN
|
|
|
952
956
|
const procClosesWithInit = procType === "rpc" || procType === "subscription";
|
|
953
957
|
const streamId = generateId();
|
|
954
958
|
const { span, ctx } = createProcTelemetryInfo(
|
|
959
|
+
transport.tracer,
|
|
955
960
|
session,
|
|
956
961
|
procType,
|
|
957
962
|
serviceName,
|
|
@@ -1170,7 +1175,6 @@ function coerceErrorString(err) {
|
|
|
1170
1175
|
}
|
|
1171
1176
|
|
|
1172
1177
|
// router/server.ts
|
|
1173
|
-
var import_api2 = require("@opentelemetry/api");
|
|
1174
1178
|
var CancelResultSchema = ErrResultSchema(
|
|
1175
1179
|
import_typebox6.Type.Object({
|
|
1176
1180
|
code: import_typebox6.Type.Literal(CANCEL_CODE),
|
|
@@ -1238,6 +1242,7 @@ var RiverServer = class {
|
|
|
1238
1242
|
return;
|
|
1239
1243
|
}
|
|
1240
1244
|
createHandlerSpan(
|
|
1245
|
+
transport.tracer,
|
|
1241
1246
|
newStreamProps.initialSession,
|
|
1242
1247
|
newStreamProps.procedure.type,
|
|
1243
1248
|
newStreamProps.serviceName,
|
|
@@ -1416,6 +1421,7 @@ var RiverServer = class {
|
|
|
1416
1421
|
this.cancelStream(from, sessionScopedSend, streamId2, payload);
|
|
1417
1422
|
};
|
|
1418
1423
|
const onServerCancel = (e) => {
|
|
1424
|
+
recordRiverError(span, e);
|
|
1419
1425
|
if (reqReadable.isClosed() && resWritable.isClosed()) {
|
|
1420
1426
|
return;
|
|
1421
1427
|
}
|
|
@@ -1450,6 +1456,9 @@ var RiverServer = class {
|
|
|
1450
1456
|
}
|
|
1451
1457
|
const resWritable = new WritableImpl({
|
|
1452
1458
|
writeCb: (response) => {
|
|
1459
|
+
if (!response.ok) {
|
|
1460
|
+
recordRiverError(span, response.payload);
|
|
1461
|
+
}
|
|
1453
1462
|
sessionScopedSend({
|
|
1454
1463
|
streamId,
|
|
1455
1464
|
controlFlags: procClosesWithResponse ? getStreamCloseBackwardsCompat(protocolVersion) : 0,
|
|
@@ -1479,7 +1488,6 @@ var RiverServer = class {
|
|
|
1479
1488
|
const onHandlerError = (err, span2) => {
|
|
1480
1489
|
const errorMsg = coerceErrorString(err);
|
|
1481
1490
|
span2.recordException(err instanceof Error ? err : new Error(errorMsg));
|
|
1482
|
-
span2.setStatus({ code: import_api2.SpanStatusCode.ERROR });
|
|
1483
1491
|
this.log?.error(
|
|
1484
1492
|
`${serviceName}.${procedureName} handler threw an uncaught error`,
|
|
1485
1493
|
{
|
|
@@ -1848,6 +1856,9 @@ function createClientHandshakeOptions(schema, construct) {
|
|
|
1848
1856
|
function createServerHandshakeOptions(schema, validate) {
|
|
1849
1857
|
return { schema, validate };
|
|
1850
1858
|
}
|
|
1859
|
+
|
|
1860
|
+
// package.json
|
|
1861
|
+
var version = "0.204.0";
|
|
1851
1862
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1852
1863
|
0 && (module.exports = {
|
|
1853
1864
|
CANCEL_CODE,
|