@replit/river 0.16.1 → 0.16.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/README.md +25 -11
- package/dist/{chunk-7SPCAA6Q.js → chunk-CJGD7CNG.js} +17 -12
- package/dist/{chunk-XLJGKNV2.js → chunk-HKVP6XEL.js} +1 -1
- package/dist/{chunk-L65XWBX2.js → chunk-HZWCU4ZI.js} +1 -1
- package/dist/{chunk-Q6WPGM3K.js → chunk-SKH3JYHN.js} +10 -2
- package/dist/{connection-94896f3b.d.ts → connection-2db95d74.d.ts} +1 -1
- package/dist/{connection-99346822.d.ts → connection-c97da681.d.ts} +1 -1
- package/dist/{index-2e402bb8.d.ts → index-c9e9977f.d.ts} +13 -10
- package/dist/{procedures-f0226890.d.ts → procedures-d295c1a5.d.ts} +1 -1
- package/dist/router/index.cjs +10 -2
- package/dist/router/index.d.cts +8 -4
- package/dist/router/index.d.ts +8 -4
- package/dist/router/index.js +1 -1
- package/dist/transport/impls/uds/client.cjs +17 -12
- package/dist/transport/impls/uds/client.d.cts +2 -2
- package/dist/transport/impls/uds/client.d.ts +2 -2
- package/dist/transport/impls/uds/client.js +2 -2
- package/dist/transport/impls/uds/server.cjs +7 -6
- package/dist/transport/impls/uds/server.d.cts +2 -2
- package/dist/transport/impls/uds/server.d.ts +2 -2
- package/dist/transport/impls/uds/server.js +2 -2
- package/dist/transport/impls/ws/client.cjs +17 -12
- package/dist/transport/impls/ws/client.d.cts +2 -2
- package/dist/transport/impls/ws/client.d.ts +2 -2
- package/dist/transport/impls/ws/client.js +2 -2
- package/dist/transport/impls/ws/server.cjs +7 -6
- package/dist/transport/impls/ws/server.d.cts +2 -2
- package/dist/transport/impls/ws/server.d.ts +2 -2
- package/dist/transport/impls/ws/server.js +2 -2
- package/dist/transport/index.cjs +17 -12
- package/dist/transport/index.d.cts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,32 +22,46 @@ See [PROTOCOL.md](./PROTOCOL.md) for more information on the protocol.
|
|
|
22
22
|
|
|
23
23
|
Before proceeding, ensure you have TypeScript 5 installed and configured appropriately:
|
|
24
24
|
|
|
25
|
-
1. **Ensure
|
|
25
|
+
1. **Ensure your `tsconfig.json` is configured correctly**:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
You must verify that:
|
|
28
|
+
|
|
29
|
+
- `compilerOptions.moduleResolution` is set to `"bundler"`
|
|
30
|
+
- `compilerOptions.strictFunctionTypes` is set to `true`
|
|
31
|
+
- `compilerOptions.strictNullChecks` is set to `true`
|
|
32
|
+
|
|
33
|
+
or, preferably, that:
|
|
34
|
+
|
|
35
|
+
- `compilerOptions.moduleResolution` is set to `"bundler"`
|
|
36
|
+
- `compilerOptions.strict` is set to `true`
|
|
37
|
+
|
|
38
|
+
Like so:
|
|
39
|
+
|
|
40
|
+
```jsonc
|
|
28
41
|
{
|
|
29
42
|
"compilerOptions": {
|
|
30
|
-
"moduleResolution": "bundler"
|
|
43
|
+
"moduleResolution": "bundler",
|
|
44
|
+
"strict": true
|
|
31
45
|
// Other compiler options...
|
|
32
46
|
}
|
|
33
47
|
}
|
|
34
48
|
```
|
|
35
49
|
|
|
36
|
-
If
|
|
50
|
+
If these options already exist in your `tsconfig.json` and don't match what is shown above, modify them. River is designed for `"strict": true`, but technically only `strictFunctionTypes` and `strictNullChecks` being set to `true` is required. Failing to set these will cause unresolvable type errors when defining services.
|
|
37
51
|
|
|
38
52
|
2. Install River and Dependencies:
|
|
39
53
|
|
|
40
|
-
To use River, install the required packages using npm:
|
|
54
|
+
To use River, install the required packages using npm:
|
|
41
55
|
|
|
42
|
-
```bash
|
|
43
|
-
|
|
44
|
-
```
|
|
56
|
+
```bash
|
|
57
|
+
npm i @replit/river @sinclair/typebox
|
|
58
|
+
```
|
|
45
59
|
|
|
46
60
|
3. If you plan on using WebSocket for the underlying transport, also install
|
|
47
61
|
|
|
48
|
-
```bash
|
|
49
|
-
npm i ws isomorphic-ws
|
|
50
|
-
```
|
|
62
|
+
```bash
|
|
63
|
+
npm i ws isomorphic-ws
|
|
64
|
+
```
|
|
51
65
|
|
|
52
66
|
## Writing services
|
|
53
67
|
|
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
var ProtocolError = {
|
|
20
20
|
RetriesExceeded: "conn_retry_exceeded",
|
|
21
21
|
HandshakeFailed: "handshake_failed",
|
|
22
|
-
UseAfterDestroy: "use_after_destroy"
|
|
22
|
+
UseAfterDestroy: "use_after_destroy",
|
|
23
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
23
24
|
};
|
|
24
25
|
var EventDispatcher = class {
|
|
25
26
|
eventListeners = {};
|
|
@@ -331,8 +332,8 @@ var defaultConnectionRetryOptions = {
|
|
|
331
332
|
budgetRestoreIntervalMs: 200
|
|
332
333
|
};
|
|
333
334
|
var defaultClientTransportOptions = {
|
|
334
|
-
|
|
335
|
-
...
|
|
335
|
+
...defaultTransportOptions,
|
|
336
|
+
...defaultConnectionRetryOptions
|
|
336
337
|
};
|
|
337
338
|
var Transport = class {
|
|
338
339
|
/**
|
|
@@ -509,11 +510,11 @@ var Transport = class {
|
|
|
509
510
|
)}`
|
|
510
511
|
);
|
|
511
512
|
} else {
|
|
513
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
512
514
|
log?.error(
|
|
513
|
-
`${this.clientId} --
|
|
515
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
514
516
|
);
|
|
515
|
-
|
|
516
|
-
this.deleteSession(session);
|
|
517
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
517
518
|
}
|
|
518
519
|
return;
|
|
519
520
|
}
|
|
@@ -619,7 +620,13 @@ var ClientTransport = class extends Transport {
|
|
|
619
620
|
*/
|
|
620
621
|
inflightConnectionPromises;
|
|
621
622
|
retryBudget;
|
|
622
|
-
|
|
623
|
+
/**
|
|
624
|
+
* A flag indicating whether the transport should automatically reconnect
|
|
625
|
+
* when a connection is dropped.
|
|
626
|
+
* Realistically, this should always be true for clients unless you are writing
|
|
627
|
+
* tests or a special case where you don't want to reconnect.
|
|
628
|
+
*/
|
|
629
|
+
reconnectOnConnectionDrop = true;
|
|
623
630
|
constructor(clientId, providedOptions) {
|
|
624
631
|
super(clientId, providedOptions);
|
|
625
632
|
this.options = {
|
|
@@ -627,9 +634,7 @@ var ClientTransport = class extends Transport {
|
|
|
627
634
|
...providedOptions
|
|
628
635
|
};
|
|
629
636
|
this.inflightConnectionPromises = /* @__PURE__ */ new Map();
|
|
630
|
-
this.retryBudget = new LeakyBucketRateLimit(
|
|
631
|
-
this.options.connectionRetryOptions
|
|
632
|
-
);
|
|
637
|
+
this.retryBudget = new LeakyBucketRateLimit(this.options);
|
|
633
638
|
}
|
|
634
639
|
handleConnection(conn, to) {
|
|
635
640
|
if (this.state !== "open")
|
|
@@ -661,7 +666,7 @@ var ClientTransport = class extends Transport {
|
|
|
661
666
|
`${this.clientId} -- connection (id: ${conn.debugId}) to ${to} disconnected`
|
|
662
667
|
);
|
|
663
668
|
this.inflightConnectionPromises.delete(to);
|
|
664
|
-
if (this.
|
|
669
|
+
if (this.reconnectOnConnectionDrop) {
|
|
665
670
|
void this.connect(to);
|
|
666
671
|
}
|
|
667
672
|
});
|
|
@@ -767,7 +772,7 @@ var ClientTransport = class extends Transport {
|
|
|
767
772
|
} catch (error) {
|
|
768
773
|
this.inflightConnectionPromises.delete(to);
|
|
769
774
|
const errStr = coerceErrorString(error);
|
|
770
|
-
if (!this.
|
|
775
|
+
if (!this.reconnectOnConnectionDrop || !canProceedWithConnection()) {
|
|
771
776
|
log?.warn(`${this.clientId} -- connection to ${to} failed (${errStr})`);
|
|
772
777
|
} else {
|
|
773
778
|
log?.warn(
|
|
@@ -570,8 +570,13 @@ function _createRecursiveProxy(callback, path) {
|
|
|
570
570
|
});
|
|
571
571
|
return proxy;
|
|
572
572
|
}
|
|
573
|
-
var
|
|
574
|
-
|
|
573
|
+
var defaultClientOptions = {
|
|
574
|
+
connectOnInvoke: true,
|
|
575
|
+
eagerlyConnect: true
|
|
576
|
+
};
|
|
577
|
+
var createClient = (transport, serverId, providedClientOptions = {}) => {
|
|
578
|
+
const options = { ...defaultClientOptions, ...providedClientOptions };
|
|
579
|
+
if (options.eagerlyConnect) {
|
|
575
580
|
void transport.connect(serverId);
|
|
576
581
|
}
|
|
577
582
|
return _createRecursiveProxy(async (opts) => {
|
|
@@ -587,6 +592,9 @@ var createClient = (transport, serverId, eagerlyConnect = true) => {
|
|
|
587
592
|
input
|
|
588
593
|
)}`
|
|
589
594
|
);
|
|
595
|
+
if (options.connectOnInvoke && !transport.connections.has(serverId)) {
|
|
596
|
+
void transport.connect(serverId);
|
|
597
|
+
}
|
|
590
598
|
if (procType === "rpc") {
|
|
591
599
|
return handleRpc(
|
|
592
600
|
transport,
|
|
@@ -222,6 +222,7 @@ declare const ProtocolError: {
|
|
|
222
222
|
readonly RetriesExceeded: "conn_retry_exceeded";
|
|
223
223
|
readonly HandshakeFailed: "handshake_failed";
|
|
224
224
|
readonly UseAfterDestroy: "use_after_destroy";
|
|
225
|
+
readonly MessageOrderingViolated: "message_ordering_violated";
|
|
225
226
|
};
|
|
226
227
|
type ProtocolErrorType = (typeof ProtocolError)[keyof typeof ProtocolError];
|
|
227
228
|
interface EventMap {
|
|
@@ -308,14 +309,10 @@ declare class LeakyBucketRateLimit {
|
|
|
308
309
|
* @property {'destroyed'} destroyed - The transport is permanently destroyed and cannot be reopened.
|
|
309
310
|
*/
|
|
310
311
|
type TransportStatus = 'open' | 'closed' | 'destroyed';
|
|
311
|
-
type
|
|
312
|
-
type
|
|
313
|
-
type ProvidedClientTransportOptions =
|
|
314
|
-
|
|
315
|
-
} & ProvidedTransportOptions;
|
|
316
|
-
type ClientTransportOptions = SessionOptions & {
|
|
317
|
-
connectionRetryOptions: ConnectionRetryOptions;
|
|
318
|
-
};
|
|
312
|
+
type TransportOptions = SessionOptions;
|
|
313
|
+
type ProvidedTransportOptions = Partial<TransportOptions>;
|
|
314
|
+
type ProvidedClientTransportOptions = Partial<ClientTransportOptions>;
|
|
315
|
+
type ClientTransportOptions = SessionOptions & ConnectionRetryOptions;
|
|
319
316
|
/**
|
|
320
317
|
* Transports manage the lifecycle (creation/deletion) of sessions and connections. Its responsibilities include:
|
|
321
318
|
*
|
|
@@ -469,8 +466,14 @@ declare abstract class ClientTransport<ConnType extends Connection> extends Tran
|
|
|
469
466
|
*/
|
|
470
467
|
inflightConnectionPromises: Map<TransportClientId, Promise<ConnType>>;
|
|
471
468
|
retryBudget: LeakyBucketRateLimit;
|
|
472
|
-
|
|
473
|
-
|
|
469
|
+
/**
|
|
470
|
+
* A flag indicating whether the transport should automatically reconnect
|
|
471
|
+
* when a connection is dropped.
|
|
472
|
+
* Realistically, this should always be true for clients unless you are writing
|
|
473
|
+
* tests or a special case where you don't want to reconnect.
|
|
474
|
+
*/
|
|
475
|
+
reconnectOnConnectionDrop: boolean;
|
|
476
|
+
constructor(clientId: TransportClientId, providedOptions?: ProvidedClientTransportOptions);
|
|
474
477
|
protected handleConnection(conn: ConnType, to: TransportClientId): void;
|
|
475
478
|
receiveHandshakeResponseMessage(data: Uint8Array): false | {
|
|
476
479
|
instanceId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TObject, TUnion, TString, TSchema, TNever, TLiteral, Static } from '@sinclair/typebox';
|
|
2
2
|
import { Pushable } from 'it-pushable';
|
|
3
|
-
import { b as TransportClientId, e as Session, C as Connection } from './index-
|
|
3
|
+
import { b as TransportClientId, e as Session, C as Connection } from './index-c9e9977f.js';
|
|
4
4
|
|
|
5
5
|
type TLiteralString = TLiteral<string>;
|
|
6
6
|
type RiverErrorSchema = TObject<{
|
package/dist/router/index.cjs
CHANGED
|
@@ -655,8 +655,13 @@ function _createRecursiveProxy(callback, path) {
|
|
|
655
655
|
});
|
|
656
656
|
return proxy;
|
|
657
657
|
}
|
|
658
|
-
var
|
|
659
|
-
|
|
658
|
+
var defaultClientOptions = {
|
|
659
|
+
connectOnInvoke: true,
|
|
660
|
+
eagerlyConnect: true
|
|
661
|
+
};
|
|
662
|
+
var createClient = (transport, serverId, providedClientOptions = {}) => {
|
|
663
|
+
const options = { ...defaultClientOptions, ...providedClientOptions };
|
|
664
|
+
if (options.eagerlyConnect) {
|
|
660
665
|
void transport.connect(serverId);
|
|
661
666
|
}
|
|
662
667
|
return _createRecursiveProxy(async (opts) => {
|
|
@@ -672,6 +677,9 @@ var createClient = (transport, serverId, eagerlyConnect = true) => {
|
|
|
672
677
|
input
|
|
673
678
|
)}`
|
|
674
679
|
);
|
|
680
|
+
if (options.connectOnInvoke && !transport.connections.has(serverId)) {
|
|
681
|
+
void transport.connect(serverId);
|
|
682
|
+
}
|
|
675
683
|
if (procType === "rpc") {
|
|
676
684
|
return handleRpc(
|
|
677
685
|
transport,
|
package/dist/router/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TObject, TUnion, Static } from '@sinclair/typebox';
|
|
2
|
-
import { e as ProcedureMap, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../procedures-
|
|
3
|
-
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-
|
|
4
|
-
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
2
|
+
import { e as ProcedureMap, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../procedures-d295c1a5.js';
|
|
3
|
+
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-d295c1a5.js';
|
|
4
|
+
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-c9e9977f.js';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
|
|
@@ -381,6 +381,10 @@ type ServiceClient<Router extends AnyService> = {
|
|
|
381
381
|
type ServerClient<Srv extends Server<ServiceSchemaMap>> = {
|
|
382
382
|
[SvcName in keyof Srv['services']]: ServiceClient<Srv['services'][SvcName]>;
|
|
383
383
|
};
|
|
384
|
+
interface ClientOptions {
|
|
385
|
+
connectOnInvoke: boolean;
|
|
386
|
+
eagerlyConnect: boolean;
|
|
387
|
+
}
|
|
384
388
|
/**
|
|
385
389
|
* Creates a client for a given server using the provided transport.
|
|
386
390
|
* Note that the client only needs the type of the server, not the actual
|
|
@@ -394,6 +398,6 @@ type ServerClient<Srv extends Server<ServiceSchemaMap>> = {
|
|
|
394
398
|
* @param {Transport} transport - The transport to use for communication.
|
|
395
399
|
* @returns The client for the server.
|
|
396
400
|
*/
|
|
397
|
-
declare const createClient: <Srv extends Server<ServiceSchemaMap>>(transport: ClientTransport<Connection>, serverId: TransportClientId,
|
|
401
|
+
declare const createClient: <Srv extends Server<ServiceSchemaMap>>(transport: ClientTransport<Connection>, serverId: TransportClientId, providedClientOptions?: Partial<ClientOptions>) => ServerClient<Srv>;
|
|
398
402
|
|
|
399
403
|
export { PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, Result, RiverError, RiverUncaughtSchema, Server, ServerClient, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TObject, TUnion, Static } from '@sinclair/typebox';
|
|
2
|
-
import { e as ProcedureMap, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../procedures-
|
|
3
|
-
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-
|
|
4
|
-
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
2
|
+
import { e as ProcedureMap, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, P as PayloadType, b as Result, R as RiverError, S as ServiceContext } from '../procedures-d295c1a5.js';
|
|
3
|
+
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-d295c1a5.js';
|
|
4
|
+
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-c9e9977f.js';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
|
|
@@ -381,6 +381,10 @@ type ServiceClient<Router extends AnyService> = {
|
|
|
381
381
|
type ServerClient<Srv extends Server<ServiceSchemaMap>> = {
|
|
382
382
|
[SvcName in keyof Srv['services']]: ServiceClient<Srv['services'][SvcName]>;
|
|
383
383
|
};
|
|
384
|
+
interface ClientOptions {
|
|
385
|
+
connectOnInvoke: boolean;
|
|
386
|
+
eagerlyConnect: boolean;
|
|
387
|
+
}
|
|
384
388
|
/**
|
|
385
389
|
* Creates a client for a given server using the provided transport.
|
|
386
390
|
* Note that the client only needs the type of the server, not the actual
|
|
@@ -394,6 +398,6 @@ type ServerClient<Srv extends Server<ServiceSchemaMap>> = {
|
|
|
394
398
|
* @param {Transport} transport - The transport to use for communication.
|
|
395
399
|
* @returns The client for the server.
|
|
396
400
|
*/
|
|
397
|
-
declare const createClient: <Srv extends Server<ServiceSchemaMap>>(transport: ClientTransport<Connection>, serverId: TransportClientId,
|
|
401
|
+
declare const createClient: <Srv extends Server<ServiceSchemaMap>>(transport: ClientTransport<Connection>, serverId: TransportClientId, providedClientOptions?: Partial<ClientOptions>) => ServerClient<Srv>;
|
|
398
402
|
|
|
399
403
|
export { PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, Result, RiverError, RiverUncaughtSchema, Server, ServerClient, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -392,7 +392,8 @@ var import_value = require("@sinclair/typebox/value");
|
|
|
392
392
|
var ProtocolError = {
|
|
393
393
|
RetriesExceeded: "conn_retry_exceeded",
|
|
394
394
|
HandshakeFailed: "handshake_failed",
|
|
395
|
-
UseAfterDestroy: "use_after_destroy"
|
|
395
|
+
UseAfterDestroy: "use_after_destroy",
|
|
396
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
396
397
|
};
|
|
397
398
|
var EventDispatcher = class {
|
|
398
399
|
eventListeners = {};
|
|
@@ -570,8 +571,8 @@ var defaultConnectionRetryOptions = {
|
|
|
570
571
|
budgetRestoreIntervalMs: 200
|
|
571
572
|
};
|
|
572
573
|
var defaultClientTransportOptions = {
|
|
573
|
-
|
|
574
|
-
...
|
|
574
|
+
...defaultTransportOptions,
|
|
575
|
+
...defaultConnectionRetryOptions
|
|
575
576
|
};
|
|
576
577
|
var Transport = class {
|
|
577
578
|
/**
|
|
@@ -748,11 +749,11 @@ var Transport = class {
|
|
|
748
749
|
)}`
|
|
749
750
|
);
|
|
750
751
|
} else {
|
|
752
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
751
753
|
log?.error(
|
|
752
|
-
`${this.clientId} --
|
|
754
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
753
755
|
);
|
|
754
|
-
|
|
755
|
-
this.deleteSession(session);
|
|
756
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
756
757
|
}
|
|
757
758
|
return;
|
|
758
759
|
}
|
|
@@ -858,7 +859,13 @@ var ClientTransport = class extends Transport {
|
|
|
858
859
|
*/
|
|
859
860
|
inflightConnectionPromises;
|
|
860
861
|
retryBudget;
|
|
861
|
-
|
|
862
|
+
/**
|
|
863
|
+
* A flag indicating whether the transport should automatically reconnect
|
|
864
|
+
* when a connection is dropped.
|
|
865
|
+
* Realistically, this should always be true for clients unless you are writing
|
|
866
|
+
* tests or a special case where you don't want to reconnect.
|
|
867
|
+
*/
|
|
868
|
+
reconnectOnConnectionDrop = true;
|
|
862
869
|
constructor(clientId, providedOptions) {
|
|
863
870
|
super(clientId, providedOptions);
|
|
864
871
|
this.options = {
|
|
@@ -866,9 +873,7 @@ var ClientTransport = class extends Transport {
|
|
|
866
873
|
...providedOptions
|
|
867
874
|
};
|
|
868
875
|
this.inflightConnectionPromises = /* @__PURE__ */ new Map();
|
|
869
|
-
this.retryBudget = new LeakyBucketRateLimit(
|
|
870
|
-
this.options.connectionRetryOptions
|
|
871
|
-
);
|
|
876
|
+
this.retryBudget = new LeakyBucketRateLimit(this.options);
|
|
872
877
|
}
|
|
873
878
|
handleConnection(conn, to) {
|
|
874
879
|
if (this.state !== "open")
|
|
@@ -900,7 +905,7 @@ var ClientTransport = class extends Transport {
|
|
|
900
905
|
`${this.clientId} -- connection (id: ${conn.debugId}) to ${to} disconnected`
|
|
901
906
|
);
|
|
902
907
|
this.inflightConnectionPromises.delete(to);
|
|
903
|
-
if (this.
|
|
908
|
+
if (this.reconnectOnConnectionDrop) {
|
|
904
909
|
void this.connect(to);
|
|
905
910
|
}
|
|
906
911
|
});
|
|
@@ -1006,7 +1011,7 @@ var ClientTransport = class extends Transport {
|
|
|
1006
1011
|
} catch (error) {
|
|
1007
1012
|
this.inflightConnectionPromises.delete(to);
|
|
1008
1013
|
const errStr = coerceErrorString(error);
|
|
1009
|
-
if (!this.
|
|
1014
|
+
if (!this.reconnectOnConnectionDrop || !canProceedWithConnection()) {
|
|
1010
1015
|
log?.warn(`${this.clientId} -- connection to ${to} failed (${errStr})`);
|
|
1011
1016
|
} else {
|
|
1012
1017
|
log?.warn(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-c9e9977f.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-2db95d74.js';
|
|
3
3
|
import '../../../types-3e5768ec.js';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'node:net';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-c9e9977f.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-2db95d74.js';
|
|
3
3
|
import '../../../types-3e5768ec.js';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'node:net';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UdsConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-HZWCU4ZI.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-CJGD7CNG.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -111,7 +111,8 @@ function isAck(controlFlag) {
|
|
|
111
111
|
var ProtocolError = {
|
|
112
112
|
RetriesExceeded: "conn_retry_exceeded",
|
|
113
113
|
HandshakeFailed: "handshake_failed",
|
|
114
|
-
UseAfterDestroy: "use_after_destroy"
|
|
114
|
+
UseAfterDestroy: "use_after_destroy",
|
|
115
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
115
116
|
};
|
|
116
117
|
var EventDispatcher = class {
|
|
117
118
|
eventListeners = {};
|
|
@@ -411,8 +412,8 @@ var defaultConnectionRetryOptions = {
|
|
|
411
412
|
budgetRestoreIntervalMs: 200
|
|
412
413
|
};
|
|
413
414
|
var defaultClientTransportOptions = {
|
|
414
|
-
|
|
415
|
-
...
|
|
415
|
+
...defaultTransportOptions,
|
|
416
|
+
...defaultConnectionRetryOptions
|
|
416
417
|
};
|
|
417
418
|
var Transport = class {
|
|
418
419
|
/**
|
|
@@ -589,11 +590,11 @@ var Transport = class {
|
|
|
589
590
|
)}`
|
|
590
591
|
);
|
|
591
592
|
} else {
|
|
593
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
592
594
|
log?.error(
|
|
593
|
-
`${this.clientId} --
|
|
595
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
594
596
|
);
|
|
595
|
-
|
|
596
|
-
this.deleteSession(session);
|
|
597
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
597
598
|
}
|
|
598
599
|
return;
|
|
599
600
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-c9e9977f.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-2db95d74.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import 'node:stream';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-c9e9977f.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-2db95d74.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import 'node:stream';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UdsConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-HZWCU4ZI.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-CJGD7CNG.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -103,7 +103,8 @@ var log;
|
|
|
103
103
|
var ProtocolError = {
|
|
104
104
|
RetriesExceeded: "conn_retry_exceeded",
|
|
105
105
|
HandshakeFailed: "handshake_failed",
|
|
106
|
-
UseAfterDestroy: "use_after_destroy"
|
|
106
|
+
UseAfterDestroy: "use_after_destroy",
|
|
107
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
107
108
|
};
|
|
108
109
|
var EventDispatcher = class {
|
|
109
110
|
eventListeners = {};
|
|
@@ -474,8 +475,8 @@ var defaultConnectionRetryOptions = {
|
|
|
474
475
|
budgetRestoreIntervalMs: 200
|
|
475
476
|
};
|
|
476
477
|
var defaultClientTransportOptions = {
|
|
477
|
-
|
|
478
|
-
...
|
|
478
|
+
...defaultTransportOptions,
|
|
479
|
+
...defaultConnectionRetryOptions
|
|
479
480
|
};
|
|
480
481
|
var Transport = class {
|
|
481
482
|
/**
|
|
@@ -652,11 +653,11 @@ var Transport = class {
|
|
|
652
653
|
)}`
|
|
653
654
|
);
|
|
654
655
|
} else {
|
|
656
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
655
657
|
log?.error(
|
|
656
|
-
`${this.clientId} --
|
|
658
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
657
659
|
);
|
|
658
|
-
|
|
659
|
-
this.deleteSession(session);
|
|
660
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
660
661
|
}
|
|
661
662
|
return;
|
|
662
663
|
}
|
|
@@ -762,7 +763,13 @@ var ClientTransport = class extends Transport {
|
|
|
762
763
|
*/
|
|
763
764
|
inflightConnectionPromises;
|
|
764
765
|
retryBudget;
|
|
765
|
-
|
|
766
|
+
/**
|
|
767
|
+
* A flag indicating whether the transport should automatically reconnect
|
|
768
|
+
* when a connection is dropped.
|
|
769
|
+
* Realistically, this should always be true for clients unless you are writing
|
|
770
|
+
* tests or a special case where you don't want to reconnect.
|
|
771
|
+
*/
|
|
772
|
+
reconnectOnConnectionDrop = true;
|
|
766
773
|
constructor(clientId, providedOptions) {
|
|
767
774
|
super(clientId, providedOptions);
|
|
768
775
|
this.options = {
|
|
@@ -770,9 +777,7 @@ var ClientTransport = class extends Transport {
|
|
|
770
777
|
...providedOptions
|
|
771
778
|
};
|
|
772
779
|
this.inflightConnectionPromises = /* @__PURE__ */ new Map();
|
|
773
|
-
this.retryBudget = new LeakyBucketRateLimit(
|
|
774
|
-
this.options.connectionRetryOptions
|
|
775
|
-
);
|
|
780
|
+
this.retryBudget = new LeakyBucketRateLimit(this.options);
|
|
776
781
|
}
|
|
777
782
|
handleConnection(conn, to) {
|
|
778
783
|
if (this.state !== "open")
|
|
@@ -804,7 +809,7 @@ var ClientTransport = class extends Transport {
|
|
|
804
809
|
`${this.clientId} -- connection (id: ${conn.debugId}) to ${to} disconnected`
|
|
805
810
|
);
|
|
806
811
|
this.inflightConnectionPromises.delete(to);
|
|
807
|
-
if (this.
|
|
812
|
+
if (this.reconnectOnConnectionDrop) {
|
|
808
813
|
void this.connect(to);
|
|
809
814
|
}
|
|
810
815
|
});
|
|
@@ -910,7 +915,7 @@ var ClientTransport = class extends Transport {
|
|
|
910
915
|
} catch (error) {
|
|
911
916
|
this.inflightConnectionPromises.delete(to);
|
|
912
917
|
const errStr = coerceErrorString(error);
|
|
913
|
-
if (!this.
|
|
918
|
+
if (!this.reconnectOnConnectionDrop || !canProceedWithConnection()) {
|
|
914
919
|
log?.warn(`${this.clientId} -- connection to ${to} failed (${errStr})`);
|
|
915
920
|
} else {
|
|
916
921
|
log?.warn(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'isomorphic-ws';
|
|
2
|
-
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-c9e9977f.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-c97da681.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'isomorphic-ws';
|
|
2
|
-
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-c9e9977f.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-c97da681.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WebSocketConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-HKVP6XEL.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-CJGD7CNG.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -111,7 +111,8 @@ var log;
|
|
|
111
111
|
var ProtocolError = {
|
|
112
112
|
RetriesExceeded: "conn_retry_exceeded",
|
|
113
113
|
HandshakeFailed: "handshake_failed",
|
|
114
|
-
UseAfterDestroy: "use_after_destroy"
|
|
114
|
+
UseAfterDestroy: "use_after_destroy",
|
|
115
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
115
116
|
};
|
|
116
117
|
var EventDispatcher = class {
|
|
117
118
|
eventListeners = {};
|
|
@@ -411,8 +412,8 @@ var defaultConnectionRetryOptions = {
|
|
|
411
412
|
budgetRestoreIntervalMs: 200
|
|
412
413
|
};
|
|
413
414
|
var defaultClientTransportOptions = {
|
|
414
|
-
|
|
415
|
-
...
|
|
415
|
+
...defaultTransportOptions,
|
|
416
|
+
...defaultConnectionRetryOptions
|
|
416
417
|
};
|
|
417
418
|
var Transport = class {
|
|
418
419
|
/**
|
|
@@ -589,11 +590,11 @@ var Transport = class {
|
|
|
589
590
|
)}`
|
|
590
591
|
);
|
|
591
592
|
} else {
|
|
593
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
592
594
|
log?.error(
|
|
593
|
-
`${this.clientId} --
|
|
595
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
594
596
|
);
|
|
595
|
-
|
|
596
|
-
this.deleteSession(session);
|
|
597
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
597
598
|
}
|
|
598
599
|
return;
|
|
599
600
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-
|
|
1
|
+
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-c9e9977f.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
3
|
import { WebSocket } from 'isomorphic-ws';
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-c97da681.js';
|
|
5
5
|
import '../../../types-3e5768ec.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-
|
|
1
|
+
import { S as ServerTransport, b as TransportClientId, d as ProvidedTransportOptions } from '../../../index-c9e9977f.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
3
|
import { WebSocket } from 'isomorphic-ws';
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-c97da681.js';
|
|
5
5
|
import '../../../types-3e5768ec.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WebSocketConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-HKVP6XEL.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-CJGD7CNG.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import "../../../chunk-H4BYJELI.js";
|
|
9
9
|
import "../../../chunk-GZ7HCLLM.js";
|
package/dist/transport/index.cjs
CHANGED
|
@@ -134,7 +134,8 @@ var log;
|
|
|
134
134
|
var ProtocolError = {
|
|
135
135
|
RetriesExceeded: "conn_retry_exceeded",
|
|
136
136
|
HandshakeFailed: "handshake_failed",
|
|
137
|
-
UseAfterDestroy: "use_after_destroy"
|
|
137
|
+
UseAfterDestroy: "use_after_destroy",
|
|
138
|
+
MessageOrderingViolated: "message_ordering_violated"
|
|
138
139
|
};
|
|
139
140
|
var EventDispatcher = class {
|
|
140
141
|
eventListeners = {};
|
|
@@ -505,8 +506,8 @@ var defaultConnectionRetryOptions = {
|
|
|
505
506
|
budgetRestoreIntervalMs: 200
|
|
506
507
|
};
|
|
507
508
|
var defaultClientTransportOptions = {
|
|
508
|
-
|
|
509
|
-
...
|
|
509
|
+
...defaultTransportOptions,
|
|
510
|
+
...defaultConnectionRetryOptions
|
|
510
511
|
};
|
|
511
512
|
var Transport = class {
|
|
512
513
|
/**
|
|
@@ -683,11 +684,11 @@ var Transport = class {
|
|
|
683
684
|
)}`
|
|
684
685
|
);
|
|
685
686
|
} else {
|
|
687
|
+
const errMsg = `received out-of-order msg (got seq: ${msg.seq}, wanted seq: ${session.nextExpectedSeq})`;
|
|
686
688
|
log?.error(
|
|
687
|
-
`${this.clientId} --
|
|
689
|
+
`${this.clientId} -- ${errMsg}, marking connection as dead: ${JSON.stringify(msg)}`
|
|
688
690
|
);
|
|
689
|
-
|
|
690
|
-
this.deleteSession(session);
|
|
691
|
+
this.protocolError(ProtocolError.MessageOrderingViolated, errMsg);
|
|
691
692
|
}
|
|
692
693
|
return;
|
|
693
694
|
}
|
|
@@ -793,7 +794,13 @@ var ClientTransport = class extends Transport {
|
|
|
793
794
|
*/
|
|
794
795
|
inflightConnectionPromises;
|
|
795
796
|
retryBudget;
|
|
796
|
-
|
|
797
|
+
/**
|
|
798
|
+
* A flag indicating whether the transport should automatically reconnect
|
|
799
|
+
* when a connection is dropped.
|
|
800
|
+
* Realistically, this should always be true for clients unless you are writing
|
|
801
|
+
* tests or a special case where you don't want to reconnect.
|
|
802
|
+
*/
|
|
803
|
+
reconnectOnConnectionDrop = true;
|
|
797
804
|
constructor(clientId, providedOptions) {
|
|
798
805
|
super(clientId, providedOptions);
|
|
799
806
|
this.options = {
|
|
@@ -801,9 +808,7 @@ var ClientTransport = class extends Transport {
|
|
|
801
808
|
...providedOptions
|
|
802
809
|
};
|
|
803
810
|
this.inflightConnectionPromises = /* @__PURE__ */ new Map();
|
|
804
|
-
this.retryBudget = new LeakyBucketRateLimit(
|
|
805
|
-
this.options.connectionRetryOptions
|
|
806
|
-
);
|
|
811
|
+
this.retryBudget = new LeakyBucketRateLimit(this.options);
|
|
807
812
|
}
|
|
808
813
|
handleConnection(conn, to) {
|
|
809
814
|
if (this.state !== "open")
|
|
@@ -835,7 +840,7 @@ var ClientTransport = class extends Transport {
|
|
|
835
840
|
`${this.clientId} -- connection (id: ${conn.debugId}) to ${to} disconnected`
|
|
836
841
|
);
|
|
837
842
|
this.inflightConnectionPromises.delete(to);
|
|
838
|
-
if (this.
|
|
843
|
+
if (this.reconnectOnConnectionDrop) {
|
|
839
844
|
void this.connect(to);
|
|
840
845
|
}
|
|
841
846
|
});
|
|
@@ -941,7 +946,7 @@ var ClientTransport = class extends Transport {
|
|
|
941
946
|
} catch (error) {
|
|
942
947
|
this.inflightConnectionPromises.delete(to);
|
|
943
948
|
const errStr = coerceErrorString(error);
|
|
944
|
-
if (!this.
|
|
949
|
+
if (!this.reconnectOnConnectionDrop || !canProceedWithConnection()) {
|
|
945
950
|
log?.warn(`${this.clientId} -- connection to ${to} failed (${errStr})`);
|
|
946
951
|
} else {
|
|
947
952
|
log?.warn(
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, m as EventHandler, E as EventMap, l as EventTypes, O as OpaqueTransportMessage, h as OpaqueTransportMessageSchema, n as ProtocolError, o as ProtocolErrorType, S as ServerTransport, e as Session, T as Transport, b as TransportClientId, i as TransportMessage, g as TransportMessageSchema, d as TransportOptions, f as TransportStatus, k as isStreamClose, j as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, m as EventHandler, E as EventMap, l as EventTypes, O as OpaqueTransportMessage, h as OpaqueTransportMessageSchema, n as ProtocolError, o as ProtocolErrorType, S as ServerTransport, e as Session, T as Transport, b as TransportClientId, i as TransportMessage, g as TransportMessageSchema, d as TransportOptions, f as TransportStatus, k as isStreamClose, j as isStreamOpen } from '../index-c9e9977f.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, m as EventHandler, E as EventMap, l as EventTypes, O as OpaqueTransportMessage, h as OpaqueTransportMessageSchema, n as ProtocolError, o as ProtocolErrorType, S as ServerTransport, e as Session, T as Transport, b as TransportClientId, i as TransportMessage, g as TransportMessageSchema, d as TransportOptions, f as TransportStatus, k as isStreamClose, j as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, m as EventHandler, E as EventMap, l as EventTypes, O as OpaqueTransportMessage, h as OpaqueTransportMessageSchema, n as ProtocolError, o as ProtocolErrorType, S as ServerTransport, e as Session, T as Transport, b as TransportClientId, i as TransportMessage, g as TransportMessageSchema, d as TransportOptions, f as TransportStatus, k as isStreamClose, j as isStreamOpen } from '../index-c9e9977f.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
package/dist/transport/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-d295c1a5.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-c9e9977f.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
5
|
import { C as Codec } from '../types-3e5768ec.js';
|
|
6
6
|
import WebSocket from 'isomorphic-ws';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-d295c1a5.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-c9e9977f.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
5
|
import { C as Codec } from '../types-3e5768ec.js';
|
|
6
6
|
import WebSocket from 'isomorphic-ws';
|
package/dist/util/testHelpers.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UNCAUGHT_ERROR,
|
|
3
3
|
pushable
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SKH3JYHN.js";
|
|
5
5
|
import "../chunk-RPIDSIQG.js";
|
|
6
6
|
import {
|
|
7
7
|
Session
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-CJGD7CNG.js";
|
|
9
9
|
import {
|
|
10
10
|
coerceErrorString
|
|
11
11
|
} from "../chunk-GFRAOY75.js";
|
package/package.json
CHANGED