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

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
- this._peerId = `host-${PublicKey8.random().toHex()}`;
3106
+ const localPeerId = `host-${PublicKey8.random().toHex()}`;
3107
3107
  this._repo = new Repo({
3108
- peerId: this._peerId,
3108
+ peerId: localPeerId,
3109
3109
  network: [
3110
3110
  this._clientNetwork,
3111
3111
  this._meshNetwork
@@ -3129,27 +3129,26 @@ var AutomergeHost = class {
3129
3129
  isRequested
3130
3130
  }, {
3131
3131
  F: __dxlog_file16,
3132
- L: 69,
3132
+ L: 66,
3133
3133
  S: this,
3134
3134
  C: (f, a) => f(...a)
3135
3135
  });
3136
3136
  return isRequested;
3137
3137
  }
3138
3138
  try {
3139
- const rawSpaceKey = doc.access?.spaceKey ?? doc.experimental_spaceKey;
3140
- if (!rawSpaceKey) {
3139
+ if (!doc.experimental_spaceKey) {
3141
3140
  log15("space key not found for share policy check", {
3142
3141
  peerId,
3143
3142
  documentId
3144
3143
  }, {
3145
3144
  F: __dxlog_file16,
3146
- L: 77,
3145
+ L: 72,
3147
3146
  S: this,
3148
3147
  C: (f, a) => f(...a)
3149
3148
  });
3150
3149
  return false;
3151
3150
  }
3152
- const spaceKey = PublicKey8.from(rawSpaceKey);
3151
+ const spaceKey = PublicKey8.from(doc.experimental_spaceKey);
3153
3152
  const authorizedDevices = this._authorizedDevices.get(spaceKey);
3154
3153
  const deviceKeyHex = this.repo.peerMetadataByPeerId[peerId]?.dxos_deviceKey;
3155
3154
  if (!deviceKeyHex) {
@@ -3158,7 +3157,7 @@ var AutomergeHost = class {
3158
3157
  documentId
3159
3158
  }, {
3160
3159
  F: __dxlog_file16,
3161
- L: 87,
3160
+ L: 82,
3162
3161
  S: this,
3163
3162
  C: (f, a) => f(...a)
3164
3163
  });
@@ -3167,7 +3166,7 @@ var AutomergeHost = class {
3167
3166
  const deviceKey = PublicKey8.from(deviceKeyHex);
3168
3167
  const isAuthorized = authorizedDevices?.has(deviceKey) ?? false;
3169
3168
  log15("share policy check", {
3170
- localPeer: this._peerId,
3169
+ localPeer: localPeerId,
3171
3170
  remotePeer: peerId,
3172
3171
  documentId,
3173
3172
  deviceKey,
@@ -3175,7 +3174,7 @@ var AutomergeHost = class {
3175
3174
  isAuthorized
3176
3175
  }, {
3177
3176
  F: __dxlog_file16,
3178
- L: 93,
3177
+ L: 88,
3179
3178
  S: this,
3180
3179
  C: (f, a) => f(...a)
3181
3180
  });
@@ -3183,7 +3182,7 @@ var AutomergeHost = class {
3183
3182
  } catch (err) {
3184
3183
  log15.catch(err, void 0, {
3185
3184
  F: __dxlog_file16,
3186
- L: 103,
3185
+ L: 98,
3187
3186
  S: this,
3188
3187
  C: (f, a) => f(...a)
3189
3188
  });
@@ -3201,22 +3200,7 @@ var AutomergeHost = class {
3201
3200
  return mapValues(this._repo.handles, (handle) => ({
3202
3201
  state: handle.state,
3203
3202
  hasDoc: !!handle.docSync(),
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
- })
3203
+ heads: handle.docSync() ? automerge.getHeads(handle.docSync()) : null
3220
3204
  }));
3221
3205
  }
3222
3206
  _automergePeers() {
@@ -3250,16 +3234,13 @@ var AutomergeHost = class {
3250
3234
  deviceKey
3251
3235
  }, {
3252
3236
  F: __dxlog_file16,
3253
- L: 177,
3237
+ L: 155,
3254
3238
  S: this,
3255
3239
  C: (f, a) => f(...a)
3256
3240
  });
3257
3241
  defaultMap(this._authorizedDevices, spaceKey, () => new ComplexSet(PublicKey8.hash)).add(deviceKey);
3258
3242
  }
3259
3243
  };
3260
- _ts_decorate9([
3261
- trace6.info()
3262
- ], AutomergeHost.prototype, "_peerId", void 0);
3263
3244
  _ts_decorate9([
3264
3245
  trace6.info({
3265
3246
  depth: null
@@ -3304,4 +3285,4 @@ export {
3304
3285
  MeshNetworkAdapter,
3305
3286
  AutomergeHost
3306
3287
  };
3307
- //# sourceMappingURL=chunk-DHCMI2ID.mjs.map
3288
+ //# sourceMappingURL=chunk-WIB35LJH.mjs.map