@dxos/client-services 0.4.10-main.ec8b427 → 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-4NKBBUMB.mjs → chunk-I6GQX7F3.mjs} +196 -84
- package/dist/lib/browser/{chunk-4NKBBUMB.mjs.map → chunk-I6GQX7F3.mjs.map} +4 -4
- package/dist/lib/browser/index.mjs +50 -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 +6 -4
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-5YRLBMIC.cjs → chunk-42TXJ32V.cjs} +195 -88
- package/dist/lib/node/chunk-42TXJ32V.cjs.map +7 -0
- package/dist/lib/node/index.cjs +87 -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 +10 -8
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- 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-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/spaces/data-space.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/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 +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/indexing/util.ts +4 -4
- 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 +7 -4
- package/src/packlets/services/service-host.ts +32 -8
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/spaces/data-space.ts +51 -2
- 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/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
|
@@ -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";
|
|
@@ -2885,7 +2885,9 @@ import { Event as Event6, asyncTimeout, scheduleTask as scheduleTask5, sleep as
|
|
|
2885
2885
|
import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
|
|
2886
2886
|
import { cancelWithContext as cancelWithContext2, Context as Context8, ContextDisposedError } from "@dxos/context";
|
|
2887
2887
|
import { timed, warnAfterTimeout } from "@dxos/debug";
|
|
2888
|
+
import { TYPE_PROPERTIES } from "@dxos/echo-db";
|
|
2888
2889
|
import { createMappedFeedWriter } from "@dxos/echo-pipeline";
|
|
2890
|
+
import { AutomergeDocumentLoaderImpl } from "@dxos/echo-pipeline";
|
|
2889
2891
|
import { failedInvariant, invariant as invariant11 } from "@dxos/invariant";
|
|
2890
2892
|
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
2891
2893
|
import { log as log9 } from "@dxos/log";
|
|
@@ -2894,7 +2896,7 @@ import { SpaceState, CreateEpochRequest } from "@dxos/protocols/proto/dxos/clien
|
|
|
2894
2896
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2895
2897
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
2896
2898
|
import { trace as trace6 } from "@dxos/tracing";
|
|
2897
|
-
import { ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
2899
|
+
import { ComplexSet as ComplexSet3, assignDeep } from "@dxos/util";
|
|
2898
2900
|
|
|
2899
2901
|
// packages/sdk/client-services/src/packlets/spaces/automerge-space-state.ts
|
|
2900
2902
|
import { Event as Event4 } from "@dxos/async";
|
|
@@ -3249,7 +3251,7 @@ var DataSpace = class {
|
|
|
3249
3251
|
state: SpaceState[this._state]
|
|
3250
3252
|
}, {
|
|
3251
3253
|
F: __dxlog_file12,
|
|
3252
|
-
L:
|
|
3254
|
+
L: 140,
|
|
3253
3255
|
S: this,
|
|
3254
3256
|
C: (f, a) => f(...a)
|
|
3255
3257
|
});
|
|
@@ -3299,7 +3301,7 @@ var DataSpace = class {
|
|
|
3299
3301
|
state: SpaceState[this._state]
|
|
3300
3302
|
}, {
|
|
3301
3303
|
F: __dxlog_file12,
|
|
3302
|
-
L:
|
|
3304
|
+
L: 198,
|
|
3303
3305
|
S: this,
|
|
3304
3306
|
C: (f, a) => f(...a)
|
|
3305
3307
|
});
|
|
@@ -3317,7 +3319,7 @@ var DataSpace = class {
|
|
|
3317
3319
|
state: SpaceState[this._state]
|
|
3318
3320
|
}, {
|
|
3319
3321
|
F: __dxlog_file12,
|
|
3320
|
-
L:
|
|
3322
|
+
L: 212,
|
|
3321
3323
|
S: this,
|
|
3322
3324
|
C: (f, a) => f(...a)
|
|
3323
3325
|
});
|
|
@@ -3349,7 +3351,7 @@ var DataSpace = class {
|
|
|
3349
3351
|
if (err instanceof CancelledError || err instanceof ContextDisposedError) {
|
|
3350
3352
|
log9("data pipeline initialization cancelled", err, {
|
|
3351
3353
|
F: __dxlog_file12,
|
|
3352
|
-
L:
|
|
3354
|
+
L: 245,
|
|
3353
3355
|
S: this,
|
|
3354
3356
|
C: (f, a) => f(...a)
|
|
3355
3357
|
});
|
|
@@ -3357,7 +3359,7 @@ var DataSpace = class {
|
|
|
3357
3359
|
}
|
|
3358
3360
|
log9.error("Error initializing data pipeline", err, {
|
|
3359
3361
|
F: __dxlog_file12,
|
|
3360
|
-
L:
|
|
3362
|
+
L: 249,
|
|
3361
3363
|
S: this,
|
|
3362
3364
|
C: (f, a) => f(...a)
|
|
3363
3365
|
});
|
|
@@ -3366,7 +3368,7 @@ var DataSpace = class {
|
|
|
3366
3368
|
state: SpaceState[this._state]
|
|
3367
3369
|
}, {
|
|
3368
3370
|
F: __dxlog_file12,
|
|
3369
|
-
L:
|
|
3371
|
+
L: 251,
|
|
3370
3372
|
S: this,
|
|
3371
3373
|
C: (f, a) => f(...a)
|
|
3372
3374
|
});
|
|
@@ -3386,7 +3388,7 @@ var DataSpace = class {
|
|
|
3386
3388
|
state: SpaceState[this._state]
|
|
3387
3389
|
}, {
|
|
3388
3390
|
F: __dxlog_file12,
|
|
3389
|
-
L:
|
|
3391
|
+
L: 267,
|
|
3390
3392
|
S: this,
|
|
3391
3393
|
C: (f, a) => f(...a)
|
|
3392
3394
|
});
|
|
@@ -3396,7 +3398,7 @@ var DataSpace = class {
|
|
|
3396
3398
|
await cancelWithContext2(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
|
|
3397
3399
|
log9("data pipeline ready", void 0, {
|
|
3398
3400
|
F: __dxlog_file12,
|
|
3399
|
-
L:
|
|
3401
|
+
L: 279,
|
|
3400
3402
|
S: this,
|
|
3401
3403
|
C: (f, a) => f(...a)
|
|
3402
3404
|
});
|
|
@@ -3406,7 +3408,7 @@ var DataSpace = class {
|
|
|
3406
3408
|
state: SpaceState[this._state]
|
|
3407
3409
|
}, {
|
|
3408
3410
|
F: __dxlog_file12,
|
|
3409
|
-
L:
|
|
3411
|
+
L: 283,
|
|
3410
3412
|
S: this,
|
|
3411
3413
|
C: (f, a) => f(...a)
|
|
3412
3414
|
});
|
|
@@ -3422,7 +3424,7 @@ var DataSpace = class {
|
|
|
3422
3424
|
await this._createWritableFeeds();
|
|
3423
3425
|
log9("writable feeds created", void 0, {
|
|
3424
3426
|
F: __dxlog_file12,
|
|
3425
|
-
L:
|
|
3427
|
+
L: 299,
|
|
3426
3428
|
S: this,
|
|
3427
3429
|
C: (f, a) => f(...a)
|
|
3428
3430
|
});
|
|
@@ -3485,7 +3487,7 @@ var DataSpace = class {
|
|
|
3485
3487
|
rootUrl
|
|
3486
3488
|
}, {
|
|
3487
3489
|
F: __dxlog_file12,
|
|
3488
|
-
L:
|
|
3490
|
+
L: 365,
|
|
3489
3491
|
S: this,
|
|
3490
3492
|
C: (f, a) => f(...a)
|
|
3491
3493
|
});
|
|
@@ -3517,7 +3519,7 @@ var DataSpace = class {
|
|
|
3517
3519
|
err
|
|
3518
3520
|
}, {
|
|
3519
3521
|
F: __dxlog_file12,
|
|
3520
|
-
L:
|
|
3522
|
+
L: 388,
|
|
3521
3523
|
S: this,
|
|
3522
3524
|
C: (f, a) => f(...a)
|
|
3523
3525
|
});
|
|
@@ -3572,7 +3574,7 @@ var DataSpace = class {
|
|
|
3572
3574
|
const newRoot = this._automergeHost.repo.create(rootHandle.docSync());
|
|
3573
3575
|
invariant11(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
|
|
3574
3576
|
F: __dxlog_file12,
|
|
3575
|
-
L:
|
|
3577
|
+
L: 438,
|
|
3576
3578
|
S: this,
|
|
3577
3579
|
A: [
|
|
3578
3580
|
"typeof newRoot.url === 'string' && newRoot.url.length > 0",
|
|
@@ -3587,6 +3589,66 @@ var DataSpace = class {
|
|
|
3587
3589
|
};
|
|
3588
3590
|
}
|
|
3589
3591
|
break;
|
|
3592
|
+
case CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT:
|
|
3593
|
+
{
|
|
3594
|
+
log9.info("Fragmenting", void 0, {
|
|
3595
|
+
F: __dxlog_file12,
|
|
3596
|
+
L: 450,
|
|
3597
|
+
S: this,
|
|
3598
|
+
C: (f, a) => f(...a)
|
|
3599
|
+
});
|
|
3600
|
+
const currentRootUrl = this._automergeSpaceState.rootUrl;
|
|
3601
|
+
const rootHandle = this._automergeHost.repo.find(currentRootUrl);
|
|
3602
|
+
await cancelWithContext2(this._ctx, asyncTimeout(rootHandle.whenReady(), 1e4));
|
|
3603
|
+
const objects = Object.entries(rootHandle.docSync().objects);
|
|
3604
|
+
const properties = objects.find(([_, value]) => value.system.type?.itemId === TYPE_PROPERTIES);
|
|
3605
|
+
const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
|
|
3606
|
+
invariant11(properties, "Properties not found", {
|
|
3607
|
+
F: __dxlog_file12,
|
|
3608
|
+
L: 460,
|
|
3609
|
+
S: this,
|
|
3610
|
+
A: [
|
|
3611
|
+
"properties",
|
|
3612
|
+
"'Properties not found'"
|
|
3613
|
+
]
|
|
3614
|
+
});
|
|
3615
|
+
const newSpaceDoc = {
|
|
3616
|
+
...rootHandle.docSync(),
|
|
3617
|
+
objects: Object.fromEntries([
|
|
3618
|
+
properties
|
|
3619
|
+
])
|
|
3620
|
+
};
|
|
3621
|
+
const newRoot = this._automergeHost.repo.create(newSpaceDoc);
|
|
3622
|
+
invariant11(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
|
|
3623
|
+
F: __dxlog_file12,
|
|
3624
|
+
L: 465,
|
|
3625
|
+
S: this,
|
|
3626
|
+
A: [
|
|
3627
|
+
"typeof newRoot.url === 'string' && newRoot.url.length > 0",
|
|
3628
|
+
""
|
|
3629
|
+
]
|
|
3630
|
+
});
|
|
3631
|
+
const docLoader = new AutomergeDocumentLoaderImpl(this.key, this._automergeHost.repo);
|
|
3632
|
+
await docLoader.loadSpaceRootDocHandle(this._ctx, {
|
|
3633
|
+
rootUrl: newRoot.url
|
|
3634
|
+
});
|
|
3635
|
+
otherObjects.forEach(([key, value]) => {
|
|
3636
|
+
const handle = docLoader.createDocumentForObject(key);
|
|
3637
|
+
handle.change((doc) => {
|
|
3638
|
+
assignDeep(doc, [
|
|
3639
|
+
"objects",
|
|
3640
|
+
key
|
|
3641
|
+
], value);
|
|
3642
|
+
});
|
|
3643
|
+
});
|
|
3644
|
+
epoch = {
|
|
3645
|
+
previousId: this._automergeSpaceState.lastEpoch?.id,
|
|
3646
|
+
number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
|
|
3647
|
+
timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new Timeframe2(),
|
|
3648
|
+
automergeRoot: newRoot.url
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
break;
|
|
3590
3652
|
}
|
|
3591
3653
|
if (!epoch) {
|
|
3592
3654
|
return;
|
|
@@ -3628,7 +3690,7 @@ var DataSpace = class {
|
|
|
3628
3690
|
state: SpaceState[this._state]
|
|
3629
3691
|
}, {
|
|
3630
3692
|
F: __dxlog_file12,
|
|
3631
|
-
L:
|
|
3693
|
+
L: 531,
|
|
3632
3694
|
S: this,
|
|
3633
3695
|
C: (f, a) => f(...a)
|
|
3634
3696
|
});
|
|
@@ -4344,7 +4406,7 @@ import { safeInstanceof } from "@dxos/util";
|
|
|
4344
4406
|
import { getHeads } from "@dxos/automerge/automerge";
|
|
4345
4407
|
import { warnAfterTimeout as warnAfterTimeout2 } from "@dxos/debug";
|
|
4346
4408
|
import { idCodec } from "@dxos/protocols";
|
|
4347
|
-
var
|
|
4409
|
+
var createSelectedDocumentsIterator = (automergeHost) => (
|
|
4348
4410
|
/**
|
|
4349
4411
|
* Get object data blobs from Automerge Repo by ids.
|
|
4350
4412
|
* @param ids
|
|
@@ -4357,17 +4419,17 @@ var createLoadDocuments = (automergeHost) => (
|
|
|
4357
4419
|
await warnAfterTimeout2(5e3, "to long to load doc", () => handle.whenReady());
|
|
4358
4420
|
const doc = handle.docSync();
|
|
4359
4421
|
const hash = getHeads(doc).join("");
|
|
4360
|
-
yield [
|
|
4422
|
+
yield doc.objects?.[objectId] ? [
|
|
4361
4423
|
{
|
|
4362
4424
|
id,
|
|
4363
4425
|
object: doc.objects[objectId],
|
|
4364
4426
|
currentHash: hash
|
|
4365
4427
|
}
|
|
4366
|
-
];
|
|
4428
|
+
] : [];
|
|
4367
4429
|
}
|
|
4368
4430
|
}
|
|
4369
4431
|
);
|
|
4370
|
-
var
|
|
4432
|
+
var createDocumentsIterator = (automergeHost) => (
|
|
4371
4433
|
/**
|
|
4372
4434
|
* Recursively get all object data blobs from Automerge Repo.
|
|
4373
4435
|
* @param ids
|
|
@@ -4390,7 +4452,7 @@ var createGetAllDocuments = (automergeHost) => (
|
|
|
4390
4452
|
objectId
|
|
4391
4453
|
}),
|
|
4392
4454
|
object,
|
|
4393
|
-
currentHash: heads.
|
|
4455
|
+
currentHash: heads.join("")
|
|
4394
4456
|
};
|
|
4395
4457
|
});
|
|
4396
4458
|
}
|
|
@@ -4432,8 +4494,9 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4432
4494
|
}
|
|
4433
4495
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4434
4496
|
var ServiceContext = class {
|
|
4435
|
-
constructor(storage, networkManager, signalManager, _runtimeParams) {
|
|
4497
|
+
constructor(storage, level, networkManager, signalManager, _runtimeParams) {
|
|
4436
4498
|
this.storage = storage;
|
|
4499
|
+
this.level = level;
|
|
4437
4500
|
this.networkManager = networkManager;
|
|
4438
4501
|
this.signalManager = signalManager;
|
|
4439
4502
|
this._runtimeParams = _runtimeParams;
|
|
@@ -4463,7 +4526,7 @@ var ServiceContext = class {
|
|
|
4463
4526
|
});
|
|
4464
4527
|
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
|
|
4465
4528
|
this.indexMetadata = new IndexMetadataStore({
|
|
4466
|
-
|
|
4529
|
+
db: level.sublevel("index-metadata")
|
|
4467
4530
|
});
|
|
4468
4531
|
this.automergeHost = new AutomergeHost({
|
|
4469
4532
|
directory: storage.createDirectory("automerge"),
|
|
@@ -4474,8 +4537,8 @@ var ServiceContext = class {
|
|
|
4474
4537
|
directory: storage.createDirectory("index-store")
|
|
4475
4538
|
}),
|
|
4476
4539
|
metadataStore: this.indexMetadata,
|
|
4477
|
-
loadDocuments:
|
|
4478
|
-
getAllDocuments:
|
|
4540
|
+
loadDocuments: createSelectedDocumentsIterator(this.automergeHost),
|
|
4541
|
+
getAllDocuments: createDocumentsIterator(this.automergeHost)
|
|
4479
4542
|
});
|
|
4480
4543
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
4481
4544
|
this._handlerFactories.set(Invitation6.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? failUndefined2(), this._acceptIdentity.bind(this)));
|
|
@@ -4484,7 +4547,7 @@ var ServiceContext = class {
|
|
|
4484
4547
|
await this._checkStorageVersion();
|
|
4485
4548
|
log12("opening...", void 0, {
|
|
4486
4549
|
F: __dxlog_file15,
|
|
4487
|
-
L:
|
|
4550
|
+
L: 154,
|
|
4488
4551
|
S: this,
|
|
4489
4552
|
C: (f, a) => f(...a)
|
|
4490
4553
|
});
|
|
@@ -4492,7 +4555,7 @@ var ServiceContext = class {
|
|
|
4492
4555
|
id: this._instanceId
|
|
4493
4556
|
}), {
|
|
4494
4557
|
F: __dxlog_file15,
|
|
4495
|
-
L:
|
|
4558
|
+
L: 155,
|
|
4496
4559
|
S: this,
|
|
4497
4560
|
C: (f, a) => f(...a)
|
|
4498
4561
|
});
|
|
@@ -4508,13 +4571,13 @@ var ServiceContext = class {
|
|
|
4508
4571
|
id: this._instanceId
|
|
4509
4572
|
}), {
|
|
4510
4573
|
F: __dxlog_file15,
|
|
4511
|
-
L:
|
|
4574
|
+
L: 165,
|
|
4512
4575
|
S: this,
|
|
4513
4576
|
C: (f, a) => f(...a)
|
|
4514
4577
|
});
|
|
4515
4578
|
log12("opened", void 0, {
|
|
4516
4579
|
F: __dxlog_file15,
|
|
4517
|
-
L:
|
|
4580
|
+
L: 166,
|
|
4518
4581
|
S: this,
|
|
4519
4582
|
C: (f, a) => f(...a)
|
|
4520
4583
|
});
|
|
@@ -4522,7 +4585,7 @@ var ServiceContext = class {
|
|
|
4522
4585
|
async close() {
|
|
4523
4586
|
log12("closing...", void 0, {
|
|
4524
4587
|
F: __dxlog_file15,
|
|
4525
|
-
L:
|
|
4588
|
+
L: 170,
|
|
4526
4589
|
S: this,
|
|
4527
4590
|
C: (f, a) => f(...a)
|
|
4528
4591
|
});
|
|
@@ -4540,7 +4603,7 @@ var ServiceContext = class {
|
|
|
4540
4603
|
await this.indexer.destroy();
|
|
4541
4604
|
log12("closed", void 0, {
|
|
4542
4605
|
F: __dxlog_file15,
|
|
4543
|
-
L:
|
|
4606
|
+
L: 183,
|
|
4544
4607
|
S: this,
|
|
4545
4608
|
C: (f, a) => f(...a)
|
|
4546
4609
|
});
|
|
@@ -4554,7 +4617,7 @@ var ServiceContext = class {
|
|
|
4554
4617
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4555
4618
|
invariant14(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4556
4619
|
F: __dxlog_file15,
|
|
4557
|
-
L:
|
|
4620
|
+
L: 194,
|
|
4558
4621
|
S: this,
|
|
4559
4622
|
A: [
|
|
4560
4623
|
"factory",
|
|
@@ -4586,7 +4649,7 @@ var ServiceContext = class {
|
|
|
4586
4649
|
async _initialize(ctx) {
|
|
4587
4650
|
log12("initializing spaces...", void 0, {
|
|
4588
4651
|
F: __dxlog_file15,
|
|
4589
|
-
L:
|
|
4652
|
+
L: 225,
|
|
4590
4653
|
S: this,
|
|
4591
4654
|
C: (f, a) => f(...a)
|
|
4592
4655
|
});
|
|
@@ -4609,7 +4672,7 @@ var ServiceContext = class {
|
|
|
4609
4672
|
this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
|
|
4610
4673
|
invariant14(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4611
4674
|
F: __dxlog_file15,
|
|
4612
|
-
L:
|
|
4675
|
+
L: 249,
|
|
4613
4676
|
S: this,
|
|
4614
4677
|
A: [
|
|
4615
4678
|
"this.dataSpaceManager",
|
|
@@ -4633,7 +4696,7 @@ var ServiceContext = class {
|
|
|
4633
4696
|
details: assertion
|
|
4634
4697
|
}, {
|
|
4635
4698
|
F: __dxlog_file15,
|
|
4636
|
-
L:
|
|
4699
|
+
L: 265,
|
|
4637
4700
|
S: this,
|
|
4638
4701
|
C: (f, a) => f(...a)
|
|
4639
4702
|
});
|
|
@@ -4644,7 +4707,7 @@ var ServiceContext = class {
|
|
|
4644
4707
|
details: assertion
|
|
4645
4708
|
}, {
|
|
4646
4709
|
F: __dxlog_file15,
|
|
4647
|
-
L:
|
|
4710
|
+
L: 269,
|
|
4648
4711
|
S: this,
|
|
4649
4712
|
C: (f, a) => f(...a)
|
|
4650
4713
|
});
|
|
@@ -4655,7 +4718,7 @@ var ServiceContext = class {
|
|
|
4655
4718
|
details: assertion
|
|
4656
4719
|
}, {
|
|
4657
4720
|
F: __dxlog_file15,
|
|
4658
|
-
L:
|
|
4721
|
+
L: 274,
|
|
4659
4722
|
S: this,
|
|
4660
4723
|
C: (f, a) => f(...a)
|
|
4661
4724
|
});
|
|
@@ -4666,7 +4729,7 @@ var ServiceContext = class {
|
|
|
4666
4729
|
} catch (err) {
|
|
4667
4730
|
log12.catch(err, void 0, {
|
|
4668
4731
|
F: __dxlog_file15,
|
|
4669
|
-
L:
|
|
4732
|
+
L: 280,
|
|
4670
4733
|
S: this,
|
|
4671
4734
|
C: (f, a) => f(...a)
|
|
4672
4735
|
});
|
|
@@ -4836,14 +4899,27 @@ var isLocked = (lockPath) => {
|
|
|
4836
4899
|
};
|
|
4837
4900
|
|
|
4838
4901
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4839
|
-
import { DX_DATA } from "@dxos/client-protocol";
|
|
4840
4902
|
import { InvalidConfigError } from "@dxos/protocols";
|
|
4841
|
-
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
4903
|
+
import { Runtime as Runtime2 } from "@dxos/protocols/proto/dxos/config";
|
|
4842
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";
|
|
4843
4909
|
import { isNode as isNode2 } from "@dxos/util";
|
|
4844
|
-
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;
|
|
4845
4921
|
var createStorageObjects = (config) => {
|
|
4846
|
-
const { persistent = false, keyStore, dataStore
|
|
4922
|
+
const { persistent = false, keyStore, dataStore } = config ?? {};
|
|
4847
4923
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4848
4924
|
throw new InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4849
4925
|
}
|
|
@@ -4859,7 +4935,7 @@ var createStorageObjects = (config) => {
|
|
|
4859
4935
|
return {
|
|
4860
4936
|
storage: createStorage({
|
|
4861
4937
|
type: persistent ? toStorageType(dataStore) : StorageType.RAM,
|
|
4862
|
-
root:
|
|
4938
|
+
root: getRootPath(config)
|
|
4863
4939
|
})
|
|
4864
4940
|
};
|
|
4865
4941
|
};
|
|
@@ -4884,22 +4960,34 @@ var toStorageType = (type) => {
|
|
|
4884
4960
|
}
|
|
4885
4961
|
};
|
|
4886
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
|
+
|
|
4887
4975
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4888
4976
|
import { Event as Event9, synchronized as synchronized3 } from "@dxos/async";
|
|
4889
|
-
import {
|
|
4977
|
+
import { clientServiceBundle, defaultKey, Properties } from "@dxos/client-protocol";
|
|
4890
4978
|
import { Context as Context11 } from "@dxos/context";
|
|
4891
|
-
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
4892
|
-
import
|
|
4979
|
+
import { DataServiceImpl, encodeReference } from "@dxos/echo-pipeline";
|
|
4980
|
+
import * as E from "@dxos/echo-schema";
|
|
4893
4981
|
import { IndexServiceImpl } from "@dxos/indexing";
|
|
4894
4982
|
import { invariant as invariant16 } from "@dxos/invariant";
|
|
4895
|
-
import { PublicKey as
|
|
4983
|
+
import { PublicKey as PublicKey13 } from "@dxos/keys";
|
|
4896
4984
|
import { log as log15 } from "@dxos/log";
|
|
4897
4985
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
4898
4986
|
import { NetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
|
|
4899
4987
|
import { trace as trace9 } from "@dxos/protocols";
|
|
4900
4988
|
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
4901
4989
|
import { TRACE_PROCESSOR as TRACE_PROCESSOR2, trace as Trace3 } from "@dxos/tracing";
|
|
4902
|
-
import { assignDeep } from "@dxos/util";
|
|
4990
|
+
import { assignDeep as assignDeep2 } from "@dxos/util";
|
|
4903
4991
|
import { WebsocketRpcClient } from "@dxos/websocket-rpc";
|
|
4904
4992
|
|
|
4905
4993
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
@@ -4987,7 +5075,7 @@ var DevicesServiceImpl = class {
|
|
|
4987
5075
|
// packages/sdk/client-services/src/packlets/logging/logging-service.ts
|
|
4988
5076
|
import { Event as Event8 } from "@dxos/async";
|
|
4989
5077
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
4990
|
-
import { PublicKey as
|
|
5078
|
+
import { PublicKey as PublicKey12 } from "@dxos/keys";
|
|
4991
5079
|
import { getContextFromEntry, log as log14 } from "@dxos/log";
|
|
4992
5080
|
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
4993
5081
|
import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
|
|
@@ -4995,7 +5083,7 @@ var LoggingServiceImpl = class {
|
|
|
4995
5083
|
constructor() {
|
|
4996
5084
|
this._logs = new Event8();
|
|
4997
5085
|
this._started = Date.now();
|
|
4998
|
-
this._sessionId =
|
|
5086
|
+
this._sessionId = PublicKey12.random().toHex();
|
|
4999
5087
|
this._logProcessor = (_config, entry2) => {
|
|
5000
5088
|
this._logs.emit(entry2);
|
|
5001
5089
|
};
|
|
@@ -5090,12 +5178,12 @@ var LoggingServiceImpl = class {
|
|
|
5090
5178
|
});
|
|
5091
5179
|
}
|
|
5092
5180
|
};
|
|
5093
|
-
var matchFilter = (filter, level,
|
|
5181
|
+
var matchFilter = (filter, level, path2, options) => {
|
|
5094
5182
|
switch (options) {
|
|
5095
5183
|
case QueryLogsRequest.MatchingOptions.INCLUSIVE:
|
|
5096
|
-
return level >= filter.level && (!filter.pattern ||
|
|
5184
|
+
return level >= filter.level && (!filter.pattern || path2.includes(filter.pattern));
|
|
5097
5185
|
case QueryLogsRequest.MatchingOptions.EXPLICIT:
|
|
5098
|
-
return level === filter.level && (!filter.pattern ||
|
|
5186
|
+
return level === filter.level && (!filter.pattern || path2.includes(filter.pattern));
|
|
5099
5187
|
}
|
|
5100
5188
|
};
|
|
5101
5189
|
var shouldLog = (entry2, request) => {
|
|
@@ -5296,7 +5384,7 @@ var ClientServicesHost = class {
|
|
|
5296
5384
|
initialize({ config, ...options }) {
|
|
5297
5385
|
invariant16(!this._open, "service host is open", {
|
|
5298
5386
|
F: __dxlog_file18,
|
|
5299
|
-
L:
|
|
5387
|
+
L: 182,
|
|
5300
5388
|
S: this,
|
|
5301
5389
|
A: [
|
|
5302
5390
|
"!this._open",
|
|
@@ -5305,14 +5393,14 @@ var ClientServicesHost = class {
|
|
|
5305
5393
|
});
|
|
5306
5394
|
log15("initializing...", void 0, {
|
|
5307
5395
|
F: __dxlog_file18,
|
|
5308
|
-
L:
|
|
5396
|
+
L: 183,
|
|
5309
5397
|
S: this,
|
|
5310
5398
|
C: (f, a) => f(...a)
|
|
5311
5399
|
});
|
|
5312
5400
|
if (config) {
|
|
5313
5401
|
invariant16(!this._config, "config already set", {
|
|
5314
5402
|
F: __dxlog_file18,
|
|
5315
|
-
L:
|
|
5403
|
+
L: 186,
|
|
5316
5404
|
S: this,
|
|
5317
5405
|
A: [
|
|
5318
5406
|
"!this._config",
|
|
@@ -5324,13 +5412,21 @@ var ClientServicesHost = class {
|
|
|
5324
5412
|
this._storage = createStorageObjects(config.get("runtime.client.storage", {})).storage;
|
|
5325
5413
|
}
|
|
5326
5414
|
}
|
|
5415
|
+
if (!options.signalManager) {
|
|
5416
|
+
log15.warn("running signaling without telemetry metadata.", void 0, {
|
|
5417
|
+
F: __dxlog_file18,
|
|
5418
|
+
L: 194,
|
|
5419
|
+
S: this,
|
|
5420
|
+
C: (f, a) => f(...a)
|
|
5421
|
+
});
|
|
5422
|
+
}
|
|
5327
5423
|
const { connectionLog = true, transportFactory = createSimplePeerTransportFactory({
|
|
5328
5424
|
iceServers: this._config?.get("runtime.services.ice")
|
|
5329
5425
|
}), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
5330
5426
|
this._signalManager = signalManager;
|
|
5331
5427
|
invariant16(!this._networkManager, "network manager already set", {
|
|
5332
5428
|
F: __dxlog_file18,
|
|
5333
|
-
L:
|
|
5429
|
+
L: 205,
|
|
5334
5430
|
S: this,
|
|
5335
5431
|
A: [
|
|
5336
5432
|
"!this._networkManager",
|
|
@@ -5344,7 +5440,7 @@ var ClientServicesHost = class {
|
|
|
5344
5440
|
});
|
|
5345
5441
|
log15("initialized", void 0, {
|
|
5346
5442
|
F: __dxlog_file18,
|
|
5347
|
-
L:
|
|
5443
|
+
L: 212,
|
|
5348
5444
|
S: this,
|
|
5349
5445
|
C: (f, a) => f(...a)
|
|
5350
5446
|
});
|
|
@@ -5353,18 +5449,18 @@ var ClientServicesHost = class {
|
|
|
5353
5449
|
if (this._open) {
|
|
5354
5450
|
return;
|
|
5355
5451
|
}
|
|
5356
|
-
const traceId =
|
|
5452
|
+
const traceId = PublicKey13.random().toHex();
|
|
5357
5453
|
log15.trace("dxos.client-services.host.open", trace9.begin({
|
|
5358
5454
|
id: traceId
|
|
5359
5455
|
}), {
|
|
5360
5456
|
F: __dxlog_file18,
|
|
5361
|
-
L:
|
|
5457
|
+
L: 223,
|
|
5362
5458
|
S: this,
|
|
5363
5459
|
C: (f, a) => f(...a)
|
|
5364
5460
|
});
|
|
5365
5461
|
invariant16(this._config, "config not set", {
|
|
5366
5462
|
F: __dxlog_file18,
|
|
5367
|
-
L:
|
|
5463
|
+
L: 225,
|
|
5368
5464
|
S: this,
|
|
5369
5465
|
A: [
|
|
5370
5466
|
"this._config",
|
|
@@ -5373,7 +5469,7 @@ var ClientServicesHost = class {
|
|
|
5373
5469
|
});
|
|
5374
5470
|
invariant16(this._storage, "storage not set", {
|
|
5375
5471
|
F: __dxlog_file18,
|
|
5376
|
-
L:
|
|
5472
|
+
L: 226,
|
|
5377
5473
|
S: this,
|
|
5378
5474
|
A: [
|
|
5379
5475
|
"this._storage",
|
|
@@ -5382,7 +5478,7 @@ var ClientServicesHost = class {
|
|
|
5382
5478
|
});
|
|
5383
5479
|
invariant16(this._signalManager, "signal manager not set", {
|
|
5384
5480
|
F: __dxlog_file18,
|
|
5385
|
-
L:
|
|
5481
|
+
L: 227,
|
|
5386
5482
|
S: this,
|
|
5387
5483
|
A: [
|
|
5388
5484
|
"this._signalManager",
|
|
@@ -5391,7 +5487,7 @@ var ClientServicesHost = class {
|
|
|
5391
5487
|
});
|
|
5392
5488
|
invariant16(this._networkManager, "network manager not set", {
|
|
5393
5489
|
F: __dxlog_file18,
|
|
5394
|
-
L:
|
|
5490
|
+
L: 228,
|
|
5395
5491
|
S: this,
|
|
5396
5492
|
A: [
|
|
5397
5493
|
"this._networkManager",
|
|
@@ -5403,13 +5499,16 @@ var ClientServicesHost = class {
|
|
|
5403
5499
|
lockKey: this._resourceLock?.lockKey
|
|
5404
5500
|
}, {
|
|
5405
5501
|
F: __dxlog_file18,
|
|
5406
|
-
L:
|
|
5502
|
+
L: 231,
|
|
5407
5503
|
S: this,
|
|
5408
5504
|
C: (f, a) => f(...a)
|
|
5409
5505
|
});
|
|
5506
|
+
if (!this._level) {
|
|
5507
|
+
this._level = await createLevel(this._config.get("runtime.client.storage", {}));
|
|
5508
|
+
}
|
|
5410
5509
|
await this._resourceLock?.acquire();
|
|
5411
5510
|
await this._loggingService.open();
|
|
5412
|
-
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);
|
|
5413
5512
|
this._serviceRegistry.setServices({
|
|
5414
5513
|
SystemService: this._systemService,
|
|
5415
5514
|
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
@@ -5437,7 +5536,7 @@ var ClientServicesHost = class {
|
|
|
5437
5536
|
await this._serviceContext.open(ctx);
|
|
5438
5537
|
invariant16(this.serviceRegistry.services.InvitationsService, void 0, {
|
|
5439
5538
|
F: __dxlog_file18,
|
|
5440
|
-
L:
|
|
5539
|
+
L: 297,
|
|
5441
5540
|
S: this,
|
|
5442
5541
|
A: [
|
|
5443
5542
|
"this.serviceRegistry.services.InvitationsService",
|
|
@@ -5449,7 +5548,7 @@ var ClientServicesHost = class {
|
|
|
5449
5548
|
count: loadedInvitations.invitations?.length
|
|
5450
5549
|
}, {
|
|
5451
5550
|
F: __dxlog_file18,
|
|
5452
|
-
L:
|
|
5551
|
+
L: 300,
|
|
5453
5552
|
S: this,
|
|
5454
5553
|
C: (f, a) => f(...a)
|
|
5455
5554
|
});
|
|
@@ -5471,7 +5570,7 @@ var ClientServicesHost = class {
|
|
|
5471
5570
|
deviceKey
|
|
5472
5571
|
}, {
|
|
5473
5572
|
F: __dxlog_file18,
|
|
5474
|
-
L:
|
|
5573
|
+
L: 317,
|
|
5475
5574
|
S: this,
|
|
5476
5575
|
C: (f, a) => f(...a)
|
|
5477
5576
|
});
|
|
@@ -5479,7 +5578,7 @@ var ClientServicesHost = class {
|
|
|
5479
5578
|
id: traceId
|
|
5480
5579
|
}), {
|
|
5481
5580
|
F: __dxlog_file18,
|
|
5482
|
-
L:
|
|
5581
|
+
L: 318,
|
|
5483
5582
|
S: this,
|
|
5484
5583
|
C: (f, a) => f(...a)
|
|
5485
5584
|
});
|
|
@@ -5493,7 +5592,7 @@ var ClientServicesHost = class {
|
|
|
5493
5592
|
deviceKey
|
|
5494
5593
|
}, {
|
|
5495
5594
|
F: __dxlog_file18,
|
|
5496
|
-
L:
|
|
5595
|
+
L: 329,
|
|
5497
5596
|
S: this,
|
|
5498
5597
|
C: (f, a) => f(...a)
|
|
5499
5598
|
});
|
|
@@ -5503,30 +5602,31 @@ var ClientServicesHost = class {
|
|
|
5503
5602
|
});
|
|
5504
5603
|
await this._loggingService.close();
|
|
5505
5604
|
await this._serviceContext.close();
|
|
5605
|
+
await this._level?.close();
|
|
5506
5606
|
this._open = false;
|
|
5507
5607
|
this._statusUpdate.emit();
|
|
5508
5608
|
log15("closed", {
|
|
5509
5609
|
deviceKey
|
|
5510
5610
|
}, {
|
|
5511
5611
|
F: __dxlog_file18,
|
|
5512
|
-
L:
|
|
5612
|
+
L: 337,
|
|
5513
5613
|
S: this,
|
|
5514
5614
|
C: (f, a) => f(...a)
|
|
5515
5615
|
});
|
|
5516
5616
|
}
|
|
5517
5617
|
async reset() {
|
|
5518
|
-
const traceId =
|
|
5618
|
+
const traceId = PublicKey13.random().toHex();
|
|
5519
5619
|
log15.trace("dxos.sdk.client-services-host.reset", trace9.begin({
|
|
5520
5620
|
id: traceId
|
|
5521
5621
|
}), {
|
|
5522
5622
|
F: __dxlog_file18,
|
|
5523
|
-
L:
|
|
5623
|
+
L: 342,
|
|
5524
5624
|
S: this,
|
|
5525
5625
|
C: (f, a) => f(...a)
|
|
5526
5626
|
});
|
|
5527
5627
|
log15("resetting...", void 0, {
|
|
5528
5628
|
F: __dxlog_file18,
|
|
5529
|
-
L:
|
|
5629
|
+
L: 344,
|
|
5530
5630
|
S: this,
|
|
5531
5631
|
C: (f, a) => f(...a)
|
|
5532
5632
|
});
|
|
@@ -5534,7 +5634,7 @@ var ClientServicesHost = class {
|
|
|
5534
5634
|
await this._storage.reset();
|
|
5535
5635
|
log15("reset", void 0, {
|
|
5536
5636
|
F: __dxlog_file18,
|
|
5537
|
-
L:
|
|
5637
|
+
L: 347,
|
|
5538
5638
|
S: this,
|
|
5539
5639
|
C: (f, a) => f(...a)
|
|
5540
5640
|
});
|
|
@@ -5542,7 +5642,7 @@ var ClientServicesHost = class {
|
|
|
5542
5642
|
id: traceId
|
|
5543
5643
|
}), {
|
|
5544
5644
|
F: __dxlog_file18,
|
|
5545
|
-
L:
|
|
5645
|
+
L: 348,
|
|
5546
5646
|
S: this,
|
|
5547
5647
|
C: (f, a) => f(...a)
|
|
5548
5648
|
});
|
|
@@ -5552,12 +5652,10 @@ var ClientServicesHost = class {
|
|
|
5552
5652
|
const identity = await this._serviceContext.createIdentity(params);
|
|
5553
5653
|
await this._serviceContext.initialized.wait();
|
|
5554
5654
|
const space = await this._serviceContext.dataSpaceManager.createSpace();
|
|
5555
|
-
const obj = new Properties(void 0);
|
|
5556
|
-
obj[defaultKey] = identity.identityKey.toHex();
|
|
5557
5655
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5558
5656
|
invariant16(automergeIndex, void 0, {
|
|
5559
5657
|
F: __dxlog_file18,
|
|
5560
|
-
L:
|
|
5658
|
+
L: 360,
|
|
5561
5659
|
S: this,
|
|
5562
5660
|
A: [
|
|
5563
5661
|
"automergeIndex",
|
|
@@ -5566,12 +5664,25 @@ var ClientServicesHost = class {
|
|
|
5566
5664
|
});
|
|
5567
5665
|
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5568
5666
|
await document.whenReady();
|
|
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();
|
|
5569
5679
|
document.change((doc) => {
|
|
5570
|
-
|
|
5680
|
+
assignDeep2(doc, [
|
|
5571
5681
|
"objects",
|
|
5572
|
-
|
|
5573
|
-
],
|
|
5682
|
+
propertiesId
|
|
5683
|
+
], properties);
|
|
5574
5684
|
});
|
|
5685
|
+
await this._serviceContext.automergeHost.repo.flush();
|
|
5575
5686
|
return identity;
|
|
5576
5687
|
}
|
|
5577
5688
|
};
|
|
@@ -5625,6 +5736,7 @@ export {
|
|
|
5625
5736
|
Lock,
|
|
5626
5737
|
isLocked,
|
|
5627
5738
|
createStorageObjects,
|
|
5739
|
+
createLevel,
|
|
5628
5740
|
ClientServicesHost
|
|
5629
5741
|
};
|
|
5630
|
-
//# sourceMappingURL=chunk-
|
|
5742
|
+
//# sourceMappingURL=chunk-I6GQX7F3.mjs.map
|