@dxos/echo-pipeline 0.4.5-main.b5b1909 → 0.4.5-main.b6f7e18

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.
@@ -3103,9 +3103,9 @@ var AutomergeHost = class {
3103
3103
  this._meshNetwork = new MeshNetworkAdapter();
3104
3104
  this._clientNetwork = new LocalHostNetworkAdapter();
3105
3105
  this._storage = storageDirectory.type === StorageType.IDB ? new IndexedDBStorageAdapter(storageDirectory.path, "data") : new AutomergeStorageAdapter(storageDirectory);
3106
- const localPeerId = `host-${PublicKey8.random().toHex()}`;
3106
+ this._peerId = `host-${PublicKey8.random().toHex()}`;
3107
3107
  this._repo = new Repo({
3108
- peerId: localPeerId,
3108
+ peerId: this._peerId,
3109
3109
  network: [
3110
3110
  this._clientNetwork,
3111
3111
  this._meshNetwork
@@ -3129,7 +3129,7 @@ var AutomergeHost = class {
3129
3129
  isRequested
3130
3130
  }, {
3131
3131
  F: __dxlog_file16,
3132
- L: 66,
3132
+ L: 69,
3133
3133
  S: this,
3134
3134
  C: (f, a) => f(...a)
3135
3135
  });
@@ -3143,7 +3143,7 @@ var AutomergeHost = class {
3143
3143
  documentId
3144
3144
  }, {
3145
3145
  F: __dxlog_file16,
3146
- L: 74,
3146
+ L: 77,
3147
3147
  S: this,
3148
3148
  C: (f, a) => f(...a)
3149
3149
  });
@@ -3158,7 +3158,7 @@ var AutomergeHost = class {
3158
3158
  documentId
3159
3159
  }, {
3160
3160
  F: __dxlog_file16,
3161
- L: 84,
3161
+ L: 87,
3162
3162
  S: this,
3163
3163
  C: (f, a) => f(...a)
3164
3164
  });
@@ -3167,7 +3167,7 @@ var AutomergeHost = class {
3167
3167
  const deviceKey = PublicKey8.from(deviceKeyHex);
3168
3168
  const isAuthorized = authorizedDevices?.has(deviceKey) ?? false;
3169
3169
  log15("share policy check", {
3170
- localPeer: localPeerId,
3170
+ localPeer: this._peerId,
3171
3171
  remotePeer: peerId,
3172
3172
  documentId,
3173
3173
  deviceKey,
@@ -3175,7 +3175,7 @@ var AutomergeHost = class {
3175
3175
  isAuthorized
3176
3176
  }, {
3177
3177
  F: __dxlog_file16,
3178
- L: 90,
3178
+ L: 93,
3179
3179
  S: this,
3180
3180
  C: (f, a) => f(...a)
3181
3181
  });
@@ -3183,7 +3183,7 @@ var AutomergeHost = class {
3183
3183
  } catch (err) {
3184
3184
  log15.catch(err, void 0, {
3185
3185
  F: __dxlog_file16,
3186
- L: 100,
3186
+ L: 103,
3187
3187
  S: this,
3188
3188
  C: (f, a) => f(...a)
3189
3189
  });
@@ -3201,7 +3201,22 @@ var AutomergeHost = class {
3201
3201
  return mapValues(this._repo.handles, (handle) => ({
3202
3202
  state: handle.state,
3203
3203
  hasDoc: !!handle.docSync(),
3204
- heads: handle.docSync() ? automerge.getHeads(handle.docSync()) : null
3204
+ heads: handle.docSync() ? automerge.getHeads(handle.docSync()) : null,
3205
+ data: handle.docSync()?.doc && mapValues(handle.docSync()?.doc, (value, key) => {
3206
+ try {
3207
+ switch (key) {
3208
+ case "access":
3209
+ case "links":
3210
+ return value;
3211
+ case "objects":
3212
+ return Object.keys(value);
3213
+ default:
3214
+ return `${value}`;
3215
+ }
3216
+ } catch (err) {
3217
+ return `${err}`;
3218
+ }
3219
+ })
3205
3220
  }));
3206
3221
  }
3207
3222
  _automergePeers() {
@@ -3235,13 +3250,16 @@ var AutomergeHost = class {
3235
3250
  deviceKey
3236
3251
  }, {
3237
3252
  F: __dxlog_file16,
3238
- L: 157,
3253
+ L: 177,
3239
3254
  S: this,
3240
3255
  C: (f, a) => f(...a)
3241
3256
  });
3242
3257
  defaultMap(this._authorizedDevices, spaceKey, () => new ComplexSet(PublicKey8.hash)).add(deviceKey);
3243
3258
  }
3244
3259
  };
3260
+ _ts_decorate9([
3261
+ trace6.info()
3262
+ ], AutomergeHost.prototype, "_peerId", void 0);
3245
3263
  _ts_decorate9([
3246
3264
  trace6.info({
3247
3265
  depth: null
@@ -3286,4 +3304,4 @@ export {
3286
3304
  MeshNetworkAdapter,
3287
3305
  AutomergeHost
3288
3306
  };
3289
- //# sourceMappingURL=chunk-3S2G6TSQ.mjs.map
3307
+ //# sourceMappingURL=chunk-DHCMI2ID.mjs.map