@dxos/network-manager 0.5.8 → 0.5.9-main.2d0a5e6

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.
@@ -1350,7 +1350,7 @@ var INITIATION_DELAY = 100;
1350
1350
  var getClassName = (obj) => Object.getPrototypeOf(obj).constructor.name;
1351
1351
  var Swarm = class {
1352
1352
  // TODO(burdon): Swarm => Peer.create/destroy =< Connection.open/close
1353
- // TODO(burdon): Split up properties.
1353
+ // TODO(burdon): Pass in object.
1354
1354
  constructor(_topic, _ownPeerId, _topology, _protocolProvider, _messenger, _transportFactory, _label, _connectionLimiter, _initiationDelay = INITIATION_DELAY) {
1355
1355
  this._topic = _topic;
1356
1356
  this._ownPeerId = _ownPeerId;
@@ -2098,17 +2098,17 @@ function _ts_decorate4(decorators, target, key, desc) {
2098
2098
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2099
2099
  }
2100
2100
  var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/network-manager.ts";
2101
- var NetworkManager = class {
2101
+ var SwarmNetworkManager = class {
2102
2102
  constructor({ transportFactory, signalManager, log: log15 }) {
2103
2103
  /**
2104
2104
  * @internal
2105
2105
  */
2106
2106
  this._swarms = new ComplexMap6(PublicKey8.hash);
2107
2107
  this._mappers = new ComplexMap6(PublicKey8.hash);
2108
+ this._instanceId = PublicKey8.random().toHex();
2108
2109
  this._connectionState = ConnectionState2.ONLINE;
2109
2110
  this.connectionStateChanged = new Event6();
2110
2111
  this.topicsUpdated = new Event6();
2111
- this._instanceId = PublicKey8.random().toHex();
2112
2112
  this._transportFactory = transportFactory;
2113
2113
  this._signalManager = signalManager;
2114
2114
  this._signalManager.swarmEvent.on(({ topic, swarmEvent: event }) => this._swarms.get(topic)?.onSwarmEvent(event));
@@ -2146,7 +2146,7 @@ var NetworkManager = class {
2146
2146
  id: this._instanceId
2147
2147
  }), {
2148
2148
  F: __dxlog_file7,
2149
- L: 130,
2149
+ L: 126,
2150
2150
  S: this,
2151
2151
  C: (f, a) => f(...a)
2152
2152
  });
@@ -2156,7 +2156,7 @@ var NetworkManager = class {
2156
2156
  id: this._instanceId
2157
2157
  }), {
2158
2158
  F: __dxlog_file7,
2159
- L: 133,
2159
+ L: 129,
2160
2160
  S: this,
2161
2161
  C: (f, a) => f(...a)
2162
2162
  });
@@ -2166,7 +2166,7 @@ var NetworkManager = class {
2166
2166
  await this.leaveSwarm(topic).catch((err) => {
2167
2167
  log7(err, void 0, {
2168
2168
  F: __dxlog_file7,
2169
- L: 139,
2169
+ L: 135,
2170
2170
  S: this,
2171
2171
  C: (f, a) => f(...a)
2172
2172
  });
@@ -2181,7 +2181,7 @@ var NetworkManager = class {
2181
2181
  async joinSwarm({ topic, peerId, topology, protocolProvider: protocol, label }) {
2182
2182
  invariant6(PublicKey8.isPublicKey(topic), void 0, {
2183
2183
  F: __dxlog_file7,
2184
- L: 158,
2184
+ L: 154,
2185
2185
  S: this,
2186
2186
  A: [
2187
2187
  "PublicKey.isPublicKey(topic)",
@@ -2190,7 +2190,7 @@ var NetworkManager = class {
2190
2190
  });
2191
2191
  invariant6(PublicKey8.isPublicKey(peerId), void 0, {
2192
2192
  F: __dxlog_file7,
2193
- L: 159,
2193
+ L: 155,
2194
2194
  S: this,
2195
2195
  A: [
2196
2196
  "PublicKey.isPublicKey(peerId)",
@@ -2199,7 +2199,7 @@ var NetworkManager = class {
2199
2199
  });
2200
2200
  invariant6(topology, void 0, {
2201
2201
  F: __dxlog_file7,
2202
- L: 160,
2202
+ L: 156,
2203
2203
  S: this,
2204
2204
  A: [
2205
2205
  "topology",
@@ -2208,7 +2208,7 @@ var NetworkManager = class {
2208
2208
  });
2209
2209
  invariant6(typeof protocol === "function", void 0, {
2210
2210
  F: __dxlog_file7,
2211
- L: 161,
2211
+ L: 157,
2212
2212
  S: this,
2213
2213
  A: [
2214
2214
  "typeof protocol === 'function'",
@@ -2224,7 +2224,7 @@ var NetworkManager = class {
2224
2224
  topology: topology.toString()
2225
2225
  }, {
2226
2226
  F: __dxlog_file7,
2227
- L: 166,
2227
+ L: 162,
2228
2228
  S: this,
2229
2229
  C: (f, a) => f(...a)
2230
2230
  });
@@ -2234,7 +2234,7 @@ var NetworkManager = class {
2234
2234
  error
2235
2235
  }, {
2236
2236
  F: __dxlog_file7,
2237
- L: 179,
2237
+ L: 175,
2238
2238
  S: this,
2239
2239
  C: (f, a) => f(...a)
2240
2240
  });
@@ -2247,7 +2247,7 @@ var NetworkManager = class {
2247
2247
  peerId
2248
2248
  }).catch((error) => log7.catch(error, void 0, {
2249
2249
  F: __dxlog_file7,
2250
- L: 188,
2250
+ L: 184,
2251
2251
  S: this,
2252
2252
  C: (f, a) => f(...a)
2253
2253
  }));
@@ -2258,7 +2258,7 @@ var NetworkManager = class {
2258
2258
  count: this._swarms.size
2259
2259
  }, {
2260
2260
  F: __dxlog_file7,
2261
- L: 192,
2261
+ L: 188,
2262
2262
  S: this,
2263
2263
  C: (f, a) => f(...a)
2264
2264
  });
@@ -2277,7 +2277,7 @@ var NetworkManager = class {
2277
2277
  topic: PublicKey8.from(topic)
2278
2278
  }, {
2279
2279
  F: __dxlog_file7,
2280
- L: 209,
2280
+ L: 205,
2281
2281
  S: this,
2282
2282
  C: (f, a) => f(...a)
2283
2283
  });
@@ -2298,7 +2298,7 @@ var NetworkManager = class {
2298
2298
  count: this._swarms.size
2299
2299
  }, {
2300
2300
  F: __dxlog_file7,
2301
- L: 223,
2301
+ L: 219,
2302
2302
  S: this,
2303
2303
  C: (f, a) => f(...a)
2304
2304
  });
@@ -2332,10 +2332,10 @@ var NetworkManager = class {
2332
2332
  };
2333
2333
  _ts_decorate4([
2334
2334
  synchronized4
2335
- ], NetworkManager.prototype, "joinSwarm", null);
2335
+ ], SwarmNetworkManager.prototype, "joinSwarm", null);
2336
2336
  _ts_decorate4([
2337
2337
  synchronized4
2338
- ], NetworkManager.prototype, "leaveSwarm", null);
2338
+ ], SwarmNetworkManager.prototype, "leaveSwarm", null);
2339
2339
 
2340
2340
  // packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts
2341
2341
  import { invariant as invariant7 } from "@dxos/invariant";
@@ -4045,7 +4045,7 @@ export {
4045
4045
  ConnectionLimiter,
4046
4046
  EventType,
4047
4047
  ConnectionLog,
4048
- NetworkManager,
4048
+ SwarmNetworkManager,
4049
4049
  FullyConnectedTopology,
4050
4050
  MMSTTopology,
4051
4051
  StarTopology,
@@ -4063,4 +4063,4 @@ export {
4063
4063
  TcpTransport,
4064
4064
  createTeleportProtocolFactory
4065
4065
  };
4066
- //# sourceMappingURL=chunk-FR73ZRXS.mjs.map
4066
+ //# sourceMappingURL=chunk-DF5W3U6V.mjs.map