@dxos/client-services 0.1.58-main.fa022ee → 0.1.58-main.ffb4cc4

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 (58) hide show
  1. package/dist/lib/browser/{chunk-SNPC4XOB.mjs → chunk-RELEQQS5.mjs} +108 -78
  2. package/dist/lib/browser/chunk-RELEQQS5.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +5 -6
  4. package/dist/lib/browser/index.mjs.map +2 -2
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +3 -3
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  8. package/dist/lib/node/index.cjs +109 -80
  9. package/dist/lib/node/index.cjs.map +4 -4
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/packlets/testing/index.cjs +107 -77
  12. package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
  13. package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
  14. package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
  15. package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +1 -1
  16. package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
  17. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +1 -1
  18. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
  19. package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
  20. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  21. package/dist/types/src/packlets/services/service-host.d.ts +1 -0
  22. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  23. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  24. package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
  25. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  26. package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
  27. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  28. package/dist/types/src/packlets/testing/test-builder.d.ts +1 -1
  29. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  30. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
  31. package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
  32. package/dist/types/src/version.d.ts +1 -1
  33. package/package.json +35 -34
  34. package/src/packlets/devices/devices-service.test.ts +1 -1
  35. package/src/packlets/devtools/devtools.ts +1 -1
  36. package/src/packlets/identity/authenticator.ts +1 -4
  37. package/src/packlets/identity/identity-manager.test.ts +1 -1
  38. package/src/packlets/identity/identity-service.test.ts +1 -1
  39. package/src/packlets/identity/identity.test.ts +1 -1
  40. package/src/packlets/invitations/device-invitation-protocol.ts +1 -1
  41. package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
  42. package/src/packlets/network/network-service.test.ts +1 -1
  43. package/src/packlets/services/diagnostics.ts +2 -2
  44. package/src/packlets/services/service-context.ts +5 -11
  45. package/src/packlets/services/service-host.test.ts +3 -3
  46. package/src/packlets/services/service-host.ts +42 -6
  47. package/src/packlets/services/service-registry.test.ts +1 -1
  48. package/src/packlets/spaces/data-space-manager.test.ts +1 -1
  49. package/src/packlets/spaces/data-space-manager.ts +1 -1
  50. package/src/packlets/spaces/data-space.ts +1 -1
  51. package/src/packlets/spaces/spaces-service.test.ts +1 -1
  52. package/src/packlets/spaces/spaces-service.ts +1 -1
  53. package/src/packlets/storage/storage.ts +9 -9
  54. package/src/packlets/testing/test-builder.ts +3 -3
  55. package/src/packlets/vault/iframe-host-runtime.ts +1 -1
  56. package/src/packlets/vault/worker-runtime.ts +9 -6
  57. package/src/version.ts +1 -1
  58. package/dist/lib/browser/chunk-SNPC4XOB.mjs.map +0 -7
@@ -70,9 +70,6 @@ var import_log = require("@dxos/log");
70
70
  var import_protocols = require("@dxos/protocols");
71
71
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
72
72
 
73
- // packages/sdk/client-services/src/version.ts
74
- var DXOS_VERSION = "0.1.58-main.fa022ee";
75
-
76
73
  // packages/sdk/client-services/src/packlets/services/platform.ts
77
74
  var getPlatform = () => {
78
75
  if (process.browser) {
@@ -101,6 +98,9 @@ var getPlatform = () => {
101
98
  }
102
99
  };
103
100
 
101
+ // packages/sdk/client-services/src/version.ts
102
+ var DXOS_VERSION = "0.1.58-main.ffb4cc4";
103
+
104
104
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
105
105
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
106
106
  var DEFAULT_TIMEOUT = 1e3;
@@ -255,7 +255,6 @@ var createAuthProvider = (signer) => async (nonce) => {
255
255
  return Credential.encode(credential);
256
256
  };
257
257
  var TrustedKeySetAuthVerifier = class {
258
- // prettier-ignore
259
258
  constructor(_params) {
260
259
  this._params = _params;
261
260
  this._ctx = new import_context.Context();
@@ -270,7 +269,7 @@ var TrustedKeySetAuthVerifier = class {
270
269
  credential
271
270
  }, {
272
271
  F: __dxlog_file2,
273
- L: 59,
272
+ L: 56,
274
273
  S: this,
275
274
  C: (f, a) => f(...a)
276
275
  });
@@ -280,7 +279,7 @@ var TrustedKeySetAuthVerifier = class {
280
279
  result
281
280
  }, {
282
281
  F: __dxlog_file2,
283
- L: 63,
282
+ L: 60,
284
283
  S: this,
285
284
  C: (f, a) => f(...a)
286
285
  });
@@ -292,7 +291,7 @@ var TrustedKeySetAuthVerifier = class {
292
291
  credential
293
292
  }, {
294
293
  F: __dxlog_file2,
295
- L: 68,
294
+ L: 65,
296
295
  S: this,
297
296
  C: (f, a) => f(...a)
298
297
  });
@@ -303,7 +302,7 @@ var TrustedKeySetAuthVerifier = class {
303
302
  key: credential.issuer
304
303
  }, {
305
304
  F: __dxlog_file2,
306
- L: 73,
305
+ L: 70,
307
306
  S: this,
308
307
  C: (f, a) => f(...a)
309
308
  });
@@ -319,7 +318,7 @@ var TrustedKeySetAuthVerifier = class {
319
318
  key: credential.issuer
320
319
  }, {
321
320
  F: __dxlog_file2,
322
- L: 84,
321
+ L: 81,
323
322
  S: this,
324
323
  C: (f, a) => f(...a)
325
324
  });
@@ -329,7 +328,7 @@ var TrustedKeySetAuthVerifier = class {
329
328
  key: credential.issuer
330
329
  }, {
331
330
  F: __dxlog_file2,
332
- L: 87,
331
+ L: 84,
333
332
  S: this,
334
333
  C: (f, a) => f(...a)
335
334
  });
@@ -3599,7 +3598,6 @@ function _ts_decorate5(decorators, target, key, desc) {
3599
3598
  }
3600
3599
  var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
3601
3600
  var ServiceContext = class ServiceContext2 {
3602
- // prettier-ignore
3603
3601
  constructor(storage, networkManager, signalManager, modelFactory) {
3604
3602
  this.storage = storage;
3605
3603
  this.networkManager = networkManager;
@@ -3639,7 +3637,7 @@ var ServiceContext = class ServiceContext2 {
3639
3637
  await this._checkStorageVersion();
3640
3638
  (0, import_log13.log)("opening...", void 0, {
3641
3639
  F: __dxlog_file15,
3642
- L: 135,
3640
+ L: 129,
3643
3641
  S: this,
3644
3642
  C: (f, a) => f(...a)
3645
3643
  });
@@ -3647,7 +3645,7 @@ var ServiceContext = class ServiceContext2 {
3647
3645
  id: this._instanceId
3648
3646
  }), {
3649
3647
  F: __dxlog_file15,
3650
- L: 136,
3648
+ L: 130,
3651
3649
  S: this,
3652
3650
  C: (f, a) => f(...a)
3653
3651
  });
@@ -3663,13 +3661,13 @@ var ServiceContext = class ServiceContext2 {
3663
3661
  id: this._instanceId
3664
3662
  }), {
3665
3663
  F: __dxlog_file15,
3666
- L: 146,
3664
+ L: 140,
3667
3665
  S: this,
3668
3666
  C: (f, a) => f(...a)
3669
3667
  });
3670
3668
  (0, import_log13.log)("opened", void 0, {
3671
3669
  F: __dxlog_file15,
3672
- L: 147,
3670
+ L: 141,
3673
3671
  S: this,
3674
3672
  C: (f, a) => f(...a)
3675
3673
  });
@@ -3677,7 +3675,7 @@ var ServiceContext = class ServiceContext2 {
3677
3675
  async close() {
3678
3676
  (0, import_log13.log)("closing...", void 0, {
3679
3677
  F: __dxlog_file15,
3680
- L: 151,
3678
+ L: 145,
3681
3679
  S: this,
3682
3680
  C: (f, a) => f(...a)
3683
3681
  });
@@ -3694,7 +3692,7 @@ var ServiceContext = class ServiceContext2 {
3694
3692
  await this.metadataStore.close();
3695
3693
  (0, import_log13.log)("closed", void 0, {
3696
3694
  F: __dxlog_file15,
3697
- L: 163,
3695
+ L: 157,
3698
3696
  S: this,
3699
3697
  C: (f, a) => f(...a)
3700
3698
  });
@@ -3708,7 +3706,7 @@ var ServiceContext = class ServiceContext2 {
3708
3706
  const factory = this._handlerFactories.get(invitation.kind);
3709
3707
  (0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
3710
3708
  F: __dxlog_file15,
3711
- L: 174,
3709
+ L: 168,
3712
3710
  S: this,
3713
3711
  A: [
3714
3712
  "factory",
@@ -3732,7 +3730,7 @@ var ServiceContext = class ServiceContext2 {
3732
3730
  async _initialize(ctx) {
3733
3731
  (0, import_log13.log)("initializing spaces...", void 0, {
3734
3732
  F: __dxlog_file15,
3735
- L: 195,
3733
+ L: 189,
3736
3734
  S: this,
3737
3735
  C: (f, a) => f(...a)
3738
3736
  });
@@ -3755,7 +3753,7 @@ var ServiceContext = class ServiceContext2 {
3755
3753
  this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
3756
3754
  (0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
3757
3755
  F: __dxlog_file15,
3758
- L: 218,
3756
+ L: 212,
3759
3757
  S: this,
3760
3758
  A: [
3761
3759
  "this.dataSpaceManager",
@@ -3779,7 +3777,7 @@ var ServiceContext = class ServiceContext2 {
3779
3777
  details: assertion
3780
3778
  }, {
3781
3779
  F: __dxlog_file15,
3782
- L: 234,
3780
+ L: 228,
3783
3781
  S: this,
3784
3782
  C: (f, a) => f(...a)
3785
3783
  });
@@ -3790,7 +3788,7 @@ var ServiceContext = class ServiceContext2 {
3790
3788
  details: assertion
3791
3789
  }, {
3792
3790
  F: __dxlog_file15,
3793
- L: 238,
3791
+ L: 232,
3794
3792
  S: this,
3795
3793
  C: (f, a) => f(...a)
3796
3794
  });
@@ -3801,7 +3799,7 @@ var ServiceContext = class ServiceContext2 {
3801
3799
  details: assertion
3802
3800
  }, {
3803
3801
  F: __dxlog_file15,
3804
- L: 243,
3802
+ L: 237,
3805
3803
  S: this,
3806
3804
  C: (f, a) => f(...a)
3807
3805
  });
@@ -3812,7 +3810,7 @@ var ServiceContext = class ServiceContext2 {
3812
3810
  } catch (err) {
3813
3811
  import_log13.log.catch(err, void 0, {
3814
3812
  F: __dxlog_file15,
3815
- L: 249,
3813
+ L: 243,
3816
3814
  S: this,
3817
3815
  C: (f, a) => f(...a)
3818
3816
  });
@@ -3839,6 +3837,7 @@ var import_client_protocol5 = require("@dxos/client-protocol");
3839
3837
  var import_context10 = require("@dxos/context");
3840
3838
  var import_document_model2 = require("@dxos/document-model");
3841
3839
  var import_echo_pipeline3 = require("@dxos/echo-pipeline");
3840
+ var import_echo_schema = require("@dxos/echo-schema");
3842
3841
  var import_invariant15 = require("@dxos/invariant");
3843
3842
  var import_keys12 = require("@dxos/keys");
3844
3843
  var import_log16 = require("@dxos/log");
@@ -3851,6 +3850,30 @@ var import_text_model = require("@dxos/text-model");
3851
3850
  var import_tracing5 = require("@dxos/tracing");
3852
3851
  var import_websocket_rpc = require("@dxos/websocket-rpc");
3853
3852
 
3853
+ // packages/sdk/client-services/src/packlets/services/service-registry.ts
3854
+ var ServiceRegistry = class {
3855
+ // prettier-ignore
3856
+ constructor(_serviceBundle, _handlers = {}) {
3857
+ this._serviceBundle = _serviceBundle;
3858
+ this._handlers = _handlers;
3859
+ }
3860
+ get descriptors() {
3861
+ return this._serviceBundle;
3862
+ }
3863
+ get services() {
3864
+ return this._handlers;
3865
+ }
3866
+ setServices(services) {
3867
+ this._handlers = services;
3868
+ }
3869
+ addService(name, service) {
3870
+ this._handlers[name] = service;
3871
+ }
3872
+ removeService(name) {
3873
+ delete this._handlers[name];
3874
+ }
3875
+ };
3876
+
3854
3877
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
3855
3878
  var import_async12 = require("@dxos/async");
3856
3879
  var import_codec_protobuf6 = require("@dxos/codec-protobuf");
@@ -4417,23 +4440,23 @@ var import_random_access_storage = require("@dxos/random-access-storage");
4417
4440
  var import_util8 = require("@dxos/util");
4418
4441
  var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
4419
4442
  var createStorageObjects = (config) => {
4420
- const { path = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config ?? {};
4421
- if (persistent && storageType === StorageDriver.RAM) {
4443
+ const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
4444
+ if (persistent && dataStore === StorageDriver.RAM) {
4422
4445
  throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
4423
4446
  }
4424
- if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
4447
+ if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
4425
4448
  throw new import_protocols11.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
4426
4449
  }
4427
- if (persistent && keyStorage === StorageDriver.RAM) {
4450
+ if (persistent && keyStore === StorageDriver.RAM) {
4428
4451
  throw new import_protocols11.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
4429
4452
  }
4430
- if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
4453
+ if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
4431
4454
  throw new import_protocols11.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
4432
4455
  }
4433
4456
  return {
4434
4457
  storage: (0, import_random_access_storage.createStorage)({
4435
- type: persistent ? toStorageType(storageType) : import_random_access_storage.StorageType.RAM,
4436
- root: `${path}/`
4458
+ type: persistent ? toStorageType(dataStore) : import_random_access_storage.StorageType.RAM,
4459
+ root: `${dataRoot}/`
4437
4460
  })
4438
4461
  };
4439
4462
  };
@@ -4512,30 +4535,6 @@ var SystemServiceImpl = class {
4512
4535
  }
4513
4536
  };
4514
4537
 
4515
- // packages/sdk/client-services/src/packlets/services/service-registry.ts
4516
- var ServiceRegistry = class {
4517
- // prettier-ignore
4518
- constructor(_serviceBundle, _handlers = {}) {
4519
- this._serviceBundle = _serviceBundle;
4520
- this._handlers = _handlers;
4521
- }
4522
- get descriptors() {
4523
- return this._serviceBundle;
4524
- }
4525
- get services() {
4526
- return this._handlers;
4527
- }
4528
- setServices(services) {
4529
- this._handlers = services;
4530
- }
4531
- addService(name, service) {
4532
- this._handlers[name] = service;
4533
- }
4534
- removeService(name) {
4535
- delete this._handlers[name];
4536
- }
4537
- };
4538
-
4539
4538
  // packages/sdk/client-services/src/packlets/services/service-host.ts
4540
4539
  function _ts_decorate7(decorators, target, key, desc) {
4541
4540
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4551,6 +4550,18 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
4551
4550
  var createDefaultModelFactory = () => {
4552
4551
  return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
4553
4552
  };
4553
+ var createGenesisMutationFromTypedObject = (obj) => {
4554
+ const snapshot = obj[import_echo_schema.base]._createSnapshot();
4555
+ return {
4556
+ objectId: obj[import_echo_schema.base]._id,
4557
+ genesis: {
4558
+ modelType: obj[import_echo_schema.base]._modelConstructor.meta.type
4559
+ },
4560
+ snapshot: {
4561
+ model: snapshot
4562
+ }
4563
+ };
4564
+ };
4554
4565
  var ClientServicesHost = class ClientServicesHost2 {
4555
4566
  constructor({
4556
4567
  config,
@@ -4637,7 +4648,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4637
4648
  initialize({ config, ...options }) {
4638
4649
  (0, import_invariant15.invariant)(!this._open, "service host is open", {
4639
4650
  F: __dxlog_file17,
4640
- L: 184,
4651
+ L: 201,
4641
4652
  S: this,
4642
4653
  A: [
4643
4654
  "!this._open",
@@ -4646,14 +4657,14 @@ var ClientServicesHost = class ClientServicesHost2 {
4646
4657
  });
4647
4658
  (0, import_log16.log)("initializing...", void 0, {
4648
4659
  F: __dxlog_file17,
4649
- L: 185,
4660
+ L: 202,
4650
4661
  S: this,
4651
4662
  C: (f, a) => f(...a)
4652
4663
  });
4653
4664
  if (config) {
4654
4665
  (0, import_invariant15.invariant)(!this._config, "config already set", {
4655
4666
  F: __dxlog_file17,
4656
- L: 188,
4667
+ L: 205,
4657
4668
  S: this,
4658
4669
  A: [
4659
4670
  "!this._config",
@@ -4671,7 +4682,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4671
4682
  this._signalManager = signalManager;
4672
4683
  (0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
4673
4684
  F: __dxlog_file17,
4674
- L: 204,
4685
+ L: 221,
4675
4686
  S: this,
4676
4687
  A: [
4677
4688
  "!this._networkManager",
@@ -4685,7 +4696,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4685
4696
  });
4686
4697
  (0, import_log16.log)("initialized", void 0, {
4687
4698
  F: __dxlog_file17,
4688
- L: 211,
4699
+ L: 228,
4689
4700
  S: this,
4690
4701
  C: (f, a) => f(...a)
4691
4702
  });
@@ -4699,13 +4710,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4699
4710
  id: traceId
4700
4711
  }), {
4701
4712
  F: __dxlog_file17,
4702
- L: 222,
4713
+ L: 239,
4703
4714
  S: this,
4704
4715
  C: (f, a) => f(...a)
4705
4716
  });
4706
4717
  (0, import_invariant15.invariant)(this._config, "config not set", {
4707
4718
  F: __dxlog_file17,
4708
- L: 224,
4719
+ L: 241,
4709
4720
  S: this,
4710
4721
  A: [
4711
4722
  "this._config",
@@ -4714,7 +4725,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4714
4725
  });
4715
4726
  (0, import_invariant15.invariant)(this._storage, "storage not set", {
4716
4727
  F: __dxlog_file17,
4717
- L: 225,
4728
+ L: 242,
4718
4729
  S: this,
4719
4730
  A: [
4720
4731
  "this._storage",
@@ -4723,7 +4734,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4723
4734
  });
4724
4735
  (0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
4725
4736
  F: __dxlog_file17,
4726
- L: 226,
4737
+ L: 243,
4727
4738
  S: this,
4728
4739
  A: [
4729
4740
  "this._signalManager",
@@ -4732,7 +4743,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4732
4743
  });
4733
4744
  (0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
4734
4745
  F: __dxlog_file17,
4735
- L: 227,
4746
+ L: 244,
4736
4747
  S: this,
4737
4748
  A: [
4738
4749
  "this._networkManager",
@@ -4744,7 +4755,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4744
4755
  lockKey: this._resourceLock?.lockKey
4745
4756
  }, {
4746
4757
  F: __dxlog_file17,
4747
- L: 230,
4758
+ L: 247,
4748
4759
  S: this,
4749
4760
  C: (f, a) => f(...a)
4750
4761
  });
@@ -4753,7 +4764,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4753
4764
  this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
4754
4765
  this._serviceRegistry.setServices({
4755
4766
  SystemService: this._systemService,
4756
- IdentityService: new IdentityServiceImpl((params) => this._serviceContext.createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4767
+ IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4757
4768
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
4758
4769
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
4759
4770
  SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
@@ -4790,7 +4801,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4790
4801
  deviceKey
4791
4802
  }, {
4792
4803
  F: __dxlog_file17,
4793
- L: 299,
4804
+ L: 316,
4794
4805
  S: this,
4795
4806
  C: (f, a) => f(...a)
4796
4807
  });
@@ -4798,7 +4809,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4798
4809
  id: traceId
4799
4810
  }), {
4800
4811
  F: __dxlog_file17,
4801
- L: 300,
4812
+ L: 317,
4802
4813
  S: this,
4803
4814
  C: (f, a) => f(...a)
4804
4815
  });
@@ -4812,7 +4823,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4812
4823
  deviceKey
4813
4824
  }, {
4814
4825
  F: __dxlog_file17,
4815
- L: 311,
4826
+ L: 328,
4816
4827
  S: this,
4817
4828
  C: (f, a) => f(...a)
4818
4829
  });
@@ -4828,7 +4839,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4828
4839
  deviceKey
4829
4840
  }, {
4830
4841
  F: __dxlog_file17,
4831
- L: 318,
4842
+ L: 335,
4832
4843
  S: this,
4833
4844
  C: (f, a) => f(...a)
4834
4845
  });
@@ -4839,13 +4850,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4839
4850
  id: traceId
4840
4851
  }), {
4841
4852
  F: __dxlog_file17,
4842
- L: 323,
4853
+ L: 340,
4843
4854
  S: this,
4844
4855
  C: (f, a) => f(...a)
4845
4856
  });
4846
4857
  (0, import_log16.log)("resetting...", void 0, {
4847
4858
  F: __dxlog_file17,
4848
- L: 325,
4859
+ L: 342,
4849
4860
  S: this,
4850
4861
  C: (f, a) => f(...a)
4851
4862
  });
@@ -4853,7 +4864,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4853
4864
  await this._storage.reset();
4854
4865
  (0, import_log16.log)("reset", void 0, {
4855
4866
  F: __dxlog_file17,
4856
- L: 328,
4867
+ L: 345,
4857
4868
  S: this,
4858
4869
  C: (f, a) => f(...a)
4859
4870
  });
@@ -4861,12 +4872,31 @@ var ClientServicesHost = class ClientServicesHost2 {
4861
4872
  id: traceId
4862
4873
  }), {
4863
4874
  F: __dxlog_file17,
4864
- L: 329,
4875
+ L: 346,
4865
4876
  S: this,
4866
4877
  C: (f, a) => f(...a)
4867
4878
  });
4868
4879
  await this._callbacks?.onReset?.();
4869
4880
  }
4881
+ async _createIdentity(params) {
4882
+ const identity = await this._serviceContext.createIdentity(params);
4883
+ await this._serviceContext.initialized.wait();
4884
+ const space = await this._serviceContext.dataSpaceManager.createSpace();
4885
+ const obj = new import_client_protocol5.Properties();
4886
+ obj[import_client_protocol5.defaultKey] = identity.identityKey.toHex();
4887
+ await this._serviceRegistry.services.DataService.write({
4888
+ spaceKey: space.key,
4889
+ batch: {
4890
+ objects: [
4891
+ createGenesisMutationFromTypedObject(obj)
4892
+ ]
4893
+ }
4894
+ });
4895
+ await this._serviceRegistry.services.DataService.flush({
4896
+ spaceKey: space.key
4897
+ });
4898
+ return identity;
4899
+ }
4870
4900
  };
4871
4901
  _ts_decorate7([
4872
4902
  import_tracing5.trace.info()
@@ -5127,7 +5157,7 @@ var TestBuilder = class {
5127
5157
  };
5128
5158
  var TestPeer = class {
5129
5159
  constructor(signalContext, opts = {
5130
- storageType: import_random_access_storage2.StorageType.RAM
5160
+ dataStore: import_random_access_storage2.StorageType.RAM
5131
5161
  }) {
5132
5162
  this.signalContext = signalContext;
5133
5163
  this.opts = opts;
@@ -5138,7 +5168,7 @@ var TestPeer = class {
5138
5168
  }
5139
5169
  get storage() {
5140
5170
  return this._props.storage ??= (0, import_random_access_storage2.createStorage)({
5141
- type: this.opts.storageType
5171
+ type: this.opts.dataStore
5142
5172
  });
5143
5173
  }
5144
5174
  get keyring() {