@dxos/client-services 0.1.32-next.77d513e → 0.1.33
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-E3FD43YN.mjs → chunk-H5IXSSI7.mjs} +125 -39
- package/dist/lib/browser/chunk-H5IXSSI7.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/index.cjs +132 -46
- 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 +134 -48
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts +1 -0
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +1 -0
- 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/package.json +30 -30
- package/src/packlets/identity/identity-manager.ts +18 -0
- package/src/packlets/services/service-context.ts +8 -0
- package/src/packlets/services/service-host.ts +8 -1
- package/dist/lib/browser/chunk-E3FD43YN.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -630,7 +630,9 @@ var Identity = class {
|
|
|
630
630
|
var import_node_assert2 = __toESM(require("node:assert"));
|
|
631
631
|
var import_async5 = require("@dxos/async");
|
|
632
632
|
var import_credentials4 = require("@dxos/credentials");
|
|
633
|
+
var import_keys4 = require("@dxos/keys");
|
|
633
634
|
var import_log3 = require("@dxos/log");
|
|
635
|
+
var import_protocols2 = require("@dxos/protocols");
|
|
634
636
|
var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
635
637
|
var import_util2 = require("@dxos/util");
|
|
636
638
|
var IdentityManager = class {
|
|
@@ -642,18 +644,28 @@ var IdentityManager = class {
|
|
|
642
644
|
this._feedStore = _feedStore;
|
|
643
645
|
this._spaceManager = _spaceManager;
|
|
644
646
|
this.stateUpdate = new import_async5.Event();
|
|
647
|
+
this._instanceId = import_keys4.PublicKey.random().toHex();
|
|
645
648
|
}
|
|
646
649
|
get identity() {
|
|
647
650
|
return this._identity;
|
|
648
651
|
}
|
|
649
652
|
async open() {
|
|
653
|
+
var _a;
|
|
654
|
+
import_log3.log.trace("dxos.halo.identity-manager", import_protocols2.trace.begin({
|
|
655
|
+
id: this._instanceId
|
|
656
|
+
}), {
|
|
657
|
+
file: "identity-manager.ts",
|
|
658
|
+
line: 71,
|
|
659
|
+
scope: this,
|
|
660
|
+
callSite: (f, a) => f(...a)
|
|
661
|
+
});
|
|
650
662
|
await this._metadataStore.load();
|
|
651
663
|
const identityRecord = this._metadataStore.getIdentityRecord();
|
|
652
664
|
(0, import_log3.log)("identity record", {
|
|
653
665
|
identityRecord
|
|
654
666
|
}, {
|
|
655
667
|
file: "identity-manager.ts",
|
|
656
|
-
line:
|
|
668
|
+
line: 75,
|
|
657
669
|
scope: this,
|
|
658
670
|
callSite: (f, a) => f(...a)
|
|
659
671
|
});
|
|
@@ -661,18 +673,36 @@ var IdentityManager = class {
|
|
|
661
673
|
this._identity = await this._constructIdentity(identityRecord);
|
|
662
674
|
await this._identity.open();
|
|
663
675
|
await this._identity.ready();
|
|
676
|
+
import_log3.log.trace("dxos.halo.identity", {
|
|
677
|
+
identityKey: identityRecord.identityKey,
|
|
678
|
+
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
679
|
+
}, {
|
|
680
|
+
file: "identity-manager.ts",
|
|
681
|
+
line: 80,
|
|
682
|
+
scope: this,
|
|
683
|
+
callSite: (f, a) => f(...a)
|
|
684
|
+
});
|
|
664
685
|
this.stateUpdate.emit();
|
|
665
686
|
}
|
|
666
687
|
}
|
|
667
688
|
async close() {
|
|
668
689
|
var _a;
|
|
669
690
|
await ((_a = this._identity) == null ? void 0 : _a.close());
|
|
691
|
+
import_log3.log.trace("dxos.halo.identity-manager", import_protocols2.trace.end({
|
|
692
|
+
id: this._instanceId
|
|
693
|
+
}), {
|
|
694
|
+
file: "identity-manager.ts",
|
|
695
|
+
line: 90,
|
|
696
|
+
scope: this,
|
|
697
|
+
callSite: (f, a) => f(...a)
|
|
698
|
+
});
|
|
670
699
|
}
|
|
671
700
|
async createIdentity({ displayName } = {}) {
|
|
701
|
+
var _a;
|
|
672
702
|
(0, import_node_assert2.default)(!this._identity, "Identity already exists.");
|
|
673
703
|
(0, import_log3.log)("creating identity...", {}, {
|
|
674
704
|
file: "identity-manager.ts",
|
|
675
|
-
line:
|
|
705
|
+
line: 95,
|
|
676
706
|
scope: this,
|
|
677
707
|
callSite: (f, a) => f(...a)
|
|
678
708
|
});
|
|
@@ -716,13 +746,22 @@ var IdentityManager = class {
|
|
|
716
746
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
717
747
|
this._identity = identity;
|
|
718
748
|
await this._identity.ready();
|
|
749
|
+
import_log3.log.trace("dxos.halo.identity", {
|
|
750
|
+
identityKey: identityRecord.identityKey,
|
|
751
|
+
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
752
|
+
}, {
|
|
753
|
+
file: "identity-manager.ts",
|
|
754
|
+
line: 150,
|
|
755
|
+
scope: this,
|
|
756
|
+
callSite: (f, a) => f(...a)
|
|
757
|
+
});
|
|
719
758
|
this.stateUpdate.emit();
|
|
720
759
|
(0, import_log3.log)("created identity", {
|
|
721
760
|
identityKey: identity.identityKey,
|
|
722
761
|
deviceKey: identity.deviceKey
|
|
723
762
|
}, {
|
|
724
763
|
file: "identity-manager.ts",
|
|
725
|
-
line:
|
|
764
|
+
line: 156,
|
|
726
765
|
scope: this,
|
|
727
766
|
callSite: (f, a) => f(...a)
|
|
728
767
|
});
|
|
@@ -732,11 +771,12 @@ var IdentityManager = class {
|
|
|
732
771
|
* Accept an existing identity. Expects it's device key to be authorized (now or later).
|
|
733
772
|
*/
|
|
734
773
|
async acceptIdentity(params) {
|
|
774
|
+
var _a;
|
|
735
775
|
(0, import_log3.log)("accepting identity", {
|
|
736
776
|
params
|
|
737
777
|
}, {
|
|
738
778
|
file: "identity-manager.ts",
|
|
739
|
-
line:
|
|
779
|
+
line: 164,
|
|
740
780
|
scope: this,
|
|
741
781
|
callSite: (f, a) => f(...a)
|
|
742
782
|
});
|
|
@@ -757,13 +797,22 @@ var IdentityManager = class {
|
|
|
757
797
|
this._identity = identity;
|
|
758
798
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
759
799
|
await this._identity.ready();
|
|
800
|
+
import_log3.log.trace("dxos.halo.identity", {
|
|
801
|
+
identityKey: identityRecord.identityKey,
|
|
802
|
+
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
803
|
+
}, {
|
|
804
|
+
file: "identity-manager.ts",
|
|
805
|
+
line: 184,
|
|
806
|
+
scope: this,
|
|
807
|
+
callSite: (f, a) => f(...a)
|
|
808
|
+
});
|
|
760
809
|
this.stateUpdate.emit();
|
|
761
810
|
(0, import_log3.log)("accepted identity", {
|
|
762
811
|
identityKey: identity.identityKey,
|
|
763
812
|
deviceKey: identity.deviceKey
|
|
764
813
|
}, {
|
|
765
814
|
file: "identity-manager.ts",
|
|
766
|
-
line:
|
|
815
|
+
line: 190,
|
|
767
816
|
scope: this,
|
|
768
817
|
callSite: (f, a) => f(...a)
|
|
769
818
|
});
|
|
@@ -775,7 +824,7 @@ var IdentityManager = class {
|
|
|
775
824
|
identityRecord
|
|
776
825
|
}, {
|
|
777
826
|
file: "identity-manager.ts",
|
|
778
|
-
line:
|
|
827
|
+
line: 196,
|
|
779
828
|
scope: this,
|
|
780
829
|
callSite: (f, a) => f(...a)
|
|
781
830
|
});
|
|
@@ -808,7 +857,7 @@ var IdentityManager = class {
|
|
|
808
857
|
identityKey: identityRecord.identityKey
|
|
809
858
|
}, {
|
|
810
859
|
file: "identity-manager.ts",
|
|
811
|
-
line:
|
|
860
|
+
line: 224,
|
|
812
861
|
scope: this,
|
|
813
862
|
callSite: (f, a) => f(...a)
|
|
814
863
|
});
|
|
@@ -884,10 +933,10 @@ var import_async6 = require("@dxos/async");
|
|
|
884
933
|
var import_client = require("@dxos/client");
|
|
885
934
|
var import_context3 = require("@dxos/context");
|
|
886
935
|
var import_credentials7 = require("@dxos/credentials");
|
|
887
|
-
var
|
|
936
|
+
var import_keys5 = require("@dxos/keys");
|
|
888
937
|
var import_log4 = require("@dxos/log");
|
|
889
938
|
var import_network_manager = require("@dxos/network-manager");
|
|
890
|
-
var
|
|
939
|
+
var import_protocols3 = require("@dxos/protocols");
|
|
891
940
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
892
941
|
var import_invitations = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
893
942
|
var import_teleport = require("@dxos/teleport");
|
|
@@ -906,8 +955,8 @@ var DeviceInvitationsHandler = class extends import_client.AbstractInvitationsHa
|
|
|
906
955
|
const identity = this._params.getIdentity();
|
|
907
956
|
const invitation = {
|
|
908
957
|
type,
|
|
909
|
-
invitationId:
|
|
910
|
-
swarmKey: swarmKey != null ? swarmKey :
|
|
958
|
+
invitationId: import_keys5.PublicKey.random().toHex(),
|
|
959
|
+
swarmKey: swarmKey != null ? swarmKey : import_keys5.PublicKey.random(),
|
|
911
960
|
authenticationCode: (0, import_credentials7.generatePasscode)(import_client.AUTHENTICATION_CODE_LENGTH)
|
|
912
961
|
};
|
|
913
962
|
const ctx = new import_context3.Context({
|
|
@@ -1168,7 +1217,7 @@ var DeviceInvitationsHandler = class extends import_client.AbstractInvitationsHa
|
|
|
1168
1217
|
const topic = invitation.swarmKey;
|
|
1169
1218
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1170
1219
|
topic,
|
|
1171
|
-
peerId:
|
|
1220
|
+
peerId: import_keys5.PublicKey.random(),
|
|
1172
1221
|
protocolProvider: (0, import_network_manager.createTeleportProtocolFactory)(async (teleport) => {
|
|
1173
1222
|
teleport.addExtension("dxos.halo.invitations", createExtension());
|
|
1174
1223
|
}),
|
|
@@ -1187,7 +1236,7 @@ var HostHaloInvitationExtension = class extends import_teleport.RpcExtension {
|
|
|
1187
1236
|
constructor(_callbacks) {
|
|
1188
1237
|
super({
|
|
1189
1238
|
exposed: {
|
|
1190
|
-
HaloHostService:
|
|
1239
|
+
HaloHostService: import_protocols3.schema.getService("dxos.halo.invitations.HaloHostService")
|
|
1191
1240
|
}
|
|
1192
1241
|
});
|
|
1193
1242
|
this._callbacks = _callbacks;
|
|
@@ -1219,7 +1268,7 @@ var GuestHaloInvitationExtension = class extends import_teleport.RpcExtension {
|
|
|
1219
1268
|
constructor(_callbacks) {
|
|
1220
1269
|
super({
|
|
1221
1270
|
requested: {
|
|
1222
|
-
HaloHostService:
|
|
1271
|
+
HaloHostService: import_protocols3.schema.getService("dxos.halo.invitations.HaloHostService")
|
|
1223
1272
|
}
|
|
1224
1273
|
});
|
|
1225
1274
|
this._callbacks = _callbacks;
|
|
@@ -1473,10 +1522,10 @@ var import_client2 = require("@dxos/client");
|
|
|
1473
1522
|
var import_context4 = require("@dxos/context");
|
|
1474
1523
|
var import_credentials8 = require("@dxos/credentials");
|
|
1475
1524
|
var import_feed_store3 = require("@dxos/feed-store");
|
|
1476
|
-
var
|
|
1525
|
+
var import_keys6 = require("@dxos/keys");
|
|
1477
1526
|
var import_log6 = require("@dxos/log");
|
|
1478
1527
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
1479
|
-
var
|
|
1528
|
+
var import_protocols4 = require("@dxos/protocols");
|
|
1480
1529
|
var import_services3 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1481
1530
|
var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
1482
1531
|
var import_teleport2 = require("@dxos/teleport");
|
|
@@ -1499,8 +1548,8 @@ var SpaceInvitationsHandler = class extends import_client2.AbstractInvitationsHa
|
|
|
1499
1548
|
(0, import_node_assert6.default)(space);
|
|
1500
1549
|
const invitation = {
|
|
1501
1550
|
type,
|
|
1502
|
-
invitationId:
|
|
1503
|
-
swarmKey: swarmKey != null ? swarmKey :
|
|
1551
|
+
invitationId: import_keys6.PublicKey.random().toHex(),
|
|
1552
|
+
swarmKey: swarmKey != null ? swarmKey : import_keys6.PublicKey.random(),
|
|
1504
1553
|
spaceKey: space.key,
|
|
1505
1554
|
authMethod: (_a = options == null ? void 0 : options.authMethod) != null ? _a : import_invitations2.AuthMethod.SHARED_SECRET,
|
|
1506
1555
|
authenticationCode: (0, import_credentials8.generatePasscode)(import_client2.AUTHENTICATION_CODE_LENGTH)
|
|
@@ -1853,7 +1902,7 @@ var SpaceInvitationsHandler = class extends import_client2.AbstractInvitationsHa
|
|
|
1853
1902
|
const topic = invitation.swarmKey;
|
|
1854
1903
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1855
1904
|
topic,
|
|
1856
|
-
peerId:
|
|
1905
|
+
peerId: import_keys6.PublicKey.random(),
|
|
1857
1906
|
protocolProvider: (0, import_network_manager2.createTeleportProtocolFactory)(async (teleport) => {
|
|
1858
1907
|
teleport.addExtension("dxos.halo.invitations", createExtension());
|
|
1859
1908
|
}),
|
|
@@ -1873,7 +1922,7 @@ var HostSpaceInvitationExtension = class extends import_teleport2.RpcExtension {
|
|
|
1873
1922
|
constructor(_callbacks) {
|
|
1874
1923
|
super({
|
|
1875
1924
|
exposed: {
|
|
1876
|
-
SpaceHostService:
|
|
1925
|
+
SpaceHostService: import_protocols4.schema.getService("dxos.halo.invitations.SpaceHostService")
|
|
1877
1926
|
}
|
|
1878
1927
|
});
|
|
1879
1928
|
this._callbacks = _callbacks;
|
|
@@ -1904,7 +1953,7 @@ var GuestSpaceInvitationExtension = class extends import_teleport2.RpcExtension
|
|
|
1904
1953
|
constructor(_callbacks) {
|
|
1905
1954
|
super({
|
|
1906
1955
|
requested: {
|
|
1907
|
-
SpaceHostService:
|
|
1956
|
+
SpaceHostService: import_protocols4.schema.getService("dxos.halo.invitations.SpaceHostService")
|
|
1908
1957
|
}
|
|
1909
1958
|
});
|
|
1910
1959
|
this._callbacks = _callbacks;
|
|
@@ -1943,6 +1992,7 @@ var import_client8 = require("@dxos/client");
|
|
|
1943
1992
|
var import_debug7 = require("@dxos/debug");
|
|
1944
1993
|
var import_echo_pipeline5 = require("@dxos/echo-pipeline");
|
|
1945
1994
|
var import_log16 = require("@dxos/log");
|
|
1995
|
+
var import_protocols7 = require("@dxos/protocols");
|
|
1946
1996
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1947
1997
|
|
|
1948
1998
|
// packages/sdk/client-services/src/packlets/deprecated/tracing.ts
|
|
@@ -2034,7 +2084,7 @@ var import_client4 = require("@dxos/client");
|
|
|
2034
2084
|
var import_context7 = require("@dxos/context");
|
|
2035
2085
|
var import_credentials10 = require("@dxos/credentials");
|
|
2036
2086
|
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
2037
|
-
var
|
|
2087
|
+
var import_keys9 = require("@dxos/keys");
|
|
2038
2088
|
var import_log9 = require("@dxos/log");
|
|
2039
2089
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2040
2090
|
var import_util5 = require("@dxos/util");
|
|
@@ -2046,7 +2096,7 @@ var import_context6 = require("@dxos/context");
|
|
|
2046
2096
|
var import_debug3 = require("@dxos/debug");
|
|
2047
2097
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2048
2098
|
var import_errors = require("@dxos/errors");
|
|
2049
|
-
var
|
|
2099
|
+
var import_keys8 = require("@dxos/keys");
|
|
2050
2100
|
var import_log8 = require("@dxos/log");
|
|
2051
2101
|
var import_credentials9 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2052
2102
|
var import_util4 = require("@dxos/util");
|
|
@@ -2055,9 +2105,9 @@ var import_util4 = require("@dxos/util");
|
|
|
2055
2105
|
var import_node_assert8 = __toESM(require("node:assert"));
|
|
2056
2106
|
var import_async9 = require("@dxos/async");
|
|
2057
2107
|
var import_context5 = require("@dxos/context");
|
|
2058
|
-
var
|
|
2108
|
+
var import_keys7 = require("@dxos/keys");
|
|
2059
2109
|
var import_log7 = require("@dxos/log");
|
|
2060
|
-
var
|
|
2110
|
+
var import_protocols5 = require("@dxos/protocols");
|
|
2061
2111
|
var import_teleport3 = require("@dxos/teleport");
|
|
2062
2112
|
var import_util3 = require("@dxos/util");
|
|
2063
2113
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
@@ -2068,8 +2118,8 @@ var NotarizationPlugin = class {
|
|
|
2068
2118
|
this._ctx = new import_context5.Context();
|
|
2069
2119
|
this._extensionOpened = new import_async9.Event();
|
|
2070
2120
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2071
|
-
this._processedCredentials = new import_util3.ComplexSet(
|
|
2072
|
-
this._processCredentialsTriggers = new import_util3.ComplexMap(
|
|
2121
|
+
this._processedCredentials = new import_util3.ComplexSet(import_keys7.PublicKey.hash);
|
|
2122
|
+
this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys7.PublicKey.hash);
|
|
2073
2123
|
}
|
|
2074
2124
|
async open() {
|
|
2075
2125
|
}
|
|
@@ -2263,10 +2313,10 @@ var NotarizationTeleportExtension = class extends import_teleport3.RpcExtension
|
|
|
2263
2313
|
constructor(_params) {
|
|
2264
2314
|
super({
|
|
2265
2315
|
requested: {
|
|
2266
|
-
NotarizationService:
|
|
2316
|
+
NotarizationService: import_protocols5.schema.getService("dxos.mesh.teleport.notarization.NotarizationService")
|
|
2267
2317
|
},
|
|
2268
2318
|
exposed: {
|
|
2269
|
-
NotarizationService:
|
|
2319
|
+
NotarizationService: import_protocols5.schema.getService("dxos.mesh.teleport.notarization.NotarizationService")
|
|
2270
2320
|
}
|
|
2271
2321
|
});
|
|
2272
2322
|
this._params = _params;
|
|
@@ -2327,7 +2377,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2327
2377
|
snapshotId: params.snapshotId
|
|
2328
2378
|
});
|
|
2329
2379
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2330
|
-
trustedKeysProvider: () => new import_util4.ComplexSet(
|
|
2380
|
+
trustedKeysProvider: () => new import_util4.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.keys())),
|
|
2331
2381
|
update: this._inner.stateUpdate,
|
|
2332
2382
|
authTimeout: AUTH_TIMEOUT2
|
|
2333
2383
|
});
|
|
@@ -2530,7 +2580,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2530
2580
|
this._snapshotStore = _snapshotStore;
|
|
2531
2581
|
this._ctx = new import_context7.Context();
|
|
2532
2582
|
this.updated = new import_async11.Event();
|
|
2533
|
-
this._spaces = new import_util5.ComplexMap(
|
|
2583
|
+
this._spaces = new import_util5.ComplexMap(import_keys9.PublicKey.hash);
|
|
2534
2584
|
this._isOpen = false;
|
|
2535
2585
|
}
|
|
2536
2586
|
// TODO(burdon): Remove.
|
|
@@ -3698,7 +3748,9 @@ var import_debug6 = require("@dxos/debug");
|
|
|
3698
3748
|
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
3699
3749
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
3700
3750
|
var import_keyring = require("@dxos/keyring");
|
|
3751
|
+
var import_keys10 = require("@dxos/keys");
|
|
3701
3752
|
var import_log15 = require("@dxos/log");
|
|
3753
|
+
var import_protocols6 = require("@dxos/protocols");
|
|
3702
3754
|
var ServiceContext = class {
|
|
3703
3755
|
// prettier-ignore
|
|
3704
3756
|
constructor(storage, networkManager, modelFactory) {
|
|
@@ -3707,6 +3759,7 @@ var ServiceContext = class {
|
|
|
3707
3759
|
this.modelFactory = modelFactory;
|
|
3708
3760
|
this.initialized = new import_async18.Trigger();
|
|
3709
3761
|
this.dataServiceSubscriptions = new import_echo_pipeline4.DataServiceSubscriptions();
|
|
3762
|
+
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
3710
3763
|
this.metadataStore = new import_echo_pipeline4.MetadataStore(storage.createDirectory("metadata"));
|
|
3711
3764
|
this.snapshotStore = new import_echo_pipeline4.SnapshotStore(storage.createDirectory("snapshots"));
|
|
3712
3765
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
@@ -3735,9 +3788,17 @@ var ServiceContext = class {
|
|
|
3735
3788
|
});
|
|
3736
3789
|
}
|
|
3737
3790
|
async open() {
|
|
3791
|
+
import_log15.log.trace("dxos.sdk.client-services", import_protocols6.trace.begin({
|
|
3792
|
+
id: this._instanceId
|
|
3793
|
+
}), {
|
|
3794
|
+
file: "service-context.ts",
|
|
3795
|
+
line: 98,
|
|
3796
|
+
scope: this,
|
|
3797
|
+
callSite: (f, a) => f(...a)
|
|
3798
|
+
});
|
|
3738
3799
|
(0, import_log15.log)("opening...", {}, {
|
|
3739
3800
|
file: "service-context.ts",
|
|
3740
|
-
line:
|
|
3801
|
+
line: 100,
|
|
3741
3802
|
scope: this,
|
|
3742
3803
|
callSite: (f, a) => f(...a)
|
|
3743
3804
|
});
|
|
@@ -3749,7 +3810,7 @@ var ServiceContext = class {
|
|
|
3749
3810
|
}
|
|
3750
3811
|
(0, import_log15.log)("opened", {}, {
|
|
3751
3812
|
file: "service-context.ts",
|
|
3752
|
-
line:
|
|
3813
|
+
line: 107,
|
|
3753
3814
|
scope: this,
|
|
3754
3815
|
callSite: (f, a) => f(...a)
|
|
3755
3816
|
});
|
|
@@ -3758,7 +3819,7 @@ var ServiceContext = class {
|
|
|
3758
3819
|
var _a, _b;
|
|
3759
3820
|
(0, import_log15.log)("closing...", {}, {
|
|
3760
3821
|
file: "service-context.ts",
|
|
3761
|
-
line:
|
|
3822
|
+
line: 111,
|
|
3762
3823
|
scope: this,
|
|
3763
3824
|
callSite: (f, a) => f(...a)
|
|
3764
3825
|
});
|
|
@@ -3771,7 +3832,15 @@ var ServiceContext = class {
|
|
|
3771
3832
|
this.dataServiceSubscriptions.clear();
|
|
3772
3833
|
(0, import_log15.log)("closed", {}, {
|
|
3773
3834
|
file: "service-context.ts",
|
|
3774
|
-
line:
|
|
3835
|
+
line: 119,
|
|
3836
|
+
scope: this,
|
|
3837
|
+
callSite: (f, a) => f(...a)
|
|
3838
|
+
});
|
|
3839
|
+
import_log15.log.trace("dxos.sdk.client-services", import_protocols6.trace.end({
|
|
3840
|
+
id: this._instanceId
|
|
3841
|
+
}), {
|
|
3842
|
+
file: "service-context.ts",
|
|
3843
|
+
line: 121,
|
|
3775
3844
|
scope: this,
|
|
3776
3845
|
callSite: (f, a) => f(...a)
|
|
3777
3846
|
});
|
|
@@ -3779,7 +3848,7 @@ var ServiceContext = class {
|
|
|
3779
3848
|
async reset() {
|
|
3780
3849
|
(0, import_log15.log)("resetting...", {}, {
|
|
3781
3850
|
file: "service-context.ts",
|
|
3782
|
-
line:
|
|
3851
|
+
line: 125,
|
|
3783
3852
|
scope: this,
|
|
3784
3853
|
callSite: (f, a) => f(...a)
|
|
3785
3854
|
});
|
|
@@ -3787,7 +3856,7 @@ var ServiceContext = class {
|
|
|
3787
3856
|
await this.storage.reset();
|
|
3788
3857
|
(0, import_log15.log)("reset", {}, {
|
|
3789
3858
|
file: "service-context.ts",
|
|
3790
|
-
line:
|
|
3859
|
+
line: 128,
|
|
3791
3860
|
scope: this,
|
|
3792
3861
|
callSite: (f, a) => f(...a)
|
|
3793
3862
|
});
|
|
@@ -3807,7 +3876,7 @@ var ServiceContext = class {
|
|
|
3807
3876
|
var _a;
|
|
3808
3877
|
(0, import_log15.log)("initializing spaces...", {}, {
|
|
3809
3878
|
file: "service-context.ts",
|
|
3810
|
-
line:
|
|
3879
|
+
line: 147,
|
|
3811
3880
|
scope: this,
|
|
3812
3881
|
callSite: (f, a) => f(...a)
|
|
3813
3882
|
});
|
|
@@ -3843,7 +3912,7 @@ var ServiceContext = class {
|
|
|
3843
3912
|
details: assertion
|
|
3844
3913
|
}, {
|
|
3845
3914
|
file: "service-context.ts",
|
|
3846
|
-
line:
|
|
3915
|
+
line: 190,
|
|
3847
3916
|
scope: this,
|
|
3848
3917
|
callSite: (f, a) => f(...a)
|
|
3849
3918
|
});
|
|
@@ -3854,7 +3923,7 @@ var ServiceContext = class {
|
|
|
3854
3923
|
details: assertion
|
|
3855
3924
|
}, {
|
|
3856
3925
|
file: "service-context.ts",
|
|
3857
|
-
line:
|
|
3926
|
+
line: 194,
|
|
3858
3927
|
scope: this,
|
|
3859
3928
|
callSite: (f, a) => f(...a)
|
|
3860
3929
|
});
|
|
@@ -3865,7 +3934,7 @@ var ServiceContext = class {
|
|
|
3865
3934
|
details: assertion
|
|
3866
3935
|
}, {
|
|
3867
3936
|
file: "service-context.ts",
|
|
3868
|
-
line:
|
|
3937
|
+
line: 199,
|
|
3869
3938
|
scope: this,
|
|
3870
3939
|
callSite: (f, a) => f(...a)
|
|
3871
3940
|
});
|
|
@@ -3876,7 +3945,7 @@ var ServiceContext = class {
|
|
|
3876
3945
|
} catch (err) {
|
|
3877
3946
|
import_log15.log.catch(err, {}, {
|
|
3878
3947
|
file: "service-context.ts",
|
|
3879
|
-
line:
|
|
3948
|
+
line: 205,
|
|
3880
3949
|
scope: this,
|
|
3881
3950
|
callSite: (f, a) => f(...a)
|
|
3882
3951
|
});
|
|
@@ -3925,6 +3994,7 @@ var ClientServicesHost = class {
|
|
|
3925
3994
|
this._statusUpdate = new import_async19.Event();
|
|
3926
3995
|
this._opening = false;
|
|
3927
3996
|
this._open = false;
|
|
3997
|
+
this._instanceId = import_client8.PublicKey.random().toHex();
|
|
3928
3998
|
this._storage = storage;
|
|
3929
3999
|
this._modelFactory = modelFactory;
|
|
3930
4000
|
if (config) {
|
|
@@ -3997,6 +4067,14 @@ var ClientServicesHost = class {
|
|
|
3997
4067
|
if (this._open) {
|
|
3998
4068
|
return;
|
|
3999
4069
|
}
|
|
4070
|
+
import_log16.log.trace("dxos.sdk.client-services-host", import_protocols7.trace.begin({
|
|
4071
|
+
id: this._instanceId
|
|
4072
|
+
}), {
|
|
4073
|
+
file: "service-host.ts",
|
|
4074
|
+
line: 168,
|
|
4075
|
+
scope: this,
|
|
4076
|
+
callSite: (f, a) => f(...a)
|
|
4077
|
+
});
|
|
4000
4078
|
(0, import_node_assert12.default)(this._config, "config not set");
|
|
4001
4079
|
(0, import_node_assert12.default)(this._storage, "storage not set");
|
|
4002
4080
|
(0, import_node_assert12.default)(this._networkManager, "network manager not set");
|
|
@@ -4005,7 +4083,7 @@ var ClientServicesHost = class {
|
|
|
4005
4083
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
4006
4084
|
}, {
|
|
4007
4085
|
file: "service-host.ts",
|
|
4008
|
-
line:
|
|
4086
|
+
line: 175,
|
|
4009
4087
|
scope: this,
|
|
4010
4088
|
callSite: (f, a) => f(...a)
|
|
4011
4089
|
});
|
|
@@ -4046,7 +4124,7 @@ var ClientServicesHost = class {
|
|
|
4046
4124
|
deviceKey
|
|
4047
4125
|
}, {
|
|
4048
4126
|
file: "service-host.ts",
|
|
4049
|
-
line:
|
|
4127
|
+
line: 229,
|
|
4050
4128
|
scope: this,
|
|
4051
4129
|
callSite: (f, a) => f(...a)
|
|
4052
4130
|
});
|
|
@@ -4061,7 +4139,7 @@ var ClientServicesHost = class {
|
|
|
4061
4139
|
deviceKey
|
|
4062
4140
|
}, {
|
|
4063
4141
|
file: "service-host.ts",
|
|
4064
|
-
line:
|
|
4142
|
+
line: 238,
|
|
4065
4143
|
scope: this,
|
|
4066
4144
|
callSite: (f, a) => f(...a)
|
|
4067
4145
|
});
|
|
@@ -4075,7 +4153,15 @@ var ClientServicesHost = class {
|
|
|
4075
4153
|
deviceKey
|
|
4076
4154
|
}, {
|
|
4077
4155
|
file: "service-host.ts",
|
|
4078
|
-
line:
|
|
4156
|
+
line: 243,
|
|
4157
|
+
scope: this,
|
|
4158
|
+
callSite: (f, a) => f(...a)
|
|
4159
|
+
});
|
|
4160
|
+
import_log16.log.trace("dxos.sdk.client-services-host", import_protocols7.trace.end({
|
|
4161
|
+
id: this._instanceId
|
|
4162
|
+
}), {
|
|
4163
|
+
file: "service-host.ts",
|
|
4164
|
+
line: 245,
|
|
4079
4165
|
scope: this,
|
|
4080
4166
|
callSite: (f, a) => f(...a)
|
|
4081
4167
|
});
|