@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
@@ -2212,52 +2212,37 @@ var SwarmNetworkManager = class {
2212
2212
  /**
2213
2213
  * Join the swarm.
2214
2214
  */
2215
- async joinSwarm({ topic, peerInfo, topology, protocolProvider: protocol, label }) {
2215
+ async joinSwarm({ topic, topology, protocolProvider: protocol, label }) {
2216
2216
  invariant6(PublicKey8.isPublicKey(topic), void 0, {
2217
2217
  F: __dxlog_file8,
2218
- L: 161,
2218
+ L: 160,
2219
2219
  S: this,
2220
2220
  A: [
2221
2221
  "PublicKey.isPublicKey(topic)",
2222
2222
  ""
2223
2223
  ]
2224
2224
  });
2225
- if (!peerInfo) {
2226
- peerInfo = {
2227
- peerKey: this._peerInfo?.peerKey ?? PublicKey8.random().toHex(),
2228
- identityKey: this._peerInfo?.identityKey ?? PublicKey8.random().toHex()
2229
- };
2230
- }
2231
- invariant6(PublicKey8.from(peerInfo.peerKey), void 0, {
2232
- F: __dxlog_file8,
2233
- L: 168,
2234
- S: this,
2235
- A: [
2236
- "PublicKey.from(peerInfo.peerKey)",
2237
- ""
2238
- ]
2239
- });
2240
- invariant6(PublicKey8.from(peerInfo.identityKey), void 0, {
2225
+ invariant6(topology, void 0, {
2241
2226
  F: __dxlog_file8,
2242
- L: 169,
2227
+ L: 161,
2243
2228
  S: this,
2244
2229
  A: [
2245
- "PublicKey.from(peerInfo.identityKey!)",
2230
+ "topology",
2246
2231
  ""
2247
2232
  ]
2248
2233
  });
2249
- invariant6(topology, void 0, {
2234
+ invariant6(this._peerInfo, void 0, {
2250
2235
  F: __dxlog_file8,
2251
- L: 170,
2236
+ L: 162,
2252
2237
  S: this,
2253
2238
  A: [
2254
- "topology",
2239
+ "this._peerInfo",
2255
2240
  ""
2256
2241
  ]
2257
2242
  });
2258
2243
  invariant6(typeof protocol === "function", void 0, {
2259
2244
  F: __dxlog_file8,
2260
- L: 171,
2245
+ L: 163,
2261
2246
  S: this,
2262
2247
  A: [
2263
2248
  "typeof protocol === 'function'",
@@ -2269,21 +2254,21 @@ var SwarmNetworkManager = class {
2269
2254
  }
2270
2255
  log8("joining", {
2271
2256
  topic: PublicKey8.from(topic),
2272
- peerInfo,
2257
+ peerInfo: this._peerInfo,
2273
2258
  topology: topology.toString()
2274
2259
  }, {
2275
2260
  F: __dxlog_file8,
2276
- L: 176,
2261
+ L: 168,
2277
2262
  S: this,
2278
2263
  C: (f, a) => f(...a)
2279
2264
  });
2280
- const swarm = new Swarm(topic, peerInfo, topology, protocol, this._messenger, this._transportFactory, label, this._connectionLimiter);
2265
+ const swarm = new Swarm(topic, this._peerInfo, topology, protocol, this._messenger, this._transportFactory, label, this._connectionLimiter);
2281
2266
  swarm.errors.handle((error) => {
2282
2267
  log8("swarm error", {
2283
2268
  error
2284
2269
  }, {
2285
2270
  F: __dxlog_file8,
2286
- L: 189,
2271
+ L: 181,
2287
2272
  S: this,
2288
2273
  C: (f, a) => f(...a)
2289
2274
  });
@@ -2293,10 +2278,10 @@ var SwarmNetworkManager = class {
2293
2278
  await swarm.open();
2294
2279
  this._signalConnection.join({
2295
2280
  topic,
2296
- peer: peerInfo
2281
+ peer: this._peerInfo
2297
2282
  }).catch((error) => log8.catch(error, void 0, {
2298
2283
  F: __dxlog_file8,
2299
- L: 198,
2284
+ L: 190,
2300
2285
  S: this,
2301
2286
  C: (f, a) => f(...a)
2302
2287
  }));
@@ -2307,7 +2292,7 @@ var SwarmNetworkManager = class {
2307
2292
  count: this._swarms.size
2308
2293
  }, {
2309
2294
  F: __dxlog_file8,
2310
- L: 202,
2295
+ L: 194,
2311
2296
  S: this,
2312
2297
  C: (f, a) => f(...a)
2313
2298
  });
@@ -2326,7 +2311,7 @@ var SwarmNetworkManager = class {
2326
2311
  topic: PublicKey8.from(topic)
2327
2312
  }, {
2328
2313
  F: __dxlog_file8,
2329
- L: 219,
2314
+ L: 211,
2330
2315
  S: this,
2331
2316
  C: (f, a) => f(...a)
2332
2317
  });
@@ -2347,7 +2332,7 @@ var SwarmNetworkManager = class {
2347
2332
  count: this._swarms.size
2348
2333
  }, {
2349
2334
  F: __dxlog_file8,
2350
- L: 233,
2335
+ L: 225,
2351
2336
  S: this,
2352
2337
  C: (f, a) => f(...a)
2353
2338
  });
@@ -4385,4 +4370,4 @@ export {
4385
4370
  RtcTransportService,
4386
4371
  createTeleportProtocolFactory
4387
4372
  };
4388
- //# sourceMappingURL=chunk-NL5MMIE4.mjs.map
4373
+ //# sourceMappingURL=chunk-22DA2US6.mjs.map