@dxos/teleport 0.3.9-main.ee9a520 → 0.3.9-main.ef334cd
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/lib/browser/{chunk-2FV5BKLH.mjs → chunk-CZZOJEEL.mjs} +95 -62
- package/dist/lib/browser/chunk-CZZOJEEL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-GK3YA6TG.cjs → chunk-SJ6CXLWF.cjs} +93 -60
- package/dist/lib/node/chunk-SJ6CXLWF.cjs.map +7 -0
- package/dist/lib/node/index.cjs +11 -11
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +6 -6
- package/dist/lib/node/testing/index.cjs.map +1 -1
- package/dist/types/src/muxing/muxer.d.ts +5 -1
- package/dist/types/src/muxing/muxer.d.ts.map +1 -1
- package/dist/types/src/teleport.d.ts +3 -1
- package/dist/types/src/teleport.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/muxing/muxer.ts +29 -17
- package/src/teleport.ts +13 -2
- package/src/testing/test-builder.ts +1 -1
- package/dist/lib/browser/chunk-2FV5BKLH.mjs.map +0 -7
- package/dist/lib/node/chunk-GK3YA6TG.cjs.map +0 -7
|
@@ -12,7 +12,7 @@ import { Context as Context3 } from "@dxos/context";
|
|
|
12
12
|
import { failUndefined as failUndefined2 } from "@dxos/debug";
|
|
13
13
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
14
14
|
import { PublicKey } from "@dxos/keys";
|
|
15
|
-
import { log as log5 } from "@dxos/log";
|
|
15
|
+
import { log as log5, logInfo as logInfo2 } from "@dxos/log";
|
|
16
16
|
import { RpcClosedError as RpcClosedError2, TimeoutError as TimeoutError2 } from "@dxos/protocols";
|
|
17
17
|
|
|
18
18
|
// packages/core/mesh/teleport/src/control-extension.ts
|
|
@@ -325,11 +325,11 @@ var encodeFrame = (payload) => {
|
|
|
325
325
|
|
|
326
326
|
// packages/core/mesh/teleport/src/muxing/muxer.ts
|
|
327
327
|
import { Duplex as Duplex2 } from "@dxos/node-std/stream";
|
|
328
|
-
import { scheduleTaskInterval as scheduleTaskInterval2, Event as Event3, Trigger } from "@dxos/async";
|
|
328
|
+
import { scheduleTaskInterval as scheduleTaskInterval2, Event as Event3, Trigger, asyncTimeout as asyncTimeout2 } from "@dxos/async";
|
|
329
329
|
import { Context as Context2 } from "@dxos/context";
|
|
330
330
|
import { failUndefined } from "@dxos/debug";
|
|
331
331
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
332
|
-
import { log as log4 } from "@dxos/log";
|
|
332
|
+
import { log as log4, logInfo } from "@dxos/log";
|
|
333
333
|
import { schema as schema2, TimeoutError } from "@dxos/protocols";
|
|
334
334
|
|
|
335
335
|
// packages/core/mesh/teleport/src/muxing/balancer.ts
|
|
@@ -542,6 +542,16 @@ var decodeChunk = (data, withLength) => {
|
|
|
542
542
|
};
|
|
543
543
|
|
|
544
544
|
// packages/core/mesh/teleport/src/muxing/muxer.ts
|
|
545
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
546
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
547
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
548
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
549
|
+
else
|
|
550
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
551
|
+
if (d = decorators[i])
|
|
552
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
553
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
554
|
+
}
|
|
545
555
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/muxer.ts";
|
|
546
556
|
var Command = schema2.getCodecForType("dxos.mesh.muxer.Command");
|
|
547
557
|
var DEFAULT_SEND_COMMAND_TIMEOUT = 6e4;
|
|
@@ -569,6 +579,12 @@ var Muxer = class {
|
|
|
569
579
|
await this._handleCommand(Command.decode(msg));
|
|
570
580
|
});
|
|
571
581
|
}
|
|
582
|
+
setSessionId(sessionId) {
|
|
583
|
+
this._sessionId = sessionId;
|
|
584
|
+
}
|
|
585
|
+
get sessionIdString() {
|
|
586
|
+
return this._sessionId ? this._sessionId.truncate() : "none";
|
|
587
|
+
}
|
|
572
588
|
/**
|
|
573
589
|
* Creates a duplex Node.js-style stream.
|
|
574
590
|
* The remote peer is expected to call `createStream` with the same tag.
|
|
@@ -582,7 +598,7 @@ var Muxer = class {
|
|
|
582
598
|
});
|
|
583
599
|
invariant3(!channel.push, `Channel already open: ${tag}`, {
|
|
584
600
|
F: __dxlog_file4,
|
|
585
|
-
L:
|
|
601
|
+
L: 151,
|
|
586
602
|
S: this,
|
|
587
603
|
A: [
|
|
588
604
|
"!channel.push",
|
|
@@ -601,7 +617,15 @@ var Muxer = class {
|
|
|
601
617
|
stream.push(data);
|
|
602
618
|
};
|
|
603
619
|
channel.destroy = (err) => {
|
|
604
|
-
|
|
620
|
+
if (err) {
|
|
621
|
+
if (stream.listeners("error").length > 0) {
|
|
622
|
+
stream.destroy(err);
|
|
623
|
+
} else {
|
|
624
|
+
stream.destroy();
|
|
625
|
+
}
|
|
626
|
+
} else {
|
|
627
|
+
stream.destroy();
|
|
628
|
+
}
|
|
605
629
|
};
|
|
606
630
|
try {
|
|
607
631
|
await this._sendCommand({
|
|
@@ -630,7 +654,7 @@ var Muxer = class {
|
|
|
630
654
|
});
|
|
631
655
|
invariant3(!channel.push, `Channel already open: ${tag}`, {
|
|
632
656
|
F: __dxlog_file4,
|
|
633
|
-
L:
|
|
657
|
+
L: 211,
|
|
634
658
|
S: this,
|
|
635
659
|
A: [
|
|
636
660
|
"!channel.push",
|
|
@@ -654,7 +678,7 @@ var Muxer = class {
|
|
|
654
678
|
subscribe: (cb) => {
|
|
655
679
|
invariant3(!callback, "Only one subscriber is allowed", {
|
|
656
680
|
F: __dxlog_file4,
|
|
657
|
-
L:
|
|
681
|
+
L: 233,
|
|
658
682
|
S: this,
|
|
659
683
|
A: [
|
|
660
684
|
"!callback",
|
|
@@ -687,7 +711,7 @@ var Muxer = class {
|
|
|
687
711
|
if (this._destroying) {
|
|
688
712
|
log4("already destroying, ignoring graceful close request", void 0, {
|
|
689
713
|
F: __dxlog_file4,
|
|
690
|
-
L:
|
|
714
|
+
L: 266,
|
|
691
715
|
S: this,
|
|
692
716
|
C: (f, a) => f(...a)
|
|
693
717
|
});
|
|
@@ -696,7 +720,7 @@ var Muxer = class {
|
|
|
696
720
|
if (this._closing) {
|
|
697
721
|
log4("already closing, ignoring graceful close request", void 0, {
|
|
698
722
|
F: __dxlog_file4,
|
|
699
|
-
L:
|
|
723
|
+
L: 270,
|
|
700
724
|
S: this,
|
|
701
725
|
C: (f, a) => f(...a)
|
|
702
726
|
});
|
|
@@ -712,29 +736,20 @@ var Muxer = class {
|
|
|
712
736
|
err: err2
|
|
713
737
|
}, {
|
|
714
738
|
F: __dxlog_file4,
|
|
715
|
-
L:
|
|
739
|
+
L: 285,
|
|
716
740
|
S: this,
|
|
717
741
|
C: (f, a) => f(...a)
|
|
718
742
|
});
|
|
719
|
-
await this.
|
|
743
|
+
await this._dispose(err2);
|
|
720
744
|
});
|
|
721
|
-
await
|
|
722
|
-
new Promise((_resolve, reject) => {
|
|
723
|
-
setTimeout(() => {
|
|
724
|
-
reject(new TimeoutError("gracefully closing muxer"));
|
|
725
|
-
}, GRACEFUL_CLOSE_TIMEOUT);
|
|
726
|
-
}),
|
|
727
|
-
(async () => {
|
|
728
|
-
await this.dispose(err);
|
|
729
|
-
})()
|
|
730
|
-
]);
|
|
745
|
+
await asyncTimeout2(this._dispose(err), GRACEFUL_CLOSE_TIMEOUT, new TimeoutError("gracefully closing muxer"));
|
|
731
746
|
}
|
|
732
747
|
// force close without confirmation
|
|
733
748
|
async destroy(err) {
|
|
734
749
|
if (this._destroying) {
|
|
735
750
|
log4("already destroying, ignoring destroy request", void 0, {
|
|
736
751
|
F: __dxlog_file4,
|
|
737
|
-
L:
|
|
752
|
+
L: 298,
|
|
738
753
|
S: this,
|
|
739
754
|
C: (f, a) => f(...a)
|
|
740
755
|
});
|
|
@@ -745,7 +760,7 @@ var Muxer = class {
|
|
|
745
760
|
if (this._closing) {
|
|
746
761
|
log4("destroy cancelling graceful close", void 0, {
|
|
747
762
|
F: __dxlog_file4,
|
|
748
|
-
L:
|
|
763
|
+
L: 304,
|
|
749
764
|
S: this,
|
|
750
765
|
C: (f, a) => f(...a)
|
|
751
766
|
});
|
|
@@ -760,29 +775,29 @@ var Muxer = class {
|
|
|
760
775
|
err: err2
|
|
761
776
|
}, {
|
|
762
777
|
F: __dxlog_file4,
|
|
763
|
-
L:
|
|
778
|
+
L: 317,
|
|
764
779
|
S: this,
|
|
765
780
|
C: (f, a) => f(...a)
|
|
766
781
|
});
|
|
767
782
|
});
|
|
768
783
|
}
|
|
769
|
-
this.
|
|
784
|
+
this._dispose(err).catch((err2) => {
|
|
770
785
|
log4("error disposing after destroy", {
|
|
771
786
|
err: err2
|
|
772
787
|
}, {
|
|
773
788
|
F: __dxlog_file4,
|
|
774
|
-
L:
|
|
789
|
+
L: 322,
|
|
775
790
|
S: this,
|
|
776
791
|
C: (f, a) => f(...a)
|
|
777
792
|
});
|
|
778
793
|
});
|
|
779
794
|
}
|
|
780
795
|
// complete the termination, graceful or otherwise
|
|
781
|
-
async
|
|
796
|
+
async _dispose(err) {
|
|
782
797
|
if (this._disposed) {
|
|
783
798
|
log4("already destroyed, ignoring dispose request", void 0, {
|
|
784
799
|
F: __dxlog_file4,
|
|
785
|
-
L:
|
|
800
|
+
L: 330,
|
|
786
801
|
S: this,
|
|
787
802
|
C: (f, a) => f(...a)
|
|
788
803
|
});
|
|
@@ -794,6 +809,7 @@ var Muxer = class {
|
|
|
794
809
|
channel.destroy?.(err);
|
|
795
810
|
}
|
|
796
811
|
this._disposed = true;
|
|
812
|
+
await this._emitStats();
|
|
797
813
|
this.afterClosed.emit(err);
|
|
798
814
|
this._channelsByLocalId.clear();
|
|
799
815
|
this._channelsByTag.clear();
|
|
@@ -804,7 +820,7 @@ var Muxer = class {
|
|
|
804
820
|
cmd
|
|
805
821
|
}, {
|
|
806
822
|
F: __dxlog_file4,
|
|
807
|
-
L:
|
|
823
|
+
L: 353,
|
|
808
824
|
S: this,
|
|
809
825
|
C: (f, a) => f(...a)
|
|
810
826
|
});
|
|
@@ -814,15 +830,15 @@ var Muxer = class {
|
|
|
814
830
|
if (!this._closing) {
|
|
815
831
|
log4("received peer close, initiating my own graceful close", void 0, {
|
|
816
832
|
F: __dxlog_file4,
|
|
817
|
-
L:
|
|
833
|
+
L: 359,
|
|
818
834
|
S: this,
|
|
819
835
|
C: (f, a) => f(...a)
|
|
820
836
|
});
|
|
821
|
-
await this.close();
|
|
837
|
+
await this.close(new Error("received peer close"));
|
|
822
838
|
} else {
|
|
823
839
|
log4("received close from peer, already closing", void 0, {
|
|
824
840
|
F: __dxlog_file4,
|
|
825
|
-
L:
|
|
841
|
+
L: 362,
|
|
826
842
|
S: this,
|
|
827
843
|
C: (f, a) => f(...a)
|
|
828
844
|
});
|
|
@@ -851,7 +867,7 @@ var Muxer = class {
|
|
|
851
867
|
tag: stream.tag
|
|
852
868
|
}, {
|
|
853
869
|
F: __dxlog_file4,
|
|
854
|
-
L:
|
|
870
|
+
L: 391,
|
|
855
871
|
S: this,
|
|
856
872
|
C: (f, a) => f(...a)
|
|
857
873
|
});
|
|
@@ -866,7 +882,7 @@ var Muxer = class {
|
|
|
866
882
|
cmd
|
|
867
883
|
}, {
|
|
868
884
|
F: __dxlog_file4,
|
|
869
|
-
L:
|
|
885
|
+
L: 400,
|
|
870
886
|
S: this,
|
|
871
887
|
C: (f, a) => f(...a)
|
|
872
888
|
});
|
|
@@ -914,7 +930,7 @@ var Muxer = class {
|
|
|
914
930
|
threshold: MAX_SAFE_FRAME_SIZE
|
|
915
931
|
}, {
|
|
916
932
|
F: __dxlog_file4,
|
|
917
|
-
L:
|
|
933
|
+
L: 441,
|
|
918
934
|
S: this,
|
|
919
935
|
C: (f, a) => f(...a)
|
|
920
936
|
});
|
|
@@ -989,9 +1005,12 @@ var Muxer = class {
|
|
|
989
1005
|
this.statsUpdated.emit(this._lastStats);
|
|
990
1006
|
}
|
|
991
1007
|
};
|
|
1008
|
+
_ts_decorate([
|
|
1009
|
+
logInfo
|
|
1010
|
+
], Muxer.prototype, "sessionIdString", null);
|
|
992
1011
|
|
|
993
1012
|
// packages/core/mesh/teleport/src/teleport.ts
|
|
994
|
-
function
|
|
1013
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
995
1014
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
996
1015
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
997
1016
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1011,7 +1030,7 @@ var Teleport = class {
|
|
|
1011
1030
|
void this.destroy(err).catch(() => {
|
|
1012
1031
|
log5.error("Error during destroy", err, {
|
|
1013
1032
|
F: __dxlog_file5,
|
|
1014
|
-
L:
|
|
1033
|
+
L: 39,
|
|
1015
1034
|
S: this,
|
|
1016
1035
|
C: (f, a) => f(...a)
|
|
1017
1036
|
});
|
|
@@ -1026,7 +1045,7 @@ var Teleport = class {
|
|
|
1026
1045
|
this._aborting = false;
|
|
1027
1046
|
invariant4(typeof initiator === "boolean", void 0, {
|
|
1028
1047
|
F: __dxlog_file5,
|
|
1029
|
-
L:
|
|
1048
|
+
L: 56,
|
|
1030
1049
|
S: this,
|
|
1031
1050
|
A: [
|
|
1032
1051
|
"typeof initiator === 'boolean'",
|
|
@@ -1035,7 +1054,7 @@ var Teleport = class {
|
|
|
1035
1054
|
});
|
|
1036
1055
|
invariant4(PublicKey.isPublicKey(localPeerId), void 0, {
|
|
1037
1056
|
F: __dxlog_file5,
|
|
1038
|
-
L:
|
|
1057
|
+
L: 57,
|
|
1039
1058
|
S: this,
|
|
1040
1059
|
A: [
|
|
1041
1060
|
"PublicKey.isPublicKey(localPeerId)",
|
|
@@ -1044,7 +1063,7 @@ var Teleport = class {
|
|
|
1044
1063
|
});
|
|
1045
1064
|
invariant4(PublicKey.isPublicKey(remotePeerId), void 0, {
|
|
1046
1065
|
F: __dxlog_file5,
|
|
1047
|
-
L:
|
|
1066
|
+
L: 58,
|
|
1048
1067
|
S: this,
|
|
1049
1068
|
A: [
|
|
1050
1069
|
"PublicKey.isPublicKey(remotePeerId)",
|
|
@@ -1063,13 +1082,13 @@ var Teleport = class {
|
|
|
1063
1082
|
}
|
|
1064
1083
|
log5.info("abort teleport due to onTimeout in ControlExtension", void 0, {
|
|
1065
1084
|
F: __dxlog_file5,
|
|
1066
|
-
L:
|
|
1085
|
+
L: 71,
|
|
1067
1086
|
S: this,
|
|
1068
1087
|
C: (f, a) => f(...a)
|
|
1069
1088
|
});
|
|
1070
1089
|
this.abort(new TimeoutError2("control extension")).catch((err) => log5.catch(err, void 0, {
|
|
1071
1090
|
F: __dxlog_file5,
|
|
1072
|
-
L:
|
|
1091
|
+
L: 72,
|
|
1073
1092
|
S: this,
|
|
1074
1093
|
C: (f, a) => f(...a)
|
|
1075
1094
|
}));
|
|
@@ -1080,13 +1099,13 @@ var Teleport = class {
|
|
|
1080
1099
|
name
|
|
1081
1100
|
}, {
|
|
1082
1101
|
F: __dxlog_file5,
|
|
1083
|
-
L:
|
|
1102
|
+
L: 80,
|
|
1084
1103
|
S: this,
|
|
1085
1104
|
C: (f, a) => f(...a)
|
|
1086
1105
|
});
|
|
1087
1106
|
invariant4(!this._remoteExtensions.has(name), "Remote extension already exists", {
|
|
1088
1107
|
F: __dxlog_file5,
|
|
1089
|
-
L:
|
|
1108
|
+
L: 81,
|
|
1090
1109
|
S: this,
|
|
1091
1110
|
A: [
|
|
1092
1111
|
"!this._remoteExtensions.has(name)",
|
|
@@ -1107,7 +1126,7 @@ var Teleport = class {
|
|
|
1107
1126
|
if (this._destroying || this._aborting) {
|
|
1108
1127
|
log5("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
|
|
1109
1128
|
F: __dxlog_file5,
|
|
1110
|
-
L:
|
|
1129
|
+
L: 97,
|
|
1111
1130
|
S: this,
|
|
1112
1131
|
C: (f, a) => f(...a)
|
|
1113
1132
|
});
|
|
@@ -1130,12 +1149,15 @@ var Teleport = class {
|
|
|
1130
1149
|
channels: stats.channels
|
|
1131
1150
|
}, {
|
|
1132
1151
|
F: __dxlog_file5,
|
|
1133
|
-
L:
|
|
1152
|
+
L: 110,
|
|
1134
1153
|
S: this,
|
|
1135
1154
|
C: (f, a) => f(...a)
|
|
1136
1155
|
});
|
|
1137
1156
|
});
|
|
1138
1157
|
}
|
|
1158
|
+
get sessionIdString() {
|
|
1159
|
+
return this._sessionId ? this._sessionId.truncate() : "none";
|
|
1160
|
+
}
|
|
1139
1161
|
get stream() {
|
|
1140
1162
|
return this._muxer.stream;
|
|
1141
1163
|
}
|
|
@@ -1145,10 +1167,18 @@ var Teleport = class {
|
|
|
1145
1167
|
/**
|
|
1146
1168
|
* Blocks until the handshake is complete.
|
|
1147
1169
|
*/
|
|
1148
|
-
async open() {
|
|
1170
|
+
async open(sessionId = PublicKey.random()) {
|
|
1171
|
+
this._sessionId = sessionId;
|
|
1172
|
+
log5("open", void 0, {
|
|
1173
|
+
F: __dxlog_file5,
|
|
1174
|
+
L: 144,
|
|
1175
|
+
S: this,
|
|
1176
|
+
C: (f, a) => f(...a)
|
|
1177
|
+
});
|
|
1149
1178
|
this._setExtension("dxos.mesh.teleport.control", this._control);
|
|
1150
1179
|
await this._openExtension("dxos.mesh.teleport.control");
|
|
1151
1180
|
this._open = true;
|
|
1181
|
+
this._muxer.setSessionId(sessionId);
|
|
1152
1182
|
}
|
|
1153
1183
|
async close(err) {
|
|
1154
1184
|
await this.destroy(err);
|
|
@@ -1168,7 +1198,7 @@ var Teleport = class {
|
|
|
1168
1198
|
} catch (err2) {
|
|
1169
1199
|
log5.catch(err2, void 0, {
|
|
1170
1200
|
F: __dxlog_file5,
|
|
1171
|
-
L:
|
|
1201
|
+
L: 173,
|
|
1172
1202
|
S: this,
|
|
1173
1203
|
C: (f, a) => f(...a)
|
|
1174
1204
|
});
|
|
@@ -1191,7 +1221,7 @@ var Teleport = class {
|
|
|
1191
1221
|
} catch (err2) {
|
|
1192
1222
|
log5.catch(err2, void 0, {
|
|
1193
1223
|
F: __dxlog_file5,
|
|
1194
|
-
L:
|
|
1224
|
+
L: 197,
|
|
1195
1225
|
S: this,
|
|
1196
1226
|
C: (f, a) => f(...a)
|
|
1197
1227
|
});
|
|
@@ -1207,7 +1237,7 @@ var Teleport = class {
|
|
|
1207
1237
|
name
|
|
1208
1238
|
}, {
|
|
1209
1239
|
F: __dxlog_file5,
|
|
1210
|
-
L:
|
|
1240
|
+
L: 209,
|
|
1211
1241
|
S: this,
|
|
1212
1242
|
C: (f, a) => f(...a)
|
|
1213
1243
|
});
|
|
@@ -1231,7 +1261,7 @@ var Teleport = class {
|
|
|
1231
1261
|
_setExtension(extensionName, extension) {
|
|
1232
1262
|
invariant4(!extensionName.includes("/"), "Invalid extension name", {
|
|
1233
1263
|
F: __dxlog_file5,
|
|
1234
|
-
L:
|
|
1264
|
+
L: 233,
|
|
1235
1265
|
S: this,
|
|
1236
1266
|
A: [
|
|
1237
1267
|
"!extensionName.includes('/')",
|
|
@@ -1240,7 +1270,7 @@ var Teleport = class {
|
|
|
1240
1270
|
});
|
|
1241
1271
|
invariant4(!this._extensions.has(extensionName), "Extension already exists", {
|
|
1242
1272
|
F: __dxlog_file5,
|
|
1243
|
-
L:
|
|
1273
|
+
L: 234,
|
|
1244
1274
|
S: this,
|
|
1245
1275
|
A: [
|
|
1246
1276
|
"!this._extensions.has(extensionName)",
|
|
@@ -1254,7 +1284,7 @@ var Teleport = class {
|
|
|
1254
1284
|
extensionName
|
|
1255
1285
|
}, {
|
|
1256
1286
|
F: __dxlog_file5,
|
|
1257
|
-
L:
|
|
1287
|
+
L: 239,
|
|
1258
1288
|
S: this,
|
|
1259
1289
|
C: (f, a) => f(...a)
|
|
1260
1290
|
});
|
|
@@ -1266,7 +1296,7 @@ var Teleport = class {
|
|
|
1266
1296
|
createPort: async (channelName, opts) => {
|
|
1267
1297
|
invariant4(!channelName.includes("/"), "Invalid channel name", {
|
|
1268
1298
|
F: __dxlog_file5,
|
|
1269
|
-
L:
|
|
1299
|
+
L: 247,
|
|
1270
1300
|
S: this,
|
|
1271
1301
|
A: [
|
|
1272
1302
|
"!channelName.includes('/')",
|
|
@@ -1278,7 +1308,7 @@ var Teleport = class {
|
|
|
1278
1308
|
createStream: async (channelName, opts) => {
|
|
1279
1309
|
invariant4(!channelName.includes("/"), "Invalid channel name", {
|
|
1280
1310
|
F: __dxlog_file5,
|
|
1281
|
-
L:
|
|
1311
|
+
L: 251,
|
|
1282
1312
|
S: this,
|
|
1283
1313
|
A: [
|
|
1284
1314
|
"!channelName.includes('/')",
|
|
@@ -1298,16 +1328,19 @@ var Teleport = class {
|
|
|
1298
1328
|
extensionName
|
|
1299
1329
|
}, {
|
|
1300
1330
|
F: __dxlog_file5,
|
|
1301
|
-
L:
|
|
1331
|
+
L: 262,
|
|
1302
1332
|
S: this,
|
|
1303
1333
|
C: (f, a) => f(...a)
|
|
1304
1334
|
});
|
|
1305
1335
|
}
|
|
1306
1336
|
};
|
|
1307
|
-
|
|
1337
|
+
_ts_decorate2([
|
|
1338
|
+
logInfo2
|
|
1339
|
+
], Teleport.prototype, "sessionIdString", null);
|
|
1340
|
+
_ts_decorate2([
|
|
1308
1341
|
synchronized
|
|
1309
1342
|
], Teleport.prototype, "abort", null);
|
|
1310
|
-
|
|
1343
|
+
_ts_decorate2([
|
|
1311
1344
|
synchronized
|
|
1312
1345
|
], Teleport.prototype, "destroy", null);
|
|
1313
1346
|
|
|
@@ -1454,7 +1487,7 @@ var TestPeer = class {
|
|
|
1454
1487
|
""
|
|
1455
1488
|
]
|
|
1456
1489
|
});
|
|
1457
|
-
await connection.teleport.open();
|
|
1490
|
+
await connection.teleport.open(PublicKey2.random());
|
|
1458
1491
|
await this.onOpen(connection);
|
|
1459
1492
|
}
|
|
1460
1493
|
async closeConnection(connection) {
|
|
@@ -1513,7 +1546,7 @@ var TestConnection = class {
|
|
|
1513
1546
|
};
|
|
1514
1547
|
|
|
1515
1548
|
// packages/core/mesh/teleport/src/testing/test-extension.ts
|
|
1516
|
-
import { asyncTimeout as
|
|
1549
|
+
import { asyncTimeout as asyncTimeout3, Trigger as Trigger2 } from "@dxos/async";
|
|
1517
1550
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1518
1551
|
import { log as log7 } from "@dxos/log";
|
|
1519
1552
|
import { schema as schema3 } from "@dxos/protocols";
|
|
@@ -1597,7 +1630,7 @@ var TestExtension = class {
|
|
|
1597
1630
|
await this.open.wait({
|
|
1598
1631
|
timeout: 1500
|
|
1599
1632
|
});
|
|
1600
|
-
const res = await
|
|
1633
|
+
const res = await asyncTimeout3(this._rpc.rpc.TestService.testCall({
|
|
1601
1634
|
data: message
|
|
1602
1635
|
}), 1500);
|
|
1603
1636
|
invariant6(res.data === message, void 0, {
|
|
@@ -1890,4 +1923,4 @@ export {
|
|
|
1890
1923
|
TestExtension,
|
|
1891
1924
|
TestExtensionWithStreams
|
|
1892
1925
|
};
|
|
1893
|
-
//# sourceMappingURL=chunk-
|
|
1926
|
+
//# sourceMappingURL=chunk-CZZOJEEL.mjs.map
|