@dxos/client-services 0.4.8-main.ac78619 → 0.4.8-main.b987d6b
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-5DNT7O4B.mjs → chunk-X3ICFZ5Z.mjs} +139 -43
- package/dist/lib/browser/chunk-X3ICFZ5Z.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-IIMBD24E.cjs → chunk-WIEUHWJN.cjs} +151 -59
- package/dist/lib/node/chunk-WIEUHWJN.cjs.map +7 -0
- package/dist/lib/node/index.cjs +38 -38
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/indexing/index.d.ts +2 -0
- package/dist/types/src/packlets/indexing/index.d.ts.map +1 -0
- package/dist/types/src/packlets/indexing/util.d.ts +15 -0
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts +2 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +37 -35
- package/src/packlets/identity/identity.ts +1 -0
- package/src/packlets/indexing/index.ts +5 -0
- package/src/packlets/indexing/util.ts +89 -0
- package/src/packlets/services/service-context.ts +13 -2
- package/src/packlets/services/service-host.ts +6 -0
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-5DNT7O4B.mjs.map +0 -7
- package/dist/lib/node/chunk-IIMBD24E.cjs.map +0 -7
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_WIEUHWJN_exports = {};
|
|
30
|
+
__export(chunk_WIEUHWJN_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -61,7 +61,7 @@ __export(chunk_IIMBD24E_exports, {
|
|
|
61
61
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
62
62
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
63
63
|
});
|
|
64
|
-
module.exports = __toCommonJS(
|
|
64
|
+
module.exports = __toCommonJS(chunk_WIEUHWJN_exports);
|
|
65
65
|
var import_async = require("@dxos/async");
|
|
66
66
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
67
67
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -207,8 +207,8 @@ var import_context10 = require("@dxos/context");
|
|
|
207
207
|
var import_credentials15 = require("@dxos/credentials");
|
|
208
208
|
var import_debug6 = require("@dxos/debug");
|
|
209
209
|
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
210
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
211
210
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
211
|
+
var import_indexing = require("@dxos/indexing");
|
|
212
212
|
var import_invariant14 = require("@dxos/invariant");
|
|
213
213
|
var import_keyring = require("@dxos/keyring");
|
|
214
214
|
var import_keys10 = require("@dxos/keys");
|
|
@@ -218,11 +218,14 @@ var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
|
218
218
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
219
219
|
var import_tracing6 = require("@dxos/tracing");
|
|
220
220
|
var import_util7 = require("@dxos/util");
|
|
221
|
+
var import_automerge = require("@dxos/automerge/automerge");
|
|
222
|
+
var import_debug7 = require("@dxos/debug");
|
|
223
|
+
var import_protocols13 = require("@dxos/protocols");
|
|
221
224
|
var import_invariant15 = require("@dxos/invariant");
|
|
222
225
|
var import_lock_file = require("@dxos/lock-file");
|
|
223
226
|
var import_log14 = require("@dxos/log");
|
|
224
227
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
225
|
-
var
|
|
228
|
+
var import_protocols14 = require("@dxos/protocols");
|
|
226
229
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
227
230
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
228
231
|
var import_util8 = require("@dxos/util");
|
|
@@ -231,14 +234,15 @@ var import_client_protocol5 = require("@dxos/client-protocol");
|
|
|
231
234
|
var import_context11 = require("@dxos/context");
|
|
232
235
|
var import_document_model2 = require("@dxos/document-model");
|
|
233
236
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
234
|
-
var
|
|
237
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
238
|
+
var import_indexing2 = require("@dxos/indexing");
|
|
235
239
|
var import_invariant16 = require("@dxos/invariant");
|
|
236
240
|
var import_keys11 = require("@dxos/keys");
|
|
237
241
|
var import_log15 = require("@dxos/log");
|
|
238
242
|
var import_messaging = require("@dxos/messaging");
|
|
239
243
|
var import_model_factory = require("@dxos/model-factory");
|
|
240
244
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
241
|
-
var
|
|
245
|
+
var import_protocols15 = require("@dxos/protocols");
|
|
242
246
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
243
247
|
var import_text_model = require("@dxos/text-model");
|
|
244
248
|
var import_tracing7 = require("@dxos/tracing");
|
|
@@ -728,6 +732,7 @@ var Identity = class {
|
|
|
728
732
|
await this.space.open(ctx);
|
|
729
733
|
}
|
|
730
734
|
async close(ctx) {
|
|
735
|
+
await this._presence?.destroy();
|
|
731
736
|
await this.authVerifier.close();
|
|
732
737
|
await this.space.spaceState.removeCredentialProcessor(this._profileStateMachine);
|
|
733
738
|
await this.space.spaceState.removeCredentialProcessor(this._deviceStateMachine);
|
|
@@ -767,7 +772,7 @@ var Identity = class {
|
|
|
767
772
|
getIdentityCredentialSigner() {
|
|
768
773
|
(0, import_invariant.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
769
774
|
F: __dxlog_file2,
|
|
770
|
-
L:
|
|
775
|
+
L: 145,
|
|
771
776
|
S: this,
|
|
772
777
|
A: [
|
|
773
778
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -791,7 +796,7 @@ var Identity = class {
|
|
|
791
796
|
dataFeedKey
|
|
792
797
|
}, {
|
|
793
798
|
F: __dxlog_file2,
|
|
794
|
-
L:
|
|
799
|
+
L: 161,
|
|
795
800
|
S: this,
|
|
796
801
|
C: (f, a) => f(...a)
|
|
797
802
|
});
|
|
@@ -2886,7 +2891,7 @@ var getPlatform = () => {
|
|
|
2886
2891
|
};
|
|
2887
2892
|
}
|
|
2888
2893
|
};
|
|
2889
|
-
var DXOS_VERSION = "0.4.8-main.
|
|
2894
|
+
var DXOS_VERSION = "0.4.8-main.b987d6b";
|
|
2890
2895
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2891
2896
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2892
2897
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -4427,6 +4432,80 @@ var SpacesServiceImpl = class {
|
|
|
4427
4432
|
}
|
|
4428
4433
|
};
|
|
4429
4434
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
4435
|
+
var createLoadDocuments = (automergeHost) => (
|
|
4436
|
+
/**
|
|
4437
|
+
* Get object data blobs from Automerge Repo by ids.
|
|
4438
|
+
* @param ids
|
|
4439
|
+
*/
|
|
4440
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
4441
|
+
async function* loadDocuments(ids) {
|
|
4442
|
+
for (const id of ids) {
|
|
4443
|
+
const { documentId, objectId } = import_protocols13.idCodec.decode(id);
|
|
4444
|
+
const handle = automergeHost.repo.find(documentId);
|
|
4445
|
+
await (0, import_debug7.warnAfterTimeout)(5e3, "to long to load doc", () => handle.whenReady());
|
|
4446
|
+
const doc = handle.docSync();
|
|
4447
|
+
const heads = (0, import_automerge.getHeads)(doc);
|
|
4448
|
+
yield [
|
|
4449
|
+
{
|
|
4450
|
+
id,
|
|
4451
|
+
object: doc.objects[objectId],
|
|
4452
|
+
currentHash: heads.at(-1)
|
|
4453
|
+
}
|
|
4454
|
+
];
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
);
|
|
4458
|
+
var createGetAllDocuments = (automergeHost) => (
|
|
4459
|
+
/**
|
|
4460
|
+
* Recursively get all object data blobs from Automerge Repo.
|
|
4461
|
+
* @param ids
|
|
4462
|
+
*/
|
|
4463
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
4464
|
+
async function* getAllDocuments() {
|
|
4465
|
+
const visited = /* @__PURE__ */ new Set();
|
|
4466
|
+
async function* getObjectsFromHandle(handle) {
|
|
4467
|
+
if (visited.has(handle.documentId)) {
|
|
4468
|
+
return;
|
|
4469
|
+
}
|
|
4470
|
+
await (0, import_debug7.warnAfterTimeout)(5e3, "to long to load doc", () => handle.whenReady());
|
|
4471
|
+
const doc = handle.docSync();
|
|
4472
|
+
const heads = (0, import_automerge.getHeads)(doc);
|
|
4473
|
+
if (doc.objects) {
|
|
4474
|
+
yield Object.entries(doc.objects).map(([objectId, object]) => {
|
|
4475
|
+
return {
|
|
4476
|
+
id: import_protocols13.idCodec.encode({
|
|
4477
|
+
documentId: handle.documentId,
|
|
4478
|
+
objectId
|
|
4479
|
+
}),
|
|
4480
|
+
object,
|
|
4481
|
+
currentHash: heads.at(-1)
|
|
4482
|
+
};
|
|
4483
|
+
});
|
|
4484
|
+
}
|
|
4485
|
+
if (doc.links) {
|
|
4486
|
+
for (const id of Object.values(doc.links)) {
|
|
4487
|
+
if (visited.has(id)) {
|
|
4488
|
+
continue;
|
|
4489
|
+
}
|
|
4490
|
+
const linkHandle = automergeHost.repo.find(id);
|
|
4491
|
+
for await (const result of getObjectsFromHandle(linkHandle)) {
|
|
4492
|
+
yield result;
|
|
4493
|
+
}
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
visited.add(handle.documentId);
|
|
4497
|
+
}
|
|
4498
|
+
for (const handle of Object.values(automergeHost.repo.handles)) {
|
|
4499
|
+
if (visited.has(handle.documentId)) {
|
|
4500
|
+
continue;
|
|
4501
|
+
}
|
|
4502
|
+
for await (const result of getObjectsFromHandle(handle)) {
|
|
4503
|
+
yield result;
|
|
4504
|
+
}
|
|
4505
|
+
visited.add(handle.documentId);
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
);
|
|
4430
4509
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
4431
4510
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4432
4511
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -4450,9 +4529,6 @@ var ServiceContext = class {
|
|
|
4450
4529
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
4451
4530
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
4452
4531
|
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
4453
|
-
this.indexMetadata = new import_echo_schema.IndexMetadataStore({
|
|
4454
|
-
directory: storage.createDirectory("index-metadata")
|
|
4455
|
-
});
|
|
4456
4532
|
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
4457
4533
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
4458
4534
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
@@ -4475,10 +4551,21 @@ var ServiceContext = class {
|
|
|
4475
4551
|
snapshotStore: this.snapshotStore
|
|
4476
4552
|
});
|
|
4477
4553
|
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
|
|
4554
|
+
this.indexMetadata = new import_indexing.IndexMetadataStore({
|
|
4555
|
+
directory: storage.createDirectory("index-metadata")
|
|
4556
|
+
});
|
|
4478
4557
|
this.automergeHost = new import_echo_pipeline2.AutomergeHost({
|
|
4479
4558
|
directory: storage.createDirectory("automerge"),
|
|
4480
4559
|
metadata: this.indexMetadata
|
|
4481
4560
|
});
|
|
4561
|
+
this.indexer = new import_indexing.Indexer({
|
|
4562
|
+
indexStore: new import_indexing.IndexStore({
|
|
4563
|
+
directory: storage.createDirectory("index-store")
|
|
4564
|
+
}),
|
|
4565
|
+
metadataStore: this.indexMetadata,
|
|
4566
|
+
loadDocuments: createLoadDocuments(this.automergeHost),
|
|
4567
|
+
getAllDocuments: createGetAllDocuments(this.automergeHost)
|
|
4568
|
+
});
|
|
4482
4569
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
4483
4570
|
this._handlerFactories.set(import_services12.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? (0, import_debug6.failUndefined)(), this._acceptIdentity.bind(this)));
|
|
4484
4571
|
}
|
|
@@ -4486,7 +4573,7 @@ var ServiceContext = class {
|
|
|
4486
4573
|
await this._checkStorageVersion();
|
|
4487
4574
|
(0, import_log13.log)("opening...", void 0, {
|
|
4488
4575
|
F: __dxlog_file15,
|
|
4489
|
-
L:
|
|
4576
|
+
L: 162,
|
|
4490
4577
|
S: this,
|
|
4491
4578
|
C: (f, a) => f(...a)
|
|
4492
4579
|
});
|
|
@@ -4494,7 +4581,7 @@ var ServiceContext = class {
|
|
|
4494
4581
|
id: this._instanceId
|
|
4495
4582
|
}), {
|
|
4496
4583
|
F: __dxlog_file15,
|
|
4497
|
-
L:
|
|
4584
|
+
L: 163,
|
|
4498
4585
|
S: this,
|
|
4499
4586
|
C: (f, a) => f(...a)
|
|
4500
4587
|
});
|
|
@@ -4510,13 +4597,13 @@ var ServiceContext = class {
|
|
|
4510
4597
|
id: this._instanceId
|
|
4511
4598
|
}), {
|
|
4512
4599
|
F: __dxlog_file15,
|
|
4513
|
-
L:
|
|
4600
|
+
L: 173,
|
|
4514
4601
|
S: this,
|
|
4515
4602
|
C: (f, a) => f(...a)
|
|
4516
4603
|
});
|
|
4517
4604
|
(0, import_log13.log)("opened", void 0, {
|
|
4518
4605
|
F: __dxlog_file15,
|
|
4519
|
-
L:
|
|
4606
|
+
L: 174,
|
|
4520
4607
|
S: this,
|
|
4521
4608
|
C: (f, a) => f(...a)
|
|
4522
4609
|
});
|
|
@@ -4524,7 +4611,7 @@ var ServiceContext = class {
|
|
|
4524
4611
|
async close() {
|
|
4525
4612
|
(0, import_log13.log)("closing...", void 0, {
|
|
4526
4613
|
F: __dxlog_file15,
|
|
4527
|
-
L:
|
|
4614
|
+
L: 178,
|
|
4528
4615
|
S: this,
|
|
4529
4616
|
C: (f, a) => f(...a)
|
|
4530
4617
|
});
|
|
@@ -4540,9 +4627,10 @@ var ServiceContext = class {
|
|
|
4540
4627
|
await this.signalManager.close();
|
|
4541
4628
|
this.dataServiceSubscriptions.clear();
|
|
4542
4629
|
await this.metadataStore.close();
|
|
4630
|
+
await this.indexer.destroy();
|
|
4543
4631
|
(0, import_log13.log)("closed", void 0, {
|
|
4544
4632
|
F: __dxlog_file15,
|
|
4545
|
-
L:
|
|
4633
|
+
L: 192,
|
|
4546
4634
|
S: this,
|
|
4547
4635
|
C: (f, a) => f(...a)
|
|
4548
4636
|
});
|
|
@@ -4556,7 +4644,7 @@ var ServiceContext = class {
|
|
|
4556
4644
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4557
4645
|
(0, import_invariant14.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4558
4646
|
F: __dxlog_file15,
|
|
4559
|
-
L:
|
|
4647
|
+
L: 203,
|
|
4560
4648
|
S: this,
|
|
4561
4649
|
A: [
|
|
4562
4650
|
"factory",
|
|
@@ -4588,7 +4676,7 @@ var ServiceContext = class {
|
|
|
4588
4676
|
async _initialize(ctx) {
|
|
4589
4677
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
4590
4678
|
F: __dxlog_file15,
|
|
4591
|
-
L:
|
|
4679
|
+
L: 234,
|
|
4592
4680
|
S: this,
|
|
4593
4681
|
C: (f, a) => f(...a)
|
|
4594
4682
|
});
|
|
@@ -4611,7 +4699,7 @@ var ServiceContext = class {
|
|
|
4611
4699
|
this._handlerFactories.set(import_services12.Invitation.Kind.SPACE, (invitation) => {
|
|
4612
4700
|
(0, import_invariant14.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4613
4701
|
F: __dxlog_file15,
|
|
4614
|
-
L:
|
|
4702
|
+
L: 259,
|
|
4615
4703
|
S: this,
|
|
4616
4704
|
A: [
|
|
4617
4705
|
"this.dataSpaceManager",
|
|
@@ -4635,7 +4723,7 @@ var ServiceContext = class {
|
|
|
4635
4723
|
details: assertion
|
|
4636
4724
|
}, {
|
|
4637
4725
|
F: __dxlog_file15,
|
|
4638
|
-
L:
|
|
4726
|
+
L: 275,
|
|
4639
4727
|
S: this,
|
|
4640
4728
|
C: (f, a) => f(...a)
|
|
4641
4729
|
});
|
|
@@ -4646,7 +4734,7 @@ var ServiceContext = class {
|
|
|
4646
4734
|
details: assertion
|
|
4647
4735
|
}, {
|
|
4648
4736
|
F: __dxlog_file15,
|
|
4649
|
-
L:
|
|
4737
|
+
L: 279,
|
|
4650
4738
|
S: this,
|
|
4651
4739
|
C: (f, a) => f(...a)
|
|
4652
4740
|
});
|
|
@@ -4657,7 +4745,7 @@ var ServiceContext = class {
|
|
|
4657
4745
|
details: assertion
|
|
4658
4746
|
}, {
|
|
4659
4747
|
F: __dxlog_file15,
|
|
4660
|
-
L:
|
|
4748
|
+
L: 284,
|
|
4661
4749
|
S: this,
|
|
4662
4750
|
C: (f, a) => f(...a)
|
|
4663
4751
|
});
|
|
@@ -4668,7 +4756,7 @@ var ServiceContext = class {
|
|
|
4668
4756
|
} catch (err) {
|
|
4669
4757
|
import_log13.log.catch(err, void 0, {
|
|
4670
4758
|
F: __dxlog_file15,
|
|
4671
|
-
L:
|
|
4759
|
+
L: 290,
|
|
4672
4760
|
S: this,
|
|
4673
4761
|
C: (f, a) => f(...a)
|
|
4674
4762
|
});
|
|
@@ -4768,16 +4856,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
4768
4856
|
var createStorageObjects = (config) => {
|
|
4769
4857
|
const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
|
|
4770
4858
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4771
|
-
throw new
|
|
4859
|
+
throw new import_protocols14.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4772
4860
|
}
|
|
4773
4861
|
if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
|
|
4774
|
-
throw new
|
|
4862
|
+
throw new import_protocols14.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4775
4863
|
}
|
|
4776
4864
|
if (persistent && keyStore === StorageDriver.RAM) {
|
|
4777
|
-
throw new
|
|
4865
|
+
throw new import_protocols14.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4778
4866
|
}
|
|
4779
4867
|
if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
|
|
4780
|
-
throw new
|
|
4868
|
+
throw new import_protocols14.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4781
4869
|
}
|
|
4782
4870
|
return {
|
|
4783
4871
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -5182,7 +5270,7 @@ var ClientServicesHost = class {
|
|
|
5182
5270
|
initialize({ config, ...options }) {
|
|
5183
5271
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
5184
5272
|
F: __dxlog_file18,
|
|
5185
|
-
L:
|
|
5273
|
+
L: 191,
|
|
5186
5274
|
S: this,
|
|
5187
5275
|
A: [
|
|
5188
5276
|
"!this._open",
|
|
@@ -5191,14 +5279,14 @@ var ClientServicesHost = class {
|
|
|
5191
5279
|
});
|
|
5192
5280
|
(0, import_log15.log)("initializing...", void 0, {
|
|
5193
5281
|
F: __dxlog_file18,
|
|
5194
|
-
L:
|
|
5282
|
+
L: 192,
|
|
5195
5283
|
S: this,
|
|
5196
5284
|
C: (f, a) => f(...a)
|
|
5197
5285
|
});
|
|
5198
5286
|
if (config) {
|
|
5199
5287
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
5200
5288
|
F: __dxlog_file18,
|
|
5201
|
-
L:
|
|
5289
|
+
L: 195,
|
|
5202
5290
|
S: this,
|
|
5203
5291
|
A: [
|
|
5204
5292
|
"!this._config",
|
|
@@ -5216,7 +5304,7 @@ var ClientServicesHost = class {
|
|
|
5216
5304
|
this._signalManager = signalManager;
|
|
5217
5305
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
5218
5306
|
F: __dxlog_file18,
|
|
5219
|
-
L:
|
|
5307
|
+
L: 211,
|
|
5220
5308
|
S: this,
|
|
5221
5309
|
A: [
|
|
5222
5310
|
"!this._networkManager",
|
|
@@ -5230,7 +5318,7 @@ var ClientServicesHost = class {
|
|
|
5230
5318
|
});
|
|
5231
5319
|
(0, import_log15.log)("initialized", void 0, {
|
|
5232
5320
|
F: __dxlog_file18,
|
|
5233
|
-
L:
|
|
5321
|
+
L: 218,
|
|
5234
5322
|
S: this,
|
|
5235
5323
|
C: (f, a) => f(...a)
|
|
5236
5324
|
});
|
|
@@ -5240,17 +5328,17 @@ var ClientServicesHost = class {
|
|
|
5240
5328
|
return;
|
|
5241
5329
|
}
|
|
5242
5330
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
5243
|
-
import_log15.log.trace("dxos.client-services.host.open",
|
|
5331
|
+
import_log15.log.trace("dxos.client-services.host.open", import_protocols15.trace.begin({
|
|
5244
5332
|
id: traceId
|
|
5245
5333
|
}), {
|
|
5246
5334
|
F: __dxlog_file18,
|
|
5247
|
-
L:
|
|
5335
|
+
L: 229,
|
|
5248
5336
|
S: this,
|
|
5249
5337
|
C: (f, a) => f(...a)
|
|
5250
5338
|
});
|
|
5251
5339
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
5252
5340
|
F: __dxlog_file18,
|
|
5253
|
-
L:
|
|
5341
|
+
L: 231,
|
|
5254
5342
|
S: this,
|
|
5255
5343
|
A: [
|
|
5256
5344
|
"this._config",
|
|
@@ -5259,7 +5347,7 @@ var ClientServicesHost = class {
|
|
|
5259
5347
|
});
|
|
5260
5348
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
5261
5349
|
F: __dxlog_file18,
|
|
5262
|
-
L:
|
|
5350
|
+
L: 232,
|
|
5263
5351
|
S: this,
|
|
5264
5352
|
A: [
|
|
5265
5353
|
"this._storage",
|
|
@@ -5268,7 +5356,7 @@ var ClientServicesHost = class {
|
|
|
5268
5356
|
});
|
|
5269
5357
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
5270
5358
|
F: __dxlog_file18,
|
|
5271
|
-
L:
|
|
5359
|
+
L: 233,
|
|
5272
5360
|
S: this,
|
|
5273
5361
|
A: [
|
|
5274
5362
|
"this._signalManager",
|
|
@@ -5277,7 +5365,7 @@ var ClientServicesHost = class {
|
|
|
5277
5365
|
});
|
|
5278
5366
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
5279
5367
|
F: __dxlog_file18,
|
|
5280
|
-
L:
|
|
5368
|
+
L: 234,
|
|
5281
5369
|
S: this,
|
|
5282
5370
|
A: [
|
|
5283
5371
|
"this._networkManager",
|
|
@@ -5289,7 +5377,7 @@ var ClientServicesHost = class {
|
|
|
5289
5377
|
lockKey: this._resourceLock?.lockKey
|
|
5290
5378
|
}, {
|
|
5291
5379
|
F: __dxlog_file18,
|
|
5292
|
-
L:
|
|
5380
|
+
L: 237,
|
|
5293
5381
|
S: this,
|
|
5294
5382
|
C: (f, a) => f(...a)
|
|
5295
5383
|
});
|
|
@@ -5306,6 +5394,10 @@ var ClientServicesHost = class {
|
|
|
5306
5394
|
return this._serviceContext.dataSpaceManager;
|
|
5307
5395
|
}),
|
|
5308
5396
|
DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.dataServiceSubscriptions, this._serviceContext.automergeHost),
|
|
5397
|
+
IndexService: new import_indexing2.IndexServiceImpl({
|
|
5398
|
+
indexer: this._serviceContext.indexer,
|
|
5399
|
+
automergeHost: this._serviceContext.automergeHost
|
|
5400
|
+
}),
|
|
5309
5401
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
5310
5402
|
LoggingService: this._loggingService,
|
|
5311
5403
|
TracingService: this._tracingService,
|
|
@@ -5319,7 +5411,7 @@ var ClientServicesHost = class {
|
|
|
5319
5411
|
await this._serviceContext.open(ctx);
|
|
5320
5412
|
(0, import_invariant16.invariant)(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5321
5413
|
F: __dxlog_file18,
|
|
5322
|
-
L:
|
|
5414
|
+
L: 303,
|
|
5323
5415
|
S: this,
|
|
5324
5416
|
A: [
|
|
5325
5417
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5331,7 +5423,7 @@ var ClientServicesHost = class {
|
|
|
5331
5423
|
count: loadedInvitations.invitations?.length
|
|
5332
5424
|
}, {
|
|
5333
5425
|
F: __dxlog_file18,
|
|
5334
|
-
L:
|
|
5426
|
+
L: 306,
|
|
5335
5427
|
S: this,
|
|
5336
5428
|
C: (f, a) => f(...a)
|
|
5337
5429
|
});
|
|
@@ -5353,15 +5445,15 @@ var ClientServicesHost = class {
|
|
|
5353
5445
|
deviceKey
|
|
5354
5446
|
}, {
|
|
5355
5447
|
F: __dxlog_file18,
|
|
5356
|
-
L:
|
|
5448
|
+
L: 323,
|
|
5357
5449
|
S: this,
|
|
5358
5450
|
C: (f, a) => f(...a)
|
|
5359
5451
|
});
|
|
5360
|
-
import_log15.log.trace("dxos.client-services.host.open",
|
|
5452
|
+
import_log15.log.trace("dxos.client-services.host.open", import_protocols15.trace.end({
|
|
5361
5453
|
id: traceId
|
|
5362
5454
|
}), {
|
|
5363
5455
|
F: __dxlog_file18,
|
|
5364
|
-
L:
|
|
5456
|
+
L: 324,
|
|
5365
5457
|
S: this,
|
|
5366
5458
|
C: (f, a) => f(...a)
|
|
5367
5459
|
});
|
|
@@ -5375,7 +5467,7 @@ var ClientServicesHost = class {
|
|
|
5375
5467
|
deviceKey
|
|
5376
5468
|
}, {
|
|
5377
5469
|
F: __dxlog_file18,
|
|
5378
|
-
L:
|
|
5470
|
+
L: 335,
|
|
5379
5471
|
S: this,
|
|
5380
5472
|
C: (f, a) => f(...a)
|
|
5381
5473
|
});
|
|
@@ -5391,24 +5483,24 @@ var ClientServicesHost = class {
|
|
|
5391
5483
|
deviceKey
|
|
5392
5484
|
}, {
|
|
5393
5485
|
F: __dxlog_file18,
|
|
5394
|
-
L:
|
|
5486
|
+
L: 342,
|
|
5395
5487
|
S: this,
|
|
5396
5488
|
C: (f, a) => f(...a)
|
|
5397
5489
|
});
|
|
5398
5490
|
}
|
|
5399
5491
|
async reset() {
|
|
5400
5492
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
5401
|
-
import_log15.log.trace("dxos.sdk.client-services-host.reset",
|
|
5493
|
+
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.begin({
|
|
5402
5494
|
id: traceId
|
|
5403
5495
|
}), {
|
|
5404
5496
|
F: __dxlog_file18,
|
|
5405
|
-
L:
|
|
5497
|
+
L: 347,
|
|
5406
5498
|
S: this,
|
|
5407
5499
|
C: (f, a) => f(...a)
|
|
5408
5500
|
});
|
|
5409
5501
|
(0, import_log15.log)("resetting...", void 0, {
|
|
5410
5502
|
F: __dxlog_file18,
|
|
5411
|
-
L:
|
|
5503
|
+
L: 349,
|
|
5412
5504
|
S: this,
|
|
5413
5505
|
C: (f, a) => f(...a)
|
|
5414
5506
|
});
|
|
@@ -5416,15 +5508,15 @@ var ClientServicesHost = class {
|
|
|
5416
5508
|
await this._storage.reset();
|
|
5417
5509
|
(0, import_log15.log)("reset", void 0, {
|
|
5418
5510
|
F: __dxlog_file18,
|
|
5419
|
-
L:
|
|
5511
|
+
L: 352,
|
|
5420
5512
|
S: this,
|
|
5421
5513
|
C: (f, a) => f(...a)
|
|
5422
5514
|
});
|
|
5423
|
-
import_log15.log.trace("dxos.sdk.client-services-host.reset",
|
|
5515
|
+
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.end({
|
|
5424
5516
|
id: traceId
|
|
5425
5517
|
}), {
|
|
5426
5518
|
F: __dxlog_file18,
|
|
5427
|
-
L:
|
|
5519
|
+
L: 353,
|
|
5428
5520
|
S: this,
|
|
5429
5521
|
C: (f, a) => f(...a)
|
|
5430
5522
|
});
|
|
@@ -5439,7 +5531,7 @@ var ClientServicesHost = class {
|
|
|
5439
5531
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5440
5532
|
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5441
5533
|
F: __dxlog_file18,
|
|
5442
|
-
L:
|
|
5534
|
+
L: 368,
|
|
5443
5535
|
S: this,
|
|
5444
5536
|
A: [
|
|
5445
5537
|
"automergeIndex",
|
|
@@ -5451,8 +5543,8 @@ var ClientServicesHost = class {
|
|
|
5451
5543
|
document.change((doc) => {
|
|
5452
5544
|
(0, import_util9.assignDeep)(doc, [
|
|
5453
5545
|
"objects",
|
|
5454
|
-
(0,
|
|
5455
|
-
], (0,
|
|
5546
|
+
(0, import_echo_schema.getAutomergeObjectCore)(obj).id
|
|
5547
|
+
], (0, import_echo_schema.getRawDoc)(obj).handle.docSync());
|
|
5456
5548
|
});
|
|
5457
5549
|
return identity;
|
|
5458
5550
|
}
|
|
@@ -5509,4 +5601,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5509
5601
|
subscribeToSpaces,
|
|
5510
5602
|
subscribeToSwarmInfo
|
|
5511
5603
|
});
|
|
5512
|
-
//# sourceMappingURL=chunk-
|
|
5604
|
+
//# sourceMappingURL=chunk-WIEUHWJN.cjs.map
|