@dxos/client-services 0.4.4 → 0.4.5-main.17763ce
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-NFGK66US.mjs → chunk-4XBABVDC.mjs} +106 -96
- package/dist/lib/browser/chunk-4XBABVDC.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-DZARJVRB.cjs → chunk-DI4IFQ6U.cjs} +218 -208
- package/dist/lib/node/chunk-DI4IFQ6U.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-manager.d.ts +3 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- 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/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +35 -35
- package/src/packlets/devices/devices-service.test.ts +12 -1
- package/src/packlets/devices/devices-service.ts +1 -1
- package/src/packlets/identity/identity-manager.test.ts +19 -0
- package/src/packlets/identity/identity-manager.ts +27 -1
- package/src/packlets/identity/identity-service.ts +2 -4
- package/src/packlets/services/service-host.ts +13 -40
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-NFGK66US.mjs.map +0 -7
- package/dist/lib/node/chunk-DZARJVRB.cjs.map +0 -7
|
@@ -650,6 +650,7 @@ import { invariant as invariant2 } from "@dxos/invariant";
|
|
|
650
650
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
651
651
|
import { log as log3 } from "@dxos/log";
|
|
652
652
|
import { trace as trace2 } from "@dxos/protocols";
|
|
653
|
+
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
653
654
|
import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
654
655
|
import { Timeframe } from "@dxos/timeframe";
|
|
655
656
|
import { trace as Trace } from "@dxos/tracing";
|
|
@@ -684,7 +685,7 @@ var IdentityManager = class {
|
|
|
684
685
|
id: traceId
|
|
685
686
|
}), {
|
|
686
687
|
F: __dxlog_file3,
|
|
687
|
-
L:
|
|
688
|
+
L: 80,
|
|
688
689
|
S: this,
|
|
689
690
|
C: (f, a) => f(...a)
|
|
690
691
|
});
|
|
@@ -693,7 +694,7 @@ var IdentityManager = class {
|
|
|
693
694
|
identityRecord
|
|
694
695
|
}, {
|
|
695
696
|
F: __dxlog_file3,
|
|
696
|
-
L:
|
|
697
|
+
L: 83,
|
|
697
698
|
S: this,
|
|
698
699
|
C: (f, a) => f(...a)
|
|
699
700
|
});
|
|
@@ -706,7 +707,7 @@ var IdentityManager = class {
|
|
|
706
707
|
displayName: this._identity.profileDocument?.displayName
|
|
707
708
|
}, {
|
|
708
709
|
F: __dxlog_file3,
|
|
709
|
-
L:
|
|
710
|
+
L: 88,
|
|
710
711
|
S: this,
|
|
711
712
|
C: (f, a) => f(...a)
|
|
712
713
|
});
|
|
@@ -716,7 +717,7 @@ var IdentityManager = class {
|
|
|
716
717
|
id: traceId
|
|
717
718
|
}), {
|
|
718
719
|
F: __dxlog_file3,
|
|
719
|
-
L:
|
|
720
|
+
L: 94,
|
|
720
721
|
S: this,
|
|
721
722
|
C: (f, a) => f(...a)
|
|
722
723
|
});
|
|
@@ -727,7 +728,7 @@ var IdentityManager = class {
|
|
|
727
728
|
async createIdentity({ displayName } = {}) {
|
|
728
729
|
invariant2(!this._identity, "Identity already exists.", {
|
|
729
730
|
F: __dxlog_file3,
|
|
730
|
-
L:
|
|
731
|
+
L: 102,
|
|
731
732
|
S: this,
|
|
732
733
|
A: [
|
|
733
734
|
"!this._identity",
|
|
@@ -736,7 +737,7 @@ var IdentityManager = class {
|
|
|
736
737
|
});
|
|
737
738
|
log3("creating identity...", void 0, {
|
|
738
739
|
F: __dxlog_file3,
|
|
739
|
-
L:
|
|
740
|
+
L: 103,
|
|
740
741
|
S: this,
|
|
741
742
|
C: (f, a) => f(...a)
|
|
742
743
|
});
|
|
@@ -757,7 +758,7 @@ var IdentityManager = class {
|
|
|
757
758
|
const generator = new CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
758
759
|
invariant2(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
759
760
|
F: __dxlog_file3,
|
|
760
|
-
L:
|
|
761
|
+
L: 122,
|
|
761
762
|
S: this,
|
|
762
763
|
A: [
|
|
763
764
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -766,7 +767,7 @@ var IdentityManager = class {
|
|
|
766
767
|
});
|
|
767
768
|
invariant2(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
768
769
|
F: __dxlog_file3,
|
|
769
|
-
L:
|
|
770
|
+
L: 123,
|
|
770
771
|
S: this,
|
|
771
772
|
A: [
|
|
772
773
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -808,7 +809,7 @@ var IdentityManager = class {
|
|
|
808
809
|
displayName: this._identity.profileDocument?.displayName
|
|
809
810
|
}, {
|
|
810
811
|
F: __dxlog_file3,
|
|
811
|
-
L:
|
|
812
|
+
L: 168,
|
|
812
813
|
S: this,
|
|
813
814
|
C: (f, a) => f(...a)
|
|
814
815
|
});
|
|
@@ -818,7 +819,7 @@ var IdentityManager = class {
|
|
|
818
819
|
deviceKey: identity.deviceKey
|
|
819
820
|
}, {
|
|
820
821
|
F: __dxlog_file3,
|
|
821
|
-
L:
|
|
822
|
+
L: 174,
|
|
822
823
|
S: this,
|
|
823
824
|
C: (f, a) => f(...a)
|
|
824
825
|
});
|
|
@@ -832,13 +833,13 @@ var IdentityManager = class {
|
|
|
832
833
|
params
|
|
833
834
|
}, {
|
|
834
835
|
F: __dxlog_file3,
|
|
835
|
-
L:
|
|
836
|
+
L: 182,
|
|
836
837
|
S: this,
|
|
837
838
|
C: (f, a) => f(...a)
|
|
838
839
|
});
|
|
839
840
|
invariant2(!this._identity, "Identity already exists.", {
|
|
840
841
|
F: __dxlog_file3,
|
|
841
|
-
L:
|
|
842
|
+
L: 183,
|
|
842
843
|
S: this,
|
|
843
844
|
A: [
|
|
844
845
|
"!this._identity",
|
|
@@ -866,7 +867,7 @@ var IdentityManager = class {
|
|
|
866
867
|
displayName: this._identity.profileDocument?.displayName
|
|
867
868
|
}, {
|
|
868
869
|
F: __dxlog_file3,
|
|
869
|
-
L:
|
|
870
|
+
L: 202,
|
|
870
871
|
S: this,
|
|
871
872
|
C: (f, a) => f(...a)
|
|
872
873
|
});
|
|
@@ -876,7 +877,7 @@ var IdentityManager = class {
|
|
|
876
877
|
deviceKey: identity.deviceKey
|
|
877
878
|
}, {
|
|
878
879
|
F: __dxlog_file3,
|
|
879
|
-
L:
|
|
880
|
+
L: 208,
|
|
880
881
|
S: this,
|
|
881
882
|
C: (f, a) => f(...a)
|
|
882
883
|
});
|
|
@@ -888,7 +889,7 @@ var IdentityManager = class {
|
|
|
888
889
|
async updateProfile(profile) {
|
|
889
890
|
invariant2(this._identity, "Identity not initialized.", {
|
|
890
891
|
F: __dxlog_file3,
|
|
891
|
-
L:
|
|
892
|
+
L: 216,
|
|
892
893
|
S: this,
|
|
893
894
|
A: [
|
|
894
895
|
"this._identity",
|
|
@@ -916,10 +917,45 @@ var IdentityManager = class {
|
|
|
916
917
|
this.stateUpdate.emit();
|
|
917
918
|
return profile;
|
|
918
919
|
}
|
|
920
|
+
async updateDeviceProfile(profile) {
|
|
921
|
+
invariant2(this._identity, "Identity not initialized.", {
|
|
922
|
+
F: __dxlog_file3,
|
|
923
|
+
L: 233,
|
|
924
|
+
S: this,
|
|
925
|
+
A: [
|
|
926
|
+
"this._identity",
|
|
927
|
+
"'Identity not initialized.'"
|
|
928
|
+
]
|
|
929
|
+
});
|
|
930
|
+
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
931
|
+
subject: this._identity.deviceKey,
|
|
932
|
+
assertion: {
|
|
933
|
+
"@type": "dxos.halo.credentials.DeviceProfile",
|
|
934
|
+
profile
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
const receipt = await this._identity.controlPipeline.writer.write({
|
|
938
|
+
credential: {
|
|
939
|
+
credential
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([
|
|
943
|
+
[
|
|
944
|
+
receipt.feedKey,
|
|
945
|
+
receipt.seq
|
|
946
|
+
]
|
|
947
|
+
]));
|
|
948
|
+
this.stateUpdate.emit();
|
|
949
|
+
return {
|
|
950
|
+
deviceKey: this._identity.deviceKey,
|
|
951
|
+
kind: DeviceKind.CURRENT,
|
|
952
|
+
profile
|
|
953
|
+
};
|
|
954
|
+
}
|
|
919
955
|
async _constructIdentity(identityRecord) {
|
|
920
956
|
invariant2(!this._identity, void 0, {
|
|
921
957
|
F: __dxlog_file3,
|
|
922
|
-
L:
|
|
958
|
+
L: 254,
|
|
923
959
|
S: this,
|
|
924
960
|
A: [
|
|
925
961
|
"!this._identity",
|
|
@@ -930,13 +966,13 @@ var IdentityManager = class {
|
|
|
930
966
|
identityRecord
|
|
931
967
|
}, {
|
|
932
968
|
F: __dxlog_file3,
|
|
933
|
-
L:
|
|
969
|
+
L: 255,
|
|
934
970
|
S: this,
|
|
935
971
|
C: (f, a) => f(...a)
|
|
936
972
|
});
|
|
937
973
|
invariant2(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
938
974
|
F: __dxlog_file3,
|
|
939
|
-
L:
|
|
975
|
+
L: 258,
|
|
940
976
|
S: this,
|
|
941
977
|
A: [
|
|
942
978
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -948,7 +984,7 @@ var IdentityManager = class {
|
|
|
948
984
|
});
|
|
949
985
|
invariant2(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
950
986
|
F: __dxlog_file3,
|
|
951
|
-
L:
|
|
987
|
+
L: 262,
|
|
952
988
|
S: this,
|
|
953
989
|
A: [
|
|
954
990
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -980,7 +1016,7 @@ var IdentityManager = class {
|
|
|
980
1016
|
identityKey: identityRecord.identityKey
|
|
981
1017
|
}, {
|
|
982
1018
|
F: __dxlog_file3,
|
|
983
|
-
L:
|
|
1019
|
+
L: 286,
|
|
984
1020
|
S: this,
|
|
985
1021
|
C: (f, a) => f(...a)
|
|
986
1022
|
});
|
|
@@ -1001,7 +1037,7 @@ var IdentityManager = class {
|
|
|
1001
1037
|
onAuthFailure: () => {
|
|
1002
1038
|
log3.warn("auth failure", void 0, {
|
|
1003
1039
|
F: __dxlog_file3,
|
|
1004
|
-
L:
|
|
1040
|
+
L: 305,
|
|
1005
1041
|
S: this,
|
|
1006
1042
|
C: (f, a) => f(...a)
|
|
1007
1043
|
});
|
|
@@ -1025,7 +1061,6 @@ import { signPresentation } from "@dxos/credentials";
|
|
|
1025
1061
|
import { todo } from "@dxos/debug";
|
|
1026
1062
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1027
1063
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1028
|
-
var CREATE_PROFILE_WITH_AUTOMERGE_DEFAULT = true;
|
|
1029
1064
|
var IdentityServiceImpl = class {
|
|
1030
1065
|
constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
|
|
1031
1066
|
this._createIdentity = _createIdentity;
|
|
@@ -1034,7 +1069,7 @@ var IdentityServiceImpl = class {
|
|
|
1034
1069
|
this._onProfileUpdate = _onProfileUpdate;
|
|
1035
1070
|
}
|
|
1036
1071
|
async createIdentity(request) {
|
|
1037
|
-
await this._createIdentity(request.profile ?? {}
|
|
1072
|
+
await this._createIdentity(request.profile ?? {});
|
|
1038
1073
|
return this._getIdentity();
|
|
1039
1074
|
}
|
|
1040
1075
|
async recoverIdentity(request) {
|
|
@@ -1062,7 +1097,7 @@ var IdentityServiceImpl = class {
|
|
|
1062
1097
|
async updateProfile(profile) {
|
|
1063
1098
|
invariant3(this._identityManager.identity, "Identity not initialized.", {
|
|
1064
1099
|
F: __dxlog_file4,
|
|
1065
|
-
L:
|
|
1100
|
+
L: 61,
|
|
1066
1101
|
S: this,
|
|
1067
1102
|
A: [
|
|
1068
1103
|
"this._identityManager.identity",
|
|
@@ -1076,7 +1111,7 @@ var IdentityServiceImpl = class {
|
|
|
1076
1111
|
async signPresentation({ presentation, nonce }) {
|
|
1077
1112
|
invariant3(this._identityManager.identity, "Identity not initialized.", {
|
|
1078
1113
|
F: __dxlog_file4,
|
|
1079
|
-
L:
|
|
1114
|
+
L: 68,
|
|
1080
1115
|
S: this,
|
|
1081
1116
|
A: [
|
|
1082
1117
|
"this._identityManager.identity",
|
|
@@ -2566,7 +2601,7 @@ var getPlatform = () => {
|
|
|
2566
2601
|
};
|
|
2567
2602
|
|
|
2568
2603
|
// packages/sdk/client-services/src/version.ts
|
|
2569
|
-
var DXOS_VERSION = "0.4.
|
|
2604
|
+
var DXOS_VERSION = "0.4.5-main.17763ce";
|
|
2570
2605
|
|
|
2571
2606
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2572
2607
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -4614,18 +4649,19 @@ import { trace as trace9 } from "@dxos/protocols";
|
|
|
4614
4649
|
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
4615
4650
|
import { TextModel } from "@dxos/text-model";
|
|
4616
4651
|
import { TRACE_PROCESSOR as TRACE_PROCESSOR2, trace as Trace3 } from "@dxos/tracing";
|
|
4652
|
+
import { assignDeep } from "@dxos/util";
|
|
4617
4653
|
import { WebsocketRpcClient } from "@dxos/websocket-rpc";
|
|
4618
4654
|
|
|
4619
4655
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
4620
4656
|
import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
|
|
4621
4657
|
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
4622
|
-
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
4658
|
+
import { DeviceKind as DeviceKind2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
4623
4659
|
var DevicesServiceImpl = class {
|
|
4624
4660
|
constructor(_identityManager) {
|
|
4625
4661
|
this._identityManager = _identityManager;
|
|
4626
4662
|
}
|
|
4627
4663
|
async updateDevice(profile) {
|
|
4628
|
-
|
|
4664
|
+
return this._identityManager.updateDeviceProfile(profile);
|
|
4629
4665
|
}
|
|
4630
4666
|
queryDevices() {
|
|
4631
4667
|
return new Stream11(({ next }) => {
|
|
@@ -4639,7 +4675,7 @@ var DevicesServiceImpl = class {
|
|
|
4639
4675
|
next({
|
|
4640
4676
|
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
4641
4677
|
deviceKey: key,
|
|
4642
|
-
kind: this._identityManager.identity?.deviceKey.equals(key) ?
|
|
4678
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind2.CURRENT : DeviceKind2.TRUSTED,
|
|
4643
4679
|
profile
|
|
4644
4680
|
}))
|
|
4645
4681
|
});
|
|
@@ -4882,18 +4918,6 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
4882
4918
|
var createDefaultModelFactory = () => {
|
|
4883
4919
|
return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
|
|
4884
4920
|
};
|
|
4885
|
-
var createGenesisMutationFromTypedObject = (obj) => {
|
|
4886
|
-
const snapshot = obj[base]._createSnapshot();
|
|
4887
|
-
return {
|
|
4888
|
-
objectId: obj[base]._id,
|
|
4889
|
-
genesis: {
|
|
4890
|
-
modelType: obj[base]._modelConstructor.meta.type
|
|
4891
|
-
},
|
|
4892
|
-
snapshot: {
|
|
4893
|
-
model: snapshot
|
|
4894
|
-
}
|
|
4895
|
-
};
|
|
4896
|
-
};
|
|
4897
4921
|
var ClientServicesHost = class {
|
|
4898
4922
|
constructor({
|
|
4899
4923
|
config,
|
|
@@ -4980,7 +5004,7 @@ var ClientServicesHost = class {
|
|
|
4980
5004
|
initialize({ config, ...options }) {
|
|
4981
5005
|
invariant14(!this._open, "service host is open", {
|
|
4982
5006
|
F: __dxlog_file17,
|
|
4983
|
-
L:
|
|
5007
|
+
L: 186,
|
|
4984
5008
|
S: this,
|
|
4985
5009
|
A: [
|
|
4986
5010
|
"!this._open",
|
|
@@ -4989,14 +5013,14 @@ var ClientServicesHost = class {
|
|
|
4989
5013
|
});
|
|
4990
5014
|
log16("initializing...", void 0, {
|
|
4991
5015
|
F: __dxlog_file17,
|
|
4992
|
-
L:
|
|
5016
|
+
L: 187,
|
|
4993
5017
|
S: this,
|
|
4994
5018
|
C: (f, a) => f(...a)
|
|
4995
5019
|
});
|
|
4996
5020
|
if (config) {
|
|
4997
5021
|
invariant14(!this._config, "config already set", {
|
|
4998
5022
|
F: __dxlog_file17,
|
|
4999
|
-
L:
|
|
5023
|
+
L: 190,
|
|
5000
5024
|
S: this,
|
|
5001
5025
|
A: [
|
|
5002
5026
|
"!this._config",
|
|
@@ -5014,7 +5038,7 @@ var ClientServicesHost = class {
|
|
|
5014
5038
|
this._signalManager = signalManager;
|
|
5015
5039
|
invariant14(!this._networkManager, "network manager already set", {
|
|
5016
5040
|
F: __dxlog_file17,
|
|
5017
|
-
L:
|
|
5041
|
+
L: 206,
|
|
5018
5042
|
S: this,
|
|
5019
5043
|
A: [
|
|
5020
5044
|
"!this._networkManager",
|
|
@@ -5028,7 +5052,7 @@ var ClientServicesHost = class {
|
|
|
5028
5052
|
});
|
|
5029
5053
|
log16("initialized", void 0, {
|
|
5030
5054
|
F: __dxlog_file17,
|
|
5031
|
-
L:
|
|
5055
|
+
L: 213,
|
|
5032
5056
|
S: this,
|
|
5033
5057
|
C: (f, a) => f(...a)
|
|
5034
5058
|
});
|
|
@@ -5042,13 +5066,13 @@ var ClientServicesHost = class {
|
|
|
5042
5066
|
id: traceId
|
|
5043
5067
|
}), {
|
|
5044
5068
|
F: __dxlog_file17,
|
|
5045
|
-
L:
|
|
5069
|
+
L: 224,
|
|
5046
5070
|
S: this,
|
|
5047
5071
|
C: (f, a) => f(...a)
|
|
5048
5072
|
});
|
|
5049
5073
|
invariant14(this._config, "config not set", {
|
|
5050
5074
|
F: __dxlog_file17,
|
|
5051
|
-
L:
|
|
5075
|
+
L: 226,
|
|
5052
5076
|
S: this,
|
|
5053
5077
|
A: [
|
|
5054
5078
|
"this._config",
|
|
@@ -5057,7 +5081,7 @@ var ClientServicesHost = class {
|
|
|
5057
5081
|
});
|
|
5058
5082
|
invariant14(this._storage, "storage not set", {
|
|
5059
5083
|
F: __dxlog_file17,
|
|
5060
|
-
L:
|
|
5084
|
+
L: 227,
|
|
5061
5085
|
S: this,
|
|
5062
5086
|
A: [
|
|
5063
5087
|
"this._storage",
|
|
@@ -5066,7 +5090,7 @@ var ClientServicesHost = class {
|
|
|
5066
5090
|
});
|
|
5067
5091
|
invariant14(this._signalManager, "signal manager not set", {
|
|
5068
5092
|
F: __dxlog_file17,
|
|
5069
|
-
L:
|
|
5093
|
+
L: 228,
|
|
5070
5094
|
S: this,
|
|
5071
5095
|
A: [
|
|
5072
5096
|
"this._signalManager",
|
|
@@ -5075,7 +5099,7 @@ var ClientServicesHost = class {
|
|
|
5075
5099
|
});
|
|
5076
5100
|
invariant14(this._networkManager, "network manager not set", {
|
|
5077
5101
|
F: __dxlog_file17,
|
|
5078
|
-
L:
|
|
5102
|
+
L: 229,
|
|
5079
5103
|
S: this,
|
|
5080
5104
|
A: [
|
|
5081
5105
|
"this._networkManager",
|
|
@@ -5087,7 +5111,7 @@ var ClientServicesHost = class {
|
|
|
5087
5111
|
lockKey: this._resourceLock?.lockKey
|
|
5088
5112
|
}, {
|
|
5089
5113
|
F: __dxlog_file17,
|
|
5090
|
-
L:
|
|
5114
|
+
L: 232,
|
|
5091
5115
|
S: this,
|
|
5092
5116
|
C: (f, a) => f(...a)
|
|
5093
5117
|
});
|
|
@@ -5096,7 +5120,7 @@ var ClientServicesHost = class {
|
|
|
5096
5120
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
5097
5121
|
this._serviceRegistry.setServices({
|
|
5098
5122
|
SystemService: this._systemService,
|
|
5099
|
-
IdentityService: new IdentityServiceImpl((params
|
|
5123
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
5100
5124
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
5101
5125
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
5102
5126
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -5133,7 +5157,7 @@ var ClientServicesHost = class {
|
|
|
5133
5157
|
deviceKey
|
|
5134
5158
|
}, {
|
|
5135
5159
|
F: __dxlog_file17,
|
|
5136
|
-
L:
|
|
5160
|
+
L: 305,
|
|
5137
5161
|
S: this,
|
|
5138
5162
|
C: (f, a) => f(...a)
|
|
5139
5163
|
});
|
|
@@ -5141,7 +5165,7 @@ var ClientServicesHost = class {
|
|
|
5141
5165
|
id: traceId
|
|
5142
5166
|
}), {
|
|
5143
5167
|
F: __dxlog_file17,
|
|
5144
|
-
L:
|
|
5168
|
+
L: 306,
|
|
5145
5169
|
S: this,
|
|
5146
5170
|
C: (f, a) => f(...a)
|
|
5147
5171
|
});
|
|
@@ -5155,7 +5179,7 @@ var ClientServicesHost = class {
|
|
|
5155
5179
|
deviceKey
|
|
5156
5180
|
}, {
|
|
5157
5181
|
F: __dxlog_file17,
|
|
5158
|
-
L:
|
|
5182
|
+
L: 317,
|
|
5159
5183
|
S: this,
|
|
5160
5184
|
C: (f, a) => f(...a)
|
|
5161
5185
|
});
|
|
@@ -5171,7 +5195,7 @@ var ClientServicesHost = class {
|
|
|
5171
5195
|
deviceKey
|
|
5172
5196
|
}, {
|
|
5173
5197
|
F: __dxlog_file17,
|
|
5174
|
-
L:
|
|
5198
|
+
L: 324,
|
|
5175
5199
|
S: this,
|
|
5176
5200
|
C: (f, a) => f(...a)
|
|
5177
5201
|
});
|
|
@@ -5182,13 +5206,13 @@ var ClientServicesHost = class {
|
|
|
5182
5206
|
id: traceId
|
|
5183
5207
|
}), {
|
|
5184
5208
|
F: __dxlog_file17,
|
|
5185
|
-
L:
|
|
5209
|
+
L: 329,
|
|
5186
5210
|
S: this,
|
|
5187
5211
|
C: (f, a) => f(...a)
|
|
5188
5212
|
});
|
|
5189
5213
|
log16("resetting...", void 0, {
|
|
5190
5214
|
F: __dxlog_file17,
|
|
5191
|
-
L:
|
|
5215
|
+
L: 331,
|
|
5192
5216
|
S: this,
|
|
5193
5217
|
C: (f, a) => f(...a)
|
|
5194
5218
|
});
|
|
@@ -5196,7 +5220,7 @@ var ClientServicesHost = class {
|
|
|
5196
5220
|
await this._storage.reset();
|
|
5197
5221
|
log16("reset", void 0, {
|
|
5198
5222
|
F: __dxlog_file17,
|
|
5199
|
-
L:
|
|
5223
|
+
L: 334,
|
|
5200
5224
|
S: this,
|
|
5201
5225
|
C: (f, a) => f(...a)
|
|
5202
5226
|
});
|
|
@@ -5204,50 +5228,36 @@ var ClientServicesHost = class {
|
|
|
5204
5228
|
id: traceId
|
|
5205
5229
|
}), {
|
|
5206
5230
|
F: __dxlog_file17,
|
|
5207
|
-
L:
|
|
5231
|
+
L: 335,
|
|
5208
5232
|
S: this,
|
|
5209
5233
|
C: (f, a) => f(...a)
|
|
5210
5234
|
});
|
|
5211
5235
|
await this._callbacks?.onReset?.();
|
|
5212
5236
|
}
|
|
5213
|
-
async _createIdentity(params
|
|
5237
|
+
async _createIdentity(params) {
|
|
5214
5238
|
const identity = await this._serviceContext.createIdentity(params);
|
|
5215
5239
|
await this._serviceContext.initialized.wait();
|
|
5216
5240
|
const space = await this._serviceContext.dataSpaceManager.createSpace();
|
|
5217
|
-
const obj = new Properties(void 0
|
|
5218
|
-
automerge: useAutomerge
|
|
5219
|
-
});
|
|
5241
|
+
const obj = new Properties(void 0);
|
|
5220
5242
|
obj[defaultKey] = identity.identityKey.toHex();
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
A: [
|
|
5240
|
-
"automergeIndex",
|
|
5241
|
-
""
|
|
5242
|
-
]
|
|
5243
|
-
});
|
|
5244
|
-
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5245
|
-
await document.whenReady();
|
|
5246
|
-
document.change((doc) => {
|
|
5247
|
-
doc.objects ??= {};
|
|
5248
|
-
doc.objects[obj[base]._id] = getRawDoc(obj).handle.docSync();
|
|
5249
|
-
});
|
|
5250
|
-
}
|
|
5243
|
+
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5244
|
+
invariant14(automergeIndex, void 0, {
|
|
5245
|
+
F: __dxlog_file17,
|
|
5246
|
+
L: 350,
|
|
5247
|
+
S: this,
|
|
5248
|
+
A: [
|
|
5249
|
+
"automergeIndex",
|
|
5250
|
+
""
|
|
5251
|
+
]
|
|
5252
|
+
});
|
|
5253
|
+
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
|
|
5254
|
+
await document.whenReady();
|
|
5255
|
+
document.change((doc) => {
|
|
5256
|
+
assignDeep(doc, [
|
|
5257
|
+
"objects",
|
|
5258
|
+
obj[base]._id
|
|
5259
|
+
], getRawDoc(obj).handle.docSync());
|
|
5260
|
+
});
|
|
5251
5261
|
return identity;
|
|
5252
5262
|
}
|
|
5253
5263
|
};
|
|
@@ -5303,4 +5313,4 @@ export {
|
|
|
5303
5313
|
createDefaultModelFactory,
|
|
5304
5314
|
ClientServicesHost
|
|
5305
5315
|
};
|
|
5306
|
-
//# sourceMappingURL=chunk-
|
|
5316
|
+
//# sourceMappingURL=chunk-4XBABVDC.mjs.map
|