@dxos/client-services 0.4.5-main.ec866f5 → 0.4.5-main.f10c180

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.
@@ -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: 75,
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: 78,
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: 83,
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: 89,
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: 97,
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: 98,
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: 117,
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: 118,
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: 163,
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: 169,
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: 177,
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: 178,
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: 197,
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: 203,
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: 211,
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: 228,
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: 229,
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: 232,
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: 236,
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: 260,
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: 279,
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-main.ec866f5";
2604
+ var DXOS_VERSION = "0.4.5-main.f10c180";
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";
@@ -4619,13 +4655,13 @@ import { WebsocketRpcClient } from "@dxos/websocket-rpc";
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
- throw new Error("Method not implemented.");
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) ? DeviceKind.CURRENT : DeviceKind.TRUSTED,
4678
+ kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind2.CURRENT : DeviceKind2.TRUSTED,
4643
4679
  profile
4644
4680
  }))
4645
4681
  });
@@ -5277,4 +5313,4 @@ export {
5277
5313
  createDefaultModelFactory,
5278
5314
  ClientServicesHost
5279
5315
  };
5280
- //# sourceMappingURL=chunk-BWQLRXYM.mjs.map
5316
+ //# sourceMappingURL=chunk-5W4FJWOL.mjs.map