@replit/river 0.208.2 → 0.208.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.
- package/dist/{chunk-2OE32RBD.js → chunk-3WYK5ZRT.js} +2 -2
- package/dist/{chunk-XS6CNYUH.js → chunk-JC4XN6NC.js} +17 -14
- package/dist/chunk-JC4XN6NC.js.map +1 -0
- package/dist/{chunk-XB663LV7.js → chunk-M2B4PVR5.js} +2 -2
- package/dist/codec/index.js +2 -2
- package/dist/router/index.cjs +16 -13
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +1 -1
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/testUtil/index.cjs +1 -1
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.js +2 -2
- 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.js +3 -3
- 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.js +3 -3
- package/dist/transport/index.cjs +1 -1
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.js +2 -2
- package/package.json +4 -2
- package/dist/chunk-XS6CNYUH.js.map +0 -1
- /package/dist/{chunk-2OE32RBD.js.map → chunk-3WYK5ZRT.js.map} +0 -0
- /package/dist/{chunk-XB663LV7.js.map → chunk-M2B4PVR5.js.map} +0 -0
package/dist/router/index.cjs
CHANGED
|
@@ -117,6 +117,9 @@ function flattenErrorType(errType) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// router/services.ts
|
|
120
|
+
function Strict(schema) {
|
|
121
|
+
return JSON.parse(JSON.stringify(schema));
|
|
122
|
+
}
|
|
120
123
|
function serializeSchemaV1Compat(services, handshakeSchema) {
|
|
121
124
|
const serializedServiceObject = Object.entries(services).reduce((acc, [name, value]) => {
|
|
122
125
|
acc[name] = value.serializeV1Compat();
|
|
@@ -126,7 +129,7 @@ function serializeSchemaV1Compat(services, handshakeSchema) {
|
|
|
126
129
|
services: serializedServiceObject
|
|
127
130
|
};
|
|
128
131
|
if (handshakeSchema) {
|
|
129
|
-
schema.handshakeSchema =
|
|
132
|
+
schema.handshakeSchema = Strict(handshakeSchema);
|
|
130
133
|
}
|
|
131
134
|
return schema;
|
|
132
135
|
}
|
|
@@ -139,7 +142,7 @@ function serializeSchema(services, handshakeSchema) {
|
|
|
139
142
|
services: serializedServiceObject
|
|
140
143
|
};
|
|
141
144
|
if (handshakeSchema) {
|
|
142
|
-
schema.handshakeSchema =
|
|
145
|
+
schema.handshakeSchema = Strict(handshakeSchema);
|
|
143
146
|
}
|
|
144
147
|
return schema;
|
|
145
148
|
}
|
|
@@ -242,15 +245,15 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
242
245
|
Object.entries(this.procedures).map(([procName, procDef]) => [
|
|
243
246
|
procName,
|
|
244
247
|
{
|
|
245
|
-
init:
|
|
246
|
-
output:
|
|
248
|
+
init: Strict(procDef.requestInit),
|
|
249
|
+
output: Strict(procDef.responseData),
|
|
247
250
|
errors: getSerializedProcErrors(procDef),
|
|
248
251
|
// Only add `description` field if the type declares it.
|
|
249
252
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
250
253
|
type: procDef.type,
|
|
251
254
|
// Only add the `input` field if the type declares it.
|
|
252
255
|
..."requestData" in procDef ? {
|
|
253
|
-
input:
|
|
256
|
+
input: Strict(procDef.requestData)
|
|
254
257
|
} : {}
|
|
255
258
|
}
|
|
256
259
|
])
|
|
@@ -274,8 +277,8 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
274
277
|
{
|
|
275
278
|
// BACKWARDS COMPAT: map init to input for protocolv1
|
|
276
279
|
// this is the only change needed to make it compatible.
|
|
277
|
-
input:
|
|
278
|
-
output:
|
|
280
|
+
input: Strict(procDef.requestInit),
|
|
281
|
+
output: Strict(procDef.responseData),
|
|
279
282
|
errors: getSerializedProcErrors(procDef),
|
|
280
283
|
// Only add `description` field if the type declares it.
|
|
281
284
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
@@ -286,13 +289,13 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
286
289
|
return [
|
|
287
290
|
procName,
|
|
288
291
|
{
|
|
289
|
-
init:
|
|
290
|
-
output:
|
|
292
|
+
init: Strict(procDef.requestInit),
|
|
293
|
+
output: Strict(procDef.responseData),
|
|
291
294
|
errors: getSerializedProcErrors(procDef),
|
|
292
295
|
// Only add `description` field if the type declares it.
|
|
293
296
|
..."description" in procDef ? { description: procDef.description } : {},
|
|
294
297
|
type: procDef.type,
|
|
295
|
-
input:
|
|
298
|
+
input: Strict(procDef.requestData)
|
|
296
299
|
}
|
|
297
300
|
];
|
|
298
301
|
}
|
|
@@ -321,12 +324,12 @@ var ServiceSchema = class _ServiceSchema {
|
|
|
321
324
|
};
|
|
322
325
|
function getSerializedProcErrors(procDef) {
|
|
323
326
|
if (!("responseError" in procDef) || procDef.responseError[import_typebox2.Kind] === "Never") {
|
|
324
|
-
return
|
|
327
|
+
return Strict(ReaderErrorSchema);
|
|
325
328
|
}
|
|
326
329
|
const withProtocolErrors = flattenErrorType(
|
|
327
330
|
import_typebox2.Type.Union([procDef.responseError, ReaderErrorSchema])
|
|
328
331
|
);
|
|
329
|
-
return
|
|
332
|
+
return Strict(withProtocolErrors);
|
|
330
333
|
}
|
|
331
334
|
var ServiceScaffold = class {
|
|
332
335
|
/**
|
|
@@ -1892,7 +1895,7 @@ function createServerHandshakeOptions(schema, validate) {
|
|
|
1892
1895
|
}
|
|
1893
1896
|
|
|
1894
1897
|
// package.json
|
|
1895
|
-
var version = "0.208.
|
|
1898
|
+
var version = "0.208.3";
|
|
1896
1899
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1897
1900
|
0 && (module.exports = {
|
|
1898
1901
|
CANCEL_CODE,
|