@dxos/network-manager 0.6.13-main.548ca8d → 0.6.13-main.ed424a1

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 (31) hide show
  1. package/dist/lib/browser/{chunk-IDPSMH73.mjs → chunk-MKIVP7G3.mjs} +19 -34
  2. package/dist/lib/browser/chunk-MKIVP7G3.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/testing/index.mjs +5 -6
  6. package/dist/lib/browser/testing/index.mjs.map +3 -3
  7. package/dist/lib/node/{chunk-MCPADZS5.cjs → chunk-D6P7ACEM.cjs} +22 -37
  8. package/dist/lib/node/{chunk-MCPADZS5.cjs.map → chunk-D6P7ACEM.cjs.map} +3 -3
  9. package/dist/lib/node/index.cjs +23 -23
  10. package/dist/lib/node/index.cjs.map +1 -1
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/testing/index.cjs +18 -19
  13. package/dist/lib/node/testing/index.cjs.map +3 -3
  14. package/dist/lib/node-esm/{chunk-NL5MMIE4.mjs → chunk-22DA2US6.mjs} +19 -34
  15. package/dist/lib/node-esm/chunk-22DA2US6.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +1 -1
  17. package/dist/lib/node-esm/meta.json +1 -1
  18. package/dist/lib/node-esm/testing/index.mjs +5 -6
  19. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  20. package/dist/types/src/network-manager.d.ts +2 -1
  21. package/dist/types/src/network-manager.d.ts.map +1 -1
  22. package/dist/types/src/testing/test-wire-protocol.d.ts +1 -2
  23. package/dist/types/src/testing/test-wire-protocol.d.ts.map +1 -1
  24. package/package.json +18 -16
  25. package/src/network-manager.ts +5 -13
  26. package/src/swarm/connection.test.ts +2 -2
  27. package/src/swarm/swarm.test.ts +1 -1
  28. package/src/testing/test-builder.ts +1 -1
  29. package/src/testing/test-wire-protocol.ts +1 -4
  30. package/dist/lib/browser/chunk-IDPSMH73.mjs.map +0 -7
  31. package/dist/lib/node-esm/chunk-NL5MMIE4.mjs.map +0 -7
@@ -2215,52 +2215,37 @@ var SwarmNetworkManager = class {
2215
2215
  /**
2216
2216
  * Join the swarm.
2217
2217
  */
2218
- async joinSwarm({ topic, peerInfo, topology, protocolProvider: protocol, label }) {
2218
+ async joinSwarm({ topic, topology, protocolProvider: protocol, label }) {
2219
2219
  invariant6(PublicKey8.isPublicKey(topic), void 0, {
2220
2220
  F: __dxlog_file8,
2221
- L: 161,
2221
+ L: 160,
2222
2222
  S: this,
2223
2223
  A: [
2224
2224
  "PublicKey.isPublicKey(topic)",
2225
2225
  ""
2226
2226
  ]
2227
2227
  });
2228
- if (!peerInfo) {
2229
- peerInfo = {
2230
- peerKey: this._peerInfo?.peerKey ?? PublicKey8.random().toHex(),
2231
- identityKey: this._peerInfo?.identityKey ?? PublicKey8.random().toHex()
2232
- };
2233
- }
2234
- invariant6(PublicKey8.from(peerInfo.peerKey), void 0, {
2235
- F: __dxlog_file8,
2236
- L: 168,
2237
- S: this,
2238
- A: [
2239
- "PublicKey.from(peerInfo.peerKey)",
2240
- ""
2241
- ]
2242
- });
2243
- invariant6(PublicKey8.from(peerInfo.identityKey), void 0, {
2228
+ invariant6(topology, void 0, {
2244
2229
  F: __dxlog_file8,
2245
- L: 169,
2230
+ L: 161,
2246
2231
  S: this,
2247
2232
  A: [
2248
- "PublicKey.from(peerInfo.identityKey!)",
2233
+ "topology",
2249
2234
  ""
2250
2235
  ]
2251
2236
  });
2252
- invariant6(topology, void 0, {
2237
+ invariant6(this._peerInfo, void 0, {
2253
2238
  F: __dxlog_file8,
2254
- L: 170,
2239
+ L: 162,
2255
2240
  S: this,
2256
2241
  A: [
2257
- "topology",
2242
+ "this._peerInfo",
2258
2243
  ""
2259
2244
  ]
2260
2245
  });
2261
2246
  invariant6(typeof protocol === "function", void 0, {
2262
2247
  F: __dxlog_file8,
2263
- L: 171,
2248
+ L: 163,
2264
2249
  S: this,
2265
2250
  A: [
2266
2251
  "typeof protocol === 'function'",
@@ -2272,21 +2257,21 @@ var SwarmNetworkManager = class {
2272
2257
  }
2273
2258
  log8("joining", {
2274
2259
  topic: PublicKey8.from(topic),
2275
- peerInfo,
2260
+ peerInfo: this._peerInfo,
2276
2261
  topology: topology.toString()
2277
2262
  }, {
2278
2263
  F: __dxlog_file8,
2279
- L: 176,
2264
+ L: 168,
2280
2265
  S: this,
2281
2266
  C: (f, a) => f(...a)
2282
2267
  });
2283
- const swarm = new Swarm(topic, peerInfo, topology, protocol, this._messenger, this._transportFactory, label, this._connectionLimiter);
2268
+ const swarm = new Swarm(topic, this._peerInfo, topology, protocol, this._messenger, this._transportFactory, label, this._connectionLimiter);
2284
2269
  swarm.errors.handle((error) => {
2285
2270
  log8("swarm error", {
2286
2271
  error
2287
2272
  }, {
2288
2273
  F: __dxlog_file8,
2289
- L: 189,
2274
+ L: 181,
2290
2275
  S: this,
2291
2276
  C: (f, a) => f(...a)
2292
2277
  });
@@ -2296,10 +2281,10 @@ var SwarmNetworkManager = class {
2296
2281
  await swarm.open();
2297
2282
  this._signalConnection.join({
2298
2283
  topic,
2299
- peer: peerInfo
2284
+ peer: this._peerInfo
2300
2285
  }).catch((error) => log8.catch(error, void 0, {
2301
2286
  F: __dxlog_file8,
2302
- L: 198,
2287
+ L: 190,
2303
2288
  S: this,
2304
2289
  C: (f, a) => f(...a)
2305
2290
  }));
@@ -2310,7 +2295,7 @@ var SwarmNetworkManager = class {
2310
2295
  count: this._swarms.size
2311
2296
  }, {
2312
2297
  F: __dxlog_file8,
2313
- L: 202,
2298
+ L: 194,
2314
2299
  S: this,
2315
2300
  C: (f, a) => f(...a)
2316
2301
  });
@@ -2329,7 +2314,7 @@ var SwarmNetworkManager = class {
2329
2314
  topic: PublicKey8.from(topic)
2330
2315
  }, {
2331
2316
  F: __dxlog_file8,
2332
- L: 219,
2317
+ L: 211,
2333
2318
  S: this,
2334
2319
  C: (f, a) => f(...a)
2335
2320
  });
@@ -2350,7 +2335,7 @@ var SwarmNetworkManager = class {
2350
2335
  count: this._swarms.size
2351
2336
  }, {
2352
2337
  F: __dxlog_file8,
2353
- L: 233,
2338
+ L: 225,
2354
2339
  S: this,
2355
2340
  C: (f, a) => f(...a)
2356
2341
  });
@@ -4388,4 +4373,4 @@ export {
4388
4373
  RtcTransportService,
4389
4374
  createTeleportProtocolFactory
4390
4375
  };
4391
- //# sourceMappingURL=chunk-IDPSMH73.mjs.map
4376
+ //# sourceMappingURL=chunk-MKIVP7G3.mjs.map