@replit/river 0.209.0 → 0.209.2
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-TVN2TB6X.js → chunk-DVAIJ57I.js} +10 -10
- package/dist/{chunk-RATCBAZE.js → chunk-L3KNTJU3.js} +316 -303
- package/dist/chunk-L3KNTJU3.js.map +1 -0
- package/dist/{chunk-LPWARXI3.js → chunk-OTL2R22H.js} +2 -2
- package/dist/{client-aETS93z1.d.cts → client-BX3IXUA2.d.cts} +1 -1
- package/dist/{client-BzJwq-hg.d.ts → client-CBak1h8Q.d.ts} +1 -1
- package/dist/codec/index.js +2 -2
- package/dist/{connection-hUWlS-hg.d.cts → connection-_eetKnva.d.cts} +1 -1
- package/dist/{connection-b1wd5XrC.d.ts → connection-zMlysQKs.d.ts} +1 -1
- package/dist/{transport-CxjUaGhi.d.cts → handshake-B3iu79B0.d.cts} +102 -102
- package/dist/{transport-DwEB67zY.d.ts → handshake-DNinPBA3.d.ts} +102 -102
- package/dist/router/index.cjs +300 -285
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +7 -7
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +5 -1
- package/dist/{server-BBgDVOzk.d.cts → server-BV7GXuhz.d.cts} +1 -1
- package/dist/{server-DZ0Yzmpf.d.ts → server-B_H1zn-R.d.ts} +1 -1
- package/dist/{services-DC_uol9A.d.cts → services-BIMmk-v4.d.cts} +97 -4
- package/dist/{services-DBvjc-Mq.d.ts → services-DtsSIaec.d.ts} +97 -4
- package/dist/testUtil/index.cjs +1 -1
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +4 -4
- package/dist/testUtil/index.d.ts +4 -4
- package/dist/testUtil/index.js +3 -3
- 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.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- 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.d.cts +3 -3
- package/dist/transport/impls/ws/server.d.ts +3 -3
- 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.d.cts +4 -4
- package/dist/transport/index.d.ts +4 -4
- package/dist/transport/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-RATCBAZE.js.map +0 -1
- /package/dist/{chunk-TVN2TB6X.js.map → chunk-DVAIJ57I.js.map} +0 -0
- /package/dist/{chunk-LPWARXI3.js.map → chunk-OTL2R22H.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-BIMmk-v4.cjs';
|
|
2
|
+
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client, M as Err, Q as ErrResult, F as INVALID_REQUEST_CODE, O as Ok, T as OkResult, h as ProcErrors, d as ProcHandler, e as ProcInit, f as ProcRequest, g as ProcResponse, i as ProcType, z as Procedure, B as ProcedureErrorSchemaType, r as ProcedureMap, R as RPCProcedure, y as RawReadable, v as Readable, x as ReadableBrokenError, w as ReadableResult, H as ReaderErrorSchema, Z as ResponseData, N as Result, Y as ResultUnwrapErr, X as ResultUnwrapOk, m as SerializedProcedureSchema, q as SerializedProcedureSchemaProtocolv1, k as SerializedServerSchema, o as SerializedServerSchemaProtocolv1, l as SerializedServiceSchema, p as SerializedServiceSchemaProtocolv1, S as Service, c as ServiceConfiguration, u as StreamProcedure, t as SubscriptionProcedure, D as UNCAUGHT_ERROR_CODE, E as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, K as createClient, j as createServiceSchema, C as flattenErrorType, s as serializeSchema, n as serializeSchemaV1Compat } from '../services-BIMmk-v4.cjs';
|
|
3
3
|
import { TSchema, Static } from '@sinclair/typebox';
|
|
4
4
|
import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.cjs';
|
|
5
|
-
import { C as Connection, q as ServerHandshakeOptions } from '../
|
|
6
|
-
export { r as createClientHandshakeOptions, s as createServerHandshakeOptions } from '../
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions } from '../handshake-B3iu79B0.cjs';
|
|
6
|
+
export { r as createClientHandshakeOptions, s as createServerHandshakeOptions } from '../handshake-B3iu79B0.cjs';
|
|
7
|
+
import { S as ServerTransport } from '../server-BV7GXuhz.cjs';
|
|
8
8
|
import '@opentelemetry/api';
|
|
9
|
-
import '../client-
|
|
9
|
+
import '../client-BX3IXUA2.cjs';
|
|
10
10
|
import '../index-D9R6UTMl.cjs';
|
|
11
11
|
import '../adapter-DjiEwOYi.cjs';
|
|
12
12
|
|
|
@@ -74,6 +74,6 @@ declare function createServer<Context extends object, MetadataSchema extends TSc
|
|
|
74
74
|
middlewares?: Array<Middleware>;
|
|
75
75
|
}>): Server<Context, ParsedMetadata, Services>;
|
|
76
76
|
|
|
77
|
-
var version = "0.209.
|
|
77
|
+
var version = "0.209.2";
|
|
78
78
|
|
|
79
79
|
export { type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-DtsSIaec.js';
|
|
2
|
+
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client, M as Err, Q as ErrResult, F as INVALID_REQUEST_CODE, O as Ok, T as OkResult, h as ProcErrors, d as ProcHandler, e as ProcInit, f as ProcRequest, g as ProcResponse, i as ProcType, z as Procedure, B as ProcedureErrorSchemaType, r as ProcedureMap, R as RPCProcedure, y as RawReadable, v as Readable, x as ReadableBrokenError, w as ReadableResult, H as ReaderErrorSchema, Z as ResponseData, N as Result, Y as ResultUnwrapErr, X as ResultUnwrapOk, m as SerializedProcedureSchema, q as SerializedProcedureSchemaProtocolv1, k as SerializedServerSchema, o as SerializedServerSchemaProtocolv1, l as SerializedServiceSchema, p as SerializedServiceSchemaProtocolv1, S as Service, c as ServiceConfiguration, u as StreamProcedure, t as SubscriptionProcedure, D as UNCAUGHT_ERROR_CODE, E as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, K as createClient, j as createServiceSchema, C as flattenErrorType, s as serializeSchema, n as serializeSchemaV1Compat } from '../services-DtsSIaec.js';
|
|
3
3
|
import { TSchema, Static } from '@sinclair/typebox';
|
|
4
4
|
import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.js';
|
|
5
|
-
import { C as Connection, q as ServerHandshakeOptions } from '../
|
|
6
|
-
export { r as createClientHandshakeOptions, s as createServerHandshakeOptions } from '../
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, q as ServerHandshakeOptions } from '../handshake-DNinPBA3.js';
|
|
6
|
+
export { r as createClientHandshakeOptions, s as createServerHandshakeOptions } from '../handshake-DNinPBA3.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-B_H1zn-R.js';
|
|
8
8
|
import '@opentelemetry/api';
|
|
9
|
-
import '../client-
|
|
9
|
+
import '../client-CBak1h8Q.js';
|
|
10
10
|
import '../index-CSM8soK7.js';
|
|
11
11
|
import '../adapter-Cp7_gIVA.js';
|
|
12
12
|
|
|
@@ -74,6 +74,6 @@ declare function createServer<Context extends object, MetadataSchema extends TSc
|
|
|
74
74
|
middlewares?: Array<Middleware>;
|
|
75
75
|
}>): Server<Context, ParsedMetadata, Services>;
|
|
76
76
|
|
|
77
|
-
var version = "0.209.
|
|
77
|
+
var version = "0.209.2";
|
|
78
78
|
|
|
79
79
|
export { type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
INVALID_REQUEST_CODE,
|
|
5
5
|
Ok,
|
|
6
6
|
Procedure,
|
|
7
|
+
ReadableBrokenError,
|
|
8
|
+
ReadableImpl,
|
|
7
9
|
ReaderErrorSchema,
|
|
8
10
|
UNCAUGHT_ERROR_CODE,
|
|
9
11
|
UNEXPECTED_DISCONNECT_CODE,
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
serializeSchema,
|
|
17
19
|
serializeSchemaV1Compat,
|
|
18
20
|
version
|
|
19
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-L3KNTJU3.js";
|
|
20
22
|
export {
|
|
21
23
|
CANCEL_CODE,
|
|
22
24
|
Err,
|
|
@@ -24,6 +26,8 @@ export {
|
|
|
24
26
|
Ok,
|
|
25
27
|
Procedure,
|
|
26
28
|
version as RIVER_VERSION,
|
|
29
|
+
ReadableImpl as RawReadable,
|
|
30
|
+
ReadableBrokenError,
|
|
27
31
|
ReaderErrorSchema,
|
|
28
32
|
UNCAUGHT_ERROR_CODE,
|
|
29
33
|
UNEXPECTED_DISCONNECT_CODE,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Connection, t as CommonSession, d as SessionState, u as CommonSessionProps, T as Transport, v as ServerTransportOptions, q as ServerHandshakeOptions, w as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './
|
|
1
|
+
import { C as Connection, t as CommonSession, d as SessionState, u as CommonSessionProps, T as Transport, v as ServerTransportOptions, q as ServerHandshakeOptions, w as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './handshake-B3iu79B0.cjs';
|
|
2
2
|
import { b as OpaqueTransportMessage, H as HandshakeErrorResponseCodes, P as ProtocolVersion, a as TransportMessage, c as TransportClientId } from './message-Dlsh5WDF.cjs';
|
|
3
3
|
import { Static, TSchema } from '@sinclair/typebox';
|
|
4
4
|
import { T as Tags } from './index-D9R6UTMl.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Connection, t as CommonSession, d as SessionState, u as CommonSessionProps, T as Transport, v as ServerTransportOptions, q as ServerHandshakeOptions, w as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './
|
|
1
|
+
import { C as Connection, t as CommonSession, d as SessionState, u as CommonSessionProps, T as Transport, v as ServerTransportOptions, q as ServerHandshakeOptions, w as ServerSession, c as ProvidedServerTransportOptions, D as DeleteSessionOptions } from './handshake-DNinPBA3.js';
|
|
2
2
|
import { b as OpaqueTransportMessage, H as HandshakeErrorResponseCodes, P as ProtocolVersion, a as TransportMessage, c as TransportClientId } from './message-Dlsh5WDF.js';
|
|
3
3
|
import { Static, TSchema } from '@sinclair/typebox';
|
|
4
4
|
import { T as Tags } from './index-CSM8soK7.js';
|
|
@@ -2,8 +2,8 @@ import * as _sinclair_typebox from '@sinclair/typebox';
|
|
|
2
2
|
import { TNever, TObject, TLiteral, TString, TSchema, TUnion, Static } from '@sinclair/typebox';
|
|
3
3
|
import { Span } from '@opentelemetry/api';
|
|
4
4
|
import { c as TransportClientId } from './message-Dlsh5WDF.cjs';
|
|
5
|
-
import { C as Connection, n as ClientHandshakeOptions, z as SessionId } from './
|
|
6
|
-
import { C as ClientTransport } from './client-
|
|
5
|
+
import { C as Connection, n as ClientHandshakeOptions, z as SessionId } from './handshake-B3iu79B0.cjs';
|
|
6
|
+
import { C as ClientTransport } from './client-BX3IXUA2.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* {@link UNCAUGHT_ERROR_CODE} is the code that is used when an error is thrown
|
|
@@ -177,6 +177,99 @@ interface Writable<T> {
|
|
|
177
177
|
*/
|
|
178
178
|
isWritable(): boolean;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Internal implementation of a {@link Readable}.
|
|
182
|
+
* This should generally not be constructed directly by consumers
|
|
183
|
+
* of river, but rather through either the client or procedure handlers.
|
|
184
|
+
*
|
|
185
|
+
* There are rare cases where this is useful to construct in tests or
|
|
186
|
+
* to 'tee' a {@link Readable} to create a copy of the stream but
|
|
187
|
+
* this is not the common case.
|
|
188
|
+
*/
|
|
189
|
+
declare class ReadableImpl<T, E extends Static<BaseErrorSchemaType>> implements Readable<T, E> {
|
|
190
|
+
/**
|
|
191
|
+
* Whether the {@link Readable} is closed.
|
|
192
|
+
*
|
|
193
|
+
* Closed {@link Readable}s are done receiving values, but that doesn't affect
|
|
194
|
+
* any other aspect of the {@link Readable} such as it's consumability.
|
|
195
|
+
*/
|
|
196
|
+
private closed;
|
|
197
|
+
/**
|
|
198
|
+
* Whether the {@link Readable} is locked.
|
|
199
|
+
*
|
|
200
|
+
* @see {@link Readable}'s typedoc to understand locking
|
|
201
|
+
*/
|
|
202
|
+
private locked;
|
|
203
|
+
/**
|
|
204
|
+
* Whether {@link break} was called.
|
|
205
|
+
*
|
|
206
|
+
* @see {@link break} for more information
|
|
207
|
+
*/
|
|
208
|
+
private broken;
|
|
209
|
+
/**
|
|
210
|
+
* This flag allows us to avoid emitting a {@link ReadableBrokenError} after {@link break} was called
|
|
211
|
+
* in cases where the {@link queue} is fully consumed and {@link ReadableImpl} is {@link closed}. This is just an
|
|
212
|
+
* ergonomic feature to avoid emitting an error in our iteration when we don't have to.
|
|
213
|
+
*/
|
|
214
|
+
private brokenWithValuesLeftToRead;
|
|
215
|
+
/**
|
|
216
|
+
* A list of values that have been pushed to the {@link ReadableImpl} but not yet emitted to the user.
|
|
217
|
+
*/
|
|
218
|
+
private queue;
|
|
219
|
+
/**
|
|
220
|
+
* Used by methods in the class to signal to the iterator that it
|
|
221
|
+
* should check for the next value.
|
|
222
|
+
*/
|
|
223
|
+
private next;
|
|
224
|
+
[Symbol.asyncIterator](): {
|
|
225
|
+
next: () => Promise<{
|
|
226
|
+
readonly done: true;
|
|
227
|
+
readonly value: undefined;
|
|
228
|
+
} | {
|
|
229
|
+
readonly done: false;
|
|
230
|
+
readonly value: ReadableResult<T, E>;
|
|
231
|
+
}>;
|
|
232
|
+
return: () => {
|
|
233
|
+
readonly done: true;
|
|
234
|
+
readonly value: undefined;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Collects all the values from the {@link Readable} into an array.
|
|
239
|
+
*
|
|
240
|
+
* @see {@link Readable}'s typedoc for more information
|
|
241
|
+
*/
|
|
242
|
+
collect(): Promise<Array<ReadableResult<T, E>>>;
|
|
243
|
+
/**
|
|
244
|
+
* Breaks the {@link Readable} and signals an error to any iterators waiting for the next value.
|
|
245
|
+
*
|
|
246
|
+
* @see {@link Readable}'s typedoc for more information
|
|
247
|
+
*/
|
|
248
|
+
break(): undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Whether the {@link Readable} is readable.
|
|
251
|
+
*
|
|
252
|
+
* @see {@link Readable}'s typedoc for more information
|
|
253
|
+
*/
|
|
254
|
+
isReadable(): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Pushes a value to be read.
|
|
257
|
+
*/
|
|
258
|
+
_pushValue(value: Result<T, E>): undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Triggers the close of the {@link Readable}. Make sure to push all remaining
|
|
261
|
+
* values before calling this method.
|
|
262
|
+
*/
|
|
263
|
+
_triggerClose(): undefined;
|
|
264
|
+
/**
|
|
265
|
+
* @internal meant for use within river, not exposed as a public API
|
|
266
|
+
*/
|
|
267
|
+
_hasValuesInQueue(): boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Whether the {@link Readable} is closed.
|
|
270
|
+
*/
|
|
271
|
+
isClosed(): boolean;
|
|
272
|
+
}
|
|
180
273
|
|
|
181
274
|
interface CallOptions {
|
|
182
275
|
signal?: AbortSignal;
|
|
@@ -813,7 +906,7 @@ declare function createServiceSchema<Context extends object = object, ParsedMeta
|
|
|
813
906
|
* Depending on your preferences, this may be a more appealing way to define
|
|
814
907
|
* a schema versus using the {@link ServiceSchema.define} method.
|
|
815
908
|
*/
|
|
816
|
-
scaffold<State_1 extends object>(config: ServiceConfiguration<Context, State_1>): ServiceScaffold<Context, State_1,
|
|
909
|
+
scaffold<State_1 extends object>(config: ServiceConfiguration<Context, State_1>): ServiceScaffold<Context, State_1, ParsedMetadata>;
|
|
817
910
|
/**
|
|
818
911
|
* Creates a new {@link ServiceSchema} with the given configuration and procedures.
|
|
819
912
|
*
|
|
@@ -1007,4 +1100,4 @@ declare class ServiceScaffold<Context extends object, State extends object, Pars
|
|
|
1007
1100
|
};
|
|
1008
1101
|
}
|
|
1009
1102
|
|
|
1010
|
-
export { type AnyServiceSchemaMap as A,
|
|
1103
|
+
export { type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L, Err as M, type Result as N, Ok as O, type ProcedureHandlerContext as P, type ErrResult as Q, type RpcProcedure as R, type Service as S, type OkResult as T, type UploadProcedure as U, type ValidProcType as V, type Writable as W, type ResultUnwrapOk as X, type ResultUnwrapErr as Y, type ResponseData as Z, type ReadableIterator as _, type PayloadType as a, type AnyProcedure as b, type ServiceConfiguration as c, type ProcHandler as d, type ProcInit as e, type ProcRequest as f, type ProcResponse as g, type ProcErrors as h, type ProcType as i, createServiceSchema as j, type SerializedServerSchema as k, type SerializedServiceSchema as l, type SerializedProcedureSchema as m, serializeSchemaV1Compat as n, type SerializedServerSchemaProtocolv1 as o, type SerializedServiceSchemaProtocolv1 as p, type SerializedProcedureSchemaProtocolv1 as q, type ProcedureMap as r, serializeSchema as s, type SubscriptionProcedure as t, type StreamProcedure as u, type Readable as v, type ReadableResult as w, ReadableBrokenError as x, ReadableImpl as y, Procedure as z };
|
|
@@ -2,8 +2,8 @@ import * as _sinclair_typebox from '@sinclair/typebox';
|
|
|
2
2
|
import { TNever, TObject, TLiteral, TString, TSchema, TUnion, Static } from '@sinclair/typebox';
|
|
3
3
|
import { Span } from '@opentelemetry/api';
|
|
4
4
|
import { c as TransportClientId } from './message-Dlsh5WDF.js';
|
|
5
|
-
import { C as Connection, n as ClientHandshakeOptions, z as SessionId } from './
|
|
6
|
-
import { C as ClientTransport } from './client-
|
|
5
|
+
import { C as Connection, n as ClientHandshakeOptions, z as SessionId } from './handshake-DNinPBA3.js';
|
|
6
|
+
import { C as ClientTransport } from './client-CBak1h8Q.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* {@link UNCAUGHT_ERROR_CODE} is the code that is used when an error is thrown
|
|
@@ -177,6 +177,99 @@ interface Writable<T> {
|
|
|
177
177
|
*/
|
|
178
178
|
isWritable(): boolean;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Internal implementation of a {@link Readable}.
|
|
182
|
+
* This should generally not be constructed directly by consumers
|
|
183
|
+
* of river, but rather through either the client or procedure handlers.
|
|
184
|
+
*
|
|
185
|
+
* There are rare cases where this is useful to construct in tests or
|
|
186
|
+
* to 'tee' a {@link Readable} to create a copy of the stream but
|
|
187
|
+
* this is not the common case.
|
|
188
|
+
*/
|
|
189
|
+
declare class ReadableImpl<T, E extends Static<BaseErrorSchemaType>> implements Readable<T, E> {
|
|
190
|
+
/**
|
|
191
|
+
* Whether the {@link Readable} is closed.
|
|
192
|
+
*
|
|
193
|
+
* Closed {@link Readable}s are done receiving values, but that doesn't affect
|
|
194
|
+
* any other aspect of the {@link Readable} such as it's consumability.
|
|
195
|
+
*/
|
|
196
|
+
private closed;
|
|
197
|
+
/**
|
|
198
|
+
* Whether the {@link Readable} is locked.
|
|
199
|
+
*
|
|
200
|
+
* @see {@link Readable}'s typedoc to understand locking
|
|
201
|
+
*/
|
|
202
|
+
private locked;
|
|
203
|
+
/**
|
|
204
|
+
* Whether {@link break} was called.
|
|
205
|
+
*
|
|
206
|
+
* @see {@link break} for more information
|
|
207
|
+
*/
|
|
208
|
+
private broken;
|
|
209
|
+
/**
|
|
210
|
+
* This flag allows us to avoid emitting a {@link ReadableBrokenError} after {@link break} was called
|
|
211
|
+
* in cases where the {@link queue} is fully consumed and {@link ReadableImpl} is {@link closed}. This is just an
|
|
212
|
+
* ergonomic feature to avoid emitting an error in our iteration when we don't have to.
|
|
213
|
+
*/
|
|
214
|
+
private brokenWithValuesLeftToRead;
|
|
215
|
+
/**
|
|
216
|
+
* A list of values that have been pushed to the {@link ReadableImpl} but not yet emitted to the user.
|
|
217
|
+
*/
|
|
218
|
+
private queue;
|
|
219
|
+
/**
|
|
220
|
+
* Used by methods in the class to signal to the iterator that it
|
|
221
|
+
* should check for the next value.
|
|
222
|
+
*/
|
|
223
|
+
private next;
|
|
224
|
+
[Symbol.asyncIterator](): {
|
|
225
|
+
next: () => Promise<{
|
|
226
|
+
readonly done: true;
|
|
227
|
+
readonly value: undefined;
|
|
228
|
+
} | {
|
|
229
|
+
readonly done: false;
|
|
230
|
+
readonly value: ReadableResult<T, E>;
|
|
231
|
+
}>;
|
|
232
|
+
return: () => {
|
|
233
|
+
readonly done: true;
|
|
234
|
+
readonly value: undefined;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Collects all the values from the {@link Readable} into an array.
|
|
239
|
+
*
|
|
240
|
+
* @see {@link Readable}'s typedoc for more information
|
|
241
|
+
*/
|
|
242
|
+
collect(): Promise<Array<ReadableResult<T, E>>>;
|
|
243
|
+
/**
|
|
244
|
+
* Breaks the {@link Readable} and signals an error to any iterators waiting for the next value.
|
|
245
|
+
*
|
|
246
|
+
* @see {@link Readable}'s typedoc for more information
|
|
247
|
+
*/
|
|
248
|
+
break(): undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Whether the {@link Readable} is readable.
|
|
251
|
+
*
|
|
252
|
+
* @see {@link Readable}'s typedoc for more information
|
|
253
|
+
*/
|
|
254
|
+
isReadable(): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Pushes a value to be read.
|
|
257
|
+
*/
|
|
258
|
+
_pushValue(value: Result<T, E>): undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Triggers the close of the {@link Readable}. Make sure to push all remaining
|
|
261
|
+
* values before calling this method.
|
|
262
|
+
*/
|
|
263
|
+
_triggerClose(): undefined;
|
|
264
|
+
/**
|
|
265
|
+
* @internal meant for use within river, not exposed as a public API
|
|
266
|
+
*/
|
|
267
|
+
_hasValuesInQueue(): boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Whether the {@link Readable} is closed.
|
|
270
|
+
*/
|
|
271
|
+
isClosed(): boolean;
|
|
272
|
+
}
|
|
180
273
|
|
|
181
274
|
interface CallOptions {
|
|
182
275
|
signal?: AbortSignal;
|
|
@@ -813,7 +906,7 @@ declare function createServiceSchema<Context extends object = object, ParsedMeta
|
|
|
813
906
|
* Depending on your preferences, this may be a more appealing way to define
|
|
814
907
|
* a schema versus using the {@link ServiceSchema.define} method.
|
|
815
908
|
*/
|
|
816
|
-
scaffold<State_1 extends object>(config: ServiceConfiguration<Context, State_1>): ServiceScaffold<Context, State_1,
|
|
909
|
+
scaffold<State_1 extends object>(config: ServiceConfiguration<Context, State_1>): ServiceScaffold<Context, State_1, ParsedMetadata>;
|
|
817
910
|
/**
|
|
818
911
|
* Creates a new {@link ServiceSchema} with the given configuration and procedures.
|
|
819
912
|
*
|
|
@@ -1007,4 +1100,4 @@ declare class ServiceScaffold<Context extends object, State extends object, Pars
|
|
|
1007
1100
|
};
|
|
1008
1101
|
}
|
|
1009
1102
|
|
|
1010
|
-
export { type AnyServiceSchemaMap as A,
|
|
1103
|
+
export { type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L, Err as M, type Result as N, Ok as O, type ProcedureHandlerContext as P, type ErrResult as Q, type RpcProcedure as R, type Service as S, type OkResult as T, type UploadProcedure as U, type ValidProcType as V, type Writable as W, type ResultUnwrapOk as X, type ResultUnwrapErr as Y, type ResponseData as Z, type ReadableIterator as _, type PayloadType as a, type AnyProcedure as b, type ServiceConfiguration as c, type ProcHandler as d, type ProcInit as e, type ProcRequest as f, type ProcResponse as g, type ProcErrors as h, type ProcType as i, createServiceSchema as j, type SerializedServerSchema as k, type SerializedServiceSchema as l, type SerializedProcedureSchema as m, serializeSchemaV1Compat as n, type SerializedServerSchemaProtocolv1 as o, type SerializedServiceSchemaProtocolv1 as p, type SerializedProcedureSchemaProtocolv1 as q, type ProcedureMap as r, serializeSchema as s, type SubscriptionProcedure as t, type StreamProcedure as u, type Readable as v, type ReadableResult as w, ReadableBrokenError as x, ReadableImpl as y, Procedure as z };
|