@dxos/client-services 0.1.58-main.f5feb2a → 0.1.58-main.f860ba2

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-L426VUEE.mjs → chunk-KE66TOYT.mjs} +109 -79
  2. package/dist/lib/browser/chunk-KE66TOYT.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 +110 -81
  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 +108 -78
  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 +2 -2
  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-L426VUEE.mjs.map +0 -7
@@ -357,7 +357,6 @@ var createAuthProvider = (signer) => async (nonce) => {
357
357
  return Credential.encode(credential);
358
358
  };
359
359
  var TrustedKeySetAuthVerifier = class {
360
- // prettier-ignore
361
360
  constructor(_params) {
362
361
  this._params = _params;
363
362
  this._ctx = new Context2();
@@ -372,7 +371,7 @@ var TrustedKeySetAuthVerifier = class {
372
371
  credential
373
372
  }, {
374
373
  F: __dxlog_file,
375
- L: 59,
374
+ L: 56,
376
375
  S: this,
377
376
  C: (f, a) => f(...a)
378
377
  });
@@ -382,7 +381,7 @@ var TrustedKeySetAuthVerifier = class {
382
381
  result
383
382
  }, {
384
383
  F: __dxlog_file,
385
- L: 63,
384
+ L: 60,
386
385
  S: this,
387
386
  C: (f, a) => f(...a)
388
387
  });
@@ -394,7 +393,7 @@ var TrustedKeySetAuthVerifier = class {
394
393
  credential
395
394
  }, {
396
395
  F: __dxlog_file,
397
- L: 68,
396
+ L: 65,
398
397
  S: this,
399
398
  C: (f, a) => f(...a)
400
399
  });
@@ -405,7 +404,7 @@ var TrustedKeySetAuthVerifier = class {
405
404
  key: credential.issuer
406
405
  }, {
407
406
  F: __dxlog_file,
408
- L: 73,
407
+ L: 70,
409
408
  S: this,
410
409
  C: (f, a) => f(...a)
411
410
  });
@@ -421,7 +420,7 @@ var TrustedKeySetAuthVerifier = class {
421
420
  key: credential.issuer
422
421
  }, {
423
422
  F: __dxlog_file,
424
- L: 84,
423
+ L: 81,
425
424
  S: this,
426
425
  C: (f, a) => f(...a)
427
426
  });
@@ -431,7 +430,7 @@ var TrustedKeySetAuthVerifier = class {
431
430
  key: credential.issuer
432
431
  }, {
433
432
  F: __dxlog_file,
434
- L: 87,
433
+ L: 84,
435
434
  S: this,
436
435
  C: (f, a) => f(...a)
437
436
  });
@@ -2470,9 +2469,6 @@ import { log as log8 } from "@dxos/log";
2470
2469
  import { STORAGE_VERSION } from "@dxos/protocols";
2471
2470
  import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
2472
2471
 
2473
- // packages/sdk/client-services/src/version.ts
2474
- var DXOS_VERSION = "0.1.58-main.f5feb2a";
2475
-
2476
2472
  // packages/sdk/client-services/src/packlets/services/platform.ts
2477
2473
  var getPlatform = () => {
2478
2474
  if (process.browser) {
@@ -2501,6 +2497,9 @@ var getPlatform = () => {
2501
2497
  }
2502
2498
  };
2503
2499
 
2500
+ // packages/sdk/client-services/src/version.ts
2501
+ var DXOS_VERSION = "0.1.58-main.f860ba2";
2502
+
2504
2503
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2505
2504
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2506
2505
  var DEFAULT_TIMEOUT = 1e3;
@@ -3747,7 +3746,7 @@ var SpacesServiceImpl = class {
3747
3746
  subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.forceTrigger()));
3748
3747
  subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
3749
3748
  subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, () => scheduler.trigger()));
3750
- space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger());
3749
+ subscriptions.add(space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger()));
3751
3750
  if (space.dataPipeline.pipelineState) {
3752
3751
  subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.on(ctx, () => scheduler.trigger()));
3753
3752
  }
@@ -3927,7 +3926,6 @@ function _ts_decorate5(decorators, target, key, desc) {
3927
3926
  }
3928
3927
  var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
3929
3928
  var ServiceContext = class ServiceContext2 {
3930
- // prettier-ignore
3931
3929
  constructor(storage, networkManager, signalManager, modelFactory) {
3932
3930
  this.storage = storage;
3933
3931
  this.networkManager = networkManager;
@@ -3967,7 +3965,7 @@ var ServiceContext = class ServiceContext2 {
3967
3965
  await this._checkStorageVersion();
3968
3966
  log13("opening...", void 0, {
3969
3967
  F: __dxlog_file15,
3970
- L: 135,
3968
+ L: 129,
3971
3969
  S: this,
3972
3970
  C: (f, a) => f(...a)
3973
3971
  });
@@ -3975,7 +3973,7 @@ var ServiceContext = class ServiceContext2 {
3975
3973
  id: this._instanceId
3976
3974
  }), {
3977
3975
  F: __dxlog_file15,
3978
- L: 136,
3976
+ L: 130,
3979
3977
  S: this,
3980
3978
  C: (f, a) => f(...a)
3981
3979
  });
@@ -3991,13 +3989,13 @@ var ServiceContext = class ServiceContext2 {
3991
3989
  id: this._instanceId
3992
3990
  }), {
3993
3991
  F: __dxlog_file15,
3994
- L: 146,
3992
+ L: 140,
3995
3993
  S: this,
3996
3994
  C: (f, a) => f(...a)
3997
3995
  });
3998
3996
  log13("opened", void 0, {
3999
3997
  F: __dxlog_file15,
4000
- L: 147,
3998
+ L: 141,
4001
3999
  S: this,
4002
4000
  C: (f, a) => f(...a)
4003
4001
  });
@@ -4005,7 +4003,7 @@ var ServiceContext = class ServiceContext2 {
4005
4003
  async close() {
4006
4004
  log13("closing...", void 0, {
4007
4005
  F: __dxlog_file15,
4008
- L: 151,
4006
+ L: 145,
4009
4007
  S: this,
4010
4008
  C: (f, a) => f(...a)
4011
4009
  });
@@ -4022,7 +4020,7 @@ var ServiceContext = class ServiceContext2 {
4022
4020
  await this.metadataStore.close();
4023
4021
  log13("closed", void 0, {
4024
4022
  F: __dxlog_file15,
4025
- L: 163,
4023
+ L: 157,
4026
4024
  S: this,
4027
4025
  C: (f, a) => f(...a)
4028
4026
  });
@@ -4036,7 +4034,7 @@ var ServiceContext = class ServiceContext2 {
4036
4034
  const factory = this._handlerFactories.get(invitation.kind);
4037
4035
  invariant13(factory, `Unknown invitation kind: ${invitation.kind}`, {
4038
4036
  F: __dxlog_file15,
4039
- L: 174,
4037
+ L: 168,
4040
4038
  S: this,
4041
4039
  A: [
4042
4040
  "factory",
@@ -4060,7 +4058,7 @@ var ServiceContext = class ServiceContext2 {
4060
4058
  async _initialize(ctx) {
4061
4059
  log13("initializing spaces...", void 0, {
4062
4060
  F: __dxlog_file15,
4063
- L: 195,
4061
+ L: 189,
4064
4062
  S: this,
4065
4063
  C: (f, a) => f(...a)
4066
4064
  });
@@ -4083,7 +4081,7 @@ var ServiceContext = class ServiceContext2 {
4083
4081
  this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
4084
4082
  invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4085
4083
  F: __dxlog_file15,
4086
- L: 218,
4084
+ L: 212,
4087
4085
  S: this,
4088
4086
  A: [
4089
4087
  "this.dataSpaceManager",
@@ -4107,7 +4105,7 @@ var ServiceContext = class ServiceContext2 {
4107
4105
  details: assertion
4108
4106
  }, {
4109
4107
  F: __dxlog_file15,
4110
- L: 234,
4108
+ L: 228,
4111
4109
  S: this,
4112
4110
  C: (f, a) => f(...a)
4113
4111
  });
@@ -4118,7 +4116,7 @@ var ServiceContext = class ServiceContext2 {
4118
4116
  details: assertion
4119
4117
  }, {
4120
4118
  F: __dxlog_file15,
4121
- L: 238,
4119
+ L: 232,
4122
4120
  S: this,
4123
4121
  C: (f, a) => f(...a)
4124
4122
  });
@@ -4129,7 +4127,7 @@ var ServiceContext = class ServiceContext2 {
4129
4127
  details: assertion
4130
4128
  }, {
4131
4129
  F: __dxlog_file15,
4132
- L: 243,
4130
+ L: 237,
4133
4131
  S: this,
4134
4132
  C: (f, a) => f(...a)
4135
4133
  });
@@ -4140,7 +4138,7 @@ var ServiceContext = class ServiceContext2 {
4140
4138
  } catch (err) {
4141
4139
  log13.catch(err, void 0, {
4142
4140
  F: __dxlog_file15,
4143
- L: 249,
4141
+ L: 243,
4144
4142
  S: this,
4145
4143
  C: (f, a) => f(...a)
4146
4144
  });
@@ -4161,6 +4159,30 @@ ServiceContext = _ts_decorate5([
4161
4159
  Trace2.resource()
4162
4160
  ], ServiceContext);
4163
4161
 
4162
+ // packages/sdk/client-services/src/packlets/services/service-registry.ts
4163
+ var ServiceRegistry = class {
4164
+ // prettier-ignore
4165
+ constructor(_serviceBundle, _handlers = {}) {
4166
+ this._serviceBundle = _serviceBundle;
4167
+ this._handlers = _handlers;
4168
+ }
4169
+ get descriptors() {
4170
+ return this._serviceBundle;
4171
+ }
4172
+ get services() {
4173
+ return this._handlers;
4174
+ }
4175
+ setServices(services) {
4176
+ this._handlers = services;
4177
+ }
4178
+ addService(name, service) {
4179
+ this._handlers[name] = service;
4180
+ }
4181
+ removeService(name) {
4182
+ delete this._handlers[name];
4183
+ }
4184
+ };
4185
+
4164
4186
  // packages/sdk/client-services/src/packlets/locks/browser.ts
4165
4187
  import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
4166
4188
  import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
@@ -4293,23 +4315,23 @@ import { createStorage, StorageType } from "@dxos/random-access-storage";
4293
4315
  import { isNode } from "@dxos/util";
4294
4316
  var StorageDriver = Runtime.Client.Storage.StorageDriver;
4295
4317
  var createStorageObjects = (config) => {
4296
- const { path = isNode() ? DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config ?? {};
4297
- if (persistent && storageType === StorageDriver.RAM) {
4318
+ const { persistent = false, keyStore, dataStore, dataRoot = isNode() ? DX_DATA : "dxos/storage" } = config ?? {};
4319
+ if (persistent && dataStore === StorageDriver.RAM) {
4298
4320
  throw new InvalidConfigError("RAM storage cannot be used in persistent mode.");
4299
4321
  }
4300
- if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
4322
+ if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
4301
4323
  throw new InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
4302
4324
  }
4303
- if (persistent && keyStorage === StorageDriver.RAM) {
4325
+ if (persistent && keyStore === StorageDriver.RAM) {
4304
4326
  throw new InvalidConfigError("RAM key storage cannot be used in persistent mode.");
4305
4327
  }
4306
- if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
4328
+ if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
4307
4329
  throw new InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
4308
4330
  }
4309
4331
  return {
4310
4332
  storage: createStorage({
4311
- type: persistent ? toStorageType(storageType) : StorageType.RAM,
4312
- root: `${path}/`
4333
+ type: persistent ? toStorageType(dataStore) : StorageType.RAM,
4334
+ root: `${dataRoot}/`
4313
4335
  })
4314
4336
  };
4315
4337
  };
@@ -4334,36 +4356,13 @@ var toStorageType = (type) => {
4334
4356
  }
4335
4357
  };
4336
4358
 
4337
- // packages/sdk/client-services/src/packlets/services/service-registry.ts
4338
- var ServiceRegistry = class {
4339
- // prettier-ignore
4340
- constructor(_serviceBundle, _handlers = {}) {
4341
- this._serviceBundle = _serviceBundle;
4342
- this._handlers = _handlers;
4343
- }
4344
- get descriptors() {
4345
- return this._serviceBundle;
4346
- }
4347
- get services() {
4348
- return this._handlers;
4349
- }
4350
- setServices(services) {
4351
- this._handlers = services;
4352
- }
4353
- addService(name, service) {
4354
- this._handlers[name] = service;
4355
- }
4356
- removeService(name) {
4357
- delete this._handlers[name];
4358
- }
4359
- };
4360
-
4361
4359
  // packages/sdk/client-services/src/packlets/services/service-host.ts
4362
4360
  import { Event as Event8, synchronized as synchronized3 } from "@dxos/async";
4363
- import { clientServiceBundle } from "@dxos/client-protocol";
4361
+ import { clientServiceBundle, defaultKey, Properties } from "@dxos/client-protocol";
4364
4362
  import { Context as Context10 } from "@dxos/context";
4365
4363
  import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
4366
4364
  import { DataServiceImpl } from "@dxos/echo-pipeline";
4365
+ import { base } from "@dxos/echo-schema";
4367
4366
  import { invariant as invariant14 } from "@dxos/invariant";
4368
4367
  import { PublicKey as PublicKey10 } from "@dxos/keys";
4369
4368
  import { log as log16 } from "@dxos/log";
@@ -4637,6 +4636,18 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
4637
4636
  var createDefaultModelFactory = () => {
4638
4637
  return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
4639
4638
  };
4639
+ var createGenesisMutationFromTypedObject = (obj) => {
4640
+ const snapshot = obj[base]._createSnapshot();
4641
+ return {
4642
+ objectId: obj[base]._id,
4643
+ genesis: {
4644
+ modelType: obj[base]._modelConstructor.meta.type
4645
+ },
4646
+ snapshot: {
4647
+ model: snapshot
4648
+ }
4649
+ };
4650
+ };
4640
4651
  var ClientServicesHost = class ClientServicesHost2 {
4641
4652
  constructor({
4642
4653
  config,
@@ -4723,7 +4734,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4723
4734
  initialize({ config, ...options }) {
4724
4735
  invariant14(!this._open, "service host is open", {
4725
4736
  F: __dxlog_file17,
4726
- L: 184,
4737
+ L: 201,
4727
4738
  S: this,
4728
4739
  A: [
4729
4740
  "!this._open",
@@ -4732,14 +4743,14 @@ var ClientServicesHost = class ClientServicesHost2 {
4732
4743
  });
4733
4744
  log16("initializing...", void 0, {
4734
4745
  F: __dxlog_file17,
4735
- L: 185,
4746
+ L: 202,
4736
4747
  S: this,
4737
4748
  C: (f, a) => f(...a)
4738
4749
  });
4739
4750
  if (config) {
4740
4751
  invariant14(!this._config, "config already set", {
4741
4752
  F: __dxlog_file17,
4742
- L: 188,
4753
+ L: 205,
4743
4754
  S: this,
4744
4755
  A: [
4745
4756
  "!this._config",
@@ -4757,7 +4768,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4757
4768
  this._signalManager = signalManager;
4758
4769
  invariant14(!this._networkManager, "network manager already set", {
4759
4770
  F: __dxlog_file17,
4760
- L: 204,
4771
+ L: 221,
4761
4772
  S: this,
4762
4773
  A: [
4763
4774
  "!this._networkManager",
@@ -4771,7 +4782,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4771
4782
  });
4772
4783
  log16("initialized", void 0, {
4773
4784
  F: __dxlog_file17,
4774
- L: 211,
4785
+ L: 228,
4775
4786
  S: this,
4776
4787
  C: (f, a) => f(...a)
4777
4788
  });
@@ -4785,13 +4796,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4785
4796
  id: traceId
4786
4797
  }), {
4787
4798
  F: __dxlog_file17,
4788
- L: 222,
4799
+ L: 239,
4789
4800
  S: this,
4790
4801
  C: (f, a) => f(...a)
4791
4802
  });
4792
4803
  invariant14(this._config, "config not set", {
4793
4804
  F: __dxlog_file17,
4794
- L: 224,
4805
+ L: 241,
4795
4806
  S: this,
4796
4807
  A: [
4797
4808
  "this._config",
@@ -4800,7 +4811,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4800
4811
  });
4801
4812
  invariant14(this._storage, "storage not set", {
4802
4813
  F: __dxlog_file17,
4803
- L: 225,
4814
+ L: 242,
4804
4815
  S: this,
4805
4816
  A: [
4806
4817
  "this._storage",
@@ -4809,7 +4820,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4809
4820
  });
4810
4821
  invariant14(this._signalManager, "signal manager not set", {
4811
4822
  F: __dxlog_file17,
4812
- L: 226,
4823
+ L: 243,
4813
4824
  S: this,
4814
4825
  A: [
4815
4826
  "this._signalManager",
@@ -4818,7 +4829,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4818
4829
  });
4819
4830
  invariant14(this._networkManager, "network manager not set", {
4820
4831
  F: __dxlog_file17,
4821
- L: 227,
4832
+ L: 244,
4822
4833
  S: this,
4823
4834
  A: [
4824
4835
  "this._networkManager",
@@ -4830,7 +4841,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4830
4841
  lockKey: this._resourceLock?.lockKey
4831
4842
  }, {
4832
4843
  F: __dxlog_file17,
4833
- L: 230,
4844
+ L: 247,
4834
4845
  S: this,
4835
4846
  C: (f, a) => f(...a)
4836
4847
  });
@@ -4839,7 +4850,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4839
4850
  this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
4840
4851
  this._serviceRegistry.setServices({
4841
4852
  SystemService: this._systemService,
4842
- IdentityService: new IdentityServiceImpl((params) => this._serviceContext.createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4853
+ IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4843
4854
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
4844
4855
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
4845
4856
  SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
@@ -4876,7 +4887,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4876
4887
  deviceKey
4877
4888
  }, {
4878
4889
  F: __dxlog_file17,
4879
- L: 299,
4890
+ L: 316,
4880
4891
  S: this,
4881
4892
  C: (f, a) => f(...a)
4882
4893
  });
@@ -4884,7 +4895,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4884
4895
  id: traceId
4885
4896
  }), {
4886
4897
  F: __dxlog_file17,
4887
- L: 300,
4898
+ L: 317,
4888
4899
  S: this,
4889
4900
  C: (f, a) => f(...a)
4890
4901
  });
@@ -4898,7 +4909,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4898
4909
  deviceKey
4899
4910
  }, {
4900
4911
  F: __dxlog_file17,
4901
- L: 311,
4912
+ L: 328,
4902
4913
  S: this,
4903
4914
  C: (f, a) => f(...a)
4904
4915
  });
@@ -4914,7 +4925,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4914
4925
  deviceKey
4915
4926
  }, {
4916
4927
  F: __dxlog_file17,
4917
- L: 318,
4928
+ L: 335,
4918
4929
  S: this,
4919
4930
  C: (f, a) => f(...a)
4920
4931
  });
@@ -4925,13 +4936,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4925
4936
  id: traceId
4926
4937
  }), {
4927
4938
  F: __dxlog_file17,
4928
- L: 323,
4939
+ L: 340,
4929
4940
  S: this,
4930
4941
  C: (f, a) => f(...a)
4931
4942
  });
4932
4943
  log16("resetting...", void 0, {
4933
4944
  F: __dxlog_file17,
4934
- L: 325,
4945
+ L: 342,
4935
4946
  S: this,
4936
4947
  C: (f, a) => f(...a)
4937
4948
  });
@@ -4939,7 +4950,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4939
4950
  await this._storage.reset();
4940
4951
  log16("reset", void 0, {
4941
4952
  F: __dxlog_file17,
4942
- L: 328,
4953
+ L: 345,
4943
4954
  S: this,
4944
4955
  C: (f, a) => f(...a)
4945
4956
  });
@@ -4947,12 +4958,31 @@ var ClientServicesHost = class ClientServicesHost2 {
4947
4958
  id: traceId
4948
4959
  }), {
4949
4960
  F: __dxlog_file17,
4950
- L: 329,
4961
+ L: 346,
4951
4962
  S: this,
4952
4963
  C: (f, a) => f(...a)
4953
4964
  });
4954
4965
  await this._callbacks?.onReset?.();
4955
4966
  }
4967
+ async _createIdentity(params) {
4968
+ const identity = await this._serviceContext.createIdentity(params);
4969
+ await this._serviceContext.initialized.wait();
4970
+ const space = await this._serviceContext.dataSpaceManager.createSpace();
4971
+ const obj = new Properties();
4972
+ obj[defaultKey] = identity.identityKey.toHex();
4973
+ await this._serviceRegistry.services.DataService.write({
4974
+ spaceKey: space.key,
4975
+ batch: {
4976
+ objects: [
4977
+ createGenesisMutationFromTypedObject(obj)
4978
+ ]
4979
+ }
4980
+ });
4981
+ await this._serviceRegistry.services.DataService.flush({
4982
+ spaceKey: space.key
4983
+ });
4984
+ return identity;
4985
+ }
4956
4986
  };
4957
4987
  _ts_decorate7([
4958
4988
  Trace3.info()
@@ -4998,11 +5028,11 @@ export {
4998
5028
  DataSpaceManager,
4999
5029
  SpacesServiceImpl,
5000
5030
  ServiceContext,
5031
+ ServiceRegistry,
5001
5032
  Lock,
5002
5033
  isLocked,
5003
5034
  createStorageObjects,
5004
- ServiceRegistry,
5005
5035
  createDefaultModelFactory,
5006
5036
  ClientServicesHost
5007
5037
  };
5008
- //# sourceMappingURL=chunk-L426VUEE.mjs.map
5038
+ //# sourceMappingURL=chunk-KE66TOYT.mjs.map