@replit/river 0.26.9 → 0.26.11

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 (37) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-6LX3MQEH.js → chunk-4DEPQJLU.js} +21 -19
  3. package/dist/chunk-4DEPQJLU.js.map +1 -0
  4. package/dist/{chunk-OPWZHQ7Z.js → chunk-ACAIVD7K.js} +3 -3
  5. package/dist/{chunk-YHILUN2S.js → chunk-BWFKJB6J.js} +4 -4
  6. package/dist/{chunk-SKWHS7YK.js → chunk-DKUZRRKE.js} +4 -4
  7. package/dist/{chunk-JVPSOBWJ.js → chunk-WXH5YYLA.js} +2 -2
  8. package/dist/{chunk-LODVVI6A.js → chunk-Z4Z7BX4W.js} +2 -2
  9. package/dist/{chunk-VPXUTLMK.js → chunk-ZWU5OYTF.js} +2 -2
  10. package/dist/chunk-ZWU5OYTF.js.map +1 -0
  11. package/dist/router/index.cjs +68 -66
  12. package/dist/router/index.cjs.map +1 -1
  13. package/dist/router/index.d.cts +1 -1
  14. package/dist/router/index.d.ts +1 -1
  15. package/dist/router/index.js +2 -2
  16. package/dist/transport/impls/ws/client.cjs +1 -1
  17. package/dist/transport/impls/ws/client.cjs.map +1 -1
  18. package/dist/transport/impls/ws/client.js +5 -5
  19. package/dist/transport/impls/ws/server.cjs +1 -1
  20. package/dist/transport/impls/ws/server.cjs.map +1 -1
  21. package/dist/transport/impls/ws/server.js +5 -5
  22. package/dist/transport/index.cjs +1 -1
  23. package/dist/transport/index.cjs.map +1 -1
  24. package/dist/transport/index.js +5 -5
  25. package/dist/util/testHelpers.cjs +1 -1
  26. package/dist/util/testHelpers.cjs.map +1 -1
  27. package/dist/util/testHelpers.d.cts +6 -2
  28. package/dist/util/testHelpers.d.ts +6 -2
  29. package/dist/util/testHelpers.js +3 -3
  30. package/package.json +3 -3
  31. package/dist/chunk-6LX3MQEH.js.map +0 -1
  32. package/dist/chunk-VPXUTLMK.js.map +0 -1
  33. /package/dist/{chunk-OPWZHQ7Z.js.map → chunk-ACAIVD7K.js.map} +0 -0
  34. /package/dist/{chunk-YHILUN2S.js.map → chunk-BWFKJB6J.js.map} +0 -0
  35. /package/dist/{chunk-SKWHS7YK.js.map → chunk-DKUZRRKE.js.map} +0 -0
  36. /package/dist/{chunk-JVPSOBWJ.js.map → chunk-WXH5YYLA.js.map} +0 -0
  37. /package/dist/{chunk-LODVVI6A.js.map → chunk-Z4Z7BX4W.js.map} +0 -0
@@ -36,7 +36,9 @@ __export(router_exports, {
36
36
  module.exports = __toCommonJS(router_exports);
37
37
 
38
38
  // router/services.ts
39
- var import_typebox = require("@sinclair/typebox");
39
+ function Strict(schema) {
40
+ return JSON.parse(JSON.stringify(schema));
41
+ }
40
42
  function serializeSchema(services, handshakeSchema) {
41
43
  const serializedServiceObject = Object.entries(services).reduce((acc, [name, value]) => {
42
44
  acc[name] = value.serialize();
@@ -46,7 +48,7 @@ function serializeSchema(services, handshakeSchema) {
46
48
  services: serializedServiceObject
47
49
  };
48
50
  if (handshakeSchema) {
49
- schema.handshakeSchema = import_typebox.Type.Strict(handshakeSchema);
51
+ schema.handshakeSchema = Strict(handshakeSchema);
50
52
  }
51
53
  return schema;
52
54
  }
@@ -149,18 +151,18 @@ var ServiceSchema = class _ServiceSchema {
149
151
  Object.entries(this.procedures).map(([procName, procDef]) => [
150
152
  procName,
151
153
  {
152
- input: import_typebox.Type.Strict(procDef.input),
153
- output: import_typebox.Type.Strict(procDef.output),
154
+ input: Strict(procDef.input),
155
+ output: Strict(procDef.output),
154
156
  // Only add `description` field if the type declares it.
155
157
  ..."description" in procDef ? { description: procDef.description } : {},
156
158
  // Only add the `errors` field if the type declares it.
157
159
  ..."errors" in procDef ? {
158
- errors: import_typebox.Type.Strict(procDef.errors)
160
+ errors: Strict(procDef.errors)
159
161
  } : {},
160
162
  type: procDef.type,
161
163
  // Only add the `init` field if the type declares it.
162
164
  ..."init" in procDef ? {
163
- init: import_typebox.Type.Strict(procDef.init)
165
+ init: Strict(procDef.init)
164
166
  } : {}
165
167
  }
166
168
  ])
@@ -238,11 +240,11 @@ var ServiceScaffold = class {
238
240
  };
239
241
 
240
242
  // router/procedures.ts
241
- var import_typebox2 = require("@sinclair/typebox");
243
+ var import_typebox = require("@sinclair/typebox");
242
244
  function rpc({
243
245
  input,
244
246
  output,
245
- errors = import_typebox2.Type.Never(),
247
+ errors = import_typebox.Type.Never(),
246
248
  description,
247
249
  handler
248
250
  }) {
@@ -259,7 +261,7 @@ function upload({
259
261
  init,
260
262
  input,
261
263
  output,
262
- errors = import_typebox2.Type.Never(),
264
+ errors = import_typebox.Type.Never(),
263
265
  description,
264
266
  handler
265
267
  }) {
@@ -283,7 +285,7 @@ function upload({
283
285
  function subscription({
284
286
  input,
285
287
  output,
286
- errors = import_typebox2.Type.Never(),
288
+ errors = import_typebox.Type.Never(),
287
289
  description,
288
290
  handler
289
291
  }) {
@@ -300,7 +302,7 @@ function stream({
300
302
  init,
301
303
  input,
302
304
  output,
303
- errors = import_typebox2.Type.Never(),
305
+ errors = import_typebox.Type.Never(),
304
306
  description,
305
307
  handler
306
308
  }) {
@@ -611,7 +613,7 @@ function _pushable(getNext, options) {
611
613
  }
612
614
 
613
615
  // transport/message.ts
614
- var import_typebox3 = require("@sinclair/typebox");
616
+ var import_typebox2 = require("@sinclair/typebox");
615
617
 
616
618
  // transport/id.ts
617
619
  var import_nanoid = require("nanoid");
@@ -621,90 +623,90 @@ var alphabet = (0, import_nanoid.customAlphabet)(
621
623
  var generateId = () => alphabet(12);
622
624
 
623
625
  // transport/message.ts
624
- var TransportMessageSchema = (t) => import_typebox3.Type.Object({
625
- id: import_typebox3.Type.String(),
626
- from: import_typebox3.Type.String(),
627
- to: import_typebox3.Type.String(),
628
- seq: import_typebox3.Type.Integer(),
629
- ack: import_typebox3.Type.Integer(),
630
- serviceName: import_typebox3.Type.Optional(import_typebox3.Type.String()),
631
- procedureName: import_typebox3.Type.Optional(import_typebox3.Type.String()),
632
- streamId: import_typebox3.Type.String(),
633
- controlFlags: import_typebox3.Type.Integer(),
634
- tracing: import_typebox3.Type.Optional(
635
- import_typebox3.Type.Object({
636
- traceparent: import_typebox3.Type.String(),
637
- tracestate: import_typebox3.Type.String()
626
+ var TransportMessageSchema = (t) => import_typebox2.Type.Object({
627
+ id: import_typebox2.Type.String(),
628
+ from: import_typebox2.Type.String(),
629
+ to: import_typebox2.Type.String(),
630
+ seq: import_typebox2.Type.Integer(),
631
+ ack: import_typebox2.Type.Integer(),
632
+ serviceName: import_typebox2.Type.Optional(import_typebox2.Type.String()),
633
+ procedureName: import_typebox2.Type.Optional(import_typebox2.Type.String()),
634
+ streamId: import_typebox2.Type.String(),
635
+ controlFlags: import_typebox2.Type.Integer(),
636
+ tracing: import_typebox2.Type.Optional(
637
+ import_typebox2.Type.Object({
638
+ traceparent: import_typebox2.Type.String(),
639
+ tracestate: import_typebox2.Type.String()
638
640
  })
639
641
  ),
640
642
  payload: t
641
643
  });
642
- var ControlMessageAckSchema = import_typebox3.Type.Object({
643
- type: import_typebox3.Type.Literal("ACK")
644
+ var ControlMessageAckSchema = import_typebox2.Type.Object({
645
+ type: import_typebox2.Type.Literal("ACK")
644
646
  });
645
- var ControlMessageCloseSchema = import_typebox3.Type.Object({
646
- type: import_typebox3.Type.Literal("CLOSE")
647
+ var ControlMessageCloseSchema = import_typebox2.Type.Object({
648
+ type: import_typebox2.Type.Literal("CLOSE")
647
649
  });
648
- var ControlMessageHandshakeRequestSchema = import_typebox3.Type.Object({
649
- type: import_typebox3.Type.Literal("HANDSHAKE_REQ"),
650
- protocolVersion: import_typebox3.Type.String(),
651
- sessionId: import_typebox3.Type.String(),
650
+ var ControlMessageHandshakeRequestSchema = import_typebox2.Type.Object({
651
+ type: import_typebox2.Type.Literal("HANDSHAKE_REQ"),
652
+ protocolVersion: import_typebox2.Type.String(),
653
+ sessionId: import_typebox2.Type.String(),
652
654
  /**
653
655
  * Specifies what the server's expected session state (from the pov of the client). This can be
654
656
  * used by the server to know whether this is a new or a reestablished connection, and whether it
655
657
  * is compatible with what it already has.
656
658
  */
657
- expectedSessionState: import_typebox3.Type.Object({
659
+ expectedSessionState: import_typebox2.Type.Object({
658
660
  // what the client expects the server to send next
659
- nextExpectedSeq: import_typebox3.Type.Integer(),
660
- nextSentSeq: import_typebox3.Type.Integer()
661
+ nextExpectedSeq: import_typebox2.Type.Integer(),
662
+ nextSentSeq: import_typebox2.Type.Integer()
661
663
  }),
662
- metadata: import_typebox3.Type.Optional(import_typebox3.Type.Unknown())
664
+ metadata: import_typebox2.Type.Optional(import_typebox2.Type.Unknown())
663
665
  });
664
- var HandshakeErrorRetriableResponseCodes = import_typebox3.Type.Union([
665
- import_typebox3.Type.Literal("SESSION_STATE_MISMATCH")
666
+ var HandshakeErrorRetriableResponseCodes = import_typebox2.Type.Union([
667
+ import_typebox2.Type.Literal("SESSION_STATE_MISMATCH")
666
668
  ]);
667
- var HandshakeErrorCustomHandlerFatalResponseCodes = import_typebox3.Type.Union([
669
+ var HandshakeErrorCustomHandlerFatalResponseCodes = import_typebox2.Type.Union([
668
670
  // The custom validation handler rejected the handler because the client is unsupported.
669
- import_typebox3.Type.Literal("REJECTED_UNSUPPORTED_CLIENT"),
671
+ import_typebox2.Type.Literal("REJECTED_UNSUPPORTED_CLIENT"),
670
672
  // The custom validation handler rejected the handshake.
671
- import_typebox3.Type.Literal("REJECTED_BY_CUSTOM_HANDLER")
673
+ import_typebox2.Type.Literal("REJECTED_BY_CUSTOM_HANDLER")
672
674
  ]);
673
- var HandshakeErrorFatalResponseCodes = import_typebox3.Type.Union([
675
+ var HandshakeErrorFatalResponseCodes = import_typebox2.Type.Union([
674
676
  HandshakeErrorCustomHandlerFatalResponseCodes,
675
677
  // The ciient sent a handshake that doesn't comply with the extended handshake metadata.
676
- import_typebox3.Type.Literal("MALFORMED_HANDSHAKE_META"),
678
+ import_typebox2.Type.Literal("MALFORMED_HANDSHAKE_META"),
677
679
  // The ciient sent a handshake that doesn't comply with ControlMessageHandshakeRequestSchema.
678
- import_typebox3.Type.Literal("MALFORMED_HANDSHAKE"),
680
+ import_typebox2.Type.Literal("MALFORMED_HANDSHAKE"),
679
681
  // The client's protocol version does not match the server's.
680
- import_typebox3.Type.Literal("PROTOCOL_VERSION_MISMATCH")
682
+ import_typebox2.Type.Literal("PROTOCOL_VERSION_MISMATCH")
681
683
  ]);
682
- var HandshakeErrorResponseCodes = import_typebox3.Type.Union([
684
+ var HandshakeErrorResponseCodes = import_typebox2.Type.Union([
683
685
  HandshakeErrorRetriableResponseCodes,
684
686
  HandshakeErrorFatalResponseCodes
685
687
  ]);
686
- var ControlMessageHandshakeResponseSchema = import_typebox3.Type.Object({
687
- type: import_typebox3.Type.Literal("HANDSHAKE_RESP"),
688
- status: import_typebox3.Type.Union([
689
- import_typebox3.Type.Object({
690
- ok: import_typebox3.Type.Literal(true),
691
- sessionId: import_typebox3.Type.String()
688
+ var ControlMessageHandshakeResponseSchema = import_typebox2.Type.Object({
689
+ type: import_typebox2.Type.Literal("HANDSHAKE_RESP"),
690
+ status: import_typebox2.Type.Union([
691
+ import_typebox2.Type.Object({
692
+ ok: import_typebox2.Type.Literal(true),
693
+ sessionId: import_typebox2.Type.String()
692
694
  }),
693
- import_typebox3.Type.Object({
694
- ok: import_typebox3.Type.Literal(false),
695
- reason: import_typebox3.Type.String(),
695
+ import_typebox2.Type.Object({
696
+ ok: import_typebox2.Type.Literal(false),
697
+ reason: import_typebox2.Type.String(),
696
698
  code: HandshakeErrorResponseCodes
697
699
  })
698
700
  ])
699
701
  });
700
- var ControlMessagePayloadSchema = import_typebox3.Type.Union([
702
+ var ControlMessagePayloadSchema = import_typebox2.Type.Union([
701
703
  ControlMessageCloseSchema,
702
704
  ControlMessageAckSchema,
703
705
  ControlMessageHandshakeRequestSchema,
704
706
  ControlMessageHandshakeResponseSchema
705
707
  ]);
706
708
  var OpaqueTransportMessageSchema = TransportMessageSchema(
707
- import_typebox3.Type.Unknown()
709
+ import_typebox2.Type.Unknown()
708
710
  );
709
711
  function closeStreamMessage(streamId) {
710
712
  return {
@@ -729,15 +731,15 @@ function isStreamClose(controlFlag) {
729
731
  }
730
732
 
731
733
  // router/result.ts
732
- var import_typebox4 = require("@sinclair/typebox");
734
+ var import_typebox3 = require("@sinclair/typebox");
733
735
  var UNCAUGHT_ERROR = "UNCAUGHT_ERROR";
734
736
  var UNEXPECTED_DISCONNECT = "UNEXPECTED_DISCONNECT";
735
- var RiverUncaughtSchema = import_typebox4.Type.Object({
736
- code: import_typebox4.Type.Union([
737
- import_typebox4.Type.Literal(UNCAUGHT_ERROR),
738
- import_typebox4.Type.Literal(UNEXPECTED_DISCONNECT)
737
+ var RiverUncaughtSchema = import_typebox3.Type.Object({
738
+ code: import_typebox3.Type.Union([
739
+ import_typebox3.Type.Literal(UNCAUGHT_ERROR),
740
+ import_typebox3.Type.Literal(UNEXPECTED_DISCONNECT)
739
741
  ]),
740
- message: import_typebox4.Type.String()
742
+ message: import_typebox3.Type.String()
741
743
  });
742
744
  function Ok(payload) {
743
745
  return {
@@ -756,7 +758,7 @@ function Err(error) {
756
758
  var import_api = require("@opentelemetry/api");
757
759
 
758
760
  // package.json
759
- var version = "0.26.9";
761
+ var version = "0.26.11";
760
762
 
761
763
  // tracing/index.ts
762
764
  function getPropagationContext(ctx) {