@dxos/client-services 0.4.10-main.e158b1a → 0.4.10-main.eedd150
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.
- package/dist/lib/browser/{chunk-VIHM6GWA.mjs → chunk-I6GQX7F3.mjs} +103 -66
- package/dist/lib/browser/{chunk-VIHM6GWA.mjs.map → chunk-I6GQX7F3.mjs.map} +4 -4
- package/dist/lib/browser/index.mjs +3 -1
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +6 -4
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-52FE74JI.cjs → chunk-42TXJ32V.cjs} +96 -64
- package/dist/lib/node/chunk-42TXJ32V.cjs.map +7 -0
- package/dist/lib/node/index.cjs +39 -37
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +10 -8
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/services/service-context.d.ts +3 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/index.d.ts +1 -0
- package/dist/types/src/packlets/storage/index.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/level.d.ts +4 -0
- package/dist/types/src/packlets/storage/level.d.ts.map +1 -0
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/util.d.ts +4 -0
- package/dist/types/src/packlets/storage/util.d.ts.map +1 -0
- package/dist/types/src/packlets/testing/test-builder.d.ts +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -34
- package/src/packlets/devices/devices-service.test.ts +1 -1
- package/src/packlets/identity/identity-service.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
- package/src/packlets/network/network-service.test.ts +1 -1
- package/src/packlets/services/service-context.test.ts +5 -5
- package/src/packlets/services/service-context.ts +4 -1
- package/src/packlets/services/service-host.ts +29 -12
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +1 -1
- package/src/packlets/storage/index.ts +1 -0
- package/src/packlets/storage/level.ts +19 -0
- package/src/packlets/storage/storage.ts +3 -9
- package/src/packlets/storage/util.ts +19 -0
- package/src/packlets/testing/test-builder.ts +5 -3
- package/src/version.ts +1 -1
- package/dist/lib/node/chunk-52FE74JI.cjs.map +0 -7
|
@@ -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.
|
|
2772
|
+
var DXOS_VERSION = "0.4.10-main.eedd150";
|
|
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";
|
|
@@ -4494,8 +4494,9 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4494
4494
|
}
|
|
4495
4495
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4496
4496
|
var ServiceContext = class {
|
|
4497
|
-
constructor(storage, networkManager, signalManager, _runtimeParams) {
|
|
4497
|
+
constructor(storage, level, networkManager, signalManager, _runtimeParams) {
|
|
4498
4498
|
this.storage = storage;
|
|
4499
|
+
this.level = level;
|
|
4499
4500
|
this.networkManager = networkManager;
|
|
4500
4501
|
this.signalManager = signalManager;
|
|
4501
4502
|
this._runtimeParams = _runtimeParams;
|
|
@@ -4525,7 +4526,7 @@ var ServiceContext = class {
|
|
|
4525
4526
|
});
|
|
4526
4527
|
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
|
|
4527
4528
|
this.indexMetadata = new IndexMetadataStore({
|
|
4528
|
-
|
|
4529
|
+
db: level.sublevel("index-metadata")
|
|
4529
4530
|
});
|
|
4530
4531
|
this.automergeHost = new AutomergeHost({
|
|
4531
4532
|
directory: storage.createDirectory("automerge"),
|
|
@@ -4546,7 +4547,7 @@ var ServiceContext = class {
|
|
|
4546
4547
|
await this._checkStorageVersion();
|
|
4547
4548
|
log12("opening...", void 0, {
|
|
4548
4549
|
F: __dxlog_file15,
|
|
4549
|
-
L:
|
|
4550
|
+
L: 154,
|
|
4550
4551
|
S: this,
|
|
4551
4552
|
C: (f, a) => f(...a)
|
|
4552
4553
|
});
|
|
@@ -4554,7 +4555,7 @@ var ServiceContext = class {
|
|
|
4554
4555
|
id: this._instanceId
|
|
4555
4556
|
}), {
|
|
4556
4557
|
F: __dxlog_file15,
|
|
4557
|
-
L:
|
|
4558
|
+
L: 155,
|
|
4558
4559
|
S: this,
|
|
4559
4560
|
C: (f, a) => f(...a)
|
|
4560
4561
|
});
|
|
@@ -4570,13 +4571,13 @@ var ServiceContext = class {
|
|
|
4570
4571
|
id: this._instanceId
|
|
4571
4572
|
}), {
|
|
4572
4573
|
F: __dxlog_file15,
|
|
4573
|
-
L:
|
|
4574
|
+
L: 165,
|
|
4574
4575
|
S: this,
|
|
4575
4576
|
C: (f, a) => f(...a)
|
|
4576
4577
|
});
|
|
4577
4578
|
log12("opened", void 0, {
|
|
4578
4579
|
F: __dxlog_file15,
|
|
4579
|
-
L:
|
|
4580
|
+
L: 166,
|
|
4580
4581
|
S: this,
|
|
4581
4582
|
C: (f, a) => f(...a)
|
|
4582
4583
|
});
|
|
@@ -4584,7 +4585,7 @@ var ServiceContext = class {
|
|
|
4584
4585
|
async close() {
|
|
4585
4586
|
log12("closing...", void 0, {
|
|
4586
4587
|
F: __dxlog_file15,
|
|
4587
|
-
L:
|
|
4588
|
+
L: 170,
|
|
4588
4589
|
S: this,
|
|
4589
4590
|
C: (f, a) => f(...a)
|
|
4590
4591
|
});
|
|
@@ -4602,7 +4603,7 @@ var ServiceContext = class {
|
|
|
4602
4603
|
await this.indexer.destroy();
|
|
4603
4604
|
log12("closed", void 0, {
|
|
4604
4605
|
F: __dxlog_file15,
|
|
4605
|
-
L:
|
|
4606
|
+
L: 183,
|
|
4606
4607
|
S: this,
|
|
4607
4608
|
C: (f, a) => f(...a)
|
|
4608
4609
|
});
|
|
@@ -4616,7 +4617,7 @@ var ServiceContext = class {
|
|
|
4616
4617
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4617
4618
|
invariant14(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4618
4619
|
F: __dxlog_file15,
|
|
4619
|
-
L:
|
|
4620
|
+
L: 194,
|
|
4620
4621
|
S: this,
|
|
4621
4622
|
A: [
|
|
4622
4623
|
"factory",
|
|
@@ -4648,7 +4649,7 @@ var ServiceContext = class {
|
|
|
4648
4649
|
async _initialize(ctx) {
|
|
4649
4650
|
log12("initializing spaces...", void 0, {
|
|
4650
4651
|
F: __dxlog_file15,
|
|
4651
|
-
L:
|
|
4652
|
+
L: 225,
|
|
4652
4653
|
S: this,
|
|
4653
4654
|
C: (f, a) => f(...a)
|
|
4654
4655
|
});
|
|
@@ -4671,7 +4672,7 @@ var ServiceContext = class {
|
|
|
4671
4672
|
this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
|
|
4672
4673
|
invariant14(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4673
4674
|
F: __dxlog_file15,
|
|
4674
|
-
L:
|
|
4675
|
+
L: 249,
|
|
4675
4676
|
S: this,
|
|
4676
4677
|
A: [
|
|
4677
4678
|
"this.dataSpaceManager",
|
|
@@ -4695,7 +4696,7 @@ var ServiceContext = class {
|
|
|
4695
4696
|
details: assertion
|
|
4696
4697
|
}, {
|
|
4697
4698
|
F: __dxlog_file15,
|
|
4698
|
-
L:
|
|
4699
|
+
L: 265,
|
|
4699
4700
|
S: this,
|
|
4700
4701
|
C: (f, a) => f(...a)
|
|
4701
4702
|
});
|
|
@@ -4706,7 +4707,7 @@ var ServiceContext = class {
|
|
|
4706
4707
|
details: assertion
|
|
4707
4708
|
}, {
|
|
4708
4709
|
F: __dxlog_file15,
|
|
4709
|
-
L:
|
|
4710
|
+
L: 269,
|
|
4710
4711
|
S: this,
|
|
4711
4712
|
C: (f, a) => f(...a)
|
|
4712
4713
|
});
|
|
@@ -4717,7 +4718,7 @@ var ServiceContext = class {
|
|
|
4717
4718
|
details: assertion
|
|
4718
4719
|
}, {
|
|
4719
4720
|
F: __dxlog_file15,
|
|
4720
|
-
L:
|
|
4721
|
+
L: 274,
|
|
4721
4722
|
S: this,
|
|
4722
4723
|
C: (f, a) => f(...a)
|
|
4723
4724
|
});
|
|
@@ -4728,7 +4729,7 @@ var ServiceContext = class {
|
|
|
4728
4729
|
} catch (err) {
|
|
4729
4730
|
log12.catch(err, void 0, {
|
|
4730
4731
|
F: __dxlog_file15,
|
|
4731
|
-
L:
|
|
4732
|
+
L: 280,
|
|
4732
4733
|
S: this,
|
|
4733
4734
|
C: (f, a) => f(...a)
|
|
4734
4735
|
});
|
|
@@ -4898,14 +4899,27 @@ var isLocked = (lockPath) => {
|
|
|
4898
4899
|
};
|
|
4899
4900
|
|
|
4900
4901
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4901
|
-
import { DX_DATA } from "@dxos/client-protocol";
|
|
4902
4902
|
import { InvalidConfigError } from "@dxos/protocols";
|
|
4903
|
-
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
4903
|
+
import { Runtime as Runtime2 } from "@dxos/protocols/proto/dxos/config";
|
|
4904
4904
|
import { createStorage, StorageType } from "@dxos/random-access-storage";
|
|
4905
|
+
|
|
4906
|
+
// packages/sdk/client-services/src/packlets/storage/util.ts
|
|
4907
|
+
import { DX_DATA } from "@dxos/client-protocol";
|
|
4908
|
+
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
4905
4909
|
import { isNode as isNode2 } from "@dxos/util";
|
|
4906
|
-
var
|
|
4910
|
+
var getRootPath = (config) => {
|
|
4911
|
+
const { dataRoot = isNode2() ? DX_DATA : "dxos/storage" } = config ?? {};
|
|
4912
|
+
return `${dataRoot}/`;
|
|
4913
|
+
};
|
|
4914
|
+
var isPersistent = (config) => {
|
|
4915
|
+
const { persistent = false } = config ?? {};
|
|
4916
|
+
return config.dataStore !== void 0 && config.dataStore !== Runtime.Client.Storage.StorageDriver.RAM || persistent;
|
|
4917
|
+
};
|
|
4918
|
+
|
|
4919
|
+
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4920
|
+
var StorageDriver = Runtime2.Client.Storage.StorageDriver;
|
|
4907
4921
|
var createStorageObjects = (config) => {
|
|
4908
|
-
const { persistent = false, keyStore, dataStore
|
|
4922
|
+
const { persistent = false, keyStore, dataStore } = config ?? {};
|
|
4909
4923
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4910
4924
|
throw new InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4911
4925
|
}
|
|
@@ -4921,7 +4935,7 @@ var createStorageObjects = (config) => {
|
|
|
4921
4935
|
return {
|
|
4922
4936
|
storage: createStorage({
|
|
4923
4937
|
type: persistent ? toStorageType(dataStore) : StorageType.RAM,
|
|
4924
|
-
root:
|
|
4938
|
+
root: getRootPath(config)
|
|
4925
4939
|
})
|
|
4926
4940
|
};
|
|
4927
4941
|
};
|
|
@@ -4946,16 +4960,27 @@ var toStorageType = (type) => {
|
|
|
4946
4960
|
}
|
|
4947
4961
|
};
|
|
4948
4962
|
|
|
4963
|
+
// packages/sdk/client-services/src/packlets/storage/level.ts
|
|
4964
|
+
import { Level } from "level";
|
|
4965
|
+
import path from "@dxos/node-std/path";
|
|
4966
|
+
import { PublicKey as PublicKey11 } from "@dxos/keys";
|
|
4967
|
+
var createLevel = async (config) => {
|
|
4968
|
+
const persistent = isPersistent(config);
|
|
4969
|
+
const storagePath = persistent ? getRootPath(config) : path.join("tmp", "level", PublicKey11.random().toHex());
|
|
4970
|
+
const level = new Level(storagePath);
|
|
4971
|
+
await level.open();
|
|
4972
|
+
return level;
|
|
4973
|
+
};
|
|
4974
|
+
|
|
4949
4975
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4950
|
-
import { Event as Event9,
|
|
4951
|
-
import { clientServiceBundle, defaultKey,
|
|
4976
|
+
import { Event as Event9, synchronized as synchronized3 } from "@dxos/async";
|
|
4977
|
+
import { clientServiceBundle, defaultKey, Properties } from "@dxos/client-protocol";
|
|
4952
4978
|
import { Context as Context11 } from "@dxos/context";
|
|
4953
|
-
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
4979
|
+
import { DataServiceImpl, encodeReference } from "@dxos/echo-pipeline";
|
|
4954
4980
|
import * as E from "@dxos/echo-schema";
|
|
4955
|
-
import { createRawObjectDoc } from "@dxos/echo-schema";
|
|
4956
4981
|
import { IndexServiceImpl } from "@dxos/indexing";
|
|
4957
4982
|
import { invariant as invariant16 } from "@dxos/invariant";
|
|
4958
|
-
import { PublicKey as
|
|
4983
|
+
import { PublicKey as PublicKey13 } from "@dxos/keys";
|
|
4959
4984
|
import { log as log15 } from "@dxos/log";
|
|
4960
4985
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
4961
4986
|
import { NetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
|
|
@@ -5050,7 +5075,7 @@ var DevicesServiceImpl = class {
|
|
|
5050
5075
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
5051
5076
|
import { Event as Event8 } from "@dxos/async";
|
|
5052
5077
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
5053
|
-
import { PublicKey as
|
|
5078
|
+
import { PublicKey as PublicKey12 } from "@dxos/keys";
|
|
5054
5079
|
import { getContextFromEntry, log as log14 } from "@dxos/log";
|
|
5055
5080
|
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
5056
5081
|
import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
|
|
@@ -5058,7 +5083,7 @@ var LoggingServiceImpl = class {
|
|
|
5058
5083
|
constructor() {
|
|
5059
5084
|
this._logs = new Event8();
|
|
5060
5085
|
this._started = Date.now();
|
|
5061
|
-
this._sessionId =
|
|
5086
|
+
this._sessionId = PublicKey12.random().toHex();
|
|
5062
5087
|
this._logProcessor = (_config, entry2) => {
|
|
5063
5088
|
this._logs.emit(entry2);
|
|
5064
5089
|
};
|
|
@@ -5153,12 +5178,12 @@ var LoggingServiceImpl = class {
|
|
|
5153
5178
|
});
|
|
5154
5179
|
}
|
|
5155
5180
|
};
|
|
5156
|
-
var matchFilter = (filter, level,
|
|
5181
|
+
var matchFilter = (filter, level, path2, options) => {
|
|
5157
5182
|
switch (options) {
|
|
5158
5183
|
case QueryLogsRequest.MatchingOptions.INCLUSIVE:
|
|
5159
|
-
return level >= filter.level && (!filter.pattern ||
|
|
5184
|
+
return level >= filter.level && (!filter.pattern || path2.includes(filter.pattern));
|
|
5160
5185
|
case QueryLogsRequest.MatchingOptions.EXPLICIT:
|
|
5161
|
-
return level === filter.level && (!filter.pattern ||
|
|
5186
|
+
return level === filter.level && (!filter.pattern || path2.includes(filter.pattern));
|
|
5162
5187
|
}
|
|
5163
5188
|
};
|
|
5164
5189
|
var shouldLog = (entry2, request) => {
|
|
@@ -5359,7 +5384,7 @@ var ClientServicesHost = class {
|
|
|
5359
5384
|
initialize({ config, ...options }) {
|
|
5360
5385
|
invariant16(!this._open, "service host is open", {
|
|
5361
5386
|
F: __dxlog_file18,
|
|
5362
|
-
L:
|
|
5387
|
+
L: 182,
|
|
5363
5388
|
S: this,
|
|
5364
5389
|
A: [
|
|
5365
5390
|
"!this._open",
|
|
@@ -5368,14 +5393,14 @@ var ClientServicesHost = class {
|
|
|
5368
5393
|
});
|
|
5369
5394
|
log15("initializing...", void 0, {
|
|
5370
5395
|
F: __dxlog_file18,
|
|
5371
|
-
L:
|
|
5396
|
+
L: 183,
|
|
5372
5397
|
S: this,
|
|
5373
5398
|
C: (f, a) => f(...a)
|
|
5374
5399
|
});
|
|
5375
5400
|
if (config) {
|
|
5376
5401
|
invariant16(!this._config, "config already set", {
|
|
5377
5402
|
F: __dxlog_file18,
|
|
5378
|
-
L:
|
|
5403
|
+
L: 186,
|
|
5379
5404
|
S: this,
|
|
5380
5405
|
A: [
|
|
5381
5406
|
"!this._config",
|
|
@@ -5390,7 +5415,7 @@ var ClientServicesHost = class {
|
|
|
5390
5415
|
if (!options.signalManager) {
|
|
5391
5416
|
log15.warn("running signaling without telemetry metadata.", void 0, {
|
|
5392
5417
|
F: __dxlog_file18,
|
|
5393
|
-
L:
|
|
5418
|
+
L: 194,
|
|
5394
5419
|
S: this,
|
|
5395
5420
|
C: (f, a) => f(...a)
|
|
5396
5421
|
});
|
|
@@ -5401,7 +5426,7 @@ var ClientServicesHost = class {
|
|
|
5401
5426
|
this._signalManager = signalManager;
|
|
5402
5427
|
invariant16(!this._networkManager, "network manager already set", {
|
|
5403
5428
|
F: __dxlog_file18,
|
|
5404
|
-
L:
|
|
5429
|
+
L: 205,
|
|
5405
5430
|
S: this,
|
|
5406
5431
|
A: [
|
|
5407
5432
|
"!this._networkManager",
|
|
@@ -5415,7 +5440,7 @@ var ClientServicesHost = class {
|
|
|
5415
5440
|
});
|
|
5416
5441
|
log15("initialized", void 0, {
|
|
5417
5442
|
F: __dxlog_file18,
|
|
5418
|
-
L:
|
|
5443
|
+
L: 212,
|
|
5419
5444
|
S: this,
|
|
5420
5445
|
C: (f, a) => f(...a)
|
|
5421
5446
|
});
|
|
@@ -5424,18 +5449,18 @@ var ClientServicesHost = class {
|
|
|
5424
5449
|
if (this._open) {
|
|
5425
5450
|
return;
|
|
5426
5451
|
}
|
|
5427
|
-
const traceId =
|
|
5452
|
+
const traceId = PublicKey13.random().toHex();
|
|
5428
5453
|
log15.trace("dxos.client-services.host.open", trace9.begin({
|
|
5429
5454
|
id: traceId
|
|
5430
5455
|
}), {
|
|
5431
5456
|
F: __dxlog_file18,
|
|
5432
|
-
L:
|
|
5457
|
+
L: 223,
|
|
5433
5458
|
S: this,
|
|
5434
5459
|
C: (f, a) => f(...a)
|
|
5435
5460
|
});
|
|
5436
5461
|
invariant16(this._config, "config not set", {
|
|
5437
5462
|
F: __dxlog_file18,
|
|
5438
|
-
L:
|
|
5463
|
+
L: 225,
|
|
5439
5464
|
S: this,
|
|
5440
5465
|
A: [
|
|
5441
5466
|
"this._config",
|
|
@@ -5444,7 +5469,7 @@ var ClientServicesHost = class {
|
|
|
5444
5469
|
});
|
|
5445
5470
|
invariant16(this._storage, "storage not set", {
|
|
5446
5471
|
F: __dxlog_file18,
|
|
5447
|
-
L:
|
|
5472
|
+
L: 226,
|
|
5448
5473
|
S: this,
|
|
5449
5474
|
A: [
|
|
5450
5475
|
"this._storage",
|
|
@@ -5453,7 +5478,7 @@ var ClientServicesHost = class {
|
|
|
5453
5478
|
});
|
|
5454
5479
|
invariant16(this._signalManager, "signal manager not set", {
|
|
5455
5480
|
F: __dxlog_file18,
|
|
5456
|
-
L:
|
|
5481
|
+
L: 227,
|
|
5457
5482
|
S: this,
|
|
5458
5483
|
A: [
|
|
5459
5484
|
"this._signalManager",
|
|
@@ -5462,7 +5487,7 @@ var ClientServicesHost = class {
|
|
|
5462
5487
|
});
|
|
5463
5488
|
invariant16(this._networkManager, "network manager not set", {
|
|
5464
5489
|
F: __dxlog_file18,
|
|
5465
|
-
L:
|
|
5490
|
+
L: 228,
|
|
5466
5491
|
S: this,
|
|
5467
5492
|
A: [
|
|
5468
5493
|
"this._networkManager",
|
|
@@ -5474,13 +5499,16 @@ var ClientServicesHost = class {
|
|
|
5474
5499
|
lockKey: this._resourceLock?.lockKey
|
|
5475
5500
|
}, {
|
|
5476
5501
|
F: __dxlog_file18,
|
|
5477
|
-
L:
|
|
5502
|
+
L: 231,
|
|
5478
5503
|
S: this,
|
|
5479
5504
|
C: (f, a) => f(...a)
|
|
5480
5505
|
});
|
|
5506
|
+
if (!this._level) {
|
|
5507
|
+
this._level = await createLevel(this._config.get("runtime.client.storage", {}));
|
|
5508
|
+
}
|
|
5481
5509
|
await this._resourceLock?.acquire();
|
|
5482
5510
|
await this._loggingService.open();
|
|
5483
|
-
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._runtimeParams);
|
|
5511
|
+
this._serviceContext = new ServiceContext(this._storage, this._level, this._networkManager, this._signalManager, this._runtimeParams);
|
|
5484
5512
|
this._serviceRegistry.setServices({
|
|
5485
5513
|
SystemService: this._systemService,
|
|
5486
5514
|
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
@@ -5508,7 +5536,7 @@ var ClientServicesHost = class {
|
|
|
5508
5536
|
await this._serviceContext.open(ctx);
|
|
5509
5537
|
invariant16(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5510
5538
|
F: __dxlog_file18,
|
|
5511
|
-
L:
|
|
5539
|
+
L: 297,
|
|
5512
5540
|
S: this,
|
|
5513
5541
|
A: [
|
|
5514
5542
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5520,7 +5548,7 @@ var ClientServicesHost = class {
|
|
|
5520
5548
|
count: loadedInvitations.invitations?.length
|
|
5521
5549
|
}, {
|
|
5522
5550
|
F: __dxlog_file18,
|
|
5523
|
-
L:
|
|
5551
|
+
L: 300,
|
|
5524
5552
|
S: this,
|
|
5525
5553
|
C: (f, a) => f(...a)
|
|
5526
5554
|
});
|
|
@@ -5542,7 +5570,7 @@ var ClientServicesHost = class {
|
|
|
5542
5570
|
deviceKey
|
|
5543
5571
|
}, {
|
|
5544
5572
|
F: __dxlog_file18,
|
|
5545
|
-
L:
|
|
5573
|
+
L: 317,
|
|
5546
5574
|
S: this,
|
|
5547
5575
|
C: (f, a) => f(...a)
|
|
5548
5576
|
});
|
|
@@ -5550,7 +5578,7 @@ var ClientServicesHost = class {
|
|
|
5550
5578
|
id: traceId
|
|
5551
5579
|
}), {
|
|
5552
5580
|
F: __dxlog_file18,
|
|
5553
|
-
L:
|
|
5581
|
+
L: 318,
|
|
5554
5582
|
S: this,
|
|
5555
5583
|
C: (f, a) => f(...a)
|
|
5556
5584
|
});
|
|
@@ -5564,7 +5592,7 @@ var ClientServicesHost = class {
|
|
|
5564
5592
|
deviceKey
|
|
5565
5593
|
}, {
|
|
5566
5594
|
F: __dxlog_file18,
|
|
5567
|
-
L:
|
|
5595
|
+
L: 329,
|
|
5568
5596
|
S: this,
|
|
5569
5597
|
C: (f, a) => f(...a)
|
|
5570
5598
|
});
|
|
@@ -5574,30 +5602,31 @@ var ClientServicesHost = class {
|
|
|
5574
5602
|
});
|
|
5575
5603
|
await this._loggingService.close();
|
|
5576
5604
|
await this._serviceContext.close();
|
|
5605
|
+
await this._level?.close();
|
|
5577
5606
|
this._open = false;
|
|
5578
5607
|
this._statusUpdate.emit();
|
|
5579
5608
|
log15("closed", {
|
|
5580
5609
|
deviceKey
|
|
5581
5610
|
}, {
|
|
5582
5611
|
F: __dxlog_file18,
|
|
5583
|
-
L:
|
|
5612
|
+
L: 337,
|
|
5584
5613
|
S: this,
|
|
5585
5614
|
C: (f, a) => f(...a)
|
|
5586
5615
|
});
|
|
5587
5616
|
}
|
|
5588
5617
|
async reset() {
|
|
5589
|
-
const traceId =
|
|
5618
|
+
const traceId = PublicKey13.random().toHex();
|
|
5590
5619
|
log15.trace("dxos.sdk.client-services-host.reset", trace9.begin({
|
|
5591
5620
|
id: traceId
|
|
5592
5621
|
}), {
|
|
5593
5622
|
F: __dxlog_file18,
|
|
5594
|
-
L:
|
|
5623
|
+
L: 342,
|
|
5595
5624
|
S: this,
|
|
5596
5625
|
C: (f, a) => f(...a)
|
|
5597
5626
|
});
|
|
5598
5627
|
log15("resetting...", void 0, {
|
|
5599
5628
|
F: __dxlog_file18,
|
|
5600
|
-
L:
|
|
5629
|
+
L: 344,
|
|
5601
5630
|
S: this,
|
|
5602
5631
|
C: (f, a) => f(...a)
|
|
5603
5632
|
});
|
|
@@ -5605,7 +5634,7 @@ var ClientServicesHost = class {
|
|
|
5605
5634
|
await this._storage.reset();
|
|
5606
5635
|
log15("reset", void 0, {
|
|
5607
5636
|
F: __dxlog_file18,
|
|
5608
|
-
L:
|
|
5637
|
+
L: 347,
|
|
5609
5638
|
S: this,
|
|
5610
5639
|
C: (f, a) => f(...a)
|
|
5611
5640
|
});
|
|
@@ -5613,7 +5642,7 @@ var ClientServicesHost = class {
|
|
|
5613
5642
|
id: traceId
|
|
5614
5643
|
}), {
|
|
5615
5644
|
F: __dxlog_file18,
|
|
5616
|
-
L:
|
|
5645
|
+
L: 348,
|
|
5617
5646
|
S: this,
|
|
5618
5647
|
C: (f, a) => f(...a)
|
|
5619
5648
|
});
|
|
@@ -5626,7 +5655,7 @@ var ClientServicesHost = class {
|
|
|
5626
5655
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5627
5656
|
invariant16(automergeIndex, void 0, {
|
|
5628
5657
|
F: __dxlog_file18,
|
|
5629
|
-
L:
|
|
5658
|
+
L: 360,
|
|
5630
5659
|
S: this,
|
|
5631
5660
|
A: [
|
|
5632
5661
|
"automergeIndex",
|
|
@@ -5635,18 +5664,25 @@ var ClientServicesHost = class {
|
|
|
5635
5664
|
});
|
|
5636
5665
|
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5637
5666
|
await document.whenReady();
|
|
5638
|
-
const
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5667
|
+
const properties = {
|
|
5668
|
+
system: {
|
|
5669
|
+
type: encodeReference(E.getTypeReference(Properties))
|
|
5670
|
+
},
|
|
5671
|
+
data: {
|
|
5672
|
+
[defaultKey]: identity.identityKey.toHex()
|
|
5673
|
+
},
|
|
5674
|
+
meta: {
|
|
5675
|
+
keys: []
|
|
5676
|
+
}
|
|
5677
|
+
};
|
|
5678
|
+
const propertiesId = PublicKey13.random().toHex();
|
|
5643
5679
|
document.change((doc) => {
|
|
5644
5680
|
assignDeep2(doc, [
|
|
5645
5681
|
"objects",
|
|
5646
|
-
|
|
5647
|
-
],
|
|
5682
|
+
propertiesId
|
|
5683
|
+
], properties);
|
|
5648
5684
|
});
|
|
5649
|
-
await
|
|
5685
|
+
await this._serviceContext.automergeHost.repo.flush();
|
|
5650
5686
|
return identity;
|
|
5651
5687
|
}
|
|
5652
5688
|
};
|
|
@@ -5700,6 +5736,7 @@ export {
|
|
|
5700
5736
|
Lock,
|
|
5701
5737
|
isLocked,
|
|
5702
5738
|
createStorageObjects,
|
|
5739
|
+
createLevel,
|
|
5703
5740
|
ClientServicesHost
|
|
5704
5741
|
};
|
|
5705
|
-
//# sourceMappingURL=chunk-
|
|
5742
|
+
//# sourceMappingURL=chunk-I6GQX7F3.mjs.map
|