@replit/river 0.200.1 → 0.200.2
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-6VA5DW7N.js → chunk-6BH2CXVE.js} +2 -2
- package/dist/{chunk-SONGYR7A.js → chunk-A4JKES5A.js} +4 -4
- package/dist/{chunk-UQHYJZTP.js → chunk-GJUUVID2.js} +2 -2
- package/dist/{chunk-UQHYJZTP.js.map → chunk-GJUUVID2.js.map} +1 -1
- package/dist/{chunk-ZNJM2HIE.js → chunk-HRKM7BIE.js} +2 -2
- package/dist/{chunk-YQPJ3HZK.js → chunk-PJB2Y2AV.js} +4 -4
- package/dist/{chunk-ZDYZ2FCN.js → chunk-QIDEN5PP.js} +3 -3
- package/dist/{chunk-MADS7AI5.js → chunk-Z4PX66JO.js} +19 -10
- package/dist/chunk-Z4PX66JO.js.map +1 -0
- package/dist/{client-095a929e.d.ts → client-9292552a.d.ts} +1 -1
- package/dist/{connection-623d75e9.d.ts → connection-94dea547.d.ts} +1 -1
- package/dist/{context-85b8690e.d.ts → context-69f37ac1.d.ts} +6 -1
- package/dist/router/index.cjs +93 -72
- 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 +29 -19
- package/dist/router/index.js.map +1 -1
- package/dist/{server-456bf6cb.d.ts → server-8fdd7fb2.d.ts} +1 -1
- package/dist/{services-e4f28470.d.ts → services-259f39a3.d.ts} +17 -8
- package/dist/transport/impls/ws/client.cjs +1 -1
- 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 +5 -5
- package/dist/transport/impls/ws/server.cjs +1 -1
- 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 +5 -5
- package/dist/transport/index.cjs +1 -1
- 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 +5 -5
- package/dist/util/testHelpers.cjs +19 -10
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -4
- package/dist/util/testHelpers.d.ts +4 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-MADS7AI5.js.map +0 -1
- /package/dist/{chunk-6VA5DW7N.js.map → chunk-6BH2CXVE.js.map} +0 -0
- /package/dist/{chunk-SONGYR7A.js.map → chunk-A4JKES5A.js.map} +0 -0
- /package/dist/{chunk-ZNJM2HIE.js.map → chunk-HRKM7BIE.js.map} +0 -0
- /package/dist/{chunk-YQPJ3HZK.js.map → chunk-PJB2Y2AV.js.map} +0 -0
- /package/dist/{chunk-ZDYZ2FCN.js.map → chunk-QIDEN5PP.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-
|
|
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-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-259f39a3.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-259f39a3.js';
|
|
3
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-
|
|
5
|
-
export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-
|
|
6
|
-
import { S as ServerTransport } from '../server-
|
|
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';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
|
-
import '../client-
|
|
8
|
+
import '../client-9292552a.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.
|
|
58
|
+
var version = "0.200.2";
|
|
59
59
|
|
|
60
60
|
export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-
|
|
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-
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, g as AnyProcedure } from '../services-259f39a3.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-259f39a3.js';
|
|
3
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-
|
|
5
|
-
export { v as ProcedureHandlerContext, w as createClientHandshakeOptions, x as createServerHandshakeOptions } from '../context-
|
|
6
|
-
import { S as ServerTransport } from '../server-
|
|
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';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
|
-
import '../client-
|
|
8
|
+
import '../client-9292552a.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.
|
|
58
|
+
var version = "0.200.2";
|
|
59
59
|
|
|
60
60
|
export { ParsedMetadata, version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
WritableImpl,
|
|
13
13
|
flattenErrorType,
|
|
14
14
|
unwrapOrThrow
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-Z4PX66JO.js";
|
|
16
16
|
import {
|
|
17
17
|
ControlMessageCloseSchema,
|
|
18
18
|
ControlMessagePayloadSchema,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
isStreamClose,
|
|
28
28
|
isStreamOpen,
|
|
29
29
|
version
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-GJUUVID2.js";
|
|
31
31
|
|
|
32
32
|
// router/services.ts
|
|
33
|
-
import { Type } from "@sinclair/typebox";
|
|
33
|
+
import { Type, Kind } from "@sinclair/typebox";
|
|
34
34
|
function serializeSchemaV1Compat(services, handshakeSchema) {
|
|
35
35
|
const serializedServiceObject = Object.entries(services).reduce((acc, [name, value]) => {
|
|
36
36
|
acc[name] = value.serializeV1Compat();
|
|
@@ -158,12 +158,9 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
158
158
|
{
|
|
159
159
|
init: Type.Strict(procDef.requestInit),
|
|
160
160
|
output: Type.Strict(procDef.responseData),
|
|
161
|
+
errors: getSerializedProcErrors(procDef),
|
|
161
162
|
// Only add `description` field if the type declares it.
|
|
162
163
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
163
|
-
// Only add the `errors` field if the type declares it.
|
|
164
|
-
..."responseError" in procDef ? {
|
|
165
|
-
errors: Type.Strict(procDef.responseError)
|
|
166
|
-
} : {},
|
|
167
164
|
type: procDef.type,
|
|
168
165
|
// Only add the `input` field if the type declares it.
|
|
169
166
|
..."requestData" in procDef ? {
|
|
@@ -193,12 +190,9 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
193
190
|
// this is the only change needed to make it compatible.
|
|
194
191
|
input: Type.Strict(procDef.requestInit),
|
|
195
192
|
output: Type.Strict(procDef.responseData),
|
|
193
|
+
errors: getSerializedProcErrors(procDef),
|
|
196
194
|
// Only add `description` field if the type declares it.
|
|
197
195
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
198
|
-
// Only add the `errors` field if the type declares it.
|
|
199
|
-
..."responseError" in procDef ? {
|
|
200
|
-
errors: Type.Strict(procDef.responseError)
|
|
201
|
-
} : {},
|
|
202
196
|
type: procDef.type
|
|
203
197
|
}
|
|
204
198
|
];
|
|
@@ -208,12 +202,9 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
208
202
|
{
|
|
209
203
|
init: Type.Strict(procDef.requestInit),
|
|
210
204
|
output: Type.Strict(procDef.responseData),
|
|
205
|
+
errors: getSerializedProcErrors(procDef),
|
|
211
206
|
// Only add `description` field if the type declares it.
|
|
212
207
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
213
|
-
// Only add the `errors` field if the type declares it.
|
|
214
|
-
..."responseError" in procDef ? {
|
|
215
|
-
errors: Type.Strict(procDef.responseError)
|
|
216
|
-
} : {},
|
|
217
208
|
type: procDef.type,
|
|
218
209
|
input: Type.Strict(procDef.requestData)
|
|
219
210
|
}
|
|
@@ -236,6 +227,15 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
236
227
|
});
|
|
237
228
|
}
|
|
238
229
|
};
|
|
230
|
+
function getSerializedProcErrors(procDef) {
|
|
231
|
+
if (!("responseError" in procDef) || procDef.responseError[Kind] === "Never") {
|
|
232
|
+
return Type.Strict(ReaderErrorSchema);
|
|
233
|
+
}
|
|
234
|
+
const withProtocolErrors = flattenErrorType(
|
|
235
|
+
Type.Union([procDef.responseError, ReaderErrorSchema])
|
|
236
|
+
);
|
|
237
|
+
return Type.Strict(withProtocolErrors);
|
|
238
|
+
}
|
|
239
239
|
var ServiceScaffold = class {
|
|
240
240
|
/**
|
|
241
241
|
* The configuration for this service.
|
|
@@ -946,6 +946,19 @@ var RiverServer = class {
|
|
|
946
946
|
const errorMsg = coerceErrorString(err);
|
|
947
947
|
span.recordException(err instanceof Error ? err : new Error(errorMsg));
|
|
948
948
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
949
|
+
this.log?.error(
|
|
950
|
+
`${serviceName}.${procedureName} handler threw an uncaught error`,
|
|
951
|
+
{
|
|
952
|
+
...loggingMetadata,
|
|
953
|
+
transportMessage: {
|
|
954
|
+
procedureName,
|
|
955
|
+
serviceName
|
|
956
|
+
},
|
|
957
|
+
extras: {
|
|
958
|
+
error: errorMsg
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
);
|
|
949
962
|
onServerCancel({
|
|
950
963
|
code: UNCAUGHT_ERROR_CODE,
|
|
951
964
|
message: errorMsg
|
|
@@ -954,10 +967,7 @@ var RiverServer = class {
|
|
|
954
967
|
if (procClosesWithInit) {
|
|
955
968
|
closeReadable();
|
|
956
969
|
} else if (procedure.type === "rpc" || procedure.type === "subscription") {
|
|
957
|
-
this.log?.warn("sent an init without a stream close",
|
|
958
|
-
...loggingMetadata,
|
|
959
|
-
clientId: this.transport.clientId
|
|
960
|
-
});
|
|
970
|
+
this.log?.warn("sent an init without a stream close", loggingMetadata);
|
|
961
971
|
}
|
|
962
972
|
const handlerContext = {
|
|
963
973
|
...serviceContext,
|