@dxos/client-services 0.4.10-main.308cc0e → 0.4.10-main.35b4a08

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.
@@ -2769,7 +2769,7 @@ var getPlatform = () => {
2769
2769
  };
2770
2770
 
2771
2771
  // packages/sdk/client-services/src/version.ts
2772
- var DXOS_VERSION = "0.4.10-main.308cc0e";
2772
+ var DXOS_VERSION = "0.4.10-main.35b4a08";
2773
2773
 
2774
2774
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2775
2775
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -4406,7 +4406,7 @@ import { safeInstanceof } from "@dxos/util";
4406
4406
  import { getHeads } from "@dxos/automerge/automerge";
4407
4407
  import { warnAfterTimeout as warnAfterTimeout2 } from "@dxos/debug";
4408
4408
  import { idCodec } from "@dxos/protocols";
4409
- var createLoadDocuments = (automergeHost) => (
4409
+ var createSelectedDocumentsIterator = (automergeHost) => (
4410
4410
  /**
4411
4411
  * Get object data blobs from Automerge Repo by ids.
4412
4412
  * @param ids
@@ -4419,17 +4419,17 @@ var createLoadDocuments = (automergeHost) => (
4419
4419
  await warnAfterTimeout2(5e3, "to long to load doc", () => handle.whenReady());
4420
4420
  const doc = handle.docSync();
4421
4421
  const hash = getHeads(doc).join("");
4422
- yield [
4422
+ yield doc.objects?.[objectId] ? [
4423
4423
  {
4424
4424
  id,
4425
4425
  object: doc.objects[objectId],
4426
4426
  currentHash: hash
4427
4427
  }
4428
- ];
4428
+ ] : [];
4429
4429
  }
4430
4430
  }
4431
4431
  );
4432
- var createGetAllDocuments = (automergeHost) => (
4432
+ var createDocumentsIterator = (automergeHost) => (
4433
4433
  /**
4434
4434
  * Recursively get all object data blobs from Automerge Repo.
4435
4435
  * @param ids
@@ -4452,7 +4452,7 @@ var createGetAllDocuments = (automergeHost) => (
4452
4452
  objectId
4453
4453
  }),
4454
4454
  object,
4455
- currentHash: heads.at(-1)
4455
+ currentHash: heads.join("")
4456
4456
  };
4457
4457
  });
4458
4458
  }
@@ -4536,8 +4536,8 @@ var ServiceContext = class {
4536
4536
  directory: storage.createDirectory("index-store")
4537
4537
  }),
4538
4538
  metadataStore: this.indexMetadata,
4539
- loadDocuments: createLoadDocuments(this.automergeHost),
4540
- getAllDocuments: createGetAllDocuments(this.automergeHost)
4539
+ loadDocuments: createSelectedDocumentsIterator(this.automergeHost),
4540
+ getAllDocuments: createDocumentsIterator(this.automergeHost)
4541
4541
  });
4542
4542
  this.invitations = new InvitationsHandler(this.networkManager);
4543
4543
  this._handlerFactories.set(Invitation6.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? failUndefined2(), this._acceptIdentity.bind(this)));
@@ -4950,8 +4950,8 @@ var toStorageType = (type) => {
4950
4950
  import { Event as Event9, synchronized as synchronized3 } from "@dxos/async";
4951
4951
  import { Properties, clientServiceBundle, defaultKey } from "@dxos/client-protocol";
4952
4952
  import { Context as Context11 } from "@dxos/context";
4953
- import { DataServiceImpl } from "@dxos/echo-pipeline";
4954
- import { getAutomergeObjectCore, getRawDoc } from "@dxos/echo-schema";
4953
+ import { DataServiceImpl, encodeReference } from "@dxos/echo-pipeline";
4954
+ import * as E from "@dxos/echo-schema";
4955
4955
  import { IndexServiceImpl } from "@dxos/indexing";
4956
4956
  import { invariant as invariant16 } from "@dxos/invariant";
4957
4957
  import { PublicKey as PublicKey12 } from "@dxos/keys";
@@ -5622,12 +5622,10 @@ var ClientServicesHost = class {
5622
5622
  const identity = await this._serviceContext.createIdentity(params);
5623
5623
  await this._serviceContext.initialized.wait();
5624
5624
  const space = await this._serviceContext.dataSpaceManager.createSpace();
5625
- const obj = new Properties(void 0);
5626
- obj[defaultKey] = identity.identityKey.toHex();
5627
5625
  const automergeIndex = space.automergeSpaceState.rootUrl;
5628
5626
  invariant16(automergeIndex, void 0, {
5629
5627
  F: __dxlog_file18,
5630
- L: 354,
5628
+ L: 351,
5631
5629
  S: this,
5632
5630
  A: [
5633
5631
  "automergeIndex",
@@ -5636,12 +5634,25 @@ var ClientServicesHost = class {
5636
5634
  });
5637
5635
  const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
5638
5636
  await document.whenReady();
5637
+ const properties = {
5638
+ system: {
5639
+ type: encodeReference(E.getTypeReference(Properties))
5640
+ },
5641
+ data: {
5642
+ [defaultKey]: identity.identityKey.toHex()
5643
+ },
5644
+ meta: {
5645
+ keys: []
5646
+ }
5647
+ };
5648
+ const propertiesId = PublicKey12.random().toHex();
5639
5649
  document.change((doc) => {
5640
5650
  assignDeep2(doc, [
5641
5651
  "objects",
5642
- getAutomergeObjectCore(obj).id
5643
- ], getRawDoc(obj).handle.docSync());
5652
+ propertiesId
5653
+ ], properties);
5644
5654
  });
5655
+ await this._serviceContext.automergeHost.repo.flush();
5645
5656
  return identity;
5646
5657
  }
5647
5658
  };
@@ -5697,4 +5708,4 @@ export {
5697
5708
  createStorageObjects,
5698
5709
  ClientServicesHost
5699
5710
  };
5700
- //# sourceMappingURL=chunk-IAFLYJN6.mjs.map
5711
+ //# sourceMappingURL=chunk-24G2JACZ.mjs.map