@replit/river 0.215.0 → 0.216.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.
Files changed (72) hide show
  1. package/README.md +47 -0
  2. package/dist/adapter-BXCk-dmy.d.ts +29 -0
  3. package/dist/adapter-D5X11kmP.d.cts +29 -0
  4. package/dist/{chunk-VXRAFUA3.js → chunk-75ZMPCKC.js} +26 -6
  5. package/dist/{chunk-VXRAFUA3.js.map → chunk-75ZMPCKC.js.map} +1 -1
  6. package/dist/chunk-SHND2JG6.js +86 -0
  7. package/dist/chunk-SHND2JG6.js.map +1 -0
  8. package/dist/{chunk-RDTQZ7HO.js → chunk-ZLMQQI43.js} +12 -2
  9. package/dist/chunk-ZLMQQI43.js.map +1 -0
  10. package/dist/{client-BhwlY0-L.d.ts → client-BNc5Pj_4.d.ts} +2 -2
  11. package/dist/{client-Dk4H7qeg.d.cts → client-BZUvFL6B.d.cts} +2 -2
  12. package/dist/codec/index.cjs.map +1 -1
  13. package/dist/codec/index.d.cts +3 -3
  14. package/dist/codec/index.d.ts +3 -3
  15. package/dist/codec/index.js +2 -2
  16. package/dist/{connection-DU9v3y8a.d.ts → connection-ou9w2dSY.d.ts} +3 -3
  17. package/dist/{connection-CS00EWuS.d.cts → connection-xxgJHs2o.d.cts} +3 -3
  18. package/dist/{index-CHCzvZ9D.d.cts → index-BAGGleT3.d.cts} +1 -1
  19. package/dist/{index-uF0cBM7z.d.ts → index-ZWkoesQD.d.ts} +1 -1
  20. package/dist/logging/index.d.cts +2 -2
  21. package/dist/logging/index.d.ts +2 -2
  22. package/dist/{message-aABg0s5M.d.cts → message-CpXWqmJw.d.cts} +1 -1
  23. package/dist/{message-aABg0s5M.d.ts → message-CpXWqmJw.d.ts} +1 -1
  24. package/dist/protobuf/codec.cjs +107 -0
  25. package/dist/protobuf/codec.cjs.map +1 -0
  26. package/dist/protobuf/codec.d.cts +13 -0
  27. package/dist/protobuf/codec.d.ts +13 -0
  28. package/dist/protobuf/codec.js +7 -0
  29. package/dist/protobuf/codec.js.map +1 -0
  30. package/dist/protobuf/index.cjs +1877 -0
  31. package/dist/protobuf/index.cjs.map +1 -0
  32. package/dist/protobuf/index.d.cts +488 -0
  33. package/dist/protobuf/index.d.ts +488 -0
  34. package/dist/protobuf/index.js +1260 -0
  35. package/dist/protobuf/index.js.map +1 -0
  36. package/dist/router/index.cjs +1 -1
  37. package/dist/router/index.cjs.map +1 -1
  38. package/dist/router/index.d.cts +12 -11
  39. package/dist/router/index.d.ts +12 -11
  40. package/dist/router/index.js +1 -1
  41. package/dist/{server-uNzkzIRh.d.ts → server-BPu7Td80.d.ts} +4 -4
  42. package/dist/{server-BR0DZaWi.d.cts → server-JdnoVO11.d.cts} +4 -4
  43. package/dist/{services-B5SY771g.d.ts → services-BrTFTO5Q.d.ts} +104 -93
  44. package/dist/{services-DBv2nmly.d.cts → services-cwGAC2rB.d.cts} +104 -93
  45. package/dist/testUtil/index.cjs +25 -5
  46. package/dist/testUtil/index.cjs.map +1 -1
  47. package/dist/testUtil/index.d.cts +8 -7
  48. package/dist/testUtil/index.d.ts +8 -7
  49. package/dist/testUtil/index.js +2 -2
  50. package/dist/transport/impls/ws/client.cjs +5 -1
  51. package/dist/transport/impls/ws/client.cjs.map +1 -1
  52. package/dist/transport/impls/ws/client.d.cts +7 -6
  53. package/dist/transport/impls/ws/client.d.ts +7 -6
  54. package/dist/transport/impls/ws/client.js +2 -2
  55. package/dist/transport/impls/ws/server.cjs +21 -5
  56. package/dist/transport/impls/ws/server.cjs.map +1 -1
  57. package/dist/transport/impls/ws/server.d.cts +7 -6
  58. package/dist/transport/impls/ws/server.d.ts +7 -6
  59. package/dist/transport/impls/ws/server.js +2 -2
  60. package/dist/transport/index.cjs +25 -5
  61. package/dist/transport/index.cjs.map +1 -1
  62. package/dist/transport/index.d.cts +8 -7
  63. package/dist/transport/index.d.ts +8 -7
  64. package/dist/transport/index.js +2 -2
  65. package/dist/{transport-BOL2p5s-.d.ts → transport-B1MUtXL7.d.ts} +7 -5
  66. package/dist/{transport-D3jzhFSi.d.cts → transport-BnU3Zb0Q.d.cts} +7 -5
  67. package/dist/types-BGGvYIJM.d.cts +20 -0
  68. package/dist/types-BGGvYIJM.d.ts +20 -0
  69. package/package.json +12 -1
  70. package/dist/adapter-CgF7vQPu.d.ts +0 -47
  71. package/dist/adapter-IGrG4KLL.d.cts +0 -47
  72. package/dist/chunk-RDTQZ7HO.js.map +0 -1
@@ -1,14 +1,15 @@
1
- import { c as TransportClientId } from '../../../message-aABg0s5M.cjs';
1
+ import { T as TransportClientId } from '../../../message-CpXWqmJw.cjs';
2
2
  import { WebSocketServer } from 'ws';
3
- import { a as WebSocketConnection } from '../../../connection-CS00EWuS.cjs';
3
+ import { a as WebSocketConnection } from '../../../connection-xxgJHs2o.cjs';
4
4
  import { W as WsLike } from '../../../wslike-Dng9H1C7.cjs';
5
- import { S as ServerTransport } from '../../../server-BR0DZaWi.cjs';
6
- import { c as ProvidedServerTransportOptions } from '../../../transport-D3jzhFSi.cjs';
5
+ import { S as ServerTransport } from '../../../server-JdnoVO11.cjs';
6
+ import { e as ProvidedServerTransportOptions } from '../../../transport-BnU3Zb0Q.cjs';
7
7
  import { IncomingMessage } from 'http';
8
8
  import { TSchema } from '@sinclair/typebox';
9
9
  import '@opentelemetry/api';
10
- import '../../../index-CHCzvZ9D.cjs';
11
- import '../../../adapter-IGrG4KLL.cjs';
10
+ import '../../../index-BAGGleT3.cjs';
11
+ import '../../../adapter-D5X11kmP.cjs';
12
+ import '../../../types-BGGvYIJM.cjs';
12
13
 
13
14
  declare class WebSocketServerTransport<MetadataSchema extends TSchema = TSchema, ParsedMetadata extends object = object> extends ServerTransport<WebSocketConnection, MetadataSchema, ParsedMetadata> {
14
15
  wss: WebSocketServer;
@@ -1,14 +1,15 @@
1
- import { c as TransportClientId } from '../../../message-aABg0s5M.js';
1
+ import { T as TransportClientId } from '../../../message-CpXWqmJw.js';
2
2
  import { WebSocketServer } from 'ws';
3
- import { a as WebSocketConnection } from '../../../connection-DU9v3y8a.js';
3
+ import { a as WebSocketConnection } from '../../../connection-ou9w2dSY.js';
4
4
  import { W as WsLike } from '../../../wslike-Dng9H1C7.js';
5
- import { S as ServerTransport } from '../../../server-uNzkzIRh.js';
6
- import { c as ProvidedServerTransportOptions } from '../../../transport-BOL2p5s-.js';
5
+ import { S as ServerTransport } from '../../../server-BPu7Td80.js';
6
+ import { e as ProvidedServerTransportOptions } from '../../../transport-B1MUtXL7.js';
7
7
  import { IncomingMessage } from 'http';
8
8
  import { TSchema } from '@sinclair/typebox';
9
9
  import '@opentelemetry/api';
10
- import '../../../index-uF0cBM7z.js';
11
- import '../../../adapter-CgF7vQPu.js';
10
+ import '../../../index-ZWkoesQD.js';
11
+ import '../../../adapter-BXCk-dmy.js';
12
+ import '../../../types-BGGvYIJM.js';
12
13
 
13
14
  declare class WebSocketServerTransport<MetadataSchema extends TSchema = TSchema, ParsedMetadata extends object = object> extends ServerTransport<WebSocketConnection, MetadataSchema, ParsedMetadata> {
14
15
  wss: WebSocketServer;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ServerTransport,
3
3
  WebSocketConnection
4
- } from "../../../chunk-VXRAFUA3.js";
4
+ } from "../../../chunk-75ZMPCKC.js";
5
5
  import "../../../chunk-CC7RN7GI.js";
6
- import "../../../chunk-RDTQZ7HO.js";
6
+ import "../../../chunk-ZLMQQI43.js";
7
7
 
8
8
  // transport/impls/ws/server.ts
9
9
  function cleanHeaders(headers) {
@@ -652,7 +652,7 @@ function coerceErrorString(err) {
652
652
  }
653
653
 
654
654
  // package.json
655
- var version = "0.215.0";
655
+ var version = "0.216.0";
656
656
 
657
657
  // tracing/index.ts
658
658
  function getPropagationContext(ctx) {
@@ -1708,6 +1708,10 @@ var LeakyBucketRateLimit = class {
1708
1708
  clearInterval(this.intervalHandle);
1709
1709
  this.intervalHandle = void 0;
1710
1710
  }
1711
+ resetBudget() {
1712
+ this.stopLeak();
1713
+ this.budgetConsumed = 0;
1714
+ }
1711
1715
  close() {
1712
1716
  this.stopLeak();
1713
1717
  }
@@ -2359,10 +2363,26 @@ var ServerTransport = class extends Transport {
2359
2363
  const previousParsedMetadata = this.sessionHandshakeMetadata.get(
2360
2364
  msg.from
2361
2365
  );
2362
- const parsedMetadataOrFailureCode = await this.handshakeExtensions.validate(
2363
- msg.payload.metadata,
2364
- previousParsedMetadata
2365
- );
2366
+ let parsedMetadataOrFailureCode;
2367
+ try {
2368
+ parsedMetadataOrFailureCode = await this.handshakeExtensions.validate(
2369
+ msg.payload.metadata,
2370
+ previousParsedMetadata
2371
+ );
2372
+ } catch (err) {
2373
+ this.rejectHandshakeRequest(
2374
+ session,
2375
+ msg.from,
2376
+ `handshake validation threw: ${coerceErrorString(err)}`,
2377
+ "REJECTED_BY_CUSTOM_HANDLER",
2378
+ {
2379
+ ...session.loggingMetadata,
2380
+ connectedTo: msg.from,
2381
+ clientId: this.clientId
2382
+ }
2383
+ );
2384
+ return;
2385
+ }
2366
2386
  if (session._isConsumed) {
2367
2387
  return;
2368
2388
  }