@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.
@@ -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 = import_typebox2.Type.Strict(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 = import_typebox2.Type.Strict(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: import_typebox2.Type.Strict(procDef.requestInit),
246
- output: import_typebox2.Type.Strict(procDef.responseData),
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: import_typebox2.Type.Strict(procDef.requestData)
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: import_typebox2.Type.Strict(procDef.requestInit),
278
- output: import_typebox2.Type.Strict(procDef.responseData),
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: import_typebox2.Type.Strict(procDef.requestInit),
290
- output: import_typebox2.Type.Strict(procDef.responseData),
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: import_typebox2.Type.Strict(procDef.requestData)
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 import_typebox2.Type.Strict(ReaderErrorSchema);
327
+ return Strict(ReaderErrorSchema);
325
328
  }
326
329
  const withProtocolErrors = flattenErrorType(
327
330
  import_typebox2.Type.Union([procDef.responseError, ReaderErrorSchema])
328
331
  );
329
- return import_typebox2.Type.Strict(withProtocolErrors);
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.2";
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,