@dxos/client-services 0.4.10-main.ec8b427 → 0.4.10-main.f68a1ca
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-4NKBBUMB.mjs → chunk-B4JZEXRB.mjs} +128 -53
- package/dist/lib/browser/{chunk-4NKBBUMB.mjs.map → chunk-B4JZEXRB.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +48 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-5YRLBMIC.cjs → chunk-EC2QGJ2V.cjs} +133 -58
- package/dist/lib/node/chunk-EC2QGJ2V.cjs.map +7 -0
- package/dist/lib/node/index.cjs +85 -57
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +6 -6
- package/dist/types/src/packlets/indexing/util.d.ts +2 -2
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shared-worker-connection.d.ts +5 -5
- package/dist/types/src/packlets/vault/shared-worker-connection.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts +2 -0
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts +2 -0
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -34
- package/src/packlets/indexing/util.ts +3 -3
- package/src/packlets/services/service-context.ts +3 -3
- package/src/packlets/services/service-host.ts +15 -8
- package/src/packlets/spaces/data-space.ts +51 -2
- package/src/packlets/vault/shared-worker-connection.ts +3 -8
- package/src/packlets/vault/worker-runtime.ts +27 -2
- package/src/packlets/vault/worker-session.ts +6 -0
- package/src/version.ts +1 -1
- package/dist/lib/node/chunk-5YRLBMIC.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_EC2QGJ2V_exports = {};
|
|
30
|
+
__export(chunk_EC2QGJ2V_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -60,7 +60,7 @@ __export(chunk_5YRLBMIC_exports, {
|
|
|
60
60
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
61
61
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
62
62
|
});
|
|
63
|
-
module.exports = __toCommonJS(
|
|
63
|
+
module.exports = __toCommonJS(chunk_EC2QGJ2V_exports);
|
|
64
64
|
var import_async = require("@dxos/async");
|
|
65
65
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
66
66
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -158,7 +158,9 @@ var import_async10 = require("@dxos/async");
|
|
|
158
158
|
var import_client_protocol3 = require("@dxos/client-protocol");
|
|
159
159
|
var import_context7 = require("@dxos/context");
|
|
160
160
|
var import_debug3 = require("@dxos/debug");
|
|
161
|
+
var import_echo_db = require("@dxos/echo-db");
|
|
161
162
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
163
|
+
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
162
164
|
var import_invariant10 = require("@dxos/invariant");
|
|
163
165
|
var import_keys7 = require("@dxos/keys");
|
|
164
166
|
var import_log8 = require("@dxos/log");
|
|
@@ -203,7 +205,7 @@ var import_async15 = require("@dxos/async");
|
|
|
203
205
|
var import_context10 = require("@dxos/context");
|
|
204
206
|
var import_credentials15 = require("@dxos/credentials");
|
|
205
207
|
var import_debug6 = require("@dxos/debug");
|
|
206
|
-
var
|
|
208
|
+
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
207
209
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
208
210
|
var import_indexing = require("@dxos/indexing");
|
|
209
211
|
var import_invariant14 = require("@dxos/invariant");
|
|
@@ -229,7 +231,8 @@ var import_util8 = require("@dxos/util");
|
|
|
229
231
|
var import_async16 = require("@dxos/async");
|
|
230
232
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
231
233
|
var import_context11 = require("@dxos/context");
|
|
232
|
-
var
|
|
234
|
+
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
235
|
+
var E = __toESM(require("@dxos/echo-schema"));
|
|
233
236
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
234
237
|
var import_indexing2 = require("@dxos/indexing");
|
|
235
238
|
var import_invariant16 = require("@dxos/invariant");
|
|
@@ -2884,7 +2887,7 @@ var getPlatform = () => {
|
|
|
2884
2887
|
};
|
|
2885
2888
|
}
|
|
2886
2889
|
};
|
|
2887
|
-
var DXOS_VERSION = "0.4.10-main.
|
|
2890
|
+
var DXOS_VERSION = "0.4.10-main.f68a1ca";
|
|
2888
2891
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2889
2892
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2890
2893
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -3326,7 +3329,7 @@ var DataSpace = class {
|
|
|
3326
3329
|
state: import_services9.SpaceState[this._state]
|
|
3327
3330
|
}, {
|
|
3328
3331
|
F: __dxlog_file12,
|
|
3329
|
-
L:
|
|
3332
|
+
L: 140,
|
|
3330
3333
|
S: this,
|
|
3331
3334
|
C: (f, a) => f(...a)
|
|
3332
3335
|
});
|
|
@@ -3376,7 +3379,7 @@ var DataSpace = class {
|
|
|
3376
3379
|
state: import_services9.SpaceState[this._state]
|
|
3377
3380
|
}, {
|
|
3378
3381
|
F: __dxlog_file12,
|
|
3379
|
-
L:
|
|
3382
|
+
L: 198,
|
|
3380
3383
|
S: this,
|
|
3381
3384
|
C: (f, a) => f(...a)
|
|
3382
3385
|
});
|
|
@@ -3394,7 +3397,7 @@ var DataSpace = class {
|
|
|
3394
3397
|
state: import_services9.SpaceState[this._state]
|
|
3395
3398
|
}, {
|
|
3396
3399
|
F: __dxlog_file12,
|
|
3397
|
-
L:
|
|
3400
|
+
L: 212,
|
|
3398
3401
|
S: this,
|
|
3399
3402
|
C: (f, a) => f(...a)
|
|
3400
3403
|
});
|
|
@@ -3426,7 +3429,7 @@ var DataSpace = class {
|
|
|
3426
3429
|
if (err instanceof import_protocols8.CancelledError || err instanceof import_context7.ContextDisposedError) {
|
|
3427
3430
|
(0, import_log8.log)("data pipeline initialization cancelled", err, {
|
|
3428
3431
|
F: __dxlog_file12,
|
|
3429
|
-
L:
|
|
3432
|
+
L: 245,
|
|
3430
3433
|
S: this,
|
|
3431
3434
|
C: (f, a) => f(...a)
|
|
3432
3435
|
});
|
|
@@ -3434,7 +3437,7 @@ var DataSpace = class {
|
|
|
3434
3437
|
}
|
|
3435
3438
|
import_log8.log.error("Error initializing data pipeline", err, {
|
|
3436
3439
|
F: __dxlog_file12,
|
|
3437
|
-
L:
|
|
3440
|
+
L: 249,
|
|
3438
3441
|
S: this,
|
|
3439
3442
|
C: (f, a) => f(...a)
|
|
3440
3443
|
});
|
|
@@ -3443,7 +3446,7 @@ var DataSpace = class {
|
|
|
3443
3446
|
state: import_services9.SpaceState[this._state]
|
|
3444
3447
|
}, {
|
|
3445
3448
|
F: __dxlog_file12,
|
|
3446
|
-
L:
|
|
3449
|
+
L: 251,
|
|
3447
3450
|
S: this,
|
|
3448
3451
|
C: (f, a) => f(...a)
|
|
3449
3452
|
});
|
|
@@ -3463,7 +3466,7 @@ var DataSpace = class {
|
|
|
3463
3466
|
state: import_services9.SpaceState[this._state]
|
|
3464
3467
|
}, {
|
|
3465
3468
|
F: __dxlog_file12,
|
|
3466
|
-
L:
|
|
3469
|
+
L: 267,
|
|
3467
3470
|
S: this,
|
|
3468
3471
|
C: (f, a) => f(...a)
|
|
3469
3472
|
});
|
|
@@ -3473,7 +3476,7 @@ var DataSpace = class {
|
|
|
3473
3476
|
await (0, import_context7.cancelWithContext)(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
|
|
3474
3477
|
(0, import_log8.log)("data pipeline ready", void 0, {
|
|
3475
3478
|
F: __dxlog_file12,
|
|
3476
|
-
L:
|
|
3479
|
+
L: 279,
|
|
3477
3480
|
S: this,
|
|
3478
3481
|
C: (f, a) => f(...a)
|
|
3479
3482
|
});
|
|
@@ -3483,7 +3486,7 @@ var DataSpace = class {
|
|
|
3483
3486
|
state: import_services9.SpaceState[this._state]
|
|
3484
3487
|
}, {
|
|
3485
3488
|
F: __dxlog_file12,
|
|
3486
|
-
L:
|
|
3489
|
+
L: 283,
|
|
3487
3490
|
S: this,
|
|
3488
3491
|
C: (f, a) => f(...a)
|
|
3489
3492
|
});
|
|
@@ -3499,7 +3502,7 @@ var DataSpace = class {
|
|
|
3499
3502
|
await this._createWritableFeeds();
|
|
3500
3503
|
(0, import_log8.log)("writable feeds created", void 0, {
|
|
3501
3504
|
F: __dxlog_file12,
|
|
3502
|
-
L:
|
|
3505
|
+
L: 299,
|
|
3503
3506
|
S: this,
|
|
3504
3507
|
C: (f, a) => f(...a)
|
|
3505
3508
|
});
|
|
@@ -3562,7 +3565,7 @@ var DataSpace = class {
|
|
|
3562
3565
|
rootUrl
|
|
3563
3566
|
}, {
|
|
3564
3567
|
F: __dxlog_file12,
|
|
3565
|
-
L:
|
|
3568
|
+
L: 365,
|
|
3566
3569
|
S: this,
|
|
3567
3570
|
C: (f, a) => f(...a)
|
|
3568
3571
|
});
|
|
@@ -3594,7 +3597,7 @@ var DataSpace = class {
|
|
|
3594
3597
|
err
|
|
3595
3598
|
}, {
|
|
3596
3599
|
F: __dxlog_file12,
|
|
3597
|
-
L:
|
|
3600
|
+
L: 388,
|
|
3598
3601
|
S: this,
|
|
3599
3602
|
C: (f, a) => f(...a)
|
|
3600
3603
|
});
|
|
@@ -3649,7 +3652,7 @@ var DataSpace = class {
|
|
|
3649
3652
|
const newRoot = this._automergeHost.repo.create(rootHandle.docSync());
|
|
3650
3653
|
(0, import_invariant10.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
|
|
3651
3654
|
F: __dxlog_file12,
|
|
3652
|
-
L:
|
|
3655
|
+
L: 438,
|
|
3653
3656
|
S: this,
|
|
3654
3657
|
A: [
|
|
3655
3658
|
"typeof newRoot.url === 'string' && newRoot.url.length > 0",
|
|
@@ -3664,6 +3667,66 @@ var DataSpace = class {
|
|
|
3664
3667
|
};
|
|
3665
3668
|
}
|
|
3666
3669
|
break;
|
|
3670
|
+
case import_services9.CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT:
|
|
3671
|
+
{
|
|
3672
|
+
import_log8.log.info("Fragmenting", void 0, {
|
|
3673
|
+
F: __dxlog_file12,
|
|
3674
|
+
L: 450,
|
|
3675
|
+
S: this,
|
|
3676
|
+
C: (f, a) => f(...a)
|
|
3677
|
+
});
|
|
3678
|
+
const currentRootUrl = this._automergeSpaceState.rootUrl;
|
|
3679
|
+
const rootHandle = this._automergeHost.repo.find(currentRootUrl);
|
|
3680
|
+
await (0, import_context7.cancelWithContext)(this._ctx, (0, import_async10.asyncTimeout)(rootHandle.whenReady(), 1e4));
|
|
3681
|
+
const objects = Object.entries(rootHandle.docSync().objects);
|
|
3682
|
+
const properties = objects.find(([_, value]) => value.system.type?.itemId === import_echo_db.TYPE_PROPERTIES);
|
|
3683
|
+
const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
|
|
3684
|
+
(0, import_invariant10.invariant)(properties, "Properties not found", {
|
|
3685
|
+
F: __dxlog_file12,
|
|
3686
|
+
L: 460,
|
|
3687
|
+
S: this,
|
|
3688
|
+
A: [
|
|
3689
|
+
"properties",
|
|
3690
|
+
"'Properties not found'"
|
|
3691
|
+
]
|
|
3692
|
+
});
|
|
3693
|
+
const newSpaceDoc = {
|
|
3694
|
+
...rootHandle.docSync(),
|
|
3695
|
+
objects: Object.fromEntries([
|
|
3696
|
+
properties
|
|
3697
|
+
])
|
|
3698
|
+
};
|
|
3699
|
+
const newRoot = this._automergeHost.repo.create(newSpaceDoc);
|
|
3700
|
+
(0, import_invariant10.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
|
|
3701
|
+
F: __dxlog_file12,
|
|
3702
|
+
L: 465,
|
|
3703
|
+
S: this,
|
|
3704
|
+
A: [
|
|
3705
|
+
"typeof newRoot.url === 'string' && newRoot.url.length > 0",
|
|
3706
|
+
""
|
|
3707
|
+
]
|
|
3708
|
+
});
|
|
3709
|
+
const docLoader = new import_echo_pipeline2.AutomergeDocumentLoaderImpl(this.key, this._automergeHost.repo);
|
|
3710
|
+
await docLoader.loadSpaceRootDocHandle(this._ctx, {
|
|
3711
|
+
rootUrl: newRoot.url
|
|
3712
|
+
});
|
|
3713
|
+
otherObjects.forEach(([key, value]) => {
|
|
3714
|
+
const handle = docLoader.createDocumentForObject(key);
|
|
3715
|
+
handle.change((doc) => {
|
|
3716
|
+
(0, import_util4.assignDeep)(doc, [
|
|
3717
|
+
"objects",
|
|
3718
|
+
key
|
|
3719
|
+
], value);
|
|
3720
|
+
});
|
|
3721
|
+
});
|
|
3722
|
+
epoch = {
|
|
3723
|
+
previousId: this._automergeSpaceState.lastEpoch?.id,
|
|
3724
|
+
number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
|
|
3725
|
+
timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new import_timeframe2.Timeframe(),
|
|
3726
|
+
automergeRoot: newRoot.url
|
|
3727
|
+
};
|
|
3728
|
+
}
|
|
3729
|
+
break;
|
|
3667
3730
|
}
|
|
3668
3731
|
if (!epoch) {
|
|
3669
3732
|
return;
|
|
@@ -3705,7 +3768,7 @@ var DataSpace = class {
|
|
|
3705
3768
|
state: import_services9.SpaceState[this._state]
|
|
3706
3769
|
}, {
|
|
3707
3770
|
F: __dxlog_file12,
|
|
3708
|
-
L:
|
|
3771
|
+
L: 531,
|
|
3709
3772
|
S: this,
|
|
3710
3773
|
C: (f, a) => f(...a)
|
|
3711
3774
|
});
|
|
@@ -4369,7 +4432,7 @@ var SpacesServiceImpl = class {
|
|
|
4369
4432
|
}
|
|
4370
4433
|
};
|
|
4371
4434
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
4372
|
-
var
|
|
4435
|
+
var createSelectedDocumentsIterator = (automergeHost) => (
|
|
4373
4436
|
/**
|
|
4374
4437
|
* Get object data blobs from Automerge Repo by ids.
|
|
4375
4438
|
* @param ids
|
|
@@ -4392,7 +4455,7 @@ var createLoadDocuments = (automergeHost) => (
|
|
|
4392
4455
|
}
|
|
4393
4456
|
}
|
|
4394
4457
|
);
|
|
4395
|
-
var
|
|
4458
|
+
var createDocumentsIterator = (automergeHost) => (
|
|
4396
4459
|
/**
|
|
4397
4460
|
* Recursively get all object data blobs from Automerge Repo.
|
|
4398
4461
|
* @param ids
|
|
@@ -4415,7 +4478,7 @@ var createGetAllDocuments = (automergeHost) => (
|
|
|
4415
4478
|
objectId
|
|
4416
4479
|
}),
|
|
4417
4480
|
object,
|
|
4418
|
-
currentHash: heads.
|
|
4481
|
+
currentHash: heads.join("")
|
|
4419
4482
|
};
|
|
4420
4483
|
});
|
|
4421
4484
|
}
|
|
@@ -4463,8 +4526,8 @@ var ServiceContext = class {
|
|
|
4463
4526
|
this.initialized = new import_async15.Trigger();
|
|
4464
4527
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
4465
4528
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
4466
|
-
this.metadataStore = new
|
|
4467
|
-
this.snapshotStore = new
|
|
4529
|
+
this.metadataStore = new import_echo_pipeline3.MetadataStore(storage.createDirectory("metadata"));
|
|
4530
|
+
this.snapshotStore = new import_echo_pipeline3.SnapshotStore(storage.createDirectory("snapshots"));
|
|
4468
4531
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
4469
4532
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
4470
4533
|
this.feedStore = new import_feed_store4.FeedStore({
|
|
@@ -4472,12 +4535,12 @@ var ServiceContext = class {
|
|
|
4472
4535
|
root: storage.createDirectory("feeds"),
|
|
4473
4536
|
signer: this.keyring,
|
|
4474
4537
|
hypercore: {
|
|
4475
|
-
valueEncoding:
|
|
4538
|
+
valueEncoding: import_echo_pipeline3.valueEncoding,
|
|
4476
4539
|
stats: true
|
|
4477
4540
|
}
|
|
4478
4541
|
})
|
|
4479
4542
|
});
|
|
4480
|
-
this.spaceManager = new
|
|
4543
|
+
this.spaceManager = new import_echo_pipeline3.SpaceManager({
|
|
4481
4544
|
feedStore: this.feedStore,
|
|
4482
4545
|
networkManager: this.networkManager,
|
|
4483
4546
|
blobStore: this.blobStore,
|
|
@@ -4488,7 +4551,7 @@ var ServiceContext = class {
|
|
|
4488
4551
|
this.indexMetadata = new import_indexing.IndexMetadataStore({
|
|
4489
4552
|
directory: storage.createDirectory("index-metadata")
|
|
4490
4553
|
});
|
|
4491
|
-
this.automergeHost = new
|
|
4554
|
+
this.automergeHost = new import_echo_pipeline3.AutomergeHost({
|
|
4492
4555
|
directory: storage.createDirectory("automerge"),
|
|
4493
4556
|
metadata: this.indexMetadata
|
|
4494
4557
|
});
|
|
@@ -4497,8 +4560,8 @@ var ServiceContext = class {
|
|
|
4497
4560
|
directory: storage.createDirectory("index-store")
|
|
4498
4561
|
}),
|
|
4499
4562
|
metadataStore: this.indexMetadata,
|
|
4500
|
-
loadDocuments:
|
|
4501
|
-
getAllDocuments:
|
|
4563
|
+
loadDocuments: createSelectedDocumentsIterator(this.automergeHost),
|
|
4564
|
+
getAllDocuments: createDocumentsIterator(this.automergeHost)
|
|
4502
4565
|
});
|
|
4503
4566
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
4504
4567
|
this._handlerFactories.set(import_services12.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? (0, import_debug6.failUndefined)(), this._acceptIdentity.bind(this)));
|
|
@@ -5198,7 +5261,7 @@ var ClientServicesHost = class {
|
|
|
5198
5261
|
initialize({ config, ...options }) {
|
|
5199
5262
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
5200
5263
|
F: __dxlog_file18,
|
|
5201
|
-
L:
|
|
5264
|
+
L: 180,
|
|
5202
5265
|
S: this,
|
|
5203
5266
|
A: [
|
|
5204
5267
|
"!this._open",
|
|
@@ -5207,14 +5270,14 @@ var ClientServicesHost = class {
|
|
|
5207
5270
|
});
|
|
5208
5271
|
(0, import_log14.log)("initializing...", void 0, {
|
|
5209
5272
|
F: __dxlog_file18,
|
|
5210
|
-
L:
|
|
5273
|
+
L: 181,
|
|
5211
5274
|
S: this,
|
|
5212
5275
|
C: (f, a) => f(...a)
|
|
5213
5276
|
});
|
|
5214
5277
|
if (config) {
|
|
5215
5278
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
5216
5279
|
F: __dxlog_file18,
|
|
5217
|
-
L:
|
|
5280
|
+
L: 184,
|
|
5218
5281
|
S: this,
|
|
5219
5282
|
A: [
|
|
5220
5283
|
"!this._config",
|
|
@@ -5226,13 +5289,21 @@ var ClientServicesHost = class {
|
|
|
5226
5289
|
this._storage = createStorageObjects(config.get("runtime.client.storage", {})).storage;
|
|
5227
5290
|
}
|
|
5228
5291
|
}
|
|
5292
|
+
if (!options.signalManager) {
|
|
5293
|
+
import_log14.log.warn("running signaling without telemetry metadata.", void 0, {
|
|
5294
|
+
F: __dxlog_file18,
|
|
5295
|
+
L: 192,
|
|
5296
|
+
S: this,
|
|
5297
|
+
C: (f, a) => f(...a)
|
|
5298
|
+
});
|
|
5299
|
+
}
|
|
5229
5300
|
const { connectionLog = true, transportFactory = (0, import_network_manager2.createSimplePeerTransportFactory)({
|
|
5230
5301
|
iceServers: this._config?.get("runtime.services.ice")
|
|
5231
5302
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
5232
5303
|
this._signalManager = signalManager;
|
|
5233
5304
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
5234
5305
|
F: __dxlog_file18,
|
|
5235
|
-
L:
|
|
5306
|
+
L: 203,
|
|
5236
5307
|
S: this,
|
|
5237
5308
|
A: [
|
|
5238
5309
|
"!this._networkManager",
|
|
@@ -5246,7 +5317,7 @@ var ClientServicesHost = class {
|
|
|
5246
5317
|
});
|
|
5247
5318
|
(0, import_log14.log)("initialized", void 0, {
|
|
5248
5319
|
F: __dxlog_file18,
|
|
5249
|
-
L:
|
|
5320
|
+
L: 210,
|
|
5250
5321
|
S: this,
|
|
5251
5322
|
C: (f, a) => f(...a)
|
|
5252
5323
|
});
|
|
@@ -5260,13 +5331,13 @@ var ClientServicesHost = class {
|
|
|
5260
5331
|
id: traceId
|
|
5261
5332
|
}), {
|
|
5262
5333
|
F: __dxlog_file18,
|
|
5263
|
-
L:
|
|
5334
|
+
L: 221,
|
|
5264
5335
|
S: this,
|
|
5265
5336
|
C: (f, a) => f(...a)
|
|
5266
5337
|
});
|
|
5267
5338
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
5268
5339
|
F: __dxlog_file18,
|
|
5269
|
-
L:
|
|
5340
|
+
L: 223,
|
|
5270
5341
|
S: this,
|
|
5271
5342
|
A: [
|
|
5272
5343
|
"this._config",
|
|
@@ -5275,7 +5346,7 @@ var ClientServicesHost = class {
|
|
|
5275
5346
|
});
|
|
5276
5347
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
5277
5348
|
F: __dxlog_file18,
|
|
5278
|
-
L:
|
|
5349
|
+
L: 224,
|
|
5279
5350
|
S: this,
|
|
5280
5351
|
A: [
|
|
5281
5352
|
"this._storage",
|
|
@@ -5284,7 +5355,7 @@ var ClientServicesHost = class {
|
|
|
5284
5355
|
});
|
|
5285
5356
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
5286
5357
|
F: __dxlog_file18,
|
|
5287
|
-
L:
|
|
5358
|
+
L: 225,
|
|
5288
5359
|
S: this,
|
|
5289
5360
|
A: [
|
|
5290
5361
|
"this._signalManager",
|
|
@@ -5293,7 +5364,7 @@ var ClientServicesHost = class {
|
|
|
5293
5364
|
});
|
|
5294
5365
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
5295
5366
|
F: __dxlog_file18,
|
|
5296
|
-
L:
|
|
5367
|
+
L: 226,
|
|
5297
5368
|
S: this,
|
|
5298
5369
|
A: [
|
|
5299
5370
|
"this._networkManager",
|
|
@@ -5305,7 +5376,7 @@ var ClientServicesHost = class {
|
|
|
5305
5376
|
lockKey: this._resourceLock?.lockKey
|
|
5306
5377
|
}, {
|
|
5307
5378
|
F: __dxlog_file18,
|
|
5308
|
-
L:
|
|
5379
|
+
L: 229,
|
|
5309
5380
|
S: this,
|
|
5310
5381
|
C: (f, a) => f(...a)
|
|
5311
5382
|
});
|
|
@@ -5321,7 +5392,7 @@ var ClientServicesHost = class {
|
|
|
5321
5392
|
await this._serviceContext.initialized.wait();
|
|
5322
5393
|
return this._serviceContext.dataSpaceManager;
|
|
5323
5394
|
}),
|
|
5324
|
-
DataService: new
|
|
5395
|
+
DataService: new import_echo_pipeline4.DataServiceImpl(this._serviceContext.automergeHost),
|
|
5325
5396
|
IndexService: new import_indexing2.IndexServiceImpl({
|
|
5326
5397
|
indexer: this._serviceContext.indexer,
|
|
5327
5398
|
automergeHost: this._serviceContext.automergeHost
|
|
@@ -5339,7 +5410,7 @@ var ClientServicesHost = class {
|
|
|
5339
5410
|
await this._serviceContext.open(ctx);
|
|
5340
5411
|
(0, import_invariant16.invariant)(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5341
5412
|
F: __dxlog_file18,
|
|
5342
|
-
L:
|
|
5413
|
+
L: 290,
|
|
5343
5414
|
S: this,
|
|
5344
5415
|
A: [
|
|
5345
5416
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5351,7 +5422,7 @@ var ClientServicesHost = class {
|
|
|
5351
5422
|
count: loadedInvitations.invitations?.length
|
|
5352
5423
|
}, {
|
|
5353
5424
|
F: __dxlog_file18,
|
|
5354
|
-
L:
|
|
5425
|
+
L: 293,
|
|
5355
5426
|
S: this,
|
|
5356
5427
|
C: (f, a) => f(...a)
|
|
5357
5428
|
});
|
|
@@ -5373,7 +5444,7 @@ var ClientServicesHost = class {
|
|
|
5373
5444
|
deviceKey
|
|
5374
5445
|
}, {
|
|
5375
5446
|
F: __dxlog_file18,
|
|
5376
|
-
L:
|
|
5447
|
+
L: 310,
|
|
5377
5448
|
S: this,
|
|
5378
5449
|
C: (f, a) => f(...a)
|
|
5379
5450
|
});
|
|
@@ -5381,7 +5452,7 @@ var ClientServicesHost = class {
|
|
|
5381
5452
|
id: traceId
|
|
5382
5453
|
}), {
|
|
5383
5454
|
F: __dxlog_file18,
|
|
5384
|
-
L:
|
|
5455
|
+
L: 311,
|
|
5385
5456
|
S: this,
|
|
5386
5457
|
C: (f, a) => f(...a)
|
|
5387
5458
|
});
|
|
@@ -5395,7 +5466,7 @@ var ClientServicesHost = class {
|
|
|
5395
5466
|
deviceKey
|
|
5396
5467
|
}, {
|
|
5397
5468
|
F: __dxlog_file18,
|
|
5398
|
-
L:
|
|
5469
|
+
L: 322,
|
|
5399
5470
|
S: this,
|
|
5400
5471
|
C: (f, a) => f(...a)
|
|
5401
5472
|
});
|
|
@@ -5411,7 +5482,7 @@ var ClientServicesHost = class {
|
|
|
5411
5482
|
deviceKey
|
|
5412
5483
|
}, {
|
|
5413
5484
|
F: __dxlog_file18,
|
|
5414
|
-
L:
|
|
5485
|
+
L: 329,
|
|
5415
5486
|
S: this,
|
|
5416
5487
|
C: (f, a) => f(...a)
|
|
5417
5488
|
});
|
|
@@ -5422,13 +5493,13 @@ var ClientServicesHost = class {
|
|
|
5422
5493
|
id: traceId
|
|
5423
5494
|
}), {
|
|
5424
5495
|
F: __dxlog_file18,
|
|
5425
|
-
L:
|
|
5496
|
+
L: 334,
|
|
5426
5497
|
S: this,
|
|
5427
5498
|
C: (f, a) => f(...a)
|
|
5428
5499
|
});
|
|
5429
5500
|
(0, import_log14.log)("resetting...", void 0, {
|
|
5430
5501
|
F: __dxlog_file18,
|
|
5431
|
-
L:
|
|
5502
|
+
L: 336,
|
|
5432
5503
|
S: this,
|
|
5433
5504
|
C: (f, a) => f(...a)
|
|
5434
5505
|
});
|
|
@@ -5436,7 +5507,7 @@ var ClientServicesHost = class {
|
|
|
5436
5507
|
await this._storage.reset();
|
|
5437
5508
|
(0, import_log14.log)("reset", void 0, {
|
|
5438
5509
|
F: __dxlog_file18,
|
|
5439
|
-
L:
|
|
5510
|
+
L: 339,
|
|
5440
5511
|
S: this,
|
|
5441
5512
|
C: (f, a) => f(...a)
|
|
5442
5513
|
});
|
|
@@ -5444,7 +5515,7 @@ var ClientServicesHost = class {
|
|
|
5444
5515
|
id: traceId
|
|
5445
5516
|
}), {
|
|
5446
5517
|
F: __dxlog_file18,
|
|
5447
|
-
L:
|
|
5518
|
+
L: 340,
|
|
5448
5519
|
S: this,
|
|
5449
5520
|
C: (f, a) => f(...a)
|
|
5450
5521
|
});
|
|
@@ -5454,12 +5525,10 @@ var ClientServicesHost = class {
|
|
|
5454
5525
|
const identity = await this._serviceContext.createIdentity(params);
|
|
5455
5526
|
await this._serviceContext.initialized.wait();
|
|
5456
5527
|
const space = await this._serviceContext.dataSpaceManager.createSpace();
|
|
5457
|
-
const obj = new import_client_protocol5.Properties(void 0);
|
|
5458
|
-
obj[import_client_protocol5.defaultKey] = identity.identityKey.toHex();
|
|
5459
5528
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5460
5529
|
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5461
5530
|
F: __dxlog_file18,
|
|
5462
|
-
L:
|
|
5531
|
+
L: 352,
|
|
5463
5532
|
S: this,
|
|
5464
5533
|
A: [
|
|
5465
5534
|
"automergeIndex",
|
|
@@ -5468,12 +5537,18 @@ var ClientServicesHost = class {
|
|
|
5468
5537
|
});
|
|
5469
5538
|
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5470
5539
|
await document.whenReady();
|
|
5540
|
+
const objectDocument = (0, import_echo_schema.createRawObjectDoc)({
|
|
5541
|
+
[import_client_protocol5.defaultKey]: identity.identityKey.toHex()
|
|
5542
|
+
}, {
|
|
5543
|
+
type: E.getTypeReference(import_client_protocol5.PropertiesSchema)
|
|
5544
|
+
});
|
|
5471
5545
|
document.change((doc) => {
|
|
5472
5546
|
(0, import_util9.assignDeep)(doc, [
|
|
5473
5547
|
"objects",
|
|
5474
|
-
|
|
5475
|
-
],
|
|
5548
|
+
objectDocument.id
|
|
5549
|
+
], objectDocument.handle.docSync());
|
|
5476
5550
|
});
|
|
5551
|
+
await (0, import_async16.sleep)(200);
|
|
5477
5552
|
return identity;
|
|
5478
5553
|
}
|
|
5479
5554
|
};
|
|
@@ -5528,4 +5603,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5528
5603
|
subscribeToSpaces,
|
|
5529
5604
|
subscribeToSwarmInfo
|
|
5530
5605
|
});
|
|
5531
|
-
//# sourceMappingURL=chunk-
|
|
5606
|
+
//# sourceMappingURL=chunk-EC2QGJ2V.cjs.map
|