@dxos/client-services 0.4.5-main.f8d6c4e → 0.4.5
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-24GIRJ7Q.mjs → chunk-HYSJ4DAC.mjs} +65 -33
- package/dist/lib/browser/chunk-HYSJ4DAC.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-FVRRSRLI.cjs → chunk-PGDBZISM.cjs} +167 -135
- package/dist/lib/node/chunk-PGDBZISM.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/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/services/service-host.ts +3 -3
- package/src/packlets/spaces/data-space-manager.ts +1 -1
- package/src/packlets/spaces/data-space.ts +2 -2
- package/src/version.ts +5 -1
- package/dist/lib/browser/chunk-24GIRJ7Q.mjs.map +0 -7
- package/dist/lib/node/chunk-FVRRSRLI.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
|
});
|
|
@@ -2565,7 +2601,7 @@ var getPlatform = () => {
|
|
|
2565
2601
|
};
|
|
2566
2602
|
|
|
2567
2603
|
// packages/sdk/client-services/src/version.ts
|
|
2568
|
-
var DXOS_VERSION = "0.4.5
|
|
2604
|
+
var DXOS_VERSION = "0.4.5";
|
|
2569
2605
|
|
|
2570
2606
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2571
2607
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -3324,11 +3360,9 @@ var DataSpace = class {
|
|
|
3324
3360
|
return;
|
|
3325
3361
|
}
|
|
3326
3362
|
const doc = handle.docSync() ?? failedInvariant();
|
|
3327
|
-
if (!doc.
|
|
3363
|
+
if (!doc.experimental_spaceKey) {
|
|
3328
3364
|
handle.change((doc2) => {
|
|
3329
|
-
doc2.
|
|
3330
|
-
spaceKey: this.key.toHex()
|
|
3331
|
-
};
|
|
3365
|
+
doc2.experimental_spaceKey = this.key.toHex();
|
|
3332
3366
|
});
|
|
3333
3367
|
}
|
|
3334
3368
|
} catch (err) {
|
|
@@ -3707,9 +3741,7 @@ var DataSpaceManager = class {
|
|
|
3707
3741
|
});
|
|
3708
3742
|
const automergeRoot = this._automergeHost.repo.create();
|
|
3709
3743
|
automergeRoot.change((doc) => {
|
|
3710
|
-
doc.
|
|
3711
|
-
spaceKey: spaceKey.toHex()
|
|
3712
|
-
};
|
|
3744
|
+
doc.experimental_spaceKey = spaceKey.toHex();
|
|
3713
3745
|
});
|
|
3714
3746
|
const space = await this._constructSpace(metadata);
|
|
3715
3747
|
const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRoot.url);
|
|
@@ -4623,13 +4655,13 @@ import { WebsocketRpcClient } from "@dxos/websocket-rpc";
|
|
|
4623
4655
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
4624
4656
|
import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
|
|
4625
4657
|
import { Stream as Stream11 } from "@dxos/codec-protobuf";
|
|
4626
|
-
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
4658
|
+
import { DeviceKind as DeviceKind2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
4627
4659
|
var DevicesServiceImpl = class {
|
|
4628
4660
|
constructor(_identityManager) {
|
|
4629
4661
|
this._identityManager = _identityManager;
|
|
4630
4662
|
}
|
|
4631
4663
|
async updateDevice(profile) {
|
|
4632
|
-
|
|
4664
|
+
return this._identityManager.updateDeviceProfile(profile);
|
|
4633
4665
|
}
|
|
4634
4666
|
queryDevices() {
|
|
4635
4667
|
return new Stream11(({ next }) => {
|
|
@@ -4643,7 +4675,7 @@ var DevicesServiceImpl = class {
|
|
|
4643
4675
|
next({
|
|
4644
4676
|
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
4645
4677
|
deviceKey: key,
|
|
4646
|
-
kind: this._identityManager.identity?.deviceKey.equals(key) ?
|
|
4678
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind2.CURRENT : DeviceKind2.TRUSTED,
|
|
4647
4679
|
profile
|
|
4648
4680
|
}))
|
|
4649
4681
|
});
|
|
@@ -5281,4 +5313,4 @@ export {
|
|
|
5281
5313
|
createDefaultModelFactory,
|
|
5282
5314
|
ClientServicesHost
|
|
5283
5315
|
};
|
|
5284
|
-
//# sourceMappingURL=chunk-
|
|
5316
|
+
//# sourceMappingURL=chunk-HYSJ4DAC.mjs.map
|