@replit/river 0.216.1 → 0.217.1

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 (76) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-BXCk-dmy.d.ts → adapter-Dl5Mewp3.d.ts} +1 -1
  3. package/dist/{chunk-C4EPHIKQ.js → chunk-JFFRB3SS.js} +48 -26
  4. package/dist/chunk-JFFRB3SS.js.map +1 -0
  5. package/dist/{chunk-62BM2WOT.js → chunk-VK3VJZGG.js} +19 -18
  6. package/dist/chunk-VK3VJZGG.js.map +1 -0
  7. package/dist/chunk-WMPWPIA4.js +72 -0
  8. package/dist/chunk-WMPWPIA4.js.map +1 -0
  9. package/dist/{client-BNc5Pj_4.d.ts → client-YP9bECp8.d.ts} +2 -2
  10. package/dist/codec/index.d.ts +3 -3
  11. package/dist/codec/index.js +2 -2
  12. package/dist/{connection-ou9w2dSY.d.ts → connection-D_HE_YQB.d.ts} +3 -3
  13. package/dist/customSchemas/index.d.ts +34 -0
  14. package/dist/customSchemas/index.js +9 -0
  15. package/dist/customSchemas/index.js.map +1 -0
  16. package/dist/{index-ZWkoesQD.d.ts → index-DgUMnNOi.d.ts} +1 -1
  17. package/dist/logging/index.d.ts +3 -3
  18. package/dist/{message-CpXWqmJw.d.ts → message-DxS8db8A.d.ts} +30 -31
  19. package/dist/protobuf/index.d.ts +11 -15
  20. package/dist/protobuf/index.js +7 -5
  21. package/dist/protobuf/index.js.map +1 -1
  22. package/dist/router/index.d.ts +11 -11
  23. package/dist/router/index.js +1 -1
  24. package/dist/{server-BPu7Td80.d.ts → server-BfM3_JLq.d.ts} +5 -5
  25. package/dist/{services-DpT2yNtt.d.ts → services-CL6k3HMH.d.ts} +8 -9
  26. package/dist/testUtil/index.d.ts +8 -8
  27. package/dist/testUtil/index.js +2 -2
  28. package/dist/testUtil/index.js.map +1 -1
  29. package/dist/transport/impls/ws/client.d.ts +7 -7
  30. package/dist/transport/impls/ws/client.js +2 -2
  31. package/dist/transport/impls/ws/server.d.ts +7 -7
  32. package/dist/transport/impls/ws/server.js +2 -2
  33. package/dist/transport/impls/ws/server.js.map +1 -1
  34. package/dist/transport/index.d.ts +8 -8
  35. package/dist/transport/index.js +2 -2
  36. package/dist/{transport-B1MUtXL7.d.ts → transport-CUpXnch7.d.ts} +4 -4
  37. package/package.json +14 -39
  38. package/dist/adapter-D5X11kmP.d.cts +0 -29
  39. package/dist/chunk-62BM2WOT.js.map +0 -1
  40. package/dist/chunk-C4EPHIKQ.js.map +0 -1
  41. package/dist/client-BZUvFL6B.d.cts +0 -54
  42. package/dist/codec/index.cjs +0 -268
  43. package/dist/codec/index.cjs.map +0 -1
  44. package/dist/codec/index.d.cts +0 -19
  45. package/dist/connection-xxgJHs2o.d.cts +0 -40
  46. package/dist/index-BAGGleT3.d.cts +0 -37
  47. package/dist/logging/index.cjs +0 -55
  48. package/dist/logging/index.cjs.map +0 -1
  49. package/dist/logging/index.d.cts +0 -4
  50. package/dist/message-CpXWqmJw.d.cts +0 -119
  51. package/dist/protobuf/codec.cjs +0 -107
  52. package/dist/protobuf/codec.cjs.map +0 -1
  53. package/dist/protobuf/codec.d.cts +0 -13
  54. package/dist/protobuf/index.cjs +0 -1877
  55. package/dist/protobuf/index.cjs.map +0 -1
  56. package/dist/protobuf/index.d.cts +0 -488
  57. package/dist/router/index.cjs +0 -2043
  58. package/dist/router/index.cjs.map +0 -1
  59. package/dist/router/index.d.cts +0 -80
  60. package/dist/server-JdnoVO11.d.cts +0 -72
  61. package/dist/services-CjigASqe.d.cts +0 -1135
  62. package/dist/testUtil/index.cjs +0 -3051
  63. package/dist/testUtil/index.cjs.map +0 -1
  64. package/dist/testUtil/index.d.cts +0 -122
  65. package/dist/transport/impls/ws/client.cjs +0 -2308
  66. package/dist/transport/impls/ws/client.cjs.map +0 -1
  67. package/dist/transport/impls/ws/client.d.cts +0 -33
  68. package/dist/transport/impls/ws/server.cjs +0 -2179
  69. package/dist/transport/impls/ws/server.cjs.map +0 -1
  70. package/dist/transport/impls/ws/server.d.cts +0 -21
  71. package/dist/transport/index.cjs +0 -2727
  72. package/dist/transport/index.cjs.map +0 -1
  73. package/dist/transport/index.d.cts +0 -11
  74. package/dist/transport-BnU3Zb0Q.d.cts +0 -590
  75. package/dist/types-BGGvYIJM.d.cts +0 -20
  76. package/dist/wslike-Dng9H1C7.d.cts +0 -40
@@ -1,122 +0,0 @@
1
- import { P as ProvidedClientTransportOptions, e as ProvidedServerTransportOptions, n as ClientHandshakeOptions, C as Connection, q as ServerHandshakeOptions, T as Transport, i as SessionNoConnection, x as SessionBoundSendFn, m as ClientTransportOptions, y as SessionOptions } from '../transport-BnU3Zb0Q.cjs';
2
- import { C as ClientTransport } from '../client-BZUvFL6B.cjs';
3
- import { S as ServerTransport } from '../server-JdnoVO11.cjs';
4
- import { T as TransportClientId, e as PartialTransportMessage, O as OpaqueTransportMessage } from '../message-CpXWqmJw.cjs';
5
- import { TSchema, Static } from '@sinclair/typebox';
6
- import { B as BaseErrorSchemaType, s as Readable, a1 as ReadableIterator, u as ReadableResult } from '../services-CjigASqe.cjs';
7
- import { W as WsLike } from '../wslike-Dng9H1C7.cjs';
8
- import NodeWs from 'ws';
9
- import http from 'node:http';
10
- import { Duplex } from 'node:stream';
11
- import '../index-BAGGleT3.cjs';
12
- import '../types-BGGvYIJM.cjs';
13
- import '../adapter-D5X11kmP.cjs';
14
- import '@opentelemetry/api';
15
-
16
- interface TestTransportOptions {
17
- client?: ProvidedClientTransportOptions;
18
- server?: ProvidedServerTransportOptions;
19
- }
20
- interface TestSetupHelpers {
21
- getClientTransport: (id: TransportClientId, handshakeOptions?: ClientHandshakeOptions) => ClientTransport<Connection>;
22
- getServerTransport: <MetadataSchema extends TSchema = TSchema, ParsedMetadata extends object = object>(id?: TransportClientId, handshakeOptions?: ServerHandshakeOptions<MetadataSchema, ParsedMetadata>) => ServerTransport<Connection, MetadataSchema, ParsedMetadata>;
23
- simulatePhantomDisconnect: () => void;
24
- restartServer: () => Promise<void>;
25
- cleanup: () => Promise<void> | void;
26
- }
27
-
28
- declare class InMemoryConnection extends Connection {
29
- conn: Duplex;
30
- constructor(pipe: Duplex);
31
- send(payload: Uint8Array): boolean;
32
- close(): void;
33
- }
34
- declare function createMockTransportNetwork(opts?: TestTransportOptions): TestSetupHelpers;
35
-
36
- /**
37
- * Creates a WebSocket client that connects to a local server at the specified port.
38
- * This should only be used for testing.
39
- * @param port - The port number to connect to.
40
- * @returns A Promise that resolves to a WebSocket instance.
41
- */
42
- declare function createLocalWebSocketClient(port: number): WsLike;
43
- /**
44
- * Creates a WebSocket server instance using the provided HTTP server.
45
- * Only used as helper for testing.
46
- * @param server - The HTTP server instance to use for the WebSocket server.
47
- * @returns A Promise that resolves to the created WebSocket server instance.
48
- */
49
- declare function createWebSocketServer(server: http.Server): NodeWs.Server<typeof NodeWs, typeof http.IncomingMessage>;
50
- /**
51
- * Starts listening on the given server and returns the automatically allocated port number.
52
- * This should only be used for testing.
53
- * @param server - The http server to listen on.
54
- * @returns A promise that resolves with the allocated port number.
55
- * @throws An error if a port cannot be allocated.
56
- */
57
- declare function onWsServerReady(server: http.Server): Promise<number>;
58
- /**
59
- * A safe way to access {@link Readble}'s iterator multiple times in test helpers.
60
- *
61
- * If there are other iteration attempts outside of the test helpers
62
- * (this function, {@link readNextResult}, and {@link isReadableDone})
63
- * it will throw an error.
64
- */
65
- declare function getReadableIterator<T, E extends Static<BaseErrorSchemaType>>(readable: Readable<T, E>): ReadableIterator<T, E>;
66
- /**
67
- * Retrieves the next value from {@link Readable}, or throws an error if the Readable is done.
68
- *
69
- * Calling semantics are similar to {@link getReadableIterator}
70
- */
71
- declare function readNextResult<T, E extends Static<BaseErrorSchemaType>>(readable: Readable<T, E>): Promise<ReadableResult<T, E>>;
72
- /**
73
- * Checks if the readable is done iterating, it consumes an iteration in the process.
74
- *
75
- * Calling semantics are similar to {@link getReadableIterator}
76
- */
77
- declare function isReadableDone<T, E extends Static<BaseErrorSchemaType>>(readable: Readable<T, E>): Promise<boolean>;
78
- declare function payloadToTransportMessage<Payload>(payload: Payload): PartialTransportMessage<Payload>;
79
- declare function createDummyTransportMessage(): PartialTransportMessage<{
80
- msg: string;
81
- test: number;
82
- }>;
83
- /**
84
- * Waits for a message on the transport.
85
- * @param {Transport} t - The transport to listen to.
86
- * @param filter - An optional filter function to apply to the received messages.
87
- * @returns A promise that resolves with the payload of the first message that passes the filter.
88
- */
89
- declare function waitForMessage(t: Transport<Connection>, filter?: (msg: OpaqueTransportMessage) => boolean, rejectMismatch?: boolean): Promise<unknown>;
90
- declare const testingSessionOptions: SessionOptions;
91
- declare const testingClientSessionOptions: ClientTransportOptions;
92
- declare function dummySession(): SessionNoConnection;
93
- declare function getClientSendFn(clientTransport: ClientTransport<Connection>, serverTransport: ServerTransport<Connection>): SessionBoundSendFn;
94
- declare function getServerSendFn(serverTransport: ServerTransport<Connection>, clientTransport: ClientTransport<Connection>): SessionBoundSendFn;
95
- declare function getTransportConnections<ConnType extends Connection>(transport: Transport<ConnType>): Array<ConnType>;
96
- declare function numberOfConnections<ConnType extends Connection>(transport: Transport<ConnType>): number;
97
- declare function closeAllConnections<ConnType extends Connection>(transport: Transport<ConnType>): void;
98
- /**
99
- * Wraps a partial context object in a proxy that throws when accessing
100
- * properties that weren't provided. This is useful for test contexts where
101
- * you only want to mock the dependencies a test actually uses.
102
- *
103
- * Symbols and `then` are allowed through without throwing — river checks
104
- * for `Symbol.asyncDispose` / `Symbol.dispose` on context values during
105
- * `server.close()`, and `then` is checked by the JS runtime when the
106
- * proxy is returned from an async function.
107
- *
108
- * @example
109
- * ```ts
110
- * const ctx = createPartialContext<MyContext>({
111
- * database: mockDb,
112
- * // accessing ctx.redis will throw
113
- * });
114
- *
115
- * const server = createServer(transport, services, {
116
- * extendedContext: ctx,
117
- * });
118
- * ```
119
- */
120
- declare function createPartialContext<T extends Record<string, unknown>>(partial: Partial<T>): T;
121
-
122
- export { InMemoryConnection, closeAllConnections, createDummyTransportMessage, createLocalWebSocketClient, createMockTransportNetwork, createPartialContext, createWebSocketServer, dummySession, getClientSendFn, getReadableIterator, getServerSendFn, getTransportConnections, isReadableDone, numberOfConnections, onWsServerReady, payloadToTransportMessage, readNextResult, testingClientSessionOptions, testingSessionOptions, waitForMessage };