@replit/river 0.14.1 → 0.15.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.
- package/dist/{builder-dfe46874.d.ts → builder-ca6c4259.d.ts} +1 -1
- package/dist/{chunk-ZD5NJJXR.js → chunk-BSAIT634.js} +1 -1
- package/dist/{chunk-WYUFVZC3.js → chunk-FFT7PSUV.js} +1 -1
- package/dist/{chunk-NJ25LQPI.js → chunk-IVNV5HBI.js} +42 -4
- package/dist/{connection-6c569569.d.ts → connection-0c5eeb14.d.ts} +1 -1
- package/dist/{connection-ec72fdb0.d.ts → connection-14675d77.d.ts} +1 -1
- package/dist/{index-d1452d8f.d.ts → index-f922ec84.d.ts} +11 -1
- package/dist/router/index.d.cts +3 -3
- package/dist/router/index.d.ts +3 -3
- package/dist/transport/impls/uds/client.cjs +21 -3
- 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 +19 -2
- 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 +21 -3
- 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 +19 -2
- 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 +43 -4
- package/dist/transport/index.d.cts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +4 -2
- package/dist/util/testHelpers.cjs +1 -0
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +3 -2
- package/package.json +1 -1
- /package/dist/{chunk-5IZ2UHWV.js → chunk-RPIDSIQG.js} +0 -0
|
@@ -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, d as Session, C as Connection } from './index-
|
|
3
|
+
import { b as TransportClientId, d as Session, C as Connection } from './index-f922ec84.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The context for services/procedures. This is used only on
|
|
@@ -16,6 +16,12 @@ import {
|
|
|
16
16
|
} from "./chunk-GZ7HCLLM.js";
|
|
17
17
|
|
|
18
18
|
// transport/events.ts
|
|
19
|
+
var ProtocolErrorType = /* @__PURE__ */ ((ProtocolErrorType2) => {
|
|
20
|
+
ProtocolErrorType2["RetriesExceeded"] = "conn_retry_exceeded";
|
|
21
|
+
ProtocolErrorType2["HandshakeFailed"] = "handshake_failed";
|
|
22
|
+
ProtocolErrorType2["UseAfterDestroy"] = "use_after_destroy";
|
|
23
|
+
return ProtocolErrorType2;
|
|
24
|
+
})(ProtocolErrorType || {});
|
|
19
25
|
var EventDispatcher = class {
|
|
20
26
|
eventListeners = {};
|
|
21
27
|
numberOfListeners(eventType) {
|
|
@@ -469,7 +475,8 @@ var Transport = class {
|
|
|
469
475
|
if (this.state === "destroyed") {
|
|
470
476
|
const err = "transport is destroyed, cant send";
|
|
471
477
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
472
|
-
|
|
478
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
479
|
+
return void 0;
|
|
473
480
|
} else if (this.state === "closed") {
|
|
474
481
|
log?.info(
|
|
475
482
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -497,6 +504,9 @@ var Transport = class {
|
|
|
497
504
|
}
|
|
498
505
|
});
|
|
499
506
|
}
|
|
507
|
+
protocolError(type, message) {
|
|
508
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
509
|
+
}
|
|
500
510
|
/**
|
|
501
511
|
* Default close implementation for transports. You should override this in the downstream
|
|
502
512
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -573,14 +583,23 @@ var ClientTransport = class extends Transport {
|
|
|
573
583
|
}
|
|
574
584
|
receiveHandshakeResponseMessage(data) {
|
|
575
585
|
const parsed = this.parseMsg(data);
|
|
576
|
-
if (!parsed)
|
|
586
|
+
if (!parsed) {
|
|
587
|
+
this.protocolError(
|
|
588
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
589
|
+
"received non-transport message"
|
|
590
|
+
);
|
|
577
591
|
return false;
|
|
592
|
+
}
|
|
578
593
|
if (!Value.Check(ControlMessageHandshakeResponseSchema, parsed.payload)) {
|
|
579
594
|
log?.warn(
|
|
580
595
|
`${this.clientId} -- received invalid handshake resp: ${JSON.stringify(
|
|
581
596
|
parsed
|
|
582
597
|
)}`
|
|
583
598
|
);
|
|
599
|
+
this.protocolError(
|
|
600
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
601
|
+
"invalid handshake resp"
|
|
602
|
+
);
|
|
584
603
|
return false;
|
|
585
604
|
}
|
|
586
605
|
if (!parsed.payload.status.ok) {
|
|
@@ -589,6 +608,10 @@ var ClientTransport = class extends Transport {
|
|
|
589
608
|
parsed
|
|
590
609
|
)}`
|
|
591
610
|
);
|
|
611
|
+
this.protocolError(
|
|
612
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
613
|
+
parsed.payload.status.reason
|
|
614
|
+
);
|
|
592
615
|
return false;
|
|
593
616
|
}
|
|
594
617
|
const instanceId = parsed.payload.status.instanceId;
|
|
@@ -627,7 +650,8 @@ var ClientTransport = class extends Transport {
|
|
|
627
650
|
if (attempt >= this.options.retryAttemptsMax) {
|
|
628
651
|
const errMsg = `connection to ${to} failed after ${attempt} attempts (${errStr}), giving up`;
|
|
629
652
|
log?.error(`${this.clientId} -- ${errMsg}`);
|
|
630
|
-
|
|
653
|
+
this.protocolError("conn_retry_exceeded" /* RetriesExceeded */, errMsg);
|
|
654
|
+
return;
|
|
631
655
|
} else {
|
|
632
656
|
const jitter = Math.floor(Math.random() * this.options.retryJitterMs);
|
|
633
657
|
const backoffMs = this.options.retryIntervalMs * 2 ** attempt + jitter;
|
|
@@ -703,8 +727,13 @@ var ServerTransport = class extends Transport {
|
|
|
703
727
|
}
|
|
704
728
|
receiveHandshakeRequestMessage(data, conn) {
|
|
705
729
|
const parsed = this.parseMsg(data);
|
|
706
|
-
if (!parsed)
|
|
730
|
+
if (!parsed) {
|
|
731
|
+
this.protocolError(
|
|
732
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
733
|
+
"received non-transport message"
|
|
734
|
+
);
|
|
707
735
|
return false;
|
|
736
|
+
}
|
|
708
737
|
if (!Value.Check(ControlMessageHandshakeRequestSchema, parsed.payload)) {
|
|
709
738
|
const responseMsg2 = handshakeResponseMessage(
|
|
710
739
|
this.clientId,
|
|
@@ -718,6 +747,10 @@ var ServerTransport = class extends Transport {
|
|
|
718
747
|
parsed
|
|
719
748
|
)}`
|
|
720
749
|
);
|
|
750
|
+
this.protocolError(
|
|
751
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
752
|
+
"invalid handshake request"
|
|
753
|
+
);
|
|
721
754
|
return false;
|
|
722
755
|
}
|
|
723
756
|
const gotVersion = parsed.payload.protocolVersion;
|
|
@@ -732,6 +765,10 @@ var ServerTransport = class extends Transport {
|
|
|
732
765
|
log?.warn(
|
|
733
766
|
`${this.clientId} -- received handshake msg with incompatible protocol version (got: ${gotVersion}, expected: ${PROTOCOL_VERSION})`
|
|
734
767
|
);
|
|
768
|
+
this.protocolError(
|
|
769
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
770
|
+
`incorrect version (got: ${gotVersion} wanted ${PROTOCOL_VERSION})`
|
|
771
|
+
);
|
|
735
772
|
return false;
|
|
736
773
|
}
|
|
737
774
|
const instanceId = parsed.payload.instanceId;
|
|
@@ -750,6 +787,7 @@ var ServerTransport = class extends Transport {
|
|
|
750
787
|
};
|
|
751
788
|
|
|
752
789
|
export {
|
|
790
|
+
ProtocolErrorType,
|
|
753
791
|
Connection,
|
|
754
792
|
defaultSessionOptions,
|
|
755
793
|
Session,
|
|
@@ -205,6 +205,11 @@ declare class Session<ConnType extends Connection> {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
type ConnectionStatus = 'connect' | 'disconnect';
|
|
208
|
+
declare const enum ProtocolErrorType {
|
|
209
|
+
RetriesExceeded = "conn_retry_exceeded",
|
|
210
|
+
HandshakeFailed = "handshake_failed",
|
|
211
|
+
UseAfterDestroy = "use_after_destroy"
|
|
212
|
+
}
|
|
208
213
|
interface EventMap {
|
|
209
214
|
message: OpaqueTransportMessage;
|
|
210
215
|
connectionStatus: {
|
|
@@ -215,6 +220,10 @@ interface EventMap {
|
|
|
215
220
|
status: ConnectionStatus;
|
|
216
221
|
session: Session<Connection>;
|
|
217
222
|
};
|
|
223
|
+
protocolError: {
|
|
224
|
+
type: ProtocolErrorType;
|
|
225
|
+
message: string;
|
|
226
|
+
};
|
|
218
227
|
}
|
|
219
228
|
type EventTypes = keyof EventMap;
|
|
220
229
|
type EventHandler<K extends EventTypes> = (event: EventMap[K]) => unknown;
|
|
@@ -367,6 +376,7 @@ declare abstract class Transport<ConnType extends Connection> {
|
|
|
367
376
|
*/
|
|
368
377
|
send(to: TransportClientId, msg: PartialTransportMessage): string | undefined;
|
|
369
378
|
sendCloseStream(to: TransportClientId, streamId: string): string | undefined;
|
|
379
|
+
protected protocolError(type: ProtocolErrorType, message: string): void;
|
|
370
380
|
/**
|
|
371
381
|
* Default close implementation for transports. You should override this in the downstream
|
|
372
382
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -418,4 +428,4 @@ declare abstract class ServerTransport<ConnType extends Connection> extends Tran
|
|
|
418
428
|
};
|
|
419
429
|
}
|
|
420
430
|
|
|
421
|
-
export { Connection as C, EventMap as E, OpaqueTransportMessage as O, PartialTransportMessage as P, ServerTransport as S, Transport as T, ClientTransport as a, TransportClientId as b, TransportOptions as c, Session as d, TransportStatus as e, TransportMessageSchema as f, OpaqueTransportMessageSchema as g, TransportMessage as h, isStreamOpen as i, isStreamClose as j, EventTypes as k, EventHandler as l };
|
|
431
|
+
export { Connection as C, EventMap as E, OpaqueTransportMessage as O, PartialTransportMessage as P, ServerTransport as S, Transport as T, ClientTransport as a, TransportClientId as b, TransportOptions as c, Session as d, TransportStatus as e, TransportMessageSchema as f, OpaqueTransportMessageSchema as g, TransportMessage as h, isStreamOpen as i, isStreamClose as j, EventTypes as k, EventHandler as l, ProtocolErrorType as m };
|
package/dist/router/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-
|
|
2
|
-
export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-
|
|
3
|
-
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
1
|
+
import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-ca6c4259.js';
|
|
2
|
+
export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-ca6c4259.js';
|
|
3
|
+
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-f922ec84.js';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
5
|
import { Static } from '@sinclair/typebox';
|
|
6
6
|
import '../types-3e5768ec.js';
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-
|
|
2
|
-
export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-
|
|
3
|
-
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
1
|
+
import { A as AnyService, P as PayloadType, b as Result, R as RiverError, S as ServiceContext, d as ProcType, e as ProcInput, f as ProcOutput, g as ProcErrors, h as ProcHasInit, i as ProcInit } from '../builder-ca6c4259.js';
|
|
2
|
+
export { E as Err, O as Ok, m as ProcHandler, k as ProcListing, a as Procedure, p as RiverErrorSchema, c as RiverUncaughtSchema, l as Service, j as ServiceBuilder, n as ServiceContextWithState, o as ServiceContextWithTransportInfo, U as UNCAUGHT_ERROR, V as ValidProcType, s as serializeService } from '../builder-ca6c4259.js';
|
|
3
|
+
import { S as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-f922ec84.js';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
5
|
import { Static } from '@sinclair/typebox';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
@@ -710,7 +710,8 @@ var Transport = class {
|
|
|
710
710
|
if (this.state === "destroyed") {
|
|
711
711
|
const err = "transport is destroyed, cant send";
|
|
712
712
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
713
|
-
|
|
713
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
714
|
+
return void 0;
|
|
714
715
|
} else if (this.state === "closed") {
|
|
715
716
|
log?.info(
|
|
716
717
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -738,6 +739,9 @@ var Transport = class {
|
|
|
738
739
|
}
|
|
739
740
|
});
|
|
740
741
|
}
|
|
742
|
+
protocolError(type, message) {
|
|
743
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
744
|
+
}
|
|
741
745
|
/**
|
|
742
746
|
* Default close implementation for transports. You should override this in the downstream
|
|
743
747
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -814,14 +818,23 @@ var ClientTransport = class extends Transport {
|
|
|
814
818
|
}
|
|
815
819
|
receiveHandshakeResponseMessage(data) {
|
|
816
820
|
const parsed = this.parseMsg(data);
|
|
817
|
-
if (!parsed)
|
|
821
|
+
if (!parsed) {
|
|
822
|
+
this.protocolError(
|
|
823
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
824
|
+
"received non-transport message"
|
|
825
|
+
);
|
|
818
826
|
return false;
|
|
827
|
+
}
|
|
819
828
|
if (!import_value.Value.Check(ControlMessageHandshakeResponseSchema, parsed.payload)) {
|
|
820
829
|
log?.warn(
|
|
821
830
|
`${this.clientId} -- received invalid handshake resp: ${JSON.stringify(
|
|
822
831
|
parsed
|
|
823
832
|
)}`
|
|
824
833
|
);
|
|
834
|
+
this.protocolError(
|
|
835
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
836
|
+
"invalid handshake resp"
|
|
837
|
+
);
|
|
825
838
|
return false;
|
|
826
839
|
}
|
|
827
840
|
if (!parsed.payload.status.ok) {
|
|
@@ -830,6 +843,10 @@ var ClientTransport = class extends Transport {
|
|
|
830
843
|
parsed
|
|
831
844
|
)}`
|
|
832
845
|
);
|
|
846
|
+
this.protocolError(
|
|
847
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
848
|
+
parsed.payload.status.reason
|
|
849
|
+
);
|
|
833
850
|
return false;
|
|
834
851
|
}
|
|
835
852
|
const instanceId = parsed.payload.status.instanceId;
|
|
@@ -868,7 +885,8 @@ var ClientTransport = class extends Transport {
|
|
|
868
885
|
if (attempt >= this.options.retryAttemptsMax) {
|
|
869
886
|
const errMsg = `connection to ${to} failed after ${attempt} attempts (${errStr}), giving up`;
|
|
870
887
|
log?.error(`${this.clientId} -- ${errMsg}`);
|
|
871
|
-
|
|
888
|
+
this.protocolError("conn_retry_exceeded" /* RetriesExceeded */, errMsg);
|
|
889
|
+
return;
|
|
872
890
|
} else {
|
|
873
891
|
const jitter = Math.floor(Math.random() * this.options.retryJitterMs);
|
|
874
892
|
const backoffMs = this.options.retryIntervalMs * 2 ** attempt + jitter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClientTransport, c as TransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as TransportOptions, b as TransportClientId } from '../../../index-f922ec84.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-0c5eeb14.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 TransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as TransportOptions, b as TransportClientId } from '../../../index-f922ec84.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-0c5eeb14.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-BSAIT634.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-IVNV5HBI.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -624,7 +624,8 @@ var Transport = class {
|
|
|
624
624
|
if (this.state === "destroyed") {
|
|
625
625
|
const err = "transport is destroyed, cant send";
|
|
626
626
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
627
|
-
|
|
627
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
628
|
+
return void 0;
|
|
628
629
|
} else if (this.state === "closed") {
|
|
629
630
|
log?.info(
|
|
630
631
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -652,6 +653,9 @@ var Transport = class {
|
|
|
652
653
|
}
|
|
653
654
|
});
|
|
654
655
|
}
|
|
656
|
+
protocolError(type, message) {
|
|
657
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
658
|
+
}
|
|
655
659
|
/**
|
|
656
660
|
* Default close implementation for transports. You should override this in the downstream
|
|
657
661
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -730,8 +734,13 @@ var ServerTransport = class extends Transport {
|
|
|
730
734
|
}
|
|
731
735
|
receiveHandshakeRequestMessage(data, conn) {
|
|
732
736
|
const parsed = this.parseMsg(data);
|
|
733
|
-
if (!parsed)
|
|
737
|
+
if (!parsed) {
|
|
738
|
+
this.protocolError(
|
|
739
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
740
|
+
"received non-transport message"
|
|
741
|
+
);
|
|
734
742
|
return false;
|
|
743
|
+
}
|
|
735
744
|
if (!import_value.Value.Check(ControlMessageHandshakeRequestSchema, parsed.payload)) {
|
|
736
745
|
const responseMsg2 = handshakeResponseMessage(
|
|
737
746
|
this.clientId,
|
|
@@ -745,6 +754,10 @@ var ServerTransport = class extends Transport {
|
|
|
745
754
|
parsed
|
|
746
755
|
)}`
|
|
747
756
|
);
|
|
757
|
+
this.protocolError(
|
|
758
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
759
|
+
"invalid handshake request"
|
|
760
|
+
);
|
|
748
761
|
return false;
|
|
749
762
|
}
|
|
750
763
|
const gotVersion = parsed.payload.protocolVersion;
|
|
@@ -759,6 +772,10 @@ var ServerTransport = class extends Transport {
|
|
|
759
772
|
log?.warn(
|
|
760
773
|
`${this.clientId} -- received handshake msg with incompatible protocol version (got: ${gotVersion}, expected: ${PROTOCOL_VERSION})`
|
|
761
774
|
);
|
|
775
|
+
this.protocolError(
|
|
776
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
777
|
+
`incorrect version (got: ${gotVersion} wanted ${PROTOCOL_VERSION})`
|
|
778
|
+
);
|
|
762
779
|
return false;
|
|
763
780
|
}
|
|
764
781
|
const instanceId = parsed.payload.instanceId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-0c5eeb14.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, c as TransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-0c5eeb14.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-BSAIT634.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-IVNV5HBI.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -616,7 +616,8 @@ var Transport = class {
|
|
|
616
616
|
if (this.state === "destroyed") {
|
|
617
617
|
const err = "transport is destroyed, cant send";
|
|
618
618
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
619
|
-
|
|
619
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
620
|
+
return void 0;
|
|
620
621
|
} else if (this.state === "closed") {
|
|
621
622
|
log?.info(
|
|
622
623
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -644,6 +645,9 @@ var Transport = class {
|
|
|
644
645
|
}
|
|
645
646
|
});
|
|
646
647
|
}
|
|
648
|
+
protocolError(type, message) {
|
|
649
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
650
|
+
}
|
|
647
651
|
/**
|
|
648
652
|
* Default close implementation for transports. You should override this in the downstream
|
|
649
653
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -720,14 +724,23 @@ var ClientTransport = class extends Transport {
|
|
|
720
724
|
}
|
|
721
725
|
receiveHandshakeResponseMessage(data) {
|
|
722
726
|
const parsed = this.parseMsg(data);
|
|
723
|
-
if (!parsed)
|
|
727
|
+
if (!parsed) {
|
|
728
|
+
this.protocolError(
|
|
729
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
730
|
+
"received non-transport message"
|
|
731
|
+
);
|
|
724
732
|
return false;
|
|
733
|
+
}
|
|
725
734
|
if (!import_value.Value.Check(ControlMessageHandshakeResponseSchema, parsed.payload)) {
|
|
726
735
|
log?.warn(
|
|
727
736
|
`${this.clientId} -- received invalid handshake resp: ${JSON.stringify(
|
|
728
737
|
parsed
|
|
729
738
|
)}`
|
|
730
739
|
);
|
|
740
|
+
this.protocolError(
|
|
741
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
742
|
+
"invalid handshake resp"
|
|
743
|
+
);
|
|
731
744
|
return false;
|
|
732
745
|
}
|
|
733
746
|
if (!parsed.payload.status.ok) {
|
|
@@ -736,6 +749,10 @@ var ClientTransport = class extends Transport {
|
|
|
736
749
|
parsed
|
|
737
750
|
)}`
|
|
738
751
|
);
|
|
752
|
+
this.protocolError(
|
|
753
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
754
|
+
parsed.payload.status.reason
|
|
755
|
+
);
|
|
739
756
|
return false;
|
|
740
757
|
}
|
|
741
758
|
const instanceId = parsed.payload.status.instanceId;
|
|
@@ -774,7 +791,8 @@ var ClientTransport = class extends Transport {
|
|
|
774
791
|
if (attempt >= this.options.retryAttemptsMax) {
|
|
775
792
|
const errMsg = `connection to ${to} failed after ${attempt} attempts (${errStr}), giving up`;
|
|
776
793
|
log?.error(`${this.clientId} -- ${errMsg}`);
|
|
777
|
-
|
|
794
|
+
this.protocolError("conn_retry_exceeded" /* RetriesExceeded */, errMsg);
|
|
795
|
+
return;
|
|
778
796
|
} else {
|
|
779
797
|
const jitter = Math.floor(Math.random() * this.options.retryJitterMs);
|
|
780
798
|
const backoffMs = this.options.retryIntervalMs * 2 ** attempt + jitter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'isomorphic-ws';
|
|
2
|
-
import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-14675d77.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 TransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-14675d77.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-FFT7PSUV.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-IVNV5HBI.js";
|
|
7
7
|
import "../../../chunk-GFRAOY75.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -624,7 +624,8 @@ var Transport = class {
|
|
|
624
624
|
if (this.state === "destroyed") {
|
|
625
625
|
const err = "transport is destroyed, cant send";
|
|
626
626
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
627
|
-
|
|
627
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
628
|
+
return void 0;
|
|
628
629
|
} else if (this.state === "closed") {
|
|
629
630
|
log?.info(
|
|
630
631
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -652,6 +653,9 @@ var Transport = class {
|
|
|
652
653
|
}
|
|
653
654
|
});
|
|
654
655
|
}
|
|
656
|
+
protocolError(type, message) {
|
|
657
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
658
|
+
}
|
|
655
659
|
/**
|
|
656
660
|
* Default close implementation for transports. You should override this in the downstream
|
|
657
661
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -730,8 +734,13 @@ var ServerTransport = class extends Transport {
|
|
|
730
734
|
}
|
|
731
735
|
receiveHandshakeRequestMessage(data, conn) {
|
|
732
736
|
const parsed = this.parseMsg(data);
|
|
733
|
-
if (!parsed)
|
|
737
|
+
if (!parsed) {
|
|
738
|
+
this.protocolError(
|
|
739
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
740
|
+
"received non-transport message"
|
|
741
|
+
);
|
|
734
742
|
return false;
|
|
743
|
+
}
|
|
735
744
|
if (!import_value.Value.Check(ControlMessageHandshakeRequestSchema, parsed.payload)) {
|
|
736
745
|
const responseMsg2 = handshakeResponseMessage(
|
|
737
746
|
this.clientId,
|
|
@@ -745,6 +754,10 @@ var ServerTransport = class extends Transport {
|
|
|
745
754
|
parsed
|
|
746
755
|
)}`
|
|
747
756
|
);
|
|
757
|
+
this.protocolError(
|
|
758
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
759
|
+
"invalid handshake request"
|
|
760
|
+
);
|
|
748
761
|
return false;
|
|
749
762
|
}
|
|
750
763
|
const gotVersion = parsed.payload.protocolVersion;
|
|
@@ -759,6 +772,10 @@ var ServerTransport = class extends Transport {
|
|
|
759
772
|
log?.warn(
|
|
760
773
|
`${this.clientId} -- received handshake msg with incompatible protocol version (got: ${gotVersion}, expected: ${PROTOCOL_VERSION})`
|
|
761
774
|
);
|
|
775
|
+
this.protocolError(
|
|
776
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
777
|
+
`incorrect version (got: ${gotVersion} wanted ${PROTOCOL_VERSION})`
|
|
778
|
+
);
|
|
762
779
|
return false;
|
|
763
780
|
}
|
|
764
781
|
const instanceId = parsed.payload.instanceId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-
|
|
1
|
+
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.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-14675d77.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, c as TransportOptions } from '../../../index-
|
|
1
|
+
import { S as ServerTransport, b as TransportClientId, c as TransportOptions } from '../../../index-f922ec84.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-14675d77.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-FFT7PSUV.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-IVNV5HBI.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
|
@@ -23,6 +23,7 @@ __export(transport_exports, {
|
|
|
23
23
|
ClientTransport: () => ClientTransport,
|
|
24
24
|
Connection: () => Connection,
|
|
25
25
|
OpaqueTransportMessageSchema: () => OpaqueTransportMessageSchema,
|
|
26
|
+
ProtocolErrorType: () => ProtocolErrorType,
|
|
26
27
|
ServerTransport: () => ServerTransport,
|
|
27
28
|
Session: () => Session,
|
|
28
29
|
Transport: () => Transport,
|
|
@@ -130,6 +131,12 @@ function isAck(controlFlag) {
|
|
|
130
131
|
var log;
|
|
131
132
|
|
|
132
133
|
// transport/events.ts
|
|
134
|
+
var ProtocolErrorType = /* @__PURE__ */ ((ProtocolErrorType2) => {
|
|
135
|
+
ProtocolErrorType2["RetriesExceeded"] = "conn_retry_exceeded";
|
|
136
|
+
ProtocolErrorType2["HandshakeFailed"] = "handshake_failed";
|
|
137
|
+
ProtocolErrorType2["UseAfterDestroy"] = "use_after_destroy";
|
|
138
|
+
return ProtocolErrorType2;
|
|
139
|
+
})(ProtocolErrorType || {});
|
|
133
140
|
var EventDispatcher = class {
|
|
134
141
|
eventListeners = {};
|
|
135
142
|
numberOfListeners(eventType) {
|
|
@@ -646,7 +653,8 @@ var Transport = class {
|
|
|
646
653
|
if (this.state === "destroyed") {
|
|
647
654
|
const err = "transport is destroyed, cant send";
|
|
648
655
|
log?.error(`${this.clientId} -- ` + err + `: ${JSON.stringify(msg)}`);
|
|
649
|
-
|
|
656
|
+
this.protocolError("use_after_destroy" /* UseAfterDestroy */, err);
|
|
657
|
+
return void 0;
|
|
650
658
|
} else if (this.state === "closed") {
|
|
651
659
|
log?.info(
|
|
652
660
|
`${this.clientId} -- transport closed when sending, discarding : ${JSON.stringify(
|
|
@@ -674,6 +682,9 @@ var Transport = class {
|
|
|
674
682
|
}
|
|
675
683
|
});
|
|
676
684
|
}
|
|
685
|
+
protocolError(type, message) {
|
|
686
|
+
this.eventDispatcher.dispatchEvent("protocolError", { type, message });
|
|
687
|
+
}
|
|
677
688
|
/**
|
|
678
689
|
* Default close implementation for transports. You should override this in the downstream
|
|
679
690
|
* implementation if you need to do any additional cleanup and call super.close() at the end.
|
|
@@ -750,14 +761,23 @@ var ClientTransport = class extends Transport {
|
|
|
750
761
|
}
|
|
751
762
|
receiveHandshakeResponseMessage(data) {
|
|
752
763
|
const parsed = this.parseMsg(data);
|
|
753
|
-
if (!parsed)
|
|
764
|
+
if (!parsed) {
|
|
765
|
+
this.protocolError(
|
|
766
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
767
|
+
"received non-transport message"
|
|
768
|
+
);
|
|
754
769
|
return false;
|
|
770
|
+
}
|
|
755
771
|
if (!import_value.Value.Check(ControlMessageHandshakeResponseSchema, parsed.payload)) {
|
|
756
772
|
log?.warn(
|
|
757
773
|
`${this.clientId} -- received invalid handshake resp: ${JSON.stringify(
|
|
758
774
|
parsed
|
|
759
775
|
)}`
|
|
760
776
|
);
|
|
777
|
+
this.protocolError(
|
|
778
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
779
|
+
"invalid handshake resp"
|
|
780
|
+
);
|
|
761
781
|
return false;
|
|
762
782
|
}
|
|
763
783
|
if (!parsed.payload.status.ok) {
|
|
@@ -766,6 +786,10 @@ var ClientTransport = class extends Transport {
|
|
|
766
786
|
parsed
|
|
767
787
|
)}`
|
|
768
788
|
);
|
|
789
|
+
this.protocolError(
|
|
790
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
791
|
+
parsed.payload.status.reason
|
|
792
|
+
);
|
|
769
793
|
return false;
|
|
770
794
|
}
|
|
771
795
|
const instanceId = parsed.payload.status.instanceId;
|
|
@@ -804,7 +828,8 @@ var ClientTransport = class extends Transport {
|
|
|
804
828
|
if (attempt >= this.options.retryAttemptsMax) {
|
|
805
829
|
const errMsg = `connection to ${to} failed after ${attempt} attempts (${errStr}), giving up`;
|
|
806
830
|
log?.error(`${this.clientId} -- ${errMsg}`);
|
|
807
|
-
|
|
831
|
+
this.protocolError("conn_retry_exceeded" /* RetriesExceeded */, errMsg);
|
|
832
|
+
return;
|
|
808
833
|
} else {
|
|
809
834
|
const jitter = Math.floor(Math.random() * this.options.retryJitterMs);
|
|
810
835
|
const backoffMs = this.options.retryIntervalMs * 2 ** attempt + jitter;
|
|
@@ -880,8 +905,13 @@ var ServerTransport = class extends Transport {
|
|
|
880
905
|
}
|
|
881
906
|
receiveHandshakeRequestMessage(data, conn) {
|
|
882
907
|
const parsed = this.parseMsg(data);
|
|
883
|
-
if (!parsed)
|
|
908
|
+
if (!parsed) {
|
|
909
|
+
this.protocolError(
|
|
910
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
911
|
+
"received non-transport message"
|
|
912
|
+
);
|
|
884
913
|
return false;
|
|
914
|
+
}
|
|
885
915
|
if (!import_value.Value.Check(ControlMessageHandshakeRequestSchema, parsed.payload)) {
|
|
886
916
|
const responseMsg2 = handshakeResponseMessage(
|
|
887
917
|
this.clientId,
|
|
@@ -895,6 +925,10 @@ var ServerTransport = class extends Transport {
|
|
|
895
925
|
parsed
|
|
896
926
|
)}`
|
|
897
927
|
);
|
|
928
|
+
this.protocolError(
|
|
929
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
930
|
+
"invalid handshake request"
|
|
931
|
+
);
|
|
898
932
|
return false;
|
|
899
933
|
}
|
|
900
934
|
const gotVersion = parsed.payload.protocolVersion;
|
|
@@ -909,6 +943,10 @@ var ServerTransport = class extends Transport {
|
|
|
909
943
|
log?.warn(
|
|
910
944
|
`${this.clientId} -- received handshake msg with incompatible protocol version (got: ${gotVersion}, expected: ${PROTOCOL_VERSION})`
|
|
911
945
|
);
|
|
946
|
+
this.protocolError(
|
|
947
|
+
"handshake_failed" /* HandshakeFailed */,
|
|
948
|
+
`incorrect version (got: ${gotVersion} wanted ${PROTOCOL_VERSION})`
|
|
949
|
+
);
|
|
912
950
|
return false;
|
|
913
951
|
}
|
|
914
952
|
const instanceId = parsed.payload.instanceId;
|
|
@@ -930,6 +968,7 @@ var ServerTransport = class extends Transport {
|
|
|
930
968
|
ClientTransport,
|
|
931
969
|
Connection,
|
|
932
970
|
OpaqueTransportMessageSchema,
|
|
971
|
+
ProtocolErrorType,
|
|
933
972
|
ServerTransport,
|
|
934
973
|
Session,
|
|
935
974
|
Transport,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, m as ProtocolErrorType, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-f922ec84.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, C as Connection, l as EventHandler, E as EventMap, k as EventTypes, O as OpaqueTransportMessage, g as OpaqueTransportMessageSchema, m as ProtocolErrorType, S as ServerTransport, d as Session, T as Transport, b as TransportClientId, h as TransportMessage, f as TransportMessageSchema, c as TransportOptions, e as TransportStatus, j as isStreamClose, i as isStreamOpen } from '../index-f922ec84.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
package/dist/transport/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-RPIDSIQG.js";
|
|
2
2
|
import {
|
|
3
3
|
ClientTransport,
|
|
4
4
|
Connection,
|
|
5
|
+
ProtocolErrorType,
|
|
5
6
|
ServerTransport,
|
|
6
7
|
Session,
|
|
7
8
|
Transport
|
|
8
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-IVNV5HBI.js";
|
|
9
10
|
import {
|
|
10
11
|
OpaqueTransportMessageSchema,
|
|
11
12
|
TransportMessageSchema
|
|
@@ -16,6 +17,7 @@ export {
|
|
|
16
17
|
ClientTransport,
|
|
17
18
|
Connection,
|
|
18
19
|
OpaqueTransportMessageSchema,
|
|
20
|
+
ProtocolErrorType,
|
|
19
21
|
ServerTransport,
|
|
20
22
|
Session,
|
|
21
23
|
Transport,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as it_pushable from 'it-pushable';
|
|
2
2
|
import WebSocket from 'isomorphic-ws';
|
|
3
3
|
import http from 'node:http';
|
|
4
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
5
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-
|
|
4
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-f922ec84.js';
|
|
5
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-ca6c4259.js';
|
|
6
6
|
import { Static } from '@sinclair/typebox';
|
|
7
7
|
import net from 'node:net';
|
|
8
8
|
import '../types-3e5768ec.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as it_pushable from 'it-pushable';
|
|
2
2
|
import WebSocket from 'isomorphic-ws';
|
|
3
3
|
import http from 'node:http';
|
|
4
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-
|
|
5
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-
|
|
4
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage } from '../index-f922ec84.js';
|
|
5
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema } from '../builder-ca6c4259.js';
|
|
6
6
|
import { Static } from '@sinclair/typebox';
|
|
7
7
|
import net from 'node:net';
|
|
8
8
|
import '../types-3e5768ec.js';
|
package/dist/util/testHelpers.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
UNCAUGHT_ERROR,
|
|
3
3
|
pushable
|
|
4
4
|
} from "../chunk-KWXQLQAF.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-RPIDSIQG.js";
|
|
6
6
|
import {
|
|
7
7
|
Session,
|
|
8
8
|
defaultSessionOptions
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-IVNV5HBI.js";
|
|
10
10
|
import {
|
|
11
11
|
coerceErrorString
|
|
12
12
|
} from "../chunk-GFRAOY75.js";
|
|
@@ -68,6 +68,7 @@ async function waitForMessage(t, filter, rejectMismatch) {
|
|
|
68
68
|
cleanup();
|
|
69
69
|
resolve(msg.payload);
|
|
70
70
|
} else if (rejectMismatch) {
|
|
71
|
+
cleanup();
|
|
71
72
|
reject(new Error("message didnt match the filter"));
|
|
72
73
|
}
|
|
73
74
|
}
|
package/package.json
CHANGED
|
File without changes
|