@dxos/client-services 0.4.4-main.e05bf88 → 0.4.4-main.e80efb0
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-D33EKODR.mjs → chunk-55444QMQ.mjs} +63 -88
- package/dist/lib/browser/chunk-55444QMQ.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-SUKIDLMK.cjs → chunk-CY2UGZE6.cjs} +76 -101
- package/dist/lib/node/chunk-CY2UGZE6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -37
- 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-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-service.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-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/identity/identity-service.ts +2 -4
- package/src/packlets/services/service-host.ts +13 -40
- package/src/packlets/spaces/data-space-manager.ts +2 -1
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-D33EKODR.mjs.map +0 -7
- package/dist/lib/node/chunk-SUKIDLMK.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_CY2UGZE6_exports = {};
|
|
30
|
+
__export(chunk_CY2UGZE6_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -60,7 +60,7 @@ __export(chunk_SUKIDLMK_exports, {
|
|
|
60
60
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
61
61
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
62
62
|
});
|
|
63
|
-
module.exports = __toCommonJS(
|
|
63
|
+
module.exports = __toCommonJS(chunk_CY2UGZE6_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");
|
|
@@ -238,6 +238,7 @@ var import_protocols14 = require("@dxos/protocols");
|
|
|
238
238
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
239
239
|
var import_text_model = require("@dxos/text-model");
|
|
240
240
|
var import_tracing7 = require("@dxos/tracing");
|
|
241
|
+
var import_util9 = require("@dxos/util");
|
|
241
242
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
242
243
|
var import_async16 = require("@dxos/async");
|
|
243
244
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
@@ -246,11 +247,11 @@ var import_async17 = require("@dxos/async");
|
|
|
246
247
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
247
248
|
var import_log16 = require("@dxos/log");
|
|
248
249
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
249
|
-
var
|
|
250
|
+
var import_util10 = require("@dxos/util");
|
|
250
251
|
var import_codec_protobuf14 = require("@dxos/codec-protobuf");
|
|
251
252
|
var import_codec_protobuf15 = require("@dxos/codec-protobuf");
|
|
252
253
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
253
|
-
var
|
|
254
|
+
var import_util11 = require("@dxos/util");
|
|
254
255
|
var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
|
|
255
256
|
return new import_codec_protobuf.Stream(({ next }) => {
|
|
256
257
|
const subscriptions = new import_async.EventSubscriptions();
|
|
@@ -1202,7 +1203,6 @@ IdentityManager = _ts_decorate2([
|
|
|
1202
1203
|
import_tracing2.trace.resource()
|
|
1203
1204
|
], IdentityManager);
|
|
1204
1205
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1205
|
-
var CREATE_PROFILE_WITH_AUTOMERGE_DEFAULT = true;
|
|
1206
1206
|
var IdentityServiceImpl = class {
|
|
1207
1207
|
constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
|
|
1208
1208
|
this._createIdentity = _createIdentity;
|
|
@@ -1211,7 +1211,7 @@ var IdentityServiceImpl = class {
|
|
|
1211
1211
|
this._onProfileUpdate = _onProfileUpdate;
|
|
1212
1212
|
}
|
|
1213
1213
|
async createIdentity(request) {
|
|
1214
|
-
await this._createIdentity(request.profile ?? {}
|
|
1214
|
+
await this._createIdentity(request.profile ?? {});
|
|
1215
1215
|
return this._getIdentity();
|
|
1216
1216
|
}
|
|
1217
1217
|
async recoverIdentity(request) {
|
|
@@ -1239,7 +1239,7 @@ var IdentityServiceImpl = class {
|
|
|
1239
1239
|
async updateProfile(profile) {
|
|
1240
1240
|
(0, import_invariant3.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1241
1241
|
F: __dxlog_file4,
|
|
1242
|
-
L:
|
|
1242
|
+
L: 61,
|
|
1243
1243
|
S: this,
|
|
1244
1244
|
A: [
|
|
1245
1245
|
"this._identityManager.identity",
|
|
@@ -1253,7 +1253,7 @@ var IdentityServiceImpl = class {
|
|
|
1253
1253
|
async signPresentation({ presentation, nonce }) {
|
|
1254
1254
|
(0, import_invariant3.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1255
1255
|
F: __dxlog_file4,
|
|
1256
|
-
L:
|
|
1256
|
+
L: 68,
|
|
1257
1257
|
S: this,
|
|
1258
1258
|
A: [
|
|
1259
1259
|
"this._identityManager.identity",
|
|
@@ -2675,7 +2675,7 @@ var getPlatform = () => {
|
|
|
2675
2675
|
};
|
|
2676
2676
|
}
|
|
2677
2677
|
};
|
|
2678
|
-
var DXOS_VERSION = "0.4.4-main.
|
|
2678
|
+
var DXOS_VERSION = "0.4.4-main.e80efb0";
|
|
2679
2679
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2680
2680
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2681
2681
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -2914,7 +2914,7 @@ var NotarizationPlugin = class {
|
|
|
2914
2914
|
...this._extensions
|
|
2915
2915
|
].find((peer2) => !peersTried.has(peer2));
|
|
2916
2916
|
if (!peer) {
|
|
2917
|
-
import_log10.log.
|
|
2917
|
+
import_log10.log.info("Exhausted all peers to notarize with", {
|
|
2918
2918
|
retryIn: retryTimeout
|
|
2919
2919
|
}, {
|
|
2920
2920
|
F: __dxlog_file11,
|
|
@@ -2948,7 +2948,7 @@ var NotarizationPlugin = class {
|
|
|
2948
2948
|
await (0, import_async11.sleep)(successDelay);
|
|
2949
2949
|
} catch (err) {
|
|
2950
2950
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2951
|
-
import_log10.log.
|
|
2951
|
+
import_log10.log.info("error notarizing (recoverable)", err, {
|
|
2952
2952
|
F: __dxlog_file11,
|
|
2953
2953
|
L: 151,
|
|
2954
2954
|
S: this,
|
|
@@ -3293,7 +3293,7 @@ var DataSpace = class {
|
|
|
3293
3293
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
3294
3294
|
(0, import_log9.log)("data pipeline ready", void 0, {
|
|
3295
3295
|
F: __dxlog_file12,
|
|
3296
|
-
L:
|
|
3296
|
+
L: 294,
|
|
3297
3297
|
S: this,
|
|
3298
3298
|
C: (f, a) => f(...a)
|
|
3299
3299
|
});
|
|
@@ -3303,7 +3303,7 @@ var DataSpace = class {
|
|
|
3303
3303
|
state: import_services8.SpaceState[this._state]
|
|
3304
3304
|
}, {
|
|
3305
3305
|
F: __dxlog_file12,
|
|
3306
|
-
L:
|
|
3306
|
+
L: 298,
|
|
3307
3307
|
S: this,
|
|
3308
3308
|
C: (f, a) => f(...a)
|
|
3309
3309
|
});
|
|
@@ -3319,7 +3319,7 @@ var DataSpace = class {
|
|
|
3319
3319
|
await this._createWritableFeeds();
|
|
3320
3320
|
(0, import_log9.log)("writable feeds created", void 0, {
|
|
3321
3321
|
F: __dxlog_file12,
|
|
3322
|
-
L:
|
|
3322
|
+
L: 314,
|
|
3323
3323
|
S: this,
|
|
3324
3324
|
C: (f, a) => f(...a)
|
|
3325
3325
|
});
|
|
@@ -3382,10 +3382,11 @@ var DataSpace = class {
|
|
|
3382
3382
|
rootUrl
|
|
3383
3383
|
}, {
|
|
3384
3384
|
F: __dxlog_file12,
|
|
3385
|
-
L:
|
|
3385
|
+
L: 380,
|
|
3386
3386
|
S: this,
|
|
3387
3387
|
C: (f, a) => f(...a)
|
|
3388
3388
|
});
|
|
3389
|
+
this._automergeHost._requestedDocs.add(rootUrl);
|
|
3389
3390
|
const handle = this._automergeHost.repo.find(rootUrl);
|
|
3390
3391
|
queueMicrotask(async () => {
|
|
3391
3392
|
try {
|
|
@@ -3755,17 +3756,17 @@ var DataSpaceManager = class {
|
|
|
3755
3756
|
S: this,
|
|
3756
3757
|
C: (f, a) => f(...a)
|
|
3757
3758
|
});
|
|
3758
|
-
const space = await this._constructSpace(metadata);
|
|
3759
3759
|
const automergeRoot = this._automergeHost.repo.create();
|
|
3760
3760
|
automergeRoot.change((doc) => {
|
|
3761
3761
|
doc.experimental_spaceKey = spaceKey.toHex();
|
|
3762
3762
|
});
|
|
3763
|
+
const space = await this._constructSpace(metadata);
|
|
3763
3764
|
const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRoot.url);
|
|
3764
3765
|
await this._metadataStore.addSpace(metadata);
|
|
3765
3766
|
const memberCredential = credentials[1];
|
|
3766
3767
|
(0, import_invariant12.invariant)((0, import_credentials12.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3767
3768
|
F: __dxlog_file13,
|
|
3768
|
-
L:
|
|
3769
|
+
L: 155,
|
|
3769
3770
|
S: this,
|
|
3770
3771
|
A: [
|
|
3771
3772
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -3783,13 +3784,13 @@ var DataSpaceManager = class {
|
|
|
3783
3784
|
opts
|
|
3784
3785
|
}, {
|
|
3785
3786
|
F: __dxlog_file13,
|
|
3786
|
-
L:
|
|
3787
|
+
L: 167,
|
|
3787
3788
|
S: this,
|
|
3788
3789
|
C: (f, a) => f(...a)
|
|
3789
3790
|
});
|
|
3790
3791
|
(0, import_invariant12.invariant)(this._isOpen, "Not open.", {
|
|
3791
3792
|
F: __dxlog_file13,
|
|
3792
|
-
L:
|
|
3793
|
+
L: 168,
|
|
3793
3794
|
S: this,
|
|
3794
3795
|
A: [
|
|
3795
3796
|
"this._isOpen",
|
|
@@ -3798,7 +3799,7 @@ var DataSpaceManager = class {
|
|
|
3798
3799
|
});
|
|
3799
3800
|
(0, import_invariant12.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3800
3801
|
F: __dxlog_file13,
|
|
3801
|
-
L:
|
|
3802
|
+
L: 169,
|
|
3802
3803
|
S: this,
|
|
3803
3804
|
A: [
|
|
3804
3805
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -3833,7 +3834,7 @@ var DataSpaceManager = class {
|
|
|
3833
3834
|
metadata
|
|
3834
3835
|
}, {
|
|
3835
3836
|
F: __dxlog_file13,
|
|
3836
|
-
L:
|
|
3837
|
+
L: 202,
|
|
3837
3838
|
S: this,
|
|
3838
3839
|
C: (f, a) => f(...a)
|
|
3839
3840
|
});
|
|
@@ -3871,7 +3872,7 @@ var DataSpaceManager = class {
|
|
|
3871
3872
|
onAuthFailure: () => {
|
|
3872
3873
|
import_log11.log.warn("auth failure", void 0, {
|
|
3873
3874
|
F: __dxlog_file13,
|
|
3874
|
-
L:
|
|
3875
|
+
L: 239,
|
|
3875
3876
|
S: this,
|
|
3876
3877
|
C: (f, a) => f(...a)
|
|
3877
3878
|
});
|
|
@@ -3895,7 +3896,7 @@ var DataSpaceManager = class {
|
|
|
3895
3896
|
space: space.key
|
|
3896
3897
|
}, {
|
|
3897
3898
|
F: __dxlog_file13,
|
|
3898
|
-
L:
|
|
3899
|
+
L: 257,
|
|
3899
3900
|
S: this,
|
|
3900
3901
|
C: (f, a) => f(...a)
|
|
3901
3902
|
});
|
|
@@ -3907,7 +3908,7 @@ var DataSpaceManager = class {
|
|
|
3907
3908
|
open: this._isOpen
|
|
3908
3909
|
}, {
|
|
3909
3910
|
F: __dxlog_file13,
|
|
3910
|
-
L:
|
|
3911
|
+
L: 264,
|
|
3911
3912
|
S: this,
|
|
3912
3913
|
C: (f, a) => f(...a)
|
|
3913
3914
|
});
|
|
@@ -3920,7 +3921,7 @@ var DataSpaceManager = class {
|
|
|
3920
3921
|
space: space.key
|
|
3921
3922
|
}, {
|
|
3922
3923
|
F: __dxlog_file13,
|
|
3923
|
-
L:
|
|
3924
|
+
L: 270,
|
|
3924
3925
|
S: this,
|
|
3925
3926
|
C: (f, a) => f(...a)
|
|
3926
3927
|
});
|
|
@@ -4598,15 +4599,15 @@ var LoggingServiceImpl = class {
|
|
|
4598
4599
|
}
|
|
4599
4600
|
async controlMetrics({ reset, record }) {
|
|
4600
4601
|
if (reset) {
|
|
4601
|
-
|
|
4602
|
+
import_util10.tracer.clear();
|
|
4602
4603
|
}
|
|
4603
4604
|
if (record === true) {
|
|
4604
|
-
|
|
4605
|
+
import_util10.tracer.start();
|
|
4605
4606
|
} else if (record === false) {
|
|
4606
|
-
|
|
4607
|
+
import_util10.tracer.stop();
|
|
4607
4608
|
}
|
|
4608
4609
|
return {
|
|
4609
|
-
recording:
|
|
4610
|
+
recording: import_util10.tracer.recording
|
|
4610
4611
|
};
|
|
4611
4612
|
}
|
|
4612
4613
|
/**
|
|
@@ -4614,10 +4615,10 @@ var LoggingServiceImpl = class {
|
|
|
4614
4615
|
*/
|
|
4615
4616
|
queryMetrics({ interval = 5e3 }) {
|
|
4616
4617
|
const getNumericalValues = (key) => {
|
|
4617
|
-
const events =
|
|
4618
|
+
const events = import_util10.tracer.get(key) ?? [];
|
|
4618
4619
|
return {
|
|
4619
4620
|
key,
|
|
4620
|
-
stats: (0,
|
|
4621
|
+
stats: (0, import_util10.numericalValues)(events, "duration")
|
|
4621
4622
|
};
|
|
4622
4623
|
};
|
|
4623
4624
|
return new import_codec_protobuf13.Stream(({ next }) => {
|
|
@@ -4655,7 +4656,7 @@ var LoggingServiceImpl = class {
|
|
|
4655
4656
|
}
|
|
4656
4657
|
const record = {
|
|
4657
4658
|
...entry2,
|
|
4658
|
-
context: (0,
|
|
4659
|
+
context: (0, import_util10.jsonify)((0, import_log16.getContextFromEntry)(entry2)),
|
|
4659
4660
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4660
4661
|
meta: {
|
|
4661
4662
|
// TODO(dmaretskyi): Fix proto.
|
|
@@ -4740,7 +4741,7 @@ var SystemServiceImpl = class {
|
|
|
4740
4741
|
const diagnostics = await this._getDiagnostics();
|
|
4741
4742
|
return {
|
|
4742
4743
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4743
|
-
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0,
|
|
4744
|
+
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util11.jsonKeyReplacer)({
|
|
4744
4745
|
truncate: keys === import_services15.GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
|
|
4745
4746
|
humanize: keys === import_services15.GetDiagnosticsRequest.KEY_OPTION.HUMANIZE
|
|
4746
4747
|
})))
|
|
@@ -4787,18 +4788,6 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
4787
4788
|
var createDefaultModelFactory = () => {
|
|
4788
4789
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4789
4790
|
};
|
|
4790
|
-
var createGenesisMutationFromTypedObject = (obj) => {
|
|
4791
|
-
const snapshot = obj[import_echo_schema.base]._createSnapshot();
|
|
4792
|
-
return {
|
|
4793
|
-
objectId: obj[import_echo_schema.base]._id,
|
|
4794
|
-
genesis: {
|
|
4795
|
-
modelType: obj[import_echo_schema.base]._modelConstructor.meta.type
|
|
4796
|
-
},
|
|
4797
|
-
snapshot: {
|
|
4798
|
-
model: snapshot
|
|
4799
|
-
}
|
|
4800
|
-
};
|
|
4801
|
-
};
|
|
4802
4791
|
var ClientServicesHost = class {
|
|
4803
4792
|
constructor({
|
|
4804
4793
|
config,
|
|
@@ -4885,7 +4874,7 @@ var ClientServicesHost = class {
|
|
|
4885
4874
|
initialize({ config, ...options }) {
|
|
4886
4875
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
4887
4876
|
F: __dxlog_file17,
|
|
4888
|
-
L:
|
|
4877
|
+
L: 186,
|
|
4889
4878
|
S: this,
|
|
4890
4879
|
A: [
|
|
4891
4880
|
"!this._open",
|
|
@@ -4894,14 +4883,14 @@ var ClientServicesHost = class {
|
|
|
4894
4883
|
});
|
|
4895
4884
|
(0, import_log15.log)("initializing...", void 0, {
|
|
4896
4885
|
F: __dxlog_file17,
|
|
4897
|
-
L:
|
|
4886
|
+
L: 187,
|
|
4898
4887
|
S: this,
|
|
4899
4888
|
C: (f, a) => f(...a)
|
|
4900
4889
|
});
|
|
4901
4890
|
if (config) {
|
|
4902
4891
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
4903
4892
|
F: __dxlog_file17,
|
|
4904
|
-
L:
|
|
4893
|
+
L: 190,
|
|
4905
4894
|
S: this,
|
|
4906
4895
|
A: [
|
|
4907
4896
|
"!this._config",
|
|
@@ -4919,7 +4908,7 @@ var ClientServicesHost = class {
|
|
|
4919
4908
|
this._signalManager = signalManager;
|
|
4920
4909
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
4921
4910
|
F: __dxlog_file17,
|
|
4922
|
-
L:
|
|
4911
|
+
L: 206,
|
|
4923
4912
|
S: this,
|
|
4924
4913
|
A: [
|
|
4925
4914
|
"!this._networkManager",
|
|
@@ -4933,7 +4922,7 @@ var ClientServicesHost = class {
|
|
|
4933
4922
|
});
|
|
4934
4923
|
(0, import_log15.log)("initialized", void 0, {
|
|
4935
4924
|
F: __dxlog_file17,
|
|
4936
|
-
L:
|
|
4925
|
+
L: 213,
|
|
4937
4926
|
S: this,
|
|
4938
4927
|
C: (f, a) => f(...a)
|
|
4939
4928
|
});
|
|
@@ -4947,13 +4936,13 @@ var ClientServicesHost = class {
|
|
|
4947
4936
|
id: traceId
|
|
4948
4937
|
}), {
|
|
4949
4938
|
F: __dxlog_file17,
|
|
4950
|
-
L:
|
|
4939
|
+
L: 224,
|
|
4951
4940
|
S: this,
|
|
4952
4941
|
C: (f, a) => f(...a)
|
|
4953
4942
|
});
|
|
4954
4943
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
4955
4944
|
F: __dxlog_file17,
|
|
4956
|
-
L:
|
|
4945
|
+
L: 226,
|
|
4957
4946
|
S: this,
|
|
4958
4947
|
A: [
|
|
4959
4948
|
"this._config",
|
|
@@ -4962,7 +4951,7 @@ var ClientServicesHost = class {
|
|
|
4962
4951
|
});
|
|
4963
4952
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
4964
4953
|
F: __dxlog_file17,
|
|
4965
|
-
L:
|
|
4954
|
+
L: 227,
|
|
4966
4955
|
S: this,
|
|
4967
4956
|
A: [
|
|
4968
4957
|
"this._storage",
|
|
@@ -4971,7 +4960,7 @@ var ClientServicesHost = class {
|
|
|
4971
4960
|
});
|
|
4972
4961
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
4973
4962
|
F: __dxlog_file17,
|
|
4974
|
-
L:
|
|
4963
|
+
L: 228,
|
|
4975
4964
|
S: this,
|
|
4976
4965
|
A: [
|
|
4977
4966
|
"this._signalManager",
|
|
@@ -4980,7 +4969,7 @@ var ClientServicesHost = class {
|
|
|
4980
4969
|
});
|
|
4981
4970
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
4982
4971
|
F: __dxlog_file17,
|
|
4983
|
-
L:
|
|
4972
|
+
L: 229,
|
|
4984
4973
|
S: this,
|
|
4985
4974
|
A: [
|
|
4986
4975
|
"this._networkManager",
|
|
@@ -4992,7 +4981,7 @@ var ClientServicesHost = class {
|
|
|
4992
4981
|
lockKey: this._resourceLock?.lockKey
|
|
4993
4982
|
}, {
|
|
4994
4983
|
F: __dxlog_file17,
|
|
4995
|
-
L:
|
|
4984
|
+
L: 232,
|
|
4996
4985
|
S: this,
|
|
4997
4986
|
C: (f, a) => f(...a)
|
|
4998
4987
|
});
|
|
@@ -5001,7 +4990,7 @@ var ClientServicesHost = class {
|
|
|
5001
4990
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
5002
4991
|
this._serviceRegistry.setServices({
|
|
5003
4992
|
SystemService: this._systemService,
|
|
5004
|
-
IdentityService: new IdentityServiceImpl((params
|
|
4993
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
5005
4994
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
5006
4995
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
5007
4996
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -5038,7 +5027,7 @@ var ClientServicesHost = class {
|
|
|
5038
5027
|
deviceKey
|
|
5039
5028
|
}, {
|
|
5040
5029
|
F: __dxlog_file17,
|
|
5041
|
-
L:
|
|
5030
|
+
L: 305,
|
|
5042
5031
|
S: this,
|
|
5043
5032
|
C: (f, a) => f(...a)
|
|
5044
5033
|
});
|
|
@@ -5046,7 +5035,7 @@ var ClientServicesHost = class {
|
|
|
5046
5035
|
id: traceId
|
|
5047
5036
|
}), {
|
|
5048
5037
|
F: __dxlog_file17,
|
|
5049
|
-
L:
|
|
5038
|
+
L: 306,
|
|
5050
5039
|
S: this,
|
|
5051
5040
|
C: (f, a) => f(...a)
|
|
5052
5041
|
});
|
|
@@ -5060,7 +5049,7 @@ var ClientServicesHost = class {
|
|
|
5060
5049
|
deviceKey
|
|
5061
5050
|
}, {
|
|
5062
5051
|
F: __dxlog_file17,
|
|
5063
|
-
L:
|
|
5052
|
+
L: 317,
|
|
5064
5053
|
S: this,
|
|
5065
5054
|
C: (f, a) => f(...a)
|
|
5066
5055
|
});
|
|
@@ -5076,7 +5065,7 @@ var ClientServicesHost = class {
|
|
|
5076
5065
|
deviceKey
|
|
5077
5066
|
}, {
|
|
5078
5067
|
F: __dxlog_file17,
|
|
5079
|
-
L:
|
|
5068
|
+
L: 324,
|
|
5080
5069
|
S: this,
|
|
5081
5070
|
C: (f, a) => f(...a)
|
|
5082
5071
|
});
|
|
@@ -5087,13 +5076,13 @@ var ClientServicesHost = class {
|
|
|
5087
5076
|
id: traceId
|
|
5088
5077
|
}), {
|
|
5089
5078
|
F: __dxlog_file17,
|
|
5090
|
-
L:
|
|
5079
|
+
L: 329,
|
|
5091
5080
|
S: this,
|
|
5092
5081
|
C: (f, a) => f(...a)
|
|
5093
5082
|
});
|
|
5094
5083
|
(0, import_log15.log)("resetting...", void 0, {
|
|
5095
5084
|
F: __dxlog_file17,
|
|
5096
|
-
L:
|
|
5085
|
+
L: 331,
|
|
5097
5086
|
S: this,
|
|
5098
5087
|
C: (f, a) => f(...a)
|
|
5099
5088
|
});
|
|
@@ -5101,7 +5090,7 @@ var ClientServicesHost = class {
|
|
|
5101
5090
|
await this._storage.reset();
|
|
5102
5091
|
(0, import_log15.log)("reset", void 0, {
|
|
5103
5092
|
F: __dxlog_file17,
|
|
5104
|
-
L:
|
|
5093
|
+
L: 334,
|
|
5105
5094
|
S: this,
|
|
5106
5095
|
C: (f, a) => f(...a)
|
|
5107
5096
|
});
|
|
@@ -5109,50 +5098,36 @@ var ClientServicesHost = class {
|
|
|
5109
5098
|
id: traceId
|
|
5110
5099
|
}), {
|
|
5111
5100
|
F: __dxlog_file17,
|
|
5112
|
-
L:
|
|
5101
|
+
L: 335,
|
|
5113
5102
|
S: this,
|
|
5114
5103
|
C: (f, a) => f(...a)
|
|
5115
5104
|
});
|
|
5116
5105
|
await this._callbacks?.onReset?.();
|
|
5117
5106
|
}
|
|
5118
|
-
async _createIdentity(params
|
|
5107
|
+
async _createIdentity(params) {
|
|
5119
5108
|
const identity = await this._serviceContext.createIdentity(params);
|
|
5120
5109
|
await this._serviceContext.initialized.wait();
|
|
5121
5110
|
const space = await this._serviceContext.dataSpaceManager.createSpace();
|
|
5122
|
-
const obj = new import_client_protocol5.Properties(void 0
|
|
5123
|
-
automerge: useAutomerge
|
|
5124
|
-
});
|
|
5111
|
+
const obj = new import_client_protocol5.Properties(void 0);
|
|
5125
5112
|
obj[import_client_protocol5.defaultKey] = identity.identityKey.toHex();
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
A: [
|
|
5145
|
-
"automergeIndex",
|
|
5146
|
-
""
|
|
5147
|
-
]
|
|
5148
|
-
});
|
|
5149
|
-
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5150
|
-
await document.whenReady();
|
|
5151
|
-
document.change((doc) => {
|
|
5152
|
-
doc.objects ??= {};
|
|
5153
|
-
doc.objects[obj[import_echo_schema.base]._id] = (0, import_echo_schema.getRawDoc)(obj).handle.docSync();
|
|
5154
|
-
});
|
|
5155
|
-
}
|
|
5113
|
+
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5114
|
+
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5115
|
+
F: __dxlog_file17,
|
|
5116
|
+
L: 350,
|
|
5117
|
+
S: this,
|
|
5118
|
+
A: [
|
|
5119
|
+
"automergeIndex",
|
|
5120
|
+
""
|
|
5121
|
+
]
|
|
5122
|
+
});
|
|
5123
|
+
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5124
|
+
await document.whenReady();
|
|
5125
|
+
document.change((doc) => {
|
|
5126
|
+
(0, import_util9.assignDeep)(doc, [
|
|
5127
|
+
"objects",
|
|
5128
|
+
obj[import_echo_schema.base]._id
|
|
5129
|
+
], (0, import_echo_schema.getRawDoc)(obj).handle.docSync());
|
|
5130
|
+
});
|
|
5156
5131
|
return identity;
|
|
5157
5132
|
}
|
|
5158
5133
|
};
|
|
@@ -5207,4 +5182,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5207
5182
|
subscribeToSpaces,
|
|
5208
5183
|
subscribeToSwarmInfo
|
|
5209
5184
|
});
|
|
5210
|
-
//# sourceMappingURL=chunk-
|
|
5185
|
+
//# sourceMappingURL=chunk-CY2UGZE6.cjs.map
|