@dxos/network-manager 0.1.13 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/lib/browser/index.mjs +2127 -0
  2. package/dist/lib/browser/index.mjs.map +7 -0
  3. package/dist/lib/browser/meta.json +1 -0
  4. package/dist/lib/browser/testing/index.mjs +2197 -0
  5. package/dist/lib/browser/testing/index.mjs.map +7 -0
  6. package/dist/lib/node/index.cjs +2173 -0
  7. package/dist/lib/node/index.cjs.map +7 -0
  8. package/dist/lib/node/meta.json +1 -0
  9. package/dist/lib/node/testing/index.cjs +2225 -0
  10. package/dist/lib/node/testing/index.cjs.map +7 -0
  11. package/dist/{src → types/src}/connection-log.d.ts +0 -0
  12. package/dist/types/src/connection-log.d.ts.map +1 -0
  13. package/dist/{src → types/src}/index.d.ts +1 -0
  14. package/dist/types/src/index.d.ts.map +1 -0
  15. package/dist/{src → types/src}/network-manager.d.ts +9 -11
  16. package/dist/types/src/network-manager.d.ts.map +1 -0
  17. package/dist/{src → types/src}/protocol-factory.d.ts +11 -5
  18. package/dist/types/src/protocol-factory.d.ts.map +1 -0
  19. package/dist/{src → types/src}/signal/index.d.ts +0 -0
  20. package/dist/types/src/signal/index.d.ts.map +1 -0
  21. package/dist/{src → types/src}/signal/integration.test.d.ts +0 -0
  22. package/dist/types/src/signal/integration.test.d.ts.map +1 -0
  23. package/dist/{src → types/src}/signal/message-router.d.ts +0 -0
  24. package/dist/types/src/signal/message-router.d.ts.map +1 -0
  25. package/dist/{src → types/src}/signal/message-router.test.d.ts +0 -0
  26. package/dist/types/src/signal/message-router.test.d.ts.map +1 -0
  27. package/dist/{src → types/src}/signal/signal-connection.d.ts +0 -0
  28. package/dist/types/src/signal/signal-connection.d.ts.map +1 -0
  29. package/dist/{src → types/src}/signal/signal-messenger.d.ts +0 -0
  30. package/dist/types/src/signal/signal-messenger.d.ts.map +1 -0
  31. package/dist/{src → types/src}/swarm/connection.d.ts +5 -17
  32. package/dist/types/src/swarm/connection.d.ts.map +1 -0
  33. package/dist/{src → types/src}/swarm/index.d.ts +0 -0
  34. package/dist/types/src/swarm/index.d.ts.map +1 -0
  35. package/dist/types/src/swarm/peer.d.ts +70 -0
  36. package/dist/types/src/swarm/peer.d.ts.map +1 -0
  37. package/dist/{src → types/src}/swarm/swarm-mapper.d.ts +1 -1
  38. package/dist/types/src/swarm/swarm-mapper.d.ts.map +1 -0
  39. package/dist/{src → types/src}/swarm/swarm.d.ts +4 -8
  40. package/dist/types/src/swarm/swarm.d.ts.map +1 -0
  41. package/dist/{src → types/src}/swarm/swarm.test.d.ts +0 -0
  42. package/dist/types/src/swarm/swarm.test.d.ts.map +1 -0
  43. package/dist/{src → types/src}/testing/index.d.ts +0 -0
  44. package/dist/types/src/testing/index.d.ts.map +1 -0
  45. package/dist/{src → types/src}/testing/test-builder.d.ts +1 -1
  46. package/dist/types/src/testing/test-builder.d.ts.map +1 -0
  47. package/dist/{src → types/src}/testing/test-protocol.d.ts +2 -2
  48. package/dist/types/src/testing/test-protocol.d.ts.map +1 -0
  49. package/dist/{src → types/src}/tests/basic-test-suite.d.ts +0 -0
  50. package/dist/types/src/tests/basic-test-suite.d.ts.map +1 -0
  51. package/dist/{src → types/src}/tests/memory-transport.test.d.ts +0 -0
  52. package/dist/types/src/tests/memory-transport.test.d.ts.map +1 -0
  53. package/dist/{src → types/src}/tests/presence.test.d.ts +0 -0
  54. package/dist/types/src/tests/presence.test.d.ts.map +1 -0
  55. package/dist/{src → types/src}/tests/property-test-suite.d.ts +0 -0
  56. package/dist/types/src/tests/property-test-suite.d.ts.map +1 -0
  57. package/dist/{src → types/src}/tests/utils.d.ts +0 -0
  58. package/dist/types/src/tests/utils.d.ts.map +1 -0
  59. package/dist/{src → types/src}/tests/webrtc-transport.test.d.ts +0 -0
  60. package/dist/types/src/tests/webrtc-transport.test.d.ts.map +1 -0
  61. package/dist/{src → types/src}/topology/fully-connected-topology.d.ts +0 -0
  62. package/dist/types/src/topology/fully-connected-topology.d.ts.map +1 -0
  63. package/dist/{src → types/src}/topology/index.d.ts +0 -0
  64. package/dist/types/src/topology/index.d.ts.map +1 -0
  65. package/dist/{src → types/src}/topology/mmst-topology.d.ts +0 -0
  66. package/dist/types/src/topology/mmst-topology.d.ts.map +1 -0
  67. package/dist/{src → types/src}/topology/star-topology.d.ts +0 -0
  68. package/dist/types/src/topology/star-topology.d.ts.map +1 -0
  69. package/dist/{src → types/src}/topology/topology.d.ts +0 -0
  70. package/dist/types/src/topology/topology.d.ts.map +1 -0
  71. package/dist/{src → types/src}/transport/index.d.ts +0 -0
  72. package/dist/types/src/transport/index.d.ts.map +1 -0
  73. package/dist/{src → types/src}/transport/memory-transport.d.ts +0 -0
  74. package/dist/types/src/transport/memory-transport.d.ts.map +1 -0
  75. package/dist/{src → types/src}/transport/memory-transport.test.d.ts +0 -0
  76. package/dist/types/src/transport/memory-transport.test.d.ts.map +1 -0
  77. package/dist/{src → types/src}/transport/transport.d.ts +1 -1
  78. package/dist/types/src/transport/transport.d.ts.map +1 -0
  79. package/dist/{src → types/src}/transport/webrtc-simple-peer.test.d.ts +0 -0
  80. package/dist/types/src/transport/webrtc-simple-peer.test.d.ts.map +1 -0
  81. package/dist/{src → types/src}/transport/webrtc-transport-proxy.d.ts +1 -1
  82. package/dist/types/src/transport/webrtc-transport-proxy.d.ts.map +1 -0
  83. package/dist/{src → types/src}/transport/webrtc-transport-proxy.test.d.ts +0 -0
  84. package/dist/types/src/transport/webrtc-transport-proxy.test.d.ts.map +1 -0
  85. package/dist/{src → types/src}/transport/webrtc-transport-service.d.ts +0 -0
  86. package/dist/types/src/transport/webrtc-transport-service.d.ts.map +1 -0
  87. package/dist/{src → types/src}/transport/webrtc-transport.d.ts +1 -1
  88. package/dist/types/src/transport/webrtc-transport.d.ts.map +1 -0
  89. package/dist/{src → types/src}/transport/webrtc-transport.test.d.ts +0 -0
  90. package/dist/types/src/transport/webrtc-transport.test.d.ts.map +1 -0
  91. package/dist/{src → types/src}/transport/webrtc.d.ts +0 -0
  92. package/dist/types/src/transport/webrtc.d.ts.map +1 -0
  93. package/dist/types/src/types.d.ts +6 -0
  94. package/dist/types/src/types.d.ts.map +1 -0
  95. package/dist/types/src/wire-protocol.d.ts +37 -0
  96. package/dist/types/src/wire-protocol.d.ts.map +1 -0
  97. package/package.json +24 -22
  98. package/src/connection-log.ts +8 -8
  99. package/src/globals.d.ts +1 -1
  100. package/src/index.ts +1 -0
  101. package/src/network-manager.ts +14 -5
  102. package/src/protocol-factory.ts +7 -4
  103. package/src/signal/integration.test.ts +8 -7
  104. package/src/signal/message-router.test.ts +14 -15
  105. package/src/signal/message-router.ts +1 -1
  106. package/src/swarm/connection.ts +11 -55
  107. package/src/swarm/peer.ts +119 -30
  108. package/src/swarm/swarm.test.ts +9 -8
  109. package/src/swarm/swarm.ts +97 -116
  110. package/src/testing/test-builder.ts +4 -1
  111. package/src/testing/test-protocol.ts +1 -1
  112. package/src/tests/basic-test-suite.ts +7 -6
  113. package/src/tests/memory-transport.test.ts +1 -1
  114. package/src/tests/presence.test.ts +5 -4
  115. package/src/tests/property-test-suite.ts +4 -3
  116. package/src/tests/utils.ts +1 -1
  117. package/src/tests/webrtc-transport.test.ts +2 -2
  118. package/src/transport/memory-transport.test.ts +4 -4
  119. package/src/transport/memory-transport.ts +5 -5
  120. package/src/transport/webrtc-simple-peer.test.ts +13 -10
  121. package/src/transport/webrtc-transport-proxy.test.ts +9 -13
  122. package/src/transport/webrtc-transport-proxy.ts +1 -1
  123. package/src/transport/webrtc-transport-service.ts +2 -2
  124. package/src/transport/webrtc-transport.test.ts +4 -4
  125. package/src/transport/webrtc-transport.ts +3 -3
  126. package/src/wire-protocol.ts +75 -0
  127. package/testing.d.ts +1 -1
  128. package/testing.js +1 -1
  129. package/dist/src/connection-log.d.ts.map +0 -1
  130. package/dist/src/connection-log.js +0 -98
  131. package/dist/src/connection-log.js.map +0 -1
  132. package/dist/src/index.d.ts.map +0 -1
  133. package/dist/src/index.js +0 -28
  134. package/dist/src/index.js.map +0 -1
  135. package/dist/src/network-manager.d.ts.map +0 -1
  136. package/dist/src/network-manager.js +0 -118
  137. package/dist/src/network-manager.js.map +0 -1
  138. package/dist/src/protocol-factory.d.ts.map +0 -1
  139. package/dist/src/protocol-factory.js +0 -66
  140. package/dist/src/protocol-factory.js.map +0 -1
  141. package/dist/src/signal/index.d.ts.map +0 -1
  142. package/dist/src/signal/index.js +0 -23
  143. package/dist/src/signal/index.js.map +0 -1
  144. package/dist/src/signal/integration.test.d.ts.map +0 -1
  145. package/dist/src/signal/integration.test.js +0 -105
  146. package/dist/src/signal/integration.test.js.map +0 -1
  147. package/dist/src/signal/message-router.d.ts.map +0 -1
  148. package/dist/src/signal/message-router.js +0 -135
  149. package/dist/src/signal/message-router.js.map +0 -1
  150. package/dist/src/signal/message-router.test.d.ts.map +0 -1
  151. package/dist/src/signal/message-router.test.js +0 -211
  152. package/dist/src/signal/message-router.test.js.map +0 -1
  153. package/dist/src/signal/signal-connection.d.ts.map +0 -1
  154. package/dist/src/signal/signal-connection.js +0 -6
  155. package/dist/src/signal/signal-connection.js.map +0 -1
  156. package/dist/src/signal/signal-messenger.d.ts.map +0 -1
  157. package/dist/src/signal/signal-messenger.js +0 -6
  158. package/dist/src/signal/signal-messenger.js.map +0 -1
  159. package/dist/src/swarm/connection.d.ts.map +0 -1
  160. package/dist/src/swarm/connection.js +0 -204
  161. package/dist/src/swarm/connection.js.map +0 -1
  162. package/dist/src/swarm/index.d.ts.map +0 -1
  163. package/dist/src/swarm/index.js +0 -23
  164. package/dist/src/swarm/index.js.map +0 -1
  165. package/dist/src/swarm/peer.d.ts +0 -45
  166. package/dist/src/swarm/peer.d.ts.map +0 -1
  167. package/dist/src/swarm/peer.js +0 -113
  168. package/dist/src/swarm/peer.js.map +0 -1
  169. package/dist/src/swarm/swarm-mapper.d.ts.map +0 -1
  170. package/dist/src/swarm/swarm-mapper.js +0 -92
  171. package/dist/src/swarm/swarm-mapper.js.map +0 -1
  172. package/dist/src/swarm/swarm.d.ts.map +0 -1
  173. package/dist/src/swarm/swarm.js +0 -305
  174. package/dist/src/swarm/swarm.js.map +0 -1
  175. package/dist/src/swarm/swarm.test.d.ts.map +0 -1
  176. package/dist/src/swarm/swarm.test.js +0 -135
  177. package/dist/src/swarm/swarm.test.js.map +0 -1
  178. package/dist/src/testing/index.d.ts.map +0 -1
  179. package/dist/src/testing/index.js +0 -22
  180. package/dist/src/testing/index.js.map +0 -1
  181. package/dist/src/testing/test-builder.d.ts.map +0 -1
  182. package/dist/src/testing/test-builder.js +0 -145
  183. package/dist/src/testing/test-builder.js.map +0 -1
  184. package/dist/src/testing/test-protocol.d.ts.map +0 -1
  185. package/dist/src/testing/test-protocol.js +0 -143
  186. package/dist/src/testing/test-protocol.js.map +0 -1
  187. package/dist/src/tests/basic-test-suite.d.ts.map +0 -1
  188. package/dist/src/tests/basic-test-suite.js +0 -142
  189. package/dist/src/tests/basic-test-suite.js.map +0 -1
  190. package/dist/src/tests/memory-transport.test.d.ts.map +0 -1
  191. package/dist/src/tests/memory-transport.test.js +0 -12
  192. package/dist/src/tests/memory-transport.test.js.map +0 -1
  193. package/dist/src/tests/presence.test.d.ts.map +0 -1
  194. package/dist/src/tests/presence.test.js +0 -61
  195. package/dist/src/tests/presence.test.js.map +0 -1
  196. package/dist/src/tests/property-test-suite.d.ts.map +0 -1
  197. package/dist/src/tests/property-test-suite.js +0 -203
  198. package/dist/src/tests/property-test-suite.js.map +0 -1
  199. package/dist/src/tests/utils.d.ts.map +0 -1
  200. package/dist/src/tests/utils.js +0 -76
  201. package/dist/src/tests/utils.js.map +0 -1
  202. package/dist/src/tests/webrtc-transport.test.d.ts.map +0 -1
  203. package/dist/src/tests/webrtc-transport.test.js +0 -16
  204. package/dist/src/tests/webrtc-transport.test.js.map +0 -1
  205. package/dist/src/topology/fully-connected-topology.d.ts.map +0 -1
  206. package/dist/src/topology/fully-connected-topology.js +0 -35
  207. package/dist/src/topology/fully-connected-topology.js.map +0 -1
  208. package/dist/src/topology/index.d.ts.map +0 -1
  209. package/dist/src/topology/index.js +0 -24
  210. package/dist/src/topology/index.js.map +0 -1
  211. package/dist/src/topology/mmst-topology.d.ts.map +0 -1
  212. package/dist/src/topology/mmst-topology.js +0 -73
  213. package/dist/src/topology/mmst-topology.js.map +0 -1
  214. package/dist/src/topology/star-topology.d.ts.map +0 -1
  215. package/dist/src/topology/star-topology.js +0 -60
  216. package/dist/src/topology/star-topology.js.map +0 -1
  217. package/dist/src/topology/topology.d.ts.map +0 -1
  218. package/dist/src/topology/topology.js +0 -6
  219. package/dist/src/topology/topology.js.map +0 -1
  220. package/dist/src/transport/index.d.ts.map +0 -1
  221. package/dist/src/transport/index.js +0 -25
  222. package/dist/src/transport/index.js.map +0 -1
  223. package/dist/src/transport/memory-transport.d.ts.map +0 -1
  224. package/dist/src/transport/memory-transport.js +0 -138
  225. package/dist/src/transport/memory-transport.js.map +0 -1
  226. package/dist/src/transport/memory-transport.test.d.ts.map +0 -1
  227. package/dist/src/transport/memory-transport.test.js +0 -96
  228. package/dist/src/transport/memory-transport.test.js.map +0 -1
  229. package/dist/src/transport/transport.d.ts.map +0 -1
  230. package/dist/src/transport/transport.js +0 -6
  231. package/dist/src/transport/transport.js.map +0 -1
  232. package/dist/src/transport/webrtc-simple-peer.test.d.ts.map +0 -1
  233. package/dist/src/transport/webrtc-simple-peer.test.js +0 -24
  234. package/dist/src/transport/webrtc-simple-peer.test.js.map +0 -1
  235. package/dist/src/transport/webrtc-transport-proxy.d.ts.map +0 -1
  236. package/dist/src/transport/webrtc-transport-proxy.js +0 -139
  237. package/dist/src/transport/webrtc-transport-proxy.js.map +0 -1
  238. package/dist/src/transport/webrtc-transport-proxy.test.d.ts.map +0 -1
  239. package/dist/src/transport/webrtc-transport-proxy.test.js +0 -219
  240. package/dist/src/transport/webrtc-transport-proxy.test.js.map +0 -1
  241. package/dist/src/transport/webrtc-transport-service.d.ts.map +0 -1
  242. package/dist/src/transport/webrtc-transport-service.js +0 -93
  243. package/dist/src/transport/webrtc-transport-service.js.map +0 -1
  244. package/dist/src/transport/webrtc-transport.d.ts.map +0 -1
  245. package/dist/src/transport/webrtc-transport.js +0 -77
  246. package/dist/src/transport/webrtc-transport.js.map +0 -1
  247. package/dist/src/transport/webrtc-transport.test.d.ts.map +0 -1
  248. package/dist/src/transport/webrtc-transport.test.js +0 -91
  249. package/dist/src/transport/webrtc-transport.test.js.map +0 -1
  250. package/dist/src/transport/webrtc.d.ts.map +0 -1
  251. package/dist/src/transport/webrtc.js +0 -17
  252. package/dist/src/transport/webrtc.js.map +0 -1
  253. package/dist/src/types.d.ts +0 -6
  254. package/dist/src/types.d.ts.map +0 -1
  255. package/dist/src/types.js +0 -6
  256. package/dist/src/types.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // @dxos/mocha platform=nodejs
5
+ // @dxos/test platform=nodejs
6
6
 
7
7
  import expect from 'expect';
8
8
  import { Duplex } from 'stream';
@@ -16,13 +16,13 @@ import { schema } from '@dxos/protocols';
16
16
  import { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
17
17
  import { Signal } from '@dxos/protocols/proto/dxos/mesh/swarm';
18
18
  import { createLinkedPorts, createProtoRpcPeer, ProtoRpcPeer } from '@dxos/rpc';
19
- import { afterTest } from '@dxos/testutils';
19
+ import { afterAll, beforeAll, describe, test, afterTest } from '@dxos/test';
20
20
 
21
21
  import { TestProtocolPlugin, testProtocolProvider } from '../testing';
22
22
  import { WebRTCTransportProxy } from './webrtc-transport-proxy';
23
23
  import { WebRTCTransportService } from './webrtc-transport-service';
24
24
 
25
- describe('WebRTCTransportProxy', function () {
25
+ describe('WebRTCTransportProxy', () => {
26
26
  const setupProxy = async ({
27
27
  initiator = true,
28
28
  stream = new Duplex({ write: () => {}, read: () => {} }),
@@ -79,7 +79,7 @@ describe('WebRTCTransportProxy', function () {
79
79
  };
80
80
 
81
81
  // This doesn't clean up correctly and crashes with SIGSEGV / SIGABRT at the end. Probably an issue with wrtc package.
82
- it('open and close', async function () {
82
+ test('open and close', async () => {
83
83
  const { webRTCTransportProxy: connection } = await setupProxy();
84
84
 
85
85
  let callsCounter = 0;
@@ -98,11 +98,7 @@ describe('WebRTCTransportProxy', function () {
98
98
  .timeout(1_000)
99
99
  .retries(3);
100
100
 
101
- it('establish connection and send data through with protocol', async function () {
102
- if (mochaExecutor.environment !== 'nodejs') {
103
- this.skip();
104
- }
105
-
101
+ test('establish connection and send data through with protocol', async () => {
106
102
  const topic = PublicKey.random();
107
103
  const peer1Id = PublicKey.random();
108
104
  const peer2Id = PublicKey.random();
@@ -156,11 +152,11 @@ describe('WebRTCTransportProxy', function () {
156
152
  .timeout(2_000)
157
153
  .retries(3);
158
154
 
159
- describe('Multiplexing', function () {
155
+ describe('Multiplexing', () => {
160
156
  let service: any;
161
157
  let rpcClient: ProtoRpcPeer<{ BridgeService: BridgeService }>;
162
158
 
163
- before(async function () {
159
+ beforeAll(async () => {
164
160
  const [port1, port2] = createLinkedPorts();
165
161
 
166
162
  const webRTCTransportService: BridgeService = new WebRTCTransportService();
@@ -190,12 +186,12 @@ describe('WebRTCTransportProxy', function () {
190
186
  await rpcClient.open();
191
187
  });
192
188
 
193
- after(async function () {
189
+ afterAll(async () => {
194
190
  await service?.close();
195
191
  await rpcClient?.close();
196
192
  });
197
193
 
198
- it('establish connection and send data through with protocol', async function () {
194
+ test('establish connection and send data through with protocol', async () => {
199
195
  const topic = PublicKey.random();
200
196
  const peer1Id = PublicKey.random();
201
197
  const peer2Id = PublicKey.random();
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
 
7
7
  import { Event } from '@dxos/async';
8
8
  import { Stream } from '@dxos/codec-protobuf';
@@ -2,8 +2,8 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
6
- import { Duplex } from 'stream';
5
+ import assert from 'node:assert';
6
+ import { Duplex } from 'node:stream';
7
7
 
8
8
  import { Stream } from '@dxos/codec-protobuf';
9
9
  import { PublicKey } from '@dxos/keys';
@@ -10,14 +10,14 @@ import { sleep } from '@dxos/async';
10
10
  import { discoveryKey } from '@dxos/crypto';
11
11
  import { PublicKey } from '@dxos/keys';
12
12
  import { Protocol } from '@dxos/mesh-protocol';
13
- import { afterTest } from '@dxos/testutils';
13
+ import { describe, test, afterTest } from '@dxos/test';
14
14
 
15
15
  import { TestProtocolPlugin, testProtocolProvider } from '../testing';
16
16
  import { WebRTCTransport } from './webrtc-transport';
17
17
 
18
- describe('WebRTCTransport', function () {
18
+ describe('WebRTCTransport', () => {
19
19
  // This doesn't clean up correctly and crashes with SIGSEGV / SIGABRT at the end. Probably an issue with wrtc package.
20
- it('open and close', async function () {
20
+ test('open and close', async () => {
21
21
  const connection = new WebRTCTransport({
22
22
  initiator: true,
23
23
  stream: new Duplex(),
@@ -39,7 +39,7 @@ describe('WebRTCTransport', function () {
39
39
  .timeout(1_000)
40
40
  .retries(3);
41
41
 
42
- it('establish connection and send data through with protocol', async function () {
42
+ test('establish connection and send data through with protocol', async () => {
43
43
  const topic = PublicKey.random();
44
44
  const peer1Id = PublicKey.random();
45
45
  const peer2Id = PublicKey.random();
@@ -40,7 +40,7 @@ export class WebRTCTransport implements Transport {
40
40
 
41
41
  this._peer.on('signal', async (data) => {
42
42
  log('signal', data);
43
- await this.params.sendSignal({ json: JSON.stringify(data) });
43
+ await this.params.sendSignal({ payload: { data } });
44
44
  });
45
45
 
46
46
  this._peer.on('connect', () => {
@@ -71,8 +71,8 @@ export class WebRTCTransport implements Transport {
71
71
 
72
72
  signal(signal: Signal) {
73
73
  assert(this._peer, 'Connection not ready to accept signals.');
74
- assert(signal.json, 'Signal message must contain signal data.');
75
- this._peer.signal(JSON.parse(signal.json));
74
+ assert(signal.payload.data, 'Signal message must contain signal data.');
75
+ this._peer.signal(signal.payload.data);
76
76
  }
77
77
 
78
78
  private async _disconnectStreams() {
@@ -0,0 +1,75 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import { Duplex } from 'node:stream';
6
+
7
+ import { discoveryKey } from '@dxos/crypto';
8
+ import { PublicKey } from '@dxos/keys';
9
+ import { Protocol } from '@dxos/mesh-protocol';
10
+ import { Teleport } from '@dxos/teleport';
11
+
12
+ import { MeshProtocolProvider } from './protocol-factory';
13
+
14
+ export type WireProtocolParams = {
15
+ initiator: boolean;
16
+ localPeerId: PublicKey;
17
+ remotePeerId: PublicKey;
18
+ topic: PublicKey;
19
+ };
20
+
21
+ export type WireProtocolProvider = (params: WireProtocolParams) => WireProtocol;
22
+
23
+ /**
24
+ * Application-specific network protocol that is used when a connection to a peer is established.
25
+ * Will implement high-level logic, like replication, authentication, etc.
26
+ */
27
+ export interface WireProtocol {
28
+ stream: Duplex;
29
+
30
+ /**
31
+ * @deprecated Only for devtools comapatibility.
32
+ */
33
+ protocol?: Protocol;
34
+
35
+ initialize(): Promise<void>;
36
+ destroy(): Promise<void>;
37
+ }
38
+
39
+ /**
40
+ * @deprecated
41
+ */
42
+ export const adaptProtocolProvider =
43
+ (factory: MeshProtocolProvider): WireProtocolProvider =>
44
+ ({ initiator, localPeerId, remotePeerId, topic }) => {
45
+ const protocol = factory({ channel: discoveryKey(topic), initiator });
46
+ return {
47
+ initialize: () => protocol.open(),
48
+ destroy: () => protocol.close(),
49
+ stream: protocol.stream,
50
+ protocol
51
+ };
52
+ };
53
+
54
+ /**
55
+ * Create a wire-protocol provider backed by a teleport instance.
56
+ * @param onConnection Called after teleport is initialized for the session. Protocol extensions could be attached here.
57
+ * @returns
58
+ */
59
+ export const createTeleportProtocolFactory = (
60
+ onConnection: (teleport: Teleport) => Promise<void>
61
+ ): WireProtocolProvider => {
62
+ return (params) => {
63
+ const teleport = new Teleport(params);
64
+ return {
65
+ stream: teleport.stream,
66
+ initialize: async () => {
67
+ await teleport.open();
68
+ await onConnection(teleport);
69
+ },
70
+ destroy: async () => {
71
+ await teleport.close();
72
+ }
73
+ };
74
+ };
75
+ };
package/testing.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  * import { ... } from '@dxos/network-manager/testing';
9
9
  * ```
10
10
  */
11
- export * from './dist/src/testing';
11
+ export * from './dist/types/src/testing';
package/testing.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- module.exports = require('./dist/src/testing/index.js');
5
+ module.exports = require('./dist/lib/node/testing/index.cjs');
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection-log.d.ts","sourceRoot":"","sources":["../../src/connection-log.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,SAAS,EAAkB,MAAM,2CAA2C,CAAC;AAGtF,OAAO,EAAmB,KAAK,EAAE,MAAM,SAAS,CAAC;AAEjD,oBAAY,SAAS;IACnB,wBAAwB,6BAA6B;IACrD,cAAc,mBAAmB;IACjC,+BAA+B,oCAAoC;IACnE,6BAA6B,kCAAkC;IAC/D,kBAAkB,uBAAuB;CAC1C;AAED,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwD;IAEhF,QAAQ,CAAC,MAAM,cAAe;IAE9B,YAAY,CAAC,OAAO,EAAE,SAAS;IAI/B,IAAI,MAAM,IAAI,SAAS,EAAE,CAExB;IAED,WAAW,CAAC,KAAK,EAAE,KAAK;IA6DxB,SAAS,CAAC,KAAK,EAAE,KAAK;CAIvB"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2021 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ConnectionLog = exports.EventType = void 0;
7
- const async_1 = require("@dxos/async");
8
- const debug_1 = require("@dxos/debug");
9
- const keys_1 = require("@dxos/keys");
10
- const util_1 = require("@dxos/util");
11
- const swarm_1 = require("./swarm");
12
- var EventType;
13
- (function (EventType) {
14
- EventType["CONNECTION_STATE_CHANGED"] = "CONNECTION_STATE_CHANGED";
15
- EventType["PROTOCOL_ERROR"] = "PROTOCOL_ERROR";
16
- EventType["PROTOCOL_EXTENSIONS_INITIALIZED"] = "PROTOCOL_EXTENSIONS_INITIALIZED";
17
- EventType["PROTOCOL_EXTENSIONS_HANDSHAKE"] = "PROTOCOL_EXTENSIONS_HANDSHAKE";
18
- EventType["PROTOCOL_HANDSHAKE"] = "PROTOCOL_HANDSHAKE";
19
- })(EventType = exports.EventType || (exports.EventType = {}));
20
- class ConnectionLog {
21
- constructor() {
22
- /**
23
- * SwarmId => info
24
- */
25
- this._swarms = new util_1.ComplexMap(keys_1.PublicKey.hash);
26
- this.update = new async_1.Event();
27
- }
28
- getSwarmInfo(swarmId) {
29
- var _a;
30
- return (_a = this._swarms.get(swarmId)) !== null && _a !== void 0 ? _a : (0, debug_1.raise)(new Error(`Swarm not found: ${swarmId}`));
31
- }
32
- get swarms() {
33
- return Array.from(this._swarms.values());
34
- }
35
- swarmJoined(swarm) {
36
- const info = {
37
- id: swarm.id,
38
- topic: swarm.topic,
39
- isActive: true,
40
- label: swarm.label,
41
- connections: []
42
- };
43
- this._swarms.set(swarm.id, info);
44
- this.update.emit();
45
- swarm.connectionAdded.on((connection) => {
46
- const connectionInfo = {
47
- state: swarm_1.ConnectionState.INITIAL,
48
- remotePeerId: connection.remoteId,
49
- sessionId: connection.sessionId,
50
- transport: connection.transport && Object.getPrototypeOf(connection.transport).constructor.name,
51
- protocolExtensions: connection.protocol.extensionNames,
52
- events: []
53
- };
54
- info.connections.push(connectionInfo);
55
- this.update.emit();
56
- connection.stateChanged.on((state) => {
57
- connectionInfo.state = state;
58
- connectionInfo.events.push({
59
- type: EventType.CONNECTION_STATE_CHANGED,
60
- newState: state
61
- });
62
- this.update.emit();
63
- });
64
- connection.protocol.error.on((error) => {
65
- var _a;
66
- connectionInfo.events.push({
67
- type: EventType.PROTOCOL_ERROR,
68
- error: (_a = error.stack) !== null && _a !== void 0 ? _a : error.message
69
- });
70
- this.update.emit();
71
- });
72
- connection.protocol.extensionsInitialized.on(() => {
73
- connectionInfo.events.push({
74
- type: EventType.PROTOCOL_EXTENSIONS_INITIALIZED
75
- });
76
- this.update.emit();
77
- });
78
- connection.protocol.extensionsHandshake.on(() => {
79
- connectionInfo.events.push({
80
- type: EventType.PROTOCOL_EXTENSIONS_HANDSHAKE
81
- });
82
- this.update.emit();
83
- });
84
- connection.protocol.handshake.on(() => {
85
- connectionInfo.events.push({
86
- type: EventType.PROTOCOL_HANDSHAKE
87
- });
88
- this.update.emit();
89
- });
90
- });
91
- }
92
- swarmLeft(swarm) {
93
- this.getSwarmInfo(swarm.id).isActive = false;
94
- this.update.emit();
95
- }
96
- }
97
- exports.ConnectionLog = ConnectionLog;
98
- //# sourceMappingURL=connection-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection-log.js","sourceRoot":"","sources":["../../src/connection-log.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAAoC;AACpC,uCAAoC;AACpC,qCAAuC;AAEvC,qCAAwC;AAExC,mCAAiD;AAEjD,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,kEAAqD,CAAA;IACrD,8CAAiC,CAAA;IACjC,gFAAmE,CAAA;IACnE,4EAA+D,CAAA;IAC/D,sDAAyC,CAAA;AAC3C,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AAED,MAAa,aAAa;IAA1B;QACE;;WAEG;QACc,YAAO,GAAG,IAAI,iBAAU,CAAuB,gBAAS,CAAC,IAAI,CAAC,CAAC;QAEvE,WAAM,GAAG,IAAI,aAAK,EAAE,CAAC;IA2EhC,CAAC;IAzEC,YAAY,CAAC,OAAkB;;QAC7B,OAAO,MAAA,IAAI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C;YACrB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,KAAY;QACpB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACF;AAjFD,sCAiFC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
package/dist/src/index.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./connection-log"), exports);
21
- __exportStar(require("./network-manager"), exports);
22
- __exportStar(require("./protocol-factory"), exports);
23
- __exportStar(require("./signal"), exports);
24
- __exportStar(require("./swarm"), exports);
25
- __exportStar(require("./topology"), exports);
26
- __exportStar(require("./transport"), exports);
27
- __exportStar(require("./types"), exports);
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-manager.d.ts","sourceRoot":"","sources":["../../src/network-manager.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAa,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,KAAK,QAAQ,CAAC;AAE3F,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,QA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- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.NetworkManager = void 0;
10
- const node_assert_1 = __importDefault(require("node:assert"));
11
- const async_1 = require("@dxos/async");
12
- const keys_1 = require("@dxos/keys");
13
- const log_1 = require("@dxos/log");
14
- const messaging_1 = require("@dxos/messaging");
15
- const util_1 = require("@dxos/util");
16
- const connection_log_1 = require("./connection-log");
17
- const swarm_1 = require("./swarm");
18
- /**
19
- * Manages connection to the swarm.
20
- */
21
- // TODO(dmaretskyi): Rename SwarmManager.
22
- class NetworkManager {
23
- constructor({ transportFactory, signalManager, log }) {
24
- this._swarms = new util_1.ComplexMap(keys_1.PublicKey.hash);
25
- this._mappers = new util_1.ComplexMap(keys_1.PublicKey.hash);
26
- this.topicsUpdated = new async_1.Event();
27
- this._transportFactory = transportFactory;
28
- // Listen for signal manager events.
29
- this._signalManager = signalManager;
30
- this._signalManager.swarmEvent.on(({ topic, swarmEvent: event }) => { var _a; return (_a = this._swarms.get(topic)) === null || _a === void 0 ? void 0 : _a.onSwarmEvent(event); });
31
- this._messenger = new messaging_1.Messenger({ signalManager: this._signalManager });
32
- this._signalConnection = {
33
- join: (opts) => this._signalManager.join(opts),
34
- leave: (opts) => this._signalManager.leave(opts)
35
- };
36
- // TODO(burdon): Inject listener (generic pattern).
37
- if (log) {
38
- this._connectionLog = new connection_log_1.ConnectionLog();
39
- }
40
- }
41
- // TODO(burdon): Remove access (Devtools only).
42
- get connectionLog() {
43
- return this._connectionLog;
44
- }
45
- // TODO(burdon): Remove access (Devtools only).
46
- get signalManager() {
47
- return this._signalManager;
48
- }
49
- // TODO(burdon): Reconcile with "discovery_key".
50
- get topics() {
51
- return Array.from(this._swarms.keys());
52
- }
53
- getSwarmMap(topic) {
54
- return this._mappers.get(topic);
55
- }
56
- getSwarm(topic) {
57
- return this._swarms.get(topic);
58
- }
59
- async close() {
60
- for (const topic of this._swarms.keys()) {
61
- await this.leaveSwarm(topic).catch((err) => {
62
- (0, log_1.log)(err, {}, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 126, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
63
- });
64
- }
65
- await this._signalManager.destroy();
66
- }
67
- /**
68
- * Join the swarm.
69
- */
70
- // TODO(burdon): Join/Open? Swarm abstraction?
71
- async joinSwarm({ topic, peerId, topology, protocol, presence, label }) {
72
- var _a;
73
- (0, node_assert_1.default)(keys_1.PublicKey.isPublicKey(topic));
74
- (0, node_assert_1.default)(keys_1.PublicKey.isPublicKey(peerId));
75
- (0, node_assert_1.default)(topology);
76
- (0, node_assert_1.default)(typeof protocol === 'function');
77
- if (this._swarms.has(topic)) {
78
- throw new Error(`Already connected to swarm: ${keys_1.PublicKey.from(topic)}`);
79
- }
80
- (0, log_1.log)('joining', { topic: keys_1.PublicKey.from(topic), peerId, topology: topology.toString() }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 146, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) }); // TODO(burdon): Log peerId.
81
- const swarm = new swarm_1.Swarm(topic, peerId, topology, protocol, this._messenger, this._transportFactory, label);
82
- swarm.errors.handle((error) => {
83
- (0, log_1.log)('swarm error', { error }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 149, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
84
- });
85
- this._swarms.set(topic, swarm);
86
- this._signalConnection.join({ topic, peerId }).catch((error) => log_1.log.catch(error, {}, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 153, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) }));
87
- this._mappers.set(topic, new swarm_1.SwarmMapper(swarm, presence));
88
- this.topicsUpdated.emit();
89
- (_a = this._connectionLog) === null || _a === void 0 ? void 0 : _a.swarmJoined(swarm);
90
- (0, log_1.log)('joined', { topic: keys_1.PublicKey.from(topic), count: this._swarms.size }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 158, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
91
- return {
92
- close: () => this.leaveSwarm(topic)
93
- };
94
- }
95
- /**
96
- * Close the connection.
97
- */
98
- async leaveSwarm(topic) {
99
- var _a;
100
- if (!this._swarms.has(topic)) {
101
- log_1.log.warn('swarm not open', { topic: keys_1.PublicKey.from(topic) }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 170, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
102
- return;
103
- }
104
- (0, log_1.log)('leaving', { topic: keys_1.PublicKey.from(topic) }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 174, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
105
- const swarm = this._swarms.get(topic);
106
- await this._signalConnection.leave({ topic, peerId: swarm.ownPeerId });
107
- const map = this._mappers.get(topic);
108
- map.destroy();
109
- this._mappers.delete(topic);
110
- (_a = this._connectionLog) === null || _a === void 0 ? void 0 : _a.swarmLeft(swarm);
111
- await swarm.destroy();
112
- this._swarms.delete(topic);
113
- await this.topicsUpdated.emit();
114
- (0, log_1.log)('left', { topic: keys_1.PublicKey.from(topic), count: this._swarms.size }, { file: "packages/core/mesh/network-manager/src/network-manager.ts", line: 188, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
115
- }
116
- }
117
- exports.NetworkManager = NetworkManager;
118
- //# sourceMappingURL=network-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-manager.js","sourceRoot":"","sources":["../../src/network-manager.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,8DAAiC;AAEjC,uCAAoC;AACpC,qCAAuC;AACvC,mCAAgC;AAEhC,+CAA2D;AAC3D,qCAAwC;AAExC,qDAAiD;AAEjD,mCAA6C;AAkD7C;;GAEG;AACH,yCAAyC;AACzC,MAAa,cAAc;IAYzB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAAG,EAAyB;QAX1D,YAAO,GAAG,IAAI,iBAAU,CAAmB,gBAAS,CAAC,IAAI,CAAC,CAAC;QAC3D,aAAQ,GAAG,IAAI,iBAAU,CAAyB,gBAAS,CAAC,IAAI,CAAC,CAAC;QAQnE,kBAAa,GAAG,IAAI,aAAK,EAAQ,CAAC;QAGhD,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAE1C,oCAAoC;QACpC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,0CAAE,YAAY,CAAC,KAAK,CAAC,CAAA,EAAA,CAAC,CAAC;QAClH,IAAI,CAAC,UAAU,GAAG,IAAI,qBAAS,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,iBAAiB,GAAG;YACvB,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cA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AC;QAEtC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QAChC,IAAA,SAAG,EAAC,MAAM,EAAE,EAAE,KAAK,EAAE,gBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,6TAAC,CAAC;IAC1E,CAAC;CACF;AAxHD,wCAwHC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol-factory.d.ts","sourceRoot":"","sources":["../../src/protocol-factory.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAY,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,UAAU,sBAAsB;IAC9B,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,oCAIzB,sBAAsB,KAAG,gBAyB3B,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,eAAe,EAAE,MAAM,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB,UAAW,SAAS,UAAU,SAAS,WAAW,MAAM,EAAE,qBAKxF,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kBACrB,MAAM,UACb,MAAM,kBACE,GAAG,KAClB,gBAMF,CAAC"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.transportProtocolProvider = exports.createProtocolFactory = exports.protocolFactory = void 0;
10
- const node_assert_1 = __importDefault(require("node:assert"));
11
- const crypto_1 = require("@dxos/crypto");
12
- const keys_1 = require("@dxos/keys");
13
- const log_1 = require("@dxos/log");
14
- const mesh_protocol_1 = require("@dxos/mesh-protocol");
15
- /**
16
- * Returns a function that takes a channel parameter, returns a Protocol object
17
- * with its context set to channel, plugins from plugins parameter and session
18
- * set to session parameter.
19
- *
20
- * @param plugins array of Protocol plugin objects to add to created Protocol objects
21
- * @param getTopics retrieve a list of known topic keys to encrypt by public key.
22
- * @deprecated Use `createProtocolFactory`.
23
- */
24
- const protocolFactory = ({ session = {}, plugins = [], getTopics }) => {
25
- (0, node_assert_1.default)(getTopics);
26
- // eslint-disable-next-line no-unused-vars
27
- return ({ channel, initiator }) => {
28
- (0, log_1.log)('creating protocol', {}, { file: "packages/core/mesh/network-manager/src/protocol-factory.ts", line: 38, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
29
- const protocol = new mesh_protocol_1.Protocol({
30
- streamOptions: { live: true },
31
- discoveryToPublicKey: (dk) => {
32
- const publicKey = getTopics().find((topic) => (0, crypto_1.discoveryKey)(topic).equals(dk));
33
- if (publicKey) {
34
- protocol.setContext({ topic: keys_1.PublicKey.stringify(publicKey) });
35
- }
36
- (0, node_assert_1.default)(publicKey, 'PublicKey not found in discovery.');
37
- return publicKey;
38
- },
39
- initiator,
40
- userSession: session,
41
- discoveryKey: channel
42
- });
43
- protocol.setExtensions(plugins.map((plugin) => plugin.createExtension())).init();
44
- return protocol;
45
- };
46
- };
47
- exports.protocolFactory = protocolFactory;
48
- const createProtocolFactory = (topic, peerId, plugins) => (0, exports.protocolFactory)({
49
- getTopics: () => [topic.asBuffer()],
50
- session: { peerId: keys_1.PublicKey.stringify(peerId.asBuffer()) },
51
- plugins
52
- });
53
- exports.createProtocolFactory = createProtocolFactory;
54
- /**
55
- * Creates a ProtocolProvider for simple transport connections with only one protocol plugin.
56
- * @deprecated Use `createProtocolFactory`.
57
- */
58
- const transportProtocolProvider = (rendezvousKey, peerId, protocolPlugin) => {
59
- return (0, exports.protocolFactory)({
60
- getTopics: () => [rendezvousKey],
61
- session: { peerId: keys_1.PublicKey.stringify(peerId) },
62
- plugins: [protocolPlugin]
63
- });
64
- };
65
- exports.transportProtocolProvider = transportProtocolProvider;
66
- //# sourceMappingURL=protocol-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol-factory.js","sourceRoot":"","sources":["../../src/protocol-factory.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,8DAAiC;AAEjC,yCAA4C;AAC5C,qCAAuC;AACvC,mCAAgC;AAChC,uDAA0D;AAU1D;;;;;;;;GAQG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,EACZ,SAAS,EACc,EAAoB,EAAE;IAC7C,IAAA,qBAAM,EAAC,SAAS,CAAC,CAAC;IAElB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QAChC,IAAA,SAAG,EAAC,mBAAmB,iUAAC,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAAC;YAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;YAC7B,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE;gBAC3B,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,qBAAY,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9E,IAAI,SAAS,EAAE;oBACb,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK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/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./message-router"), exports);
21
- __exportStar(require("./signal-connection"), exports);
22
- __exportStar(require("./signal-messenger"), exports);
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/signal/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,mDAAiC;AACjC,sDAAoC;AACpC,qDAAmC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.test.d.ts","sourceRoot":"","sources":["../../../src/signal/integration.test.ts"],"names":[],"mappings":""}