@dxos/client-services 0.1.55 → 0.1.56-main.09ca29d
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-XSZIBW37.mjs → chunk-FD4L7N4K.mjs} +677 -293
- package/dist/lib/browser/chunk-FD4L7N4K.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +50 -33
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +12 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +729 -330
- 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 +691 -300
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.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/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/packlets/identity/authenticator.test.ts +2 -2
- package/src/packlets/identity/identity-manager.ts +1 -2
- package/src/packlets/identity/identity-service.ts +1 -2
- package/src/packlets/identity/identity.ts +1 -2
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -2
- package/src/packlets/invitations/invitation-extension.ts +1 -2
- package/src/packlets/invitations/invitations-handler.ts +1 -2
- package/src/packlets/invitations/invitations-service.ts +1 -2
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -2
- package/src/packlets/locks/node.ts +1 -1
- package/src/packlets/services/service-context.ts +1 -2
- package/src/packlets/services/service-host.ts +1 -2
- package/src/packlets/spaces/data-space-manager.ts +2 -3
- package/src/packlets/spaces/notarization-plugin.ts +1 -2
- package/src/packlets/spaces/spaces-service.ts +18 -12
- package/src/packlets/testing/invitation-utils.ts +1 -2
- package/src/packlets/vault/shell-runtime.ts +1 -2
- package/src/packlets/vault/worker-session.ts +1 -2
- package/dist/lib/browser/chunk-XSZIBW37.mjs.map +0 -7
|
@@ -352,7 +352,7 @@ import { Context as Context2 } from "@dxos/context";
|
|
|
352
352
|
import { verifyCredential } from "@dxos/credentials";
|
|
353
353
|
import { log } from "@dxos/log";
|
|
354
354
|
import { schema } from "@dxos/protocols";
|
|
355
|
-
var __dxlog_file = "/
|
|
355
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
|
|
356
356
|
var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
357
357
|
var createAuthProvider = (signer) => async (nonce) => {
|
|
358
358
|
const credential = await signer.createCredential({
|
|
@@ -463,15 +463,15 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
463
463
|
};
|
|
464
464
|
|
|
465
465
|
// packages/sdk/client-services/src/packlets/identity/identity.ts
|
|
466
|
-
import invariant from "tiny-invariant";
|
|
467
466
|
import { Event } from "@dxos/async";
|
|
468
467
|
import { AUTH_TIMEOUT, LOAD_CONTROL_FEEDS_TIMEOUT } from "@dxos/client-protocol";
|
|
469
468
|
import { DeviceStateMachine, createCredentialSignerWithKey, createCredentialSignerWithChain, ProfileStateMachine } from "@dxos/credentials";
|
|
470
469
|
import { failUndefined } from "@dxos/debug";
|
|
471
470
|
import { writeMessages } from "@dxos/feed-store";
|
|
471
|
+
import { invariant } from "@dxos/invariant";
|
|
472
472
|
import { log as log2 } from "@dxos/log";
|
|
473
473
|
import { AdmittedFeed } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
474
|
-
var __dxlog_file2 = "/
|
|
474
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
475
475
|
var Identity = class {
|
|
476
476
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
477
477
|
this.stateUpdate = new Event();
|
|
@@ -546,7 +546,15 @@ var Identity = class {
|
|
|
546
546
|
* Requires identity to be ready.
|
|
547
547
|
*/
|
|
548
548
|
getIdentityCredentialSigner() {
|
|
549
|
-
invariant(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready."
|
|
549
|
+
invariant(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
550
|
+
F: __dxlog_file2,
|
|
551
|
+
L: 134,
|
|
552
|
+
S: this,
|
|
553
|
+
A: [
|
|
554
|
+
"this._deviceStateMachine.deviceCredentialChain",
|
|
555
|
+
"'Device credential chain is not ready.'"
|
|
556
|
+
]
|
|
557
|
+
});
|
|
550
558
|
return createCredentialSignerWithChain(this._signer, this._deviceStateMachine.deviceCredentialChain, this.deviceKey);
|
|
551
559
|
}
|
|
552
560
|
/**
|
|
@@ -564,7 +572,7 @@ var Identity = class {
|
|
|
564
572
|
dataFeedKey
|
|
565
573
|
}, {
|
|
566
574
|
F: __dxlog_file2,
|
|
567
|
-
L:
|
|
575
|
+
L: 150,
|
|
568
576
|
S: this,
|
|
569
577
|
C: (f, a) => f(...a)
|
|
570
578
|
});
|
|
@@ -607,15 +615,15 @@ var Identity = class {
|
|
|
607
615
|
};
|
|
608
616
|
|
|
609
617
|
// packages/sdk/client-services/src/packlets/identity/identity-manager.ts
|
|
610
|
-
import invariant2 from "tiny-invariant";
|
|
611
618
|
import { Event as Event2 } from "@dxos/async";
|
|
612
619
|
import { createCredentialSignerWithKey as createCredentialSignerWithKey2, CredentialGenerator } from "@dxos/credentials";
|
|
620
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
613
621
|
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
614
622
|
import { log as log3 } from "@dxos/log";
|
|
615
623
|
import { trace } from "@dxos/protocols";
|
|
616
624
|
import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
617
625
|
import { deferFunction } from "@dxos/util";
|
|
618
|
-
var __dxlog_file3 = "/
|
|
626
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
619
627
|
var IdentityManager = class {
|
|
620
628
|
// TODO(burdon): IdentityManagerParams.
|
|
621
629
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -636,7 +644,7 @@ var IdentityManager = class {
|
|
|
636
644
|
id: traceId
|
|
637
645
|
}), {
|
|
638
646
|
F: __dxlog_file3,
|
|
639
|
-
L:
|
|
647
|
+
L: 69,
|
|
640
648
|
S: this,
|
|
641
649
|
C: (f, a) => f(...a)
|
|
642
650
|
});
|
|
@@ -646,7 +654,7 @@ var IdentityManager = class {
|
|
|
646
654
|
identityRecord
|
|
647
655
|
}, {
|
|
648
656
|
F: __dxlog_file3,
|
|
649
|
-
L:
|
|
657
|
+
L: 73,
|
|
650
658
|
S: this,
|
|
651
659
|
C: (f, a) => f(...a)
|
|
652
660
|
});
|
|
@@ -659,7 +667,7 @@ var IdentityManager = class {
|
|
|
659
667
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
660
668
|
}, {
|
|
661
669
|
F: __dxlog_file3,
|
|
662
|
-
L:
|
|
670
|
+
L: 78,
|
|
663
671
|
S: this,
|
|
664
672
|
C: (f, a) => f(...a)
|
|
665
673
|
});
|
|
@@ -669,7 +677,7 @@ var IdentityManager = class {
|
|
|
669
677
|
id: traceId
|
|
670
678
|
}), {
|
|
671
679
|
F: __dxlog_file3,
|
|
672
|
-
L:
|
|
680
|
+
L: 84,
|
|
673
681
|
S: this,
|
|
674
682
|
C: (f, a) => f(...a)
|
|
675
683
|
});
|
|
@@ -680,10 +688,18 @@ var IdentityManager = class {
|
|
|
680
688
|
}
|
|
681
689
|
async createIdentity({ displayName } = {}) {
|
|
682
690
|
var _a;
|
|
683
|
-
invariant2(!this._identity, "Identity already exists."
|
|
691
|
+
invariant2(!this._identity, "Identity already exists.", {
|
|
692
|
+
F: __dxlog_file3,
|
|
693
|
+
L: 92,
|
|
694
|
+
S: this,
|
|
695
|
+
A: [
|
|
696
|
+
"!this._identity",
|
|
697
|
+
"'Identity already exists.'"
|
|
698
|
+
]
|
|
699
|
+
});
|
|
684
700
|
log3("creating identity...", void 0, {
|
|
685
701
|
F: __dxlog_file3,
|
|
686
|
-
L:
|
|
702
|
+
L: 93,
|
|
687
703
|
S: this,
|
|
688
704
|
C: (f, a) => f(...a)
|
|
689
705
|
});
|
|
@@ -702,8 +718,24 @@ var IdentityManager = class {
|
|
|
702
718
|
await identity.open();
|
|
703
719
|
{
|
|
704
720
|
const generator = new CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
705
|
-
invariant2(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required."
|
|
706
|
-
|
|
721
|
+
invariant2(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
722
|
+
F: __dxlog_file3,
|
|
723
|
+
L: 112,
|
|
724
|
+
S: this,
|
|
725
|
+
A: [
|
|
726
|
+
"identityRecord.haloSpace.genesisFeedKey",
|
|
727
|
+
"'Genesis feed key is required.'"
|
|
728
|
+
]
|
|
729
|
+
});
|
|
730
|
+
invariant2(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
731
|
+
F: __dxlog_file3,
|
|
732
|
+
L: 113,
|
|
733
|
+
S: this,
|
|
734
|
+
A: [
|
|
735
|
+
"identityRecord.haloSpace.dataFeedKey",
|
|
736
|
+
"'Data feed key is required.'"
|
|
737
|
+
]
|
|
738
|
+
});
|
|
707
739
|
const credentials = [
|
|
708
740
|
// Space genesis.
|
|
709
741
|
...await generator.createSpaceGenesis(identityRecord.haloSpace.key, identityRecord.haloSpace.genesisFeedKey),
|
|
@@ -732,7 +764,7 @@ var IdentityManager = class {
|
|
|
732
764
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
733
765
|
}, {
|
|
734
766
|
F: __dxlog_file3,
|
|
735
|
-
L:
|
|
767
|
+
L: 148,
|
|
736
768
|
S: this,
|
|
737
769
|
C: (f, a) => f(...a)
|
|
738
770
|
});
|
|
@@ -742,7 +774,7 @@ var IdentityManager = class {
|
|
|
742
774
|
deviceKey: identity.deviceKey
|
|
743
775
|
}, {
|
|
744
776
|
F: __dxlog_file3,
|
|
745
|
-
L:
|
|
777
|
+
L: 154,
|
|
746
778
|
S: this,
|
|
747
779
|
C: (f, a) => f(...a)
|
|
748
780
|
});
|
|
@@ -757,11 +789,19 @@ var IdentityManager = class {
|
|
|
757
789
|
params
|
|
758
790
|
}, {
|
|
759
791
|
F: __dxlog_file3,
|
|
760
|
-
L:
|
|
792
|
+
L: 162,
|
|
761
793
|
S: this,
|
|
762
794
|
C: (f, a) => f(...a)
|
|
763
795
|
});
|
|
764
|
-
invariant2(!this._identity, "Identity already exists."
|
|
796
|
+
invariant2(!this._identity, "Identity already exists.", {
|
|
797
|
+
F: __dxlog_file3,
|
|
798
|
+
L: 163,
|
|
799
|
+
S: this,
|
|
800
|
+
A: [
|
|
801
|
+
"!this._identity",
|
|
802
|
+
"'Identity already exists.'"
|
|
803
|
+
]
|
|
804
|
+
});
|
|
765
805
|
const identityRecord = {
|
|
766
806
|
identityKey: params.identityKey,
|
|
767
807
|
deviceKey: params.deviceKey,
|
|
@@ -783,7 +823,7 @@ var IdentityManager = class {
|
|
|
783
823
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
784
824
|
}, {
|
|
785
825
|
F: __dxlog_file3,
|
|
786
|
-
L:
|
|
826
|
+
L: 182,
|
|
787
827
|
S: this,
|
|
788
828
|
C: (f, a) => f(...a)
|
|
789
829
|
});
|
|
@@ -793,27 +833,51 @@ var IdentityManager = class {
|
|
|
793
833
|
deviceKey: identity.deviceKey
|
|
794
834
|
}, {
|
|
795
835
|
F: __dxlog_file3,
|
|
796
|
-
L:
|
|
836
|
+
L: 188,
|
|
797
837
|
S: this,
|
|
798
838
|
C: (f, a) => f(...a)
|
|
799
839
|
});
|
|
800
840
|
return identity;
|
|
801
841
|
}
|
|
802
842
|
async _constructIdentity(identityRecord) {
|
|
803
|
-
invariant2(!this._identity
|
|
843
|
+
invariant2(!this._identity, void 0, {
|
|
844
|
+
F: __dxlog_file3,
|
|
845
|
+
L: 193,
|
|
846
|
+
S: this,
|
|
847
|
+
A: [
|
|
848
|
+
"!this._identity",
|
|
849
|
+
""
|
|
850
|
+
]
|
|
851
|
+
});
|
|
804
852
|
log3("constructing identity", {
|
|
805
853
|
identityRecord
|
|
806
854
|
}, {
|
|
807
855
|
F: __dxlog_file3,
|
|
808
|
-
L:
|
|
856
|
+
L: 194,
|
|
809
857
|
S: this,
|
|
810
858
|
C: (f, a) => f(...a)
|
|
811
859
|
});
|
|
812
|
-
invariant2(identityRecord.haloSpace.controlFeedKey
|
|
860
|
+
invariant2(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
861
|
+
F: __dxlog_file3,
|
|
862
|
+
L: 197,
|
|
863
|
+
S: this,
|
|
864
|
+
A: [
|
|
865
|
+
"identityRecord.haloSpace.controlFeedKey",
|
|
866
|
+
""
|
|
867
|
+
]
|
|
868
|
+
});
|
|
813
869
|
const controlFeed = await this._feedStore.openFeed(identityRecord.haloSpace.controlFeedKey, {
|
|
814
870
|
writable: true
|
|
815
871
|
});
|
|
816
|
-
invariant2(identityRecord.haloSpace.dataFeedKey
|
|
872
|
+
invariant2(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
873
|
+
F: __dxlog_file3,
|
|
874
|
+
L: 201,
|
|
875
|
+
S: this,
|
|
876
|
+
A: [
|
|
877
|
+
"identityRecord.haloSpace.dataFeedKey",
|
|
878
|
+
""
|
|
879
|
+
]
|
|
880
|
+
});
|
|
817
881
|
const dataFeed = await this._feedStore.openFeed(identityRecord.haloSpace.dataFeedKey, {
|
|
818
882
|
writable: true,
|
|
819
883
|
sparse: true
|
|
@@ -839,7 +903,7 @@ var IdentityManager = class {
|
|
|
839
903
|
identityKey: identityRecord.identityKey
|
|
840
904
|
}, {
|
|
841
905
|
F: __dxlog_file3,
|
|
842
|
-
L:
|
|
906
|
+
L: 225,
|
|
843
907
|
S: this,
|
|
844
908
|
C: (f, a) => f(...a)
|
|
845
909
|
});
|
|
@@ -860,7 +924,7 @@ var IdentityManager = class {
|
|
|
860
924
|
onAuthFailure: () => {
|
|
861
925
|
log3.warn("auth failure", void 0, {
|
|
862
926
|
F: __dxlog_file3,
|
|
863
|
-
L:
|
|
927
|
+
L: 244,
|
|
864
928
|
S: this,
|
|
865
929
|
C: (f, a) => f(...a)
|
|
866
930
|
});
|
|
@@ -871,10 +935,11 @@ var IdentityManager = class {
|
|
|
871
935
|
};
|
|
872
936
|
|
|
873
937
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
874
|
-
import invariant3 from "tiny-invariant";
|
|
875
938
|
import { Stream as Stream7 } from "@dxos/codec-protobuf";
|
|
876
939
|
import { signPresentation } from "@dxos/credentials";
|
|
877
940
|
import { todo } from "@dxos/debug";
|
|
941
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
942
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
878
943
|
var IdentityServiceImpl = class {
|
|
879
944
|
// TODO(wittjosiah): Remove dependency on service context.
|
|
880
945
|
constructor(_serviceContext) {
|
|
@@ -907,7 +972,15 @@ var IdentityServiceImpl = class {
|
|
|
907
972
|
};
|
|
908
973
|
}
|
|
909
974
|
async signPresentation({ presentation, nonce }) {
|
|
910
|
-
invariant3(this._serviceContext.identityManager.identity, "Identity not initialized."
|
|
975
|
+
invariant3(this._serviceContext.identityManager.identity, "Identity not initialized.", {
|
|
976
|
+
F: __dxlog_file4,
|
|
977
|
+
L: 56,
|
|
978
|
+
S: this,
|
|
979
|
+
A: [
|
|
980
|
+
"this._serviceContext.identityManager.identity",
|
|
981
|
+
"'Identity not initialized.'"
|
|
982
|
+
]
|
|
983
|
+
});
|
|
911
984
|
return await signPresentation({
|
|
912
985
|
presentation,
|
|
913
986
|
signer: this._serviceContext.keyring,
|
|
@@ -919,8 +992,9 @@ var IdentityServiceImpl = class {
|
|
|
919
992
|
};
|
|
920
993
|
|
|
921
994
|
// packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
|
|
922
|
-
import invariant4 from "
|
|
995
|
+
import { invariant as invariant4 } from "@dxos/invariant";
|
|
923
996
|
import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
|
|
997
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
|
|
924
998
|
var DeviceInvitationProtocol = class {
|
|
925
999
|
constructor(_keyring, _getIdentity, _acceptIdentity) {
|
|
926
1000
|
this._keyring = _keyring;
|
|
@@ -936,7 +1010,15 @@ var DeviceInvitationProtocol = class {
|
|
|
936
1010
|
};
|
|
937
1011
|
}
|
|
938
1012
|
async admit(request) {
|
|
939
|
-
invariant4(request.device
|
|
1013
|
+
invariant4(request.device, void 0, {
|
|
1014
|
+
F: __dxlog_file5,
|
|
1015
|
+
L: 31,
|
|
1016
|
+
S: this,
|
|
1017
|
+
A: [
|
|
1018
|
+
"request.device",
|
|
1019
|
+
""
|
|
1020
|
+
]
|
|
1021
|
+
});
|
|
940
1022
|
const identity = this._getIdentity();
|
|
941
1023
|
await identity.admitDevice(request.device);
|
|
942
1024
|
return {
|
|
@@ -964,9 +1046,25 @@ var DeviceInvitationProtocol = class {
|
|
|
964
1046
|
};
|
|
965
1047
|
}
|
|
966
1048
|
async accept(response, request) {
|
|
967
|
-
invariant4(response.device
|
|
1049
|
+
invariant4(response.device, void 0, {
|
|
1050
|
+
F: __dxlog_file5,
|
|
1051
|
+
L: 64,
|
|
1052
|
+
S: this,
|
|
1053
|
+
A: [
|
|
1054
|
+
"response.device",
|
|
1055
|
+
""
|
|
1056
|
+
]
|
|
1057
|
+
});
|
|
968
1058
|
const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
|
|
969
|
-
invariant4(request.device
|
|
1059
|
+
invariant4(request.device, void 0, {
|
|
1060
|
+
F: __dxlog_file5,
|
|
1061
|
+
L: 67,
|
|
1062
|
+
S: this,
|
|
1063
|
+
A: [
|
|
1064
|
+
"request.device",
|
|
1065
|
+
""
|
|
1066
|
+
]
|
|
1067
|
+
});
|
|
970
1068
|
const { deviceKey, controlFeedKey, dataFeedKey } = request.device;
|
|
971
1069
|
await this._acceptIdentity({
|
|
972
1070
|
identityKey,
|
|
@@ -984,12 +1082,12 @@ var DeviceInvitationProtocol = class {
|
|
|
984
1082
|
};
|
|
985
1083
|
|
|
986
1084
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
987
|
-
import invariant6 from "tiny-invariant";
|
|
988
1085
|
import { PushStream, scheduleTask as scheduleTask2, TimeoutError, Trigger as Trigger3 } from "@dxos/async";
|
|
989
1086
|
import { AuthenticatingInvitationObservable, AUTHENTICATION_CODE_LENGTH, CancellableInvitationObservable, INVITATION_TIMEOUT } from "@dxos/client-protocol";
|
|
990
1087
|
import { Context as Context4 } from "@dxos/context";
|
|
991
1088
|
import { generatePasscode } from "@dxos/credentials";
|
|
992
1089
|
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2 } from "@dxos/errors";
|
|
1090
|
+
import { invariant as invariant6 } from "@dxos/invariant";
|
|
993
1091
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
994
1092
|
import { log as log5 } from "@dxos/log";
|
|
995
1093
|
import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
|
|
@@ -998,17 +1096,17 @@ import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/ser
|
|
|
998
1096
|
import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
999
1097
|
|
|
1000
1098
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1001
|
-
import invariant5 from "tiny-invariant";
|
|
1002
1099
|
import { Trigger as Trigger2 } from "@dxos/async";
|
|
1003
1100
|
import { cancelWithContext, Context as Context3 } from "@dxos/context";
|
|
1004
1101
|
import { InvalidInvitationExtensionRoleError } from "@dxos/errors";
|
|
1102
|
+
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1005
1103
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1006
1104
|
import { log as log4 } from "@dxos/log";
|
|
1007
1105
|
import { schema as schema2, trace as trace2 } from "@dxos/protocols";
|
|
1008
1106
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1009
1107
|
import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1010
1108
|
import { RpcExtension } from "@dxos/teleport";
|
|
1011
|
-
var
|
|
1109
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
|
|
1012
1110
|
var OPTIONS_TIMEOUT = 1e4;
|
|
1013
1111
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1014
1112
|
var InvitationHostExtension = class extends RpcExtension {
|
|
@@ -1036,7 +1134,15 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1036
1134
|
// Perhaps in the future we will have more complex logic here.
|
|
1037
1135
|
InvitationHostService: {
|
|
1038
1136
|
options: async (options) => {
|
|
1039
|
-
invariant5(!this._remoteOptions, "Remote options already set."
|
|
1137
|
+
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1138
|
+
F: __dxlog_file6,
|
|
1139
|
+
L: 88,
|
|
1140
|
+
S: this,
|
|
1141
|
+
A: [
|
|
1142
|
+
"!this._remoteOptions",
|
|
1143
|
+
"'Remote options already set.'"
|
|
1144
|
+
]
|
|
1145
|
+
});
|
|
1040
1146
|
this._remoteOptions = options;
|
|
1041
1147
|
this._remoteOptionsTrigger.wake();
|
|
1042
1148
|
},
|
|
@@ -1046,8 +1152,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1046
1152
|
log4.trace("dxos.sdk.invitation-handler.host.introduce", trace2.begin({
|
|
1047
1153
|
id: traceId
|
|
1048
1154
|
}), {
|
|
1049
|
-
F:
|
|
1050
|
-
L:
|
|
1155
|
+
F: __dxlog_file6,
|
|
1156
|
+
L: 97,
|
|
1051
1157
|
S: this,
|
|
1052
1158
|
C: (f, a) => f(...a)
|
|
1053
1159
|
});
|
|
@@ -1056,8 +1162,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1056
1162
|
log4.warn("invitation not found", {
|
|
1057
1163
|
invitationId
|
|
1058
1164
|
}, {
|
|
1059
|
-
F:
|
|
1060
|
-
L:
|
|
1165
|
+
F: __dxlog_file6,
|
|
1166
|
+
L: 101,
|
|
1061
1167
|
S: this,
|
|
1062
1168
|
C: (f, a) => f(...a)
|
|
1063
1169
|
});
|
|
@@ -1070,8 +1176,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1070
1176
|
log4("guest introduced itself", {
|
|
1071
1177
|
guestProfile: profile
|
|
1072
1178
|
}, {
|
|
1073
|
-
F:
|
|
1074
|
-
L:
|
|
1179
|
+
F: __dxlog_file6,
|
|
1180
|
+
L: 110,
|
|
1075
1181
|
S: this,
|
|
1076
1182
|
C: (f, a) => f(...a)
|
|
1077
1183
|
});
|
|
@@ -1083,8 +1189,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1083
1189
|
log4.trace("dxos.sdk.invitation-handler.host.introduce", trace2.end({
|
|
1084
1190
|
id: traceId
|
|
1085
1191
|
}), {
|
|
1086
|
-
F:
|
|
1087
|
-
L:
|
|
1192
|
+
F: __dxlog_file6,
|
|
1193
|
+
L: 117,
|
|
1088
1194
|
S: this,
|
|
1089
1195
|
C: (f, a) => f(...a)
|
|
1090
1196
|
});
|
|
@@ -1098,26 +1204,34 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1098
1204
|
log4.trace("dxos.sdk.invitation-handler.host.authenticate", trace2.begin({
|
|
1099
1205
|
id: traceId
|
|
1100
1206
|
}), {
|
|
1101
|
-
F:
|
|
1102
|
-
L:
|
|
1207
|
+
F: __dxlog_file6,
|
|
1208
|
+
L: 126,
|
|
1103
1209
|
S: this,
|
|
1104
1210
|
C: (f, a) => f(...a)
|
|
1105
1211
|
});
|
|
1106
1212
|
log4("received authentication request", {
|
|
1107
1213
|
authCode: code
|
|
1108
1214
|
}, {
|
|
1109
|
-
F:
|
|
1110
|
-
L:
|
|
1215
|
+
F: __dxlog_file6,
|
|
1216
|
+
L: 127,
|
|
1111
1217
|
S: this,
|
|
1112
1218
|
C: (f, a) => f(...a)
|
|
1113
1219
|
});
|
|
1114
1220
|
let status = AuthenticationResponse.Status.OK;
|
|
1115
|
-
invariant5(this.invitation, "Invitation is not set."
|
|
1221
|
+
invariant5(this.invitation, "Invitation is not set.", {
|
|
1222
|
+
F: __dxlog_file6,
|
|
1223
|
+
L: 130,
|
|
1224
|
+
S: this,
|
|
1225
|
+
A: [
|
|
1226
|
+
"this.invitation",
|
|
1227
|
+
"'Invitation is not set.'"
|
|
1228
|
+
]
|
|
1229
|
+
});
|
|
1116
1230
|
switch (this.invitation.authMethod) {
|
|
1117
1231
|
case Invitation2.AuthMethod.NONE: {
|
|
1118
1232
|
log4("authentication not required", void 0, {
|
|
1119
|
-
F:
|
|
1120
|
-
L:
|
|
1233
|
+
F: __dxlog_file6,
|
|
1234
|
+
L: 133,
|
|
1121
1235
|
S: this,
|
|
1122
1236
|
C: (f, a) => f(...a)
|
|
1123
1237
|
});
|
|
@@ -1141,8 +1255,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1141
1255
|
log4.error("invalid authentication method", {
|
|
1142
1256
|
authMethod: this.invitation.authMethod
|
|
1143
1257
|
}, {
|
|
1144
|
-
F:
|
|
1145
|
-
L:
|
|
1258
|
+
F: __dxlog_file6,
|
|
1259
|
+
L: 151,
|
|
1146
1260
|
S: this,
|
|
1147
1261
|
C: (f, a) => f(...a)
|
|
1148
1262
|
});
|
|
@@ -1156,8 +1270,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1156
1270
|
status
|
|
1157
1271
|
}
|
|
1158
1272
|
}), {
|
|
1159
|
-
F:
|
|
1160
|
-
L:
|
|
1273
|
+
F: __dxlog_file6,
|
|
1274
|
+
L: 157,
|
|
1161
1275
|
S: this,
|
|
1162
1276
|
C: (f, a) => f(...a)
|
|
1163
1277
|
});
|
|
@@ -1170,13 +1284,21 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1170
1284
|
log4.trace("dxos.sdk.invitation-handler.host.admit", trace2.begin({
|
|
1171
1285
|
id: traceId
|
|
1172
1286
|
}), {
|
|
1173
|
-
F:
|
|
1174
|
-
L:
|
|
1287
|
+
F: __dxlog_file6,
|
|
1288
|
+
L: 163,
|
|
1175
1289
|
S: this,
|
|
1176
1290
|
C: (f, a) => f(...a)
|
|
1177
1291
|
});
|
|
1178
1292
|
try {
|
|
1179
|
-
invariant5(this.invitation, "Invitation is not set."
|
|
1293
|
+
invariant5(this.invitation, "Invitation is not set.", {
|
|
1294
|
+
F: __dxlog_file6,
|
|
1295
|
+
L: 166,
|
|
1296
|
+
S: this,
|
|
1297
|
+
A: [
|
|
1298
|
+
"this.invitation",
|
|
1299
|
+
"'Invitation is not set.'"
|
|
1300
|
+
]
|
|
1301
|
+
});
|
|
1180
1302
|
if (isAuthenticationRequired(this.invitation) && !this.authenticationPassed) {
|
|
1181
1303
|
throw new Error("Not authenticated");
|
|
1182
1304
|
}
|
|
@@ -1184,8 +1306,8 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1184
1306
|
log4.trace("dxos.sdk.invitation-handler.host.admit", trace2.end({
|
|
1185
1307
|
id: traceId
|
|
1186
1308
|
}), {
|
|
1187
|
-
F:
|
|
1188
|
-
L:
|
|
1309
|
+
F: __dxlog_file6,
|
|
1310
|
+
L: 174,
|
|
1189
1311
|
S: this,
|
|
1190
1312
|
C: (f, a) => f(...a)
|
|
1191
1313
|
});
|
|
@@ -1241,7 +1363,15 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1241
1363
|
return {
|
|
1242
1364
|
InvitationHostService: {
|
|
1243
1365
|
options: async (options) => {
|
|
1244
|
-
invariant5(!this._remoteOptions, "Remote options already set."
|
|
1366
|
+
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1367
|
+
F: __dxlog_file6,
|
|
1368
|
+
L: 241,
|
|
1369
|
+
S: this,
|
|
1370
|
+
A: [
|
|
1371
|
+
"!this._remoteOptions",
|
|
1372
|
+
"'Remote options already set.'"
|
|
1373
|
+
]
|
|
1374
|
+
});
|
|
1245
1375
|
this._remoteOptions = options;
|
|
1246
1376
|
this._remoteOptionsTrigger.wake();
|
|
1247
1377
|
},
|
|
@@ -1262,8 +1392,8 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1262
1392
|
await super.onOpen(context);
|
|
1263
1393
|
try {
|
|
1264
1394
|
log4("begin options", void 0, {
|
|
1265
|
-
F:
|
|
1266
|
-
L:
|
|
1395
|
+
F: __dxlog_file6,
|
|
1396
|
+
L: 262,
|
|
1267
1397
|
S: this,
|
|
1268
1398
|
C: (f, a) => f(...a)
|
|
1269
1399
|
});
|
|
@@ -1274,8 +1404,8 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1274
1404
|
timeout: OPTIONS_TIMEOUT
|
|
1275
1405
|
}));
|
|
1276
1406
|
log4("end options", void 0, {
|
|
1277
|
-
F:
|
|
1278
|
-
L:
|
|
1407
|
+
F: __dxlog_file6,
|
|
1408
|
+
L: 265,
|
|
1279
1409
|
S: this,
|
|
1280
1410
|
C: (f, a) => f(...a)
|
|
1281
1411
|
});
|
|
@@ -1288,8 +1418,8 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1288
1418
|
this._callbacks.onOpen(this._ctx);
|
|
1289
1419
|
} catch (err) {
|
|
1290
1420
|
log4("openError", err, {
|
|
1291
|
-
F:
|
|
1292
|
-
L:
|
|
1421
|
+
F: __dxlog_file6,
|
|
1422
|
+
L: 275,
|
|
1293
1423
|
S: this,
|
|
1294
1424
|
C: (f, a) => f(...a)
|
|
1295
1425
|
});
|
|
@@ -1298,8 +1428,8 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1298
1428
|
}
|
|
1299
1429
|
async onClose() {
|
|
1300
1430
|
log4("onClose", void 0, {
|
|
1301
|
-
F:
|
|
1302
|
-
L:
|
|
1431
|
+
F: __dxlog_file6,
|
|
1432
|
+
L: 281,
|
|
1303
1433
|
S: this,
|
|
1304
1434
|
C: (f, a) => f(...a)
|
|
1305
1435
|
});
|
|
@@ -1309,7 +1439,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1309
1439
|
var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitation2.AuthMethod.NONE;
|
|
1310
1440
|
|
|
1311
1441
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1312
|
-
var
|
|
1442
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
|
|
1313
1443
|
var InvitationsHandler = class {
|
|
1314
1444
|
/**
|
|
1315
1445
|
* @internal
|
|
@@ -1321,7 +1451,15 @@ var InvitationsHandler = class {
|
|
|
1321
1451
|
var _a;
|
|
1322
1452
|
const { invitationId = PublicKey5.random().toHex(), type = Invitation3.Type.INTERACTIVE, authMethod = Invitation3.AuthMethod.SHARED_SECRET, state = Invitation3.State.INIT, timeout = INVITATION_TIMEOUT, swarmKey = PublicKey5.random() } = options != null ? options : {};
|
|
1323
1453
|
const authCode = (_a = options == null ? void 0 : options.authCode) != null ? _a : authMethod === Invitation3.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0;
|
|
1324
|
-
invariant6(protocol
|
|
1454
|
+
invariant6(protocol, void 0, {
|
|
1455
|
+
F: __dxlog_file7,
|
|
1456
|
+
L: 76,
|
|
1457
|
+
S: this,
|
|
1458
|
+
A: [
|
|
1459
|
+
"protocol",
|
|
1460
|
+
""
|
|
1461
|
+
]
|
|
1462
|
+
});
|
|
1325
1463
|
const invitation = {
|
|
1326
1464
|
invitationId,
|
|
1327
1465
|
type,
|
|
@@ -1343,8 +1481,8 @@ var InvitationsHandler = class {
|
|
|
1343
1481
|
log5("complete", {
|
|
1344
1482
|
...protocol.toJSON()
|
|
1345
1483
|
}, {
|
|
1346
|
-
F:
|
|
1347
|
-
L:
|
|
1484
|
+
F: __dxlog_file7,
|
|
1485
|
+
L: 98,
|
|
1348
1486
|
S: this,
|
|
1349
1487
|
C: (f, a) => f(...a)
|
|
1350
1488
|
});
|
|
@@ -1368,7 +1506,15 @@ var InvitationsHandler = class {
|
|
|
1368
1506
|
var _a2, _b, _c;
|
|
1369
1507
|
try {
|
|
1370
1508
|
const deviceKey = (_c = (_a2 = admissionRequest.device) == null ? void 0 : _a2.deviceKey) != null ? _c : (_b = admissionRequest.space) == null ? void 0 : _b.deviceKey;
|
|
1371
|
-
invariant6(deviceKey
|
|
1509
|
+
invariant6(deviceKey, void 0, {
|
|
1510
|
+
F: __dxlog_file7,
|
|
1511
|
+
L: 119,
|
|
1512
|
+
S: this,
|
|
1513
|
+
A: [
|
|
1514
|
+
"deviceKey",
|
|
1515
|
+
""
|
|
1516
|
+
]
|
|
1517
|
+
});
|
|
1372
1518
|
const admissionResponse = await protocol.admit(admissionRequest, extension.guestProfile);
|
|
1373
1519
|
extension.completedTrigger.wake(deviceKey);
|
|
1374
1520
|
return admissionResponse;
|
|
@@ -1384,16 +1530,16 @@ var InvitationsHandler = class {
|
|
|
1384
1530
|
log5.trace("dxos.sdk.invitations-handler.host.onOpen", trace3.begin({
|
|
1385
1531
|
id: traceId
|
|
1386
1532
|
}), {
|
|
1387
|
-
F:
|
|
1388
|
-
L:
|
|
1533
|
+
F: __dxlog_file7,
|
|
1534
|
+
L: 137,
|
|
1389
1535
|
S: this,
|
|
1390
1536
|
C: (f, a) => f(...a)
|
|
1391
1537
|
});
|
|
1392
1538
|
log5("connected", {
|
|
1393
1539
|
...protocol.toJSON()
|
|
1394
1540
|
}, {
|
|
1395
|
-
F:
|
|
1396
|
-
L:
|
|
1541
|
+
F: __dxlog_file7,
|
|
1542
|
+
L: 138,
|
|
1397
1543
|
S: this,
|
|
1398
1544
|
C: (f, a) => f(...a)
|
|
1399
1545
|
});
|
|
@@ -1408,8 +1554,8 @@ var InvitationsHandler = class {
|
|
|
1408
1554
|
guest: deviceKey,
|
|
1409
1555
|
...protocol.toJSON()
|
|
1410
1556
|
}, {
|
|
1411
|
-
F:
|
|
1412
|
-
L:
|
|
1557
|
+
F: __dxlog_file7,
|
|
1558
|
+
L: 141,
|
|
1413
1559
|
S: this,
|
|
1414
1560
|
C: (f, a) => f(...a)
|
|
1415
1561
|
});
|
|
@@ -1420,8 +1566,8 @@ var InvitationsHandler = class {
|
|
|
1420
1566
|
log5.trace("dxos.sdk.invitations-handler.host.onOpen", trace3.end({
|
|
1421
1567
|
id: traceId
|
|
1422
1568
|
}), {
|
|
1423
|
-
F:
|
|
1424
|
-
L:
|
|
1569
|
+
F: __dxlog_file7,
|
|
1570
|
+
L: 143,
|
|
1425
1571
|
S: this,
|
|
1426
1572
|
C: (f, a) => f(...a)
|
|
1427
1573
|
});
|
|
@@ -1430,8 +1576,8 @@ var InvitationsHandler = class {
|
|
|
1430
1576
|
log5("timeout", {
|
|
1431
1577
|
...protocol.toJSON()
|
|
1432
1578
|
}, {
|
|
1433
|
-
F:
|
|
1434
|
-
L:
|
|
1579
|
+
F: __dxlog_file7,
|
|
1580
|
+
L: 146,
|
|
1435
1581
|
S: this,
|
|
1436
1582
|
C: (f, a) => f(...a)
|
|
1437
1583
|
});
|
|
@@ -1441,8 +1587,8 @@ var InvitationsHandler = class {
|
|
|
1441
1587
|
});
|
|
1442
1588
|
} else {
|
|
1443
1589
|
log5.error("failed", err, {
|
|
1444
|
-
F:
|
|
1445
|
-
L:
|
|
1590
|
+
F: __dxlog_file7,
|
|
1591
|
+
L: 149,
|
|
1446
1592
|
S: this,
|
|
1447
1593
|
C: (f, a) => f(...a)
|
|
1448
1594
|
});
|
|
@@ -1452,8 +1598,8 @@ var InvitationsHandler = class {
|
|
|
1452
1598
|
id: traceId,
|
|
1453
1599
|
error: err
|
|
1454
1600
|
}), {
|
|
1455
|
-
F:
|
|
1456
|
-
L:
|
|
1601
|
+
F: __dxlog_file7,
|
|
1602
|
+
L: 152,
|
|
1457
1603
|
S: this,
|
|
1458
1604
|
C: (f, a) => f(...a)
|
|
1459
1605
|
});
|
|
@@ -1473,8 +1619,8 @@ var InvitationsHandler = class {
|
|
|
1473
1619
|
log5("timeout", {
|
|
1474
1620
|
...protocol.toJSON()
|
|
1475
1621
|
}, {
|
|
1476
|
-
F:
|
|
1477
|
-
L:
|
|
1622
|
+
F: __dxlog_file7,
|
|
1623
|
+
L: 167,
|
|
1478
1624
|
S: this,
|
|
1479
1625
|
C: (f, a) => f(...a)
|
|
1480
1626
|
});
|
|
@@ -1484,8 +1630,8 @@ var InvitationsHandler = class {
|
|
|
1484
1630
|
});
|
|
1485
1631
|
} else {
|
|
1486
1632
|
log5.error("failed", err, {
|
|
1487
|
-
F:
|
|
1488
|
-
L:
|
|
1633
|
+
F: __dxlog_file7,
|
|
1634
|
+
L: 170,
|
|
1489
1635
|
S: this,
|
|
1490
1636
|
C: (f, a) => f(...a)
|
|
1491
1637
|
});
|
|
@@ -1527,13 +1673,29 @@ var InvitationsHandler = class {
|
|
|
1527
1673
|
}
|
|
1528
1674
|
acceptInvitation(protocol, invitation) {
|
|
1529
1675
|
const { timeout = INVITATION_TIMEOUT } = invitation;
|
|
1530
|
-
invariant6(protocol
|
|
1676
|
+
invariant6(protocol, void 0, {
|
|
1677
|
+
F: __dxlog_file7,
|
|
1678
|
+
L: 210,
|
|
1679
|
+
S: this,
|
|
1680
|
+
A: [
|
|
1681
|
+
"protocol",
|
|
1682
|
+
""
|
|
1683
|
+
]
|
|
1684
|
+
});
|
|
1531
1685
|
const authenticated = new Trigger3();
|
|
1532
1686
|
let admitted = false;
|
|
1533
1687
|
let currentState;
|
|
1534
1688
|
const stream = new PushStream();
|
|
1535
1689
|
const setState = (newData) => {
|
|
1536
|
-
invariant6(newData.state !== void 0
|
|
1690
|
+
invariant6(newData.state !== void 0, void 0, {
|
|
1691
|
+
F: __dxlog_file7,
|
|
1692
|
+
L: 221,
|
|
1693
|
+
S: this,
|
|
1694
|
+
A: [
|
|
1695
|
+
"newData.state !== undefined",
|
|
1696
|
+
""
|
|
1697
|
+
]
|
|
1698
|
+
});
|
|
1537
1699
|
currentState = newData.state;
|
|
1538
1700
|
stream.next({
|
|
1539
1701
|
...invitation,
|
|
@@ -1546,8 +1708,8 @@ var InvitationsHandler = class {
|
|
|
1546
1708
|
log5("timeout", {
|
|
1547
1709
|
...protocol.toJSON()
|
|
1548
1710
|
}, {
|
|
1549
|
-
F:
|
|
1550
|
-
L:
|
|
1711
|
+
F: __dxlog_file7,
|
|
1712
|
+
L: 229,
|
|
1551
1713
|
S: this,
|
|
1552
1714
|
C: (f, a) => f(...a)
|
|
1553
1715
|
});
|
|
@@ -1556,8 +1718,8 @@ var InvitationsHandler = class {
|
|
|
1556
1718
|
});
|
|
1557
1719
|
} else {
|
|
1558
1720
|
log5.warn("auth failed", err, {
|
|
1559
|
-
F:
|
|
1560
|
-
L:
|
|
1721
|
+
F: __dxlog_file7,
|
|
1722
|
+
L: 232,
|
|
1561
1723
|
S: this,
|
|
1562
1724
|
C: (f, a) => f(...a)
|
|
1563
1725
|
});
|
|
@@ -1570,8 +1732,8 @@ var InvitationsHandler = class {
|
|
|
1570
1732
|
log5("complete", {
|
|
1571
1733
|
...protocol.toJSON()
|
|
1572
1734
|
}, {
|
|
1573
|
-
F:
|
|
1574
|
-
L:
|
|
1735
|
+
F: __dxlog_file7,
|
|
1736
|
+
L: 240,
|
|
1575
1737
|
S: this,
|
|
1576
1738
|
C: (f, a) => f(...a)
|
|
1577
1739
|
});
|
|
@@ -1585,8 +1747,8 @@ var InvitationsHandler = class {
|
|
|
1585
1747
|
log5("extension disposed", {
|
|
1586
1748
|
currentState
|
|
1587
1749
|
}, {
|
|
1588
|
-
F:
|
|
1589
|
-
L:
|
|
1750
|
+
F: __dxlog_file7,
|
|
1751
|
+
L: 250,
|
|
1590
1752
|
S: this,
|
|
1591
1753
|
C: (f, a) => f(...a)
|
|
1592
1754
|
});
|
|
@@ -1600,8 +1762,8 @@ var InvitationsHandler = class {
|
|
|
1600
1762
|
log5.trace("dxos.sdk.invitations-handler.guest.onOpen", trace3.begin({
|
|
1601
1763
|
id: traceId
|
|
1602
1764
|
}), {
|
|
1603
|
-
F:
|
|
1604
|
-
L:
|
|
1765
|
+
F: __dxlog_file7,
|
|
1766
|
+
L: 259,
|
|
1605
1767
|
S: this,
|
|
1606
1768
|
C: (f, a) => f(...a)
|
|
1607
1769
|
});
|
|
@@ -1612,8 +1774,8 @@ var InvitationsHandler = class {
|
|
|
1612
1774
|
log5("connected", {
|
|
1613
1775
|
...protocol.toJSON()
|
|
1614
1776
|
}, {
|
|
1615
|
-
F:
|
|
1616
|
-
L:
|
|
1777
|
+
F: __dxlog_file7,
|
|
1778
|
+
L: 267,
|
|
1617
1779
|
S: this,
|
|
1618
1780
|
C: (f, a) => f(...a)
|
|
1619
1781
|
});
|
|
@@ -1623,8 +1785,8 @@ var InvitationsHandler = class {
|
|
|
1623
1785
|
log5("introduce", {
|
|
1624
1786
|
...protocol.toJSON()
|
|
1625
1787
|
}, {
|
|
1626
|
-
F:
|
|
1627
|
-
L:
|
|
1788
|
+
F: __dxlog_file7,
|
|
1789
|
+
L: 271,
|
|
1628
1790
|
S: this,
|
|
1629
1791
|
C: (f, a) => f(...a)
|
|
1630
1792
|
});
|
|
@@ -1633,8 +1795,8 @@ var InvitationsHandler = class {
|
|
|
1633
1795
|
...protocol.toJSON(),
|
|
1634
1796
|
response: introductionResponse
|
|
1635
1797
|
}, {
|
|
1636
|
-
F:
|
|
1637
|
-
L:
|
|
1798
|
+
F: __dxlog_file7,
|
|
1799
|
+
L: 275,
|
|
1638
1800
|
S: this,
|
|
1639
1801
|
C: (f, a) => f(...a)
|
|
1640
1802
|
});
|
|
@@ -1645,8 +1807,8 @@ var InvitationsHandler = class {
|
|
|
1645
1807
|
if (isAuthenticationRequired(invitation)) {
|
|
1646
1808
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1647
1809
|
log5("guest waiting for authentication code...", void 0, {
|
|
1648
|
-
F:
|
|
1649
|
-
L:
|
|
1810
|
+
F: __dxlog_file7,
|
|
1811
|
+
L: 284,
|
|
1650
1812
|
S: this,
|
|
1651
1813
|
C: (f, a) => f(...a)
|
|
1652
1814
|
});
|
|
@@ -1657,8 +1819,8 @@ var InvitationsHandler = class {
|
|
|
1657
1819
|
timeout
|
|
1658
1820
|
});
|
|
1659
1821
|
log5("sending authentication request", void 0, {
|
|
1660
|
-
F:
|
|
1661
|
-
L:
|
|
1822
|
+
F: __dxlog_file7,
|
|
1823
|
+
L: 288,
|
|
1662
1824
|
S: this,
|
|
1663
1825
|
C: (f, a) => f(...a)
|
|
1664
1826
|
});
|
|
@@ -1678,8 +1840,8 @@ var InvitationsHandler = class {
|
|
|
1678
1840
|
log5("retrying invalid code", {
|
|
1679
1841
|
attempt
|
|
1680
1842
|
}, {
|
|
1681
|
-
F:
|
|
1682
|
-
L:
|
|
1843
|
+
F: __dxlog_file7,
|
|
1844
|
+
L: 299,
|
|
1683
1845
|
S: this,
|
|
1684
1846
|
C: (f, a) => f(...a)
|
|
1685
1847
|
});
|
|
@@ -1695,8 +1857,8 @@ var InvitationsHandler = class {
|
|
|
1695
1857
|
log5("request admission", {
|
|
1696
1858
|
...protocol.toJSON()
|
|
1697
1859
|
}, {
|
|
1698
|
-
F:
|
|
1699
|
-
L:
|
|
1860
|
+
F: __dxlog_file7,
|
|
1861
|
+
L: 310,
|
|
1700
1862
|
S: this,
|
|
1701
1863
|
C: (f, a) => f(...a)
|
|
1702
1864
|
});
|
|
@@ -1707,8 +1869,8 @@ var InvitationsHandler = class {
|
|
|
1707
1869
|
log5("admitted by host", {
|
|
1708
1870
|
...protocol.toJSON()
|
|
1709
1871
|
}, {
|
|
1710
|
-
F:
|
|
1711
|
-
L:
|
|
1872
|
+
F: __dxlog_file7,
|
|
1873
|
+
L: 321,
|
|
1712
1874
|
S: this,
|
|
1713
1875
|
C: (f, a) => f(...a)
|
|
1714
1876
|
});
|
|
@@ -1719,8 +1881,8 @@ var InvitationsHandler = class {
|
|
|
1719
1881
|
log5.trace("dxos.sdk.invitations-handler.guest.onOpen", trace3.end({
|
|
1720
1882
|
id: traceId
|
|
1721
1883
|
}), {
|
|
1722
|
-
F:
|
|
1723
|
-
L:
|
|
1884
|
+
F: __dxlog_file7,
|
|
1885
|
+
L: 323,
|
|
1724
1886
|
S: this,
|
|
1725
1887
|
C: (f, a) => f(...a)
|
|
1726
1888
|
});
|
|
@@ -1729,8 +1891,8 @@ var InvitationsHandler = class {
|
|
|
1729
1891
|
log5("timeout", {
|
|
1730
1892
|
...protocol.toJSON()
|
|
1731
1893
|
}, {
|
|
1732
|
-
F:
|
|
1733
|
-
L:
|
|
1894
|
+
F: __dxlog_file7,
|
|
1895
|
+
L: 326,
|
|
1734
1896
|
S: this,
|
|
1735
1897
|
C: (f, a) => f(...a)
|
|
1736
1898
|
});
|
|
@@ -1739,8 +1901,8 @@ var InvitationsHandler = class {
|
|
|
1739
1901
|
});
|
|
1740
1902
|
} else {
|
|
1741
1903
|
log5("auth failed", err, {
|
|
1742
|
-
F:
|
|
1743
|
-
L:
|
|
1904
|
+
F: __dxlog_file7,
|
|
1905
|
+
L: 329,
|
|
1744
1906
|
S: this,
|
|
1745
1907
|
C: (f, a) => f(...a)
|
|
1746
1908
|
});
|
|
@@ -1750,8 +1912,8 @@ var InvitationsHandler = class {
|
|
|
1750
1912
|
id: traceId,
|
|
1751
1913
|
error: err
|
|
1752
1914
|
}), {
|
|
1753
|
-
F:
|
|
1754
|
-
L:
|
|
1915
|
+
F: __dxlog_file7,
|
|
1916
|
+
L: 332,
|
|
1755
1917
|
S: this,
|
|
1756
1918
|
C: (f, a) => f(...a)
|
|
1757
1919
|
});
|
|
@@ -1768,8 +1930,8 @@ var InvitationsHandler = class {
|
|
|
1768
1930
|
log5("timeout", {
|
|
1769
1931
|
...protocol.toJSON()
|
|
1770
1932
|
}, {
|
|
1771
|
-
F:
|
|
1772
|
-
L:
|
|
1933
|
+
F: __dxlog_file7,
|
|
1934
|
+
L: 343,
|
|
1773
1935
|
S: this,
|
|
1774
1936
|
C: (f, a) => f(...a)
|
|
1775
1937
|
});
|
|
@@ -1778,8 +1940,8 @@ var InvitationsHandler = class {
|
|
|
1778
1940
|
});
|
|
1779
1941
|
} else {
|
|
1780
1942
|
log5("auth failed", err, {
|
|
1781
|
-
F:
|
|
1782
|
-
L:
|
|
1943
|
+
F: __dxlog_file7,
|
|
1944
|
+
L: 346,
|
|
1783
1945
|
S: this,
|
|
1784
1946
|
C: (f, a) => f(...a)
|
|
1785
1947
|
});
|
|
@@ -1790,7 +1952,15 @@ var InvitationsHandler = class {
|
|
|
1790
1952
|
return extension;
|
|
1791
1953
|
};
|
|
1792
1954
|
scheduleTask2(ctx, async () => {
|
|
1793
|
-
invariant6(invitation.swarmKey
|
|
1955
|
+
invariant6(invitation.swarmKey, void 0, {
|
|
1956
|
+
F: __dxlog_file7,
|
|
1957
|
+
L: 356,
|
|
1958
|
+
S: this,
|
|
1959
|
+
A: [
|
|
1960
|
+
"invitation.swarmKey",
|
|
1961
|
+
""
|
|
1962
|
+
]
|
|
1963
|
+
});
|
|
1794
1964
|
const topic = invitation.swarmKey;
|
|
1795
1965
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1796
1966
|
topic,
|
|
@@ -1823,12 +1993,12 @@ var InvitationsHandler = class {
|
|
|
1823
1993
|
};
|
|
1824
1994
|
|
|
1825
1995
|
// packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
|
|
1826
|
-
import invariant7 from "tiny-invariant";
|
|
1827
1996
|
import { Event as Event3 } from "@dxos/async";
|
|
1828
1997
|
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
1998
|
+
import { invariant as invariant7 } from "@dxos/invariant";
|
|
1829
1999
|
import { log as log6 } from "@dxos/log";
|
|
1830
2000
|
import { QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1831
|
-
var
|
|
2001
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
|
|
1832
2002
|
var InvitationsServiceImpl = class {
|
|
1833
2003
|
constructor(_invitationsHandler, _getHandler) {
|
|
1834
2004
|
this._invitationsHandler = _invitationsHandler;
|
|
@@ -1890,19 +2060,27 @@ var InvitationsServiceImpl = class {
|
|
|
1890
2060
|
}
|
|
1891
2061
|
async authenticate({ invitationId, authCode }) {
|
|
1892
2062
|
log6("authenticating...", void 0, {
|
|
1893
|
-
F:
|
|
1894
|
-
L:
|
|
2063
|
+
F: __dxlog_file8,
|
|
2064
|
+
L: 102,
|
|
1895
2065
|
S: this,
|
|
1896
2066
|
C: (f, a) => f(...a)
|
|
1897
2067
|
});
|
|
1898
|
-
invariant7(invitationId
|
|
2068
|
+
invariant7(invitationId, void 0, {
|
|
2069
|
+
F: __dxlog_file8,
|
|
2070
|
+
L: 103,
|
|
2071
|
+
S: this,
|
|
2072
|
+
A: [
|
|
2073
|
+
"invitationId",
|
|
2074
|
+
""
|
|
2075
|
+
]
|
|
2076
|
+
});
|
|
1899
2077
|
const observable = this._acceptInvitations.get(invitationId);
|
|
1900
2078
|
if (!observable) {
|
|
1901
2079
|
log6.warn("invalid invitation", {
|
|
1902
2080
|
invitationId
|
|
1903
2081
|
}, {
|
|
1904
|
-
F:
|
|
1905
|
-
L:
|
|
2082
|
+
F: __dxlog_file8,
|
|
2083
|
+
L: 106,
|
|
1906
2084
|
S: this,
|
|
1907
2085
|
C: (f, a) => f(...a)
|
|
1908
2086
|
});
|
|
@@ -1912,12 +2090,20 @@ var InvitationsServiceImpl = class {
|
|
|
1912
2090
|
}
|
|
1913
2091
|
async cancelInvitation({ invitationId }) {
|
|
1914
2092
|
log6("deleting...", void 0, {
|
|
1915
|
-
F:
|
|
1916
|
-
L:
|
|
2093
|
+
F: __dxlog_file8,
|
|
2094
|
+
L: 113,
|
|
1917
2095
|
S: this,
|
|
1918
2096
|
C: (f, a) => f(...a)
|
|
1919
2097
|
});
|
|
1920
|
-
invariant7(invitationId
|
|
2098
|
+
invariant7(invitationId, void 0, {
|
|
2099
|
+
F: __dxlog_file8,
|
|
2100
|
+
L: 114,
|
|
2101
|
+
S: this,
|
|
2102
|
+
A: [
|
|
2103
|
+
"invitationId",
|
|
2104
|
+
""
|
|
2105
|
+
]
|
|
2106
|
+
});
|
|
1921
2107
|
const created = this._createInvitations.get(invitationId);
|
|
1922
2108
|
const accepted = this._acceptInvitations.get(invitationId);
|
|
1923
2109
|
if (created) {
|
|
@@ -1932,8 +2118,8 @@ var InvitationsServiceImpl = class {
|
|
|
1932
2118
|
log6.warn("invalid invitation", {
|
|
1933
2119
|
invitationId
|
|
1934
2120
|
}, {
|
|
1935
|
-
F:
|
|
1936
|
-
L:
|
|
2121
|
+
F: __dxlog_file8,
|
|
2122
|
+
L: 126,
|
|
1937
2123
|
S: this,
|
|
1938
2124
|
C: (f, a) => f(...a)
|
|
1939
2125
|
});
|
|
@@ -1992,12 +2178,12 @@ var InvitationsServiceImpl = class {
|
|
|
1992
2178
|
};
|
|
1993
2179
|
|
|
1994
2180
|
// packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts
|
|
1995
|
-
import invariant8 from "tiny-invariant";
|
|
1996
2181
|
import { createAdmissionCredentials, getCredentialAssertion } from "@dxos/credentials";
|
|
1997
2182
|
import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
2183
|
+
import { invariant as invariant8 } from "@dxos/invariant";
|
|
1998
2184
|
import { log as log7 } from "@dxos/log";
|
|
1999
2185
|
import { Invitation as Invitation4 } from "@dxos/protocols/proto/dxos/client/services";
|
|
2000
|
-
var
|
|
2186
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
2001
2187
|
var SpaceInvitationProtocol = class {
|
|
2002
2188
|
constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
|
|
2003
2189
|
this._spaceManager = _spaceManager;
|
|
@@ -2019,24 +2205,64 @@ var SpaceInvitationProtocol = class {
|
|
|
2019
2205
|
}
|
|
2020
2206
|
async admit(request, guestProfile) {
|
|
2021
2207
|
var _a;
|
|
2022
|
-
invariant8(this._spaceKey
|
|
2208
|
+
invariant8(this._spaceKey, void 0, {
|
|
2209
|
+
F: __dxlog_file9,
|
|
2210
|
+
L: 42,
|
|
2211
|
+
S: this,
|
|
2212
|
+
A: [
|
|
2213
|
+
"this._spaceKey",
|
|
2214
|
+
""
|
|
2215
|
+
]
|
|
2216
|
+
});
|
|
2023
2217
|
const space = await this._spaceManager.spaces.get(this._spaceKey);
|
|
2024
|
-
invariant8(space
|
|
2025
|
-
|
|
2218
|
+
invariant8(space, void 0, {
|
|
2219
|
+
F: __dxlog_file9,
|
|
2220
|
+
L: 44,
|
|
2221
|
+
S: this,
|
|
2222
|
+
A: [
|
|
2223
|
+
"space",
|
|
2224
|
+
""
|
|
2225
|
+
]
|
|
2226
|
+
});
|
|
2227
|
+
invariant8(request.space, void 0, {
|
|
2228
|
+
F: __dxlog_file9,
|
|
2229
|
+
L: 46,
|
|
2230
|
+
S: this,
|
|
2231
|
+
A: [
|
|
2232
|
+
"request.space",
|
|
2233
|
+
""
|
|
2234
|
+
]
|
|
2235
|
+
});
|
|
2026
2236
|
const { identityKey, deviceKey } = request.space;
|
|
2027
2237
|
log7("writing guest credentials", {
|
|
2028
2238
|
host: this._signingContext.deviceKey,
|
|
2029
2239
|
guest: deviceKey
|
|
2030
2240
|
}, {
|
|
2031
|
-
F:
|
|
2032
|
-
L:
|
|
2241
|
+
F: __dxlog_file9,
|
|
2242
|
+
L: 49,
|
|
2033
2243
|
S: this,
|
|
2034
2244
|
C: (f, a) => f(...a)
|
|
2035
2245
|
});
|
|
2036
2246
|
const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, guestProfile);
|
|
2037
|
-
invariant8(credentials[0].credential
|
|
2247
|
+
invariant8(credentials[0].credential, void 0, {
|
|
2248
|
+
F: __dxlog_file9,
|
|
2249
|
+
L: 60,
|
|
2250
|
+
S: this,
|
|
2251
|
+
A: [
|
|
2252
|
+
"credentials[0].credential",
|
|
2253
|
+
""
|
|
2254
|
+
]
|
|
2255
|
+
});
|
|
2038
2256
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2039
|
-
invariant8(getCredentialAssertion(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember"
|
|
2257
|
+
invariant8(getCredentialAssertion(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2258
|
+
F: __dxlog_file9,
|
|
2259
|
+
L: 62,
|
|
2260
|
+
S: this,
|
|
2261
|
+
A: [
|
|
2262
|
+
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
2263
|
+
""
|
|
2264
|
+
]
|
|
2265
|
+
});
|
|
2040
2266
|
await writeMessages2(space.inner.controlPipeline.writer, credentials);
|
|
2041
2267
|
return {
|
|
2042
2268
|
space: {
|
|
@@ -2064,11 +2290,35 @@ var SpaceInvitationProtocol = class {
|
|
|
2064
2290
|
};
|
|
2065
2291
|
}
|
|
2066
2292
|
async accept(response) {
|
|
2067
|
-
invariant8(response.space
|
|
2293
|
+
invariant8(response.space, void 0, {
|
|
2294
|
+
F: __dxlog_file9,
|
|
2295
|
+
L: 97,
|
|
2296
|
+
S: this,
|
|
2297
|
+
A: [
|
|
2298
|
+
"response.space",
|
|
2299
|
+
""
|
|
2300
|
+
]
|
|
2301
|
+
});
|
|
2068
2302
|
const { credential, controlTimeframe, dataTimeframe } = response.space;
|
|
2069
2303
|
const assertion = getCredentialAssertion(credential);
|
|
2070
|
-
invariant8(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential"
|
|
2071
|
-
|
|
2304
|
+
invariant8(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2305
|
+
F: __dxlog_file9,
|
|
2306
|
+
L: 100,
|
|
2307
|
+
S: this,
|
|
2308
|
+
A: [
|
|
2309
|
+
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
2310
|
+
"'Invalid credential'"
|
|
2311
|
+
]
|
|
2312
|
+
});
|
|
2313
|
+
invariant8(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
2314
|
+
F: __dxlog_file9,
|
|
2315
|
+
L: 101,
|
|
2316
|
+
S: this,
|
|
2317
|
+
A: [
|
|
2318
|
+
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
2319
|
+
""
|
|
2320
|
+
]
|
|
2321
|
+
});
|
|
2072
2322
|
await this._spaceManager.acceptSpace({
|
|
2073
2323
|
spaceKey: assertion.spaceKey,
|
|
2074
2324
|
genesisFeedKey: assertion.genesisFeedKey,
|
|
@@ -2150,15 +2400,15 @@ import { Timeframe } from "@dxos/timeframe";
|
|
|
2150
2400
|
import { ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
2151
2401
|
|
|
2152
2402
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2153
|
-
import invariant9 from "tiny-invariant";
|
|
2154
2403
|
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger4 } from "@dxos/async";
|
|
2155
2404
|
import { Context as Context5, rejectOnDispose } from "@dxos/context";
|
|
2405
|
+
import { invariant as invariant9 } from "@dxos/invariant";
|
|
2156
2406
|
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
2157
2407
|
import { log as log8 } from "@dxos/log";
|
|
2158
2408
|
import { schema as schema3 } from "@dxos/protocols";
|
|
2159
2409
|
import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
|
|
2160
2410
|
import { ComplexMap as ComplexMap2, ComplexSet, entry } from "@dxos/util";
|
|
2161
|
-
var
|
|
2411
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2162
2412
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2163
2413
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2164
2414
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2186,20 +2436,28 @@ var NotarizationPlugin = class {
|
|
|
2186
2436
|
log8("notarize", {
|
|
2187
2437
|
credentials
|
|
2188
2438
|
}, {
|
|
2189
|
-
F:
|
|
2190
|
-
L:
|
|
2439
|
+
F: __dxlog_file10,
|
|
2440
|
+
L: 90,
|
|
2191
2441
|
S: this,
|
|
2192
2442
|
C: (f, a) => f(...a)
|
|
2193
2443
|
});
|
|
2194
|
-
invariant9(credentials.every((credential) => credential.id), "Credentials must have an id"
|
|
2444
|
+
invariant9(credentials.every((credential) => credential.id), "Credentials must have an id", {
|
|
2445
|
+
F: __dxlog_file10,
|
|
2446
|
+
L: 91,
|
|
2447
|
+
S: this,
|
|
2448
|
+
A: [
|
|
2449
|
+
"credentials.every((credential) => credential.id)",
|
|
2450
|
+
"'Credentials must have an id'"
|
|
2451
|
+
]
|
|
2452
|
+
});
|
|
2195
2453
|
const errors = new Trigger4();
|
|
2196
2454
|
const ctx = this._ctx.derive({
|
|
2197
2455
|
onError: (err) => {
|
|
2198
2456
|
log8.warn("Notarization error", {
|
|
2199
2457
|
err
|
|
2200
2458
|
}, {
|
|
2201
|
-
F:
|
|
2202
|
-
L:
|
|
2459
|
+
F: __dxlog_file10,
|
|
2460
|
+
L: 99,
|
|
2203
2461
|
S: this,
|
|
2204
2462
|
C: (f, a) => f(...a)
|
|
2205
2463
|
});
|
|
@@ -2214,8 +2472,8 @@ var NotarizationPlugin = class {
|
|
|
2214
2472
|
timeout,
|
|
2215
2473
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
2216
2474
|
}, {
|
|
2217
|
-
F:
|
|
2218
|
-
L:
|
|
2475
|
+
F: __dxlog_file10,
|
|
2476
|
+
L: 111,
|
|
2219
2477
|
S: this,
|
|
2220
2478
|
C: (f, a) => f(...a)
|
|
2221
2479
|
});
|
|
@@ -2237,8 +2495,8 @@ var NotarizationPlugin = class {
|
|
|
2237
2495
|
log8.warn("Exhausted all peers to notarize with", {
|
|
2238
2496
|
retryIn: retryTimeout
|
|
2239
2497
|
}, {
|
|
2240
|
-
F:
|
|
2241
|
-
L:
|
|
2498
|
+
F: __dxlog_file10,
|
|
2499
|
+
L: 136,
|
|
2242
2500
|
S: this,
|
|
2243
2501
|
C: (f, a) => f(...a)
|
|
2244
2502
|
});
|
|
@@ -2251,8 +2509,8 @@ var NotarizationPlugin = class {
|
|
|
2251
2509
|
peer: peer.localPeerId,
|
|
2252
2510
|
credentialId: credentials.map((credential) => credential.id)
|
|
2253
2511
|
}, {
|
|
2254
|
-
F:
|
|
2255
|
-
L:
|
|
2512
|
+
F: __dxlog_file10,
|
|
2513
|
+
L: 143,
|
|
2256
2514
|
S: this,
|
|
2257
2515
|
C: (f, a) => f(...a)
|
|
2258
2516
|
});
|
|
@@ -2260,8 +2518,8 @@ var NotarizationPlugin = class {
|
|
|
2260
2518
|
credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
|
|
2261
2519
|
});
|
|
2262
2520
|
log8("success", void 0, {
|
|
2263
|
-
F:
|
|
2264
|
-
L:
|
|
2521
|
+
F: __dxlog_file10,
|
|
2522
|
+
L: 147,
|
|
2265
2523
|
S: this,
|
|
2266
2524
|
C: (f, a) => f(...a)
|
|
2267
2525
|
});
|
|
@@ -2269,8 +2527,8 @@ var NotarizationPlugin = class {
|
|
|
2269
2527
|
} catch (err) {
|
|
2270
2528
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2271
2529
|
log8.warn("error notarizing (recoverable)", err, {
|
|
2272
|
-
F:
|
|
2273
|
-
L:
|
|
2530
|
+
F: __dxlog_file10,
|
|
2531
|
+
L: 151,
|
|
2274
2532
|
S: this,
|
|
2275
2533
|
C: (f, a) => f(...a)
|
|
2276
2534
|
});
|
|
@@ -2287,8 +2545,8 @@ var NotarizationPlugin = class {
|
|
|
2287
2545
|
errors.wait()
|
|
2288
2546
|
]);
|
|
2289
2547
|
log8("done", void 0, {
|
|
2290
|
-
F:
|
|
2291
|
-
L:
|
|
2548
|
+
F: __dxlog_file10,
|
|
2549
|
+
L: 162,
|
|
2292
2550
|
S: this,
|
|
2293
2551
|
C: (f, a) => f(...a)
|
|
2294
2552
|
});
|
|
@@ -2309,7 +2567,15 @@ var NotarizationPlugin = class {
|
|
|
2309
2567
|
this._processCredentialsTriggers.delete(credential.id);
|
|
2310
2568
|
}
|
|
2311
2569
|
setWriter(writer) {
|
|
2312
|
-
invariant9(!this._writer, "Writer already set."
|
|
2570
|
+
invariant9(!this._writer, "Writer already set.", {
|
|
2571
|
+
F: __dxlog_file10,
|
|
2572
|
+
L: 181,
|
|
2573
|
+
S: this,
|
|
2574
|
+
A: [
|
|
2575
|
+
"!this._writer",
|
|
2576
|
+
"'Writer already set.'"
|
|
2577
|
+
]
|
|
2578
|
+
});
|
|
2313
2579
|
this._writer = writer;
|
|
2314
2580
|
}
|
|
2315
2581
|
async _waitUntilProcessed(id) {
|
|
@@ -2327,7 +2593,15 @@ var NotarizationPlugin = class {
|
|
|
2327
2593
|
throw new Error(WRITER_NOT_SET_ERROR_CODE);
|
|
2328
2594
|
}
|
|
2329
2595
|
for (const credential of (_a = request.credentials) != null ? _a : []) {
|
|
2330
|
-
invariant9(credential.id, "Credential must have an id"
|
|
2596
|
+
invariant9(credential.id, "Credential must have an id", {
|
|
2597
|
+
F: __dxlog_file10,
|
|
2598
|
+
L: 200,
|
|
2599
|
+
S: this,
|
|
2600
|
+
A: [
|
|
2601
|
+
"credential.id",
|
|
2602
|
+
"'Credential must have an id'"
|
|
2603
|
+
]
|
|
2604
|
+
});
|
|
2331
2605
|
if (this._processedCredentials.has(credential.id)) {
|
|
2332
2606
|
continue;
|
|
2333
2607
|
}
|
|
@@ -2340,8 +2614,8 @@ var NotarizationPlugin = class {
|
|
|
2340
2614
|
log8("extension opened", {
|
|
2341
2615
|
peer: extension.localPeerId
|
|
2342
2616
|
}, {
|
|
2343
|
-
F:
|
|
2344
|
-
L:
|
|
2617
|
+
F: __dxlog_file10,
|
|
2618
|
+
L: 211,
|
|
2345
2619
|
S: this,
|
|
2346
2620
|
C: (f, a) => f(...a)
|
|
2347
2621
|
});
|
|
@@ -2352,8 +2626,8 @@ var NotarizationPlugin = class {
|
|
|
2352
2626
|
log8("extension closed", {
|
|
2353
2627
|
peer: extension.localPeerId
|
|
2354
2628
|
}, {
|
|
2355
|
-
F:
|
|
2356
|
-
L:
|
|
2629
|
+
F: __dxlog_file10,
|
|
2630
|
+
L: 216,
|
|
2357
2631
|
S: this,
|
|
2358
2632
|
C: (f, a) => f(...a)
|
|
2359
2633
|
});
|
|
@@ -2406,7 +2680,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
2406
2680
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2407
2681
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2408
2682
|
}
|
|
2409
|
-
var
|
|
2683
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
2410
2684
|
var DataSpace = class DataSpace2 {
|
|
2411
2685
|
constructor(params) {
|
|
2412
2686
|
this._ctx = new Context6();
|
|
@@ -2505,7 +2779,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2505
2779
|
} catch (err) {
|
|
2506
2780
|
if (err instanceof CancelledError) {
|
|
2507
2781
|
log9("data pipeline initialization cancelled", err, {
|
|
2508
|
-
F:
|
|
2782
|
+
F: __dxlog_file11,
|
|
2509
2783
|
L: 193,
|
|
2510
2784
|
S: this,
|
|
2511
2785
|
C: (f, a) => f(...a)
|
|
@@ -2513,7 +2787,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2513
2787
|
return;
|
|
2514
2788
|
}
|
|
2515
2789
|
log9.error("Error initializing data pipeline", err, {
|
|
2516
|
-
F:
|
|
2790
|
+
F: __dxlog_file11,
|
|
2517
2791
|
L: 197,
|
|
2518
2792
|
S: this,
|
|
2519
2793
|
C: (f, a) => f(...a)
|
|
@@ -2539,7 +2813,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2539
2813
|
this.metrics.controlPipelineReady = new Date();
|
|
2540
2814
|
await this._createWritableFeeds();
|
|
2541
2815
|
log9("writable feeds created", void 0, {
|
|
2542
|
-
F:
|
|
2816
|
+
F: __dxlog_file11,
|
|
2543
2817
|
L: 221,
|
|
2544
2818
|
S: this,
|
|
2545
2819
|
C: (f, a) => f(...a)
|
|
@@ -2556,7 +2830,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2556
2830
|
this.metrics.dataPipelineOpen = new Date();
|
|
2557
2831
|
await cancelWithContext2(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
2558
2832
|
log9("waiting for data pipeline to reach target timeframe", void 0, {
|
|
2559
|
-
F:
|
|
2833
|
+
F: __dxlog_file11,
|
|
2560
2834
|
L: 242,
|
|
2561
2835
|
S: this,
|
|
2562
2836
|
C: (f, a) => f(...a)
|
|
@@ -2567,7 +2841,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2567
2841
|
});
|
|
2568
2842
|
this.metrics.dataPipelineReady = new Date();
|
|
2569
2843
|
log9("data pipeline ready", void 0, {
|
|
2570
|
-
F:
|
|
2844
|
+
F: __dxlog_file11,
|
|
2571
2845
|
L: 251,
|
|
2572
2846
|
S: this,
|
|
2573
2847
|
C: (f, a) => f(...a)
|
|
@@ -2686,10 +2960,10 @@ DataSpace = _ts_decorate([
|
|
|
2686
2960
|
], DataSpace);
|
|
2687
2961
|
|
|
2688
2962
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2689
|
-
import invariant10 from "tiny-invariant";
|
|
2690
2963
|
import { Event as Event6, synchronized as synchronized2, trackLeaks as trackLeaks2 } from "@dxos/async";
|
|
2691
2964
|
import { cancelWithContext as cancelWithContext3, Context as Context7 } from "@dxos/context";
|
|
2692
2965
|
import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
|
|
2966
|
+
import { invariant as invariant10 } from "@dxos/invariant";
|
|
2693
2967
|
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
2694
2968
|
import { log as log10 } from "@dxos/log";
|
|
2695
2969
|
import { trace as trace4 } from "@dxos/protocols";
|
|
@@ -2778,7 +3052,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
2778
3052
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2779
3053
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2780
3054
|
}
|
|
2781
|
-
var
|
|
3055
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
2782
3056
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
2783
3057
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
2784
3058
|
this._spaceManager = _spaceManager;
|
|
@@ -2799,16 +3073,16 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2799
3073
|
}
|
|
2800
3074
|
async open() {
|
|
2801
3075
|
log10("open", void 0, {
|
|
2802
|
-
F:
|
|
2803
|
-
L:
|
|
3076
|
+
F: __dxlog_file12,
|
|
3077
|
+
L: 79,
|
|
2804
3078
|
S: this,
|
|
2805
3079
|
C: (f, a) => f(...a)
|
|
2806
3080
|
});
|
|
2807
3081
|
log10.trace("dxos.echo.data-space-manager.open", trace4.begin({
|
|
2808
3082
|
id: this._instanceId
|
|
2809
3083
|
}), {
|
|
2810
|
-
F:
|
|
2811
|
-
L:
|
|
3084
|
+
F: __dxlog_file12,
|
|
3085
|
+
L: 80,
|
|
2812
3086
|
S: this,
|
|
2813
3087
|
C: (f, a) => f(...a)
|
|
2814
3088
|
});
|
|
@@ -2816,8 +3090,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2816
3090
|
log10("metadata loaded", {
|
|
2817
3091
|
spaces: this._metadataStore.spaces.length
|
|
2818
3092
|
}, {
|
|
2819
|
-
F:
|
|
2820
|
-
L:
|
|
3093
|
+
F: __dxlog_file12,
|
|
3094
|
+
L: 82,
|
|
2821
3095
|
S: this,
|
|
2822
3096
|
C: (f, a) => f(...a)
|
|
2823
3097
|
});
|
|
@@ -2826,8 +3100,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2826
3100
|
log10("load space", {
|
|
2827
3101
|
spaceMetadata
|
|
2828
3102
|
}, {
|
|
2829
|
-
F:
|
|
2830
|
-
L:
|
|
3103
|
+
F: __dxlog_file12,
|
|
3104
|
+
L: 86,
|
|
2831
3105
|
S: this,
|
|
2832
3106
|
C: (f, a) => f(...a)
|
|
2833
3107
|
});
|
|
@@ -2840,8 +3114,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2840
3114
|
spaceMetadata,
|
|
2841
3115
|
err
|
|
2842
3116
|
}, {
|
|
2843
|
-
F:
|
|
2844
|
-
L:
|
|
3117
|
+
F: __dxlog_file12,
|
|
3118
|
+
L: 92,
|
|
2845
3119
|
S: this,
|
|
2846
3120
|
C: (f, a) => f(...a)
|
|
2847
3121
|
});
|
|
@@ -2852,16 +3126,16 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2852
3126
|
log10.trace("dxos.echo.data-space-manager.open", trace4.end({
|
|
2853
3127
|
id: this._instanceId
|
|
2854
3128
|
}), {
|
|
2855
|
-
F:
|
|
2856
|
-
L:
|
|
3129
|
+
F: __dxlog_file12,
|
|
3130
|
+
L: 98,
|
|
2857
3131
|
S: this,
|
|
2858
3132
|
C: (f, a) => f(...a)
|
|
2859
3133
|
});
|
|
2860
3134
|
}
|
|
2861
3135
|
async close() {
|
|
2862
3136
|
log10("close", void 0, {
|
|
2863
|
-
F:
|
|
2864
|
-
L:
|
|
3137
|
+
F: __dxlog_file12,
|
|
3138
|
+
L: 103,
|
|
2865
3139
|
S: this,
|
|
2866
3140
|
C: (f, a) => f(...a)
|
|
2867
3141
|
});
|
|
@@ -2875,7 +3149,15 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2875
3149
|
* Creates a new space writing the genesis credentials to the control feed.
|
|
2876
3150
|
*/
|
|
2877
3151
|
async createSpace() {
|
|
2878
|
-
invariant10(this._isOpen, "Not open."
|
|
3152
|
+
invariant10(this._isOpen, "Not open.", {
|
|
3153
|
+
F: __dxlog_file12,
|
|
3154
|
+
L: 116,
|
|
3155
|
+
S: this,
|
|
3156
|
+
A: [
|
|
3157
|
+
"this._isOpen",
|
|
3158
|
+
"'Not open.'"
|
|
3159
|
+
]
|
|
3160
|
+
});
|
|
2879
3161
|
const spaceKey = await this._keyring.createKey();
|
|
2880
3162
|
const controlFeedKey = await this._keyring.createKey();
|
|
2881
3163
|
const dataFeedKey = await this._keyring.createKey();
|
|
@@ -2889,8 +3171,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2889
3171
|
log10("creating space...", {
|
|
2890
3172
|
spaceKey
|
|
2891
3173
|
}, {
|
|
2892
|
-
F:
|
|
2893
|
-
L:
|
|
3174
|
+
F: __dxlog_file12,
|
|
3175
|
+
L: 128,
|
|
2894
3176
|
S: this,
|
|
2895
3177
|
C: (f, a) => f(...a)
|
|
2896
3178
|
});
|
|
@@ -2898,7 +3180,15 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2898
3180
|
const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner);
|
|
2899
3181
|
await this._metadataStore.addSpace(metadata);
|
|
2900
3182
|
const memberCredential = credentials[1];
|
|
2901
|
-
invariant10(getCredentialAssertion2(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember"
|
|
3183
|
+
invariant10(getCredentialAssertion2(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3184
|
+
F: __dxlog_file12,
|
|
3185
|
+
L: 135,
|
|
3186
|
+
S: this,
|
|
3187
|
+
A: [
|
|
3188
|
+
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
3189
|
+
""
|
|
3190
|
+
]
|
|
3191
|
+
});
|
|
2902
3192
|
await this._signingContext.recordCredential(memberCredential);
|
|
2903
3193
|
await space.initializeDataPipeline();
|
|
2904
3194
|
this.updated.emit();
|
|
@@ -2909,13 +3199,29 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2909
3199
|
log10("accept space", {
|
|
2910
3200
|
opts
|
|
2911
3201
|
}, {
|
|
2912
|
-
F:
|
|
2913
|
-
L:
|
|
3202
|
+
F: __dxlog_file12,
|
|
3203
|
+
L: 147,
|
|
2914
3204
|
S: this,
|
|
2915
3205
|
C: (f, a) => f(...a)
|
|
2916
3206
|
});
|
|
2917
|
-
invariant10(this._isOpen, "Not open."
|
|
2918
|
-
|
|
3207
|
+
invariant10(this._isOpen, "Not open.", {
|
|
3208
|
+
F: __dxlog_file12,
|
|
3209
|
+
L: 148,
|
|
3210
|
+
S: this,
|
|
3211
|
+
A: [
|
|
3212
|
+
"this._isOpen",
|
|
3213
|
+
"'Not open.'"
|
|
3214
|
+
]
|
|
3215
|
+
});
|
|
3216
|
+
invariant10(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3217
|
+
F: __dxlog_file12,
|
|
3218
|
+
L: 149,
|
|
3219
|
+
S: this,
|
|
3220
|
+
A: [
|
|
3221
|
+
"!this._spaces.has(opts.spaceKey)",
|
|
3222
|
+
"'Space already exists.'"
|
|
3223
|
+
]
|
|
3224
|
+
});
|
|
2919
3225
|
const metadata = {
|
|
2920
3226
|
key: opts.spaceKey,
|
|
2921
3227
|
genesisFeedKey: opts.genesisFeedKey,
|
|
@@ -2943,8 +3249,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2943
3249
|
log10("construct space", {
|
|
2944
3250
|
metadata
|
|
2945
3251
|
}, {
|
|
2946
|
-
F:
|
|
2947
|
-
L:
|
|
3252
|
+
F: __dxlog_file12,
|
|
3253
|
+
L: 182,
|
|
2948
3254
|
S: this,
|
|
2949
3255
|
C: (f, a) => f(...a)
|
|
2950
3256
|
});
|
|
@@ -2952,7 +3258,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2952
3258
|
localPeerId: this._signingContext.deviceKey
|
|
2953
3259
|
});
|
|
2954
3260
|
const presence = new Presence({
|
|
2955
|
-
announceInterval:
|
|
3261
|
+
announceInterval: 1e3,
|
|
2956
3262
|
offlineTimeout: 5e3,
|
|
2957
3263
|
identityKey: this._signingContext.identityKey,
|
|
2958
3264
|
gossip
|
|
@@ -2979,8 +3285,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2979
3285
|
},
|
|
2980
3286
|
onAuthFailure: () => {
|
|
2981
3287
|
log10.warn("auth failure", void 0, {
|
|
2982
|
-
F:
|
|
2983
|
-
L:
|
|
3288
|
+
F: __dxlog_file12,
|
|
3289
|
+
L: 213,
|
|
2984
3290
|
S: this,
|
|
2985
3291
|
C: (f, a) => f(...a)
|
|
2986
3292
|
});
|
|
@@ -3003,8 +3309,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3003
3309
|
log10("before space ready", {
|
|
3004
3310
|
space: space.key
|
|
3005
3311
|
}, {
|
|
3006
|
-
F:
|
|
3007
|
-
L:
|
|
3312
|
+
F: __dxlog_file12,
|
|
3313
|
+
L: 231,
|
|
3008
3314
|
S: this,
|
|
3009
3315
|
C: (f, a) => f(...a)
|
|
3010
3316
|
});
|
|
@@ -3015,8 +3321,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3015
3321
|
space: space.key,
|
|
3016
3322
|
open: this._isOpen
|
|
3017
3323
|
}, {
|
|
3018
|
-
F:
|
|
3019
|
-
L:
|
|
3324
|
+
F: __dxlog_file12,
|
|
3325
|
+
L: 238,
|
|
3020
3326
|
S: this,
|
|
3021
3327
|
C: (f, a) => f(...a)
|
|
3022
3328
|
});
|
|
@@ -3028,8 +3334,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3028
3334
|
log10("before space close", {
|
|
3029
3335
|
space: space.key
|
|
3030
3336
|
}, {
|
|
3031
|
-
F:
|
|
3032
|
-
L:
|
|
3337
|
+
F: __dxlog_file12,
|
|
3338
|
+
L: 244,
|
|
3033
3339
|
S: this,
|
|
3034
3340
|
C: (f, a) => f(...a)
|
|
3035
3341
|
});
|
|
@@ -3077,7 +3383,7 @@ import { log as log11 } from "@dxos/log";
|
|
|
3077
3383
|
import { encodeError } from "@dxos/protocols";
|
|
3078
3384
|
import { SpaceMember as SpaceMember2, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3079
3385
|
import { humanize } from "@dxos/util";
|
|
3080
|
-
var
|
|
3386
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3081
3387
|
var SpacesServiceImpl = class {
|
|
3082
3388
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3083
3389
|
this._identityManager = _identityManager;
|
|
@@ -3118,7 +3424,7 @@ var SpacesServiceImpl = class {
|
|
|
3118
3424
|
log11("update", {
|
|
3119
3425
|
spaces
|
|
3120
3426
|
}, {
|
|
3121
|
-
F:
|
|
3427
|
+
F: __dxlog_file13,
|
|
3122
3428
|
L: 78,
|
|
3123
3429
|
S: this,
|
|
3124
3430
|
C: (f, a) => f(...a)
|
|
@@ -3229,14 +3535,20 @@ var SpacesServiceImpl = class {
|
|
|
3229
3535
|
},
|
|
3230
3536
|
members: Array.from(space.inner.spaceState.members.values()).map((member) => {
|
|
3231
3537
|
var _a2, _b2, _c2;
|
|
3538
|
+
const peers = space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key));
|
|
3539
|
+
const isMe = (_a2 = this._identityManager.identity) == null ? void 0 : _a2.identityKey.equals(member.key);
|
|
3540
|
+
if (isMe) {
|
|
3541
|
+
peers.push(space.presence.getLocalState());
|
|
3542
|
+
}
|
|
3232
3543
|
return {
|
|
3233
3544
|
identity: {
|
|
3234
3545
|
identityKey: member.key,
|
|
3235
3546
|
profile: {
|
|
3236
|
-
displayName: (
|
|
3547
|
+
displayName: (_c2 = (_b2 = member.assertion.profile) == null ? void 0 : _b2.displayName) != null ? _c2 : humanize(member.key)
|
|
3237
3548
|
}
|
|
3238
3549
|
},
|
|
3239
|
-
presence:
|
|
3550
|
+
presence: isMe || peers.length > 0 ? SpaceMember2.PresenceState.ONLINE : SpaceMember2.PresenceState.OFFLINE,
|
|
3551
|
+
peerStates: peers
|
|
3240
3552
|
};
|
|
3241
3553
|
}),
|
|
3242
3554
|
creator: (_g = space.inner.spaceState.creator) == null ? void 0 : _g.key,
|
|
@@ -3248,19 +3560,19 @@ var SpacesServiceImpl = class {
|
|
|
3248
3560
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3249
3561
|
|
|
3250
3562
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3251
|
-
import invariant11 from "tiny-invariant";
|
|
3252
3563
|
import { Trigger as Trigger5 } from "@dxos/async";
|
|
3253
3564
|
import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
3254
3565
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
3255
3566
|
import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
|
|
3256
3567
|
import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
3568
|
+
import { invariant as invariant11 } from "@dxos/invariant";
|
|
3257
3569
|
import { Keyring } from "@dxos/keyring";
|
|
3258
3570
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3259
3571
|
import { log as log12 } from "@dxos/log";
|
|
3260
3572
|
import { STORAGE_VERSION, trace as trace5 } from "@dxos/protocols";
|
|
3261
3573
|
import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3262
3574
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3263
|
-
var
|
|
3575
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3264
3576
|
var ServiceContext = class {
|
|
3265
3577
|
// prettier-ignore
|
|
3266
3578
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
@@ -3304,15 +3616,15 @@ var ServiceContext = class {
|
|
|
3304
3616
|
log12.trace("dxos.sdk.service-context.open", trace5.begin({
|
|
3305
3617
|
id: this._instanceId
|
|
3306
3618
|
}), {
|
|
3307
|
-
F:
|
|
3308
|
-
L:
|
|
3619
|
+
F: __dxlog_file14,
|
|
3620
|
+
L: 125,
|
|
3309
3621
|
S: this,
|
|
3310
3622
|
C: (f, a) => f(...a)
|
|
3311
3623
|
});
|
|
3312
3624
|
await this._checkStorageVersion();
|
|
3313
3625
|
log12("opening...", void 0, {
|
|
3314
|
-
F:
|
|
3315
|
-
L:
|
|
3626
|
+
F: __dxlog_file14,
|
|
3627
|
+
L: 129,
|
|
3316
3628
|
S: this,
|
|
3317
3629
|
C: (f, a) => f(...a)
|
|
3318
3630
|
});
|
|
@@ -3324,16 +3636,16 @@ var ServiceContext = class {
|
|
|
3324
3636
|
await this._initialize();
|
|
3325
3637
|
}
|
|
3326
3638
|
log12("opened", void 0, {
|
|
3327
|
-
F:
|
|
3328
|
-
L:
|
|
3639
|
+
F: __dxlog_file14,
|
|
3640
|
+
L: 137,
|
|
3329
3641
|
S: this,
|
|
3330
3642
|
C: (f, a) => f(...a)
|
|
3331
3643
|
});
|
|
3332
3644
|
log12.trace("dxos.sdk.service-context.open", trace5.end({
|
|
3333
3645
|
id: this._instanceId
|
|
3334
3646
|
}), {
|
|
3335
|
-
F:
|
|
3336
|
-
L:
|
|
3647
|
+
F: __dxlog_file14,
|
|
3648
|
+
L: 138,
|
|
3337
3649
|
S: this,
|
|
3338
3650
|
C: (f, a) => f(...a)
|
|
3339
3651
|
});
|
|
@@ -3341,8 +3653,8 @@ var ServiceContext = class {
|
|
|
3341
3653
|
async close() {
|
|
3342
3654
|
var _a;
|
|
3343
3655
|
log12("closing...", void 0, {
|
|
3344
|
-
F:
|
|
3345
|
-
L:
|
|
3656
|
+
F: __dxlog_file14,
|
|
3657
|
+
L: 142,
|
|
3346
3658
|
S: this,
|
|
3347
3659
|
C: (f, a) => f(...a)
|
|
3348
3660
|
});
|
|
@@ -3357,8 +3669,8 @@ var ServiceContext = class {
|
|
|
3357
3669
|
await this.signalManager.close();
|
|
3358
3670
|
this.dataServiceSubscriptions.clear();
|
|
3359
3671
|
log12("closed", void 0, {
|
|
3360
|
-
F:
|
|
3361
|
-
L:
|
|
3672
|
+
F: __dxlog_file14,
|
|
3673
|
+
L: 153,
|
|
3362
3674
|
S: this,
|
|
3363
3675
|
C: (f, a) => f(...a)
|
|
3364
3676
|
});
|
|
@@ -3370,7 +3682,15 @@ var ServiceContext = class {
|
|
|
3370
3682
|
}
|
|
3371
3683
|
getInvitationHandler(invitation) {
|
|
3372
3684
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3373
|
-
invariant11(factory, `Unknown invitation kind: ${invitation.kind}
|
|
3685
|
+
invariant11(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3686
|
+
F: __dxlog_file14,
|
|
3687
|
+
L: 165,
|
|
3688
|
+
S: this,
|
|
3689
|
+
A: [
|
|
3690
|
+
"factory",
|
|
3691
|
+
"`Unknown invitation kind: ${invitation.kind}`"
|
|
3692
|
+
]
|
|
3693
|
+
});
|
|
3374
3694
|
return factory(invitation);
|
|
3375
3695
|
}
|
|
3376
3696
|
async _acceptIdentity(params) {
|
|
@@ -3388,8 +3708,8 @@ var ServiceContext = class {
|
|
|
3388
3708
|
async _initialize() {
|
|
3389
3709
|
var _a;
|
|
3390
3710
|
log12("initializing spaces...", void 0, {
|
|
3391
|
-
F:
|
|
3392
|
-
L:
|
|
3711
|
+
F: __dxlog_file14,
|
|
3712
|
+
L: 186,
|
|
3393
3713
|
S: this,
|
|
3394
3714
|
C: (f, a) => f(...a)
|
|
3395
3715
|
});
|
|
@@ -3410,7 +3730,15 @@ var ServiceContext = class {
|
|
|
3410
3730
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
3411
3731
|
await this.dataSpaceManager.open();
|
|
3412
3732
|
this._handlerFactories.set(Invitation5.Kind.SPACE, (invitation) => {
|
|
3413
|
-
invariant11(this.dataSpaceManager, "dataSpaceManager not initialized yet"
|
|
3733
|
+
invariant11(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
3734
|
+
F: __dxlog_file14,
|
|
3735
|
+
L: 209,
|
|
3736
|
+
S: this,
|
|
3737
|
+
A: [
|
|
3738
|
+
"this.dataSpaceManager",
|
|
3739
|
+
"'dataSpaceManager not initialized yet'"
|
|
3740
|
+
]
|
|
3741
|
+
});
|
|
3414
3742
|
return new SpaceInvitationProtocol(this.dataSpaceManager, signingContext, this.keyring, invitation.spaceKey);
|
|
3415
3743
|
});
|
|
3416
3744
|
this.initialized.wake();
|
|
@@ -3427,8 +3755,8 @@ var ServiceContext = class {
|
|
|
3427
3755
|
log12("dataSpaceManager not initialized yet, ignoring space admission", {
|
|
3428
3756
|
details: assertion
|
|
3429
3757
|
}, {
|
|
3430
|
-
F:
|
|
3431
|
-
L:
|
|
3758
|
+
F: __dxlog_file14,
|
|
3759
|
+
L: 225,
|
|
3432
3760
|
S: this,
|
|
3433
3761
|
C: (f, a) => f(...a)
|
|
3434
3762
|
});
|
|
@@ -3438,8 +3766,8 @@ var ServiceContext = class {
|
|
|
3438
3766
|
log12("space already exists, ignoring space admission", {
|
|
3439
3767
|
details: assertion
|
|
3440
3768
|
}, {
|
|
3441
|
-
F:
|
|
3442
|
-
L:
|
|
3769
|
+
F: __dxlog_file14,
|
|
3770
|
+
L: 229,
|
|
3443
3771
|
S: this,
|
|
3444
3772
|
C: (f, a) => f(...a)
|
|
3445
3773
|
});
|
|
@@ -3449,8 +3777,8 @@ var ServiceContext = class {
|
|
|
3449
3777
|
log12("accepting space recorded in halo", {
|
|
3450
3778
|
details: assertion
|
|
3451
3779
|
}, {
|
|
3452
|
-
F:
|
|
3453
|
-
L:
|
|
3780
|
+
F: __dxlog_file14,
|
|
3781
|
+
L: 234,
|
|
3454
3782
|
S: this,
|
|
3455
3783
|
C: (f, a) => f(...a)
|
|
3456
3784
|
});
|
|
@@ -3460,8 +3788,8 @@ var ServiceContext = class {
|
|
|
3460
3788
|
});
|
|
3461
3789
|
} catch (err) {
|
|
3462
3790
|
log12.catch(err, void 0, {
|
|
3463
|
-
F:
|
|
3464
|
-
L:
|
|
3791
|
+
F: __dxlog_file14,
|
|
3792
|
+
L: 240,
|
|
3465
3793
|
S: this,
|
|
3466
3794
|
C: (f, a) => f(...a)
|
|
3467
3795
|
});
|
|
@@ -3486,7 +3814,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
3486
3814
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3487
3815
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3488
3816
|
}
|
|
3489
|
-
var
|
|
3817
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
|
|
3490
3818
|
var Message;
|
|
3491
3819
|
(function(Message2) {
|
|
3492
3820
|
Message2["ACQUIRING"] = "acquiring";
|
|
@@ -3509,28 +3837,28 @@ var Lock = class {
|
|
|
3509
3837
|
});
|
|
3510
3838
|
try {
|
|
3511
3839
|
log13("aquiring lock...", void 0, {
|
|
3512
|
-
F:
|
|
3840
|
+
F: __dxlog_file15,
|
|
3513
3841
|
L: 42,
|
|
3514
3842
|
S: this,
|
|
3515
3843
|
C: (f, a) => f(...a)
|
|
3516
3844
|
});
|
|
3517
3845
|
await asyncTimeout(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
|
|
3518
3846
|
log13("acquired lock", void 0, {
|
|
3519
|
-
F:
|
|
3847
|
+
F: __dxlog_file15,
|
|
3520
3848
|
L: 44,
|
|
3521
3849
|
S: this,
|
|
3522
3850
|
C: (f, a) => f(...a)
|
|
3523
3851
|
});
|
|
3524
3852
|
} catch (e) {
|
|
3525
3853
|
log13("stealing lock...", void 0, {
|
|
3526
|
-
F:
|
|
3854
|
+
F: __dxlog_file15,
|
|
3527
3855
|
L: 46,
|
|
3528
3856
|
S: this,
|
|
3529
3857
|
C: (f, a) => f(...a)
|
|
3530
3858
|
});
|
|
3531
3859
|
await this._requestLock(true);
|
|
3532
3860
|
log13("stolen lock", void 0, {
|
|
3533
|
-
F:
|
|
3861
|
+
F: __dxlog_file15,
|
|
3534
3862
|
L: 48,
|
|
3535
3863
|
S: this,
|
|
3536
3864
|
C: (f, a) => f(...a)
|
|
@@ -3549,7 +3877,7 @@ var Lock = class {
|
|
|
3549
3877
|
log13("requesting lock...", {
|
|
3550
3878
|
steal
|
|
3551
3879
|
}, {
|
|
3552
|
-
F:
|
|
3880
|
+
F: __dxlog_file15,
|
|
3553
3881
|
L: 63,
|
|
3554
3882
|
S: this,
|
|
3555
3883
|
C: (f, a) => f(...a)
|
|
@@ -3564,14 +3892,14 @@ var Lock = class {
|
|
|
3564
3892
|
this._releaseTrigger = new Trigger6();
|
|
3565
3893
|
await this._releaseTrigger.wait();
|
|
3566
3894
|
log13("releasing lock...", void 0, {
|
|
3567
|
-
F:
|
|
3895
|
+
F: __dxlog_file15,
|
|
3568
3896
|
L: 72,
|
|
3569
3897
|
S: this,
|
|
3570
3898
|
C: (f, a) => f(...a)
|
|
3571
3899
|
});
|
|
3572
3900
|
await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
|
|
3573
3901
|
log13("released lock", void 0, {
|
|
3574
|
-
F:
|
|
3902
|
+
F: __dxlog_file15,
|
|
3575
3903
|
L: 74,
|
|
3576
3904
|
S: this,
|
|
3577
3905
|
C: (f, a) => f(...a)
|
|
@@ -3584,7 +3912,7 @@ var Lock = class {
|
|
|
3584
3912
|
log13("recieved lock", {
|
|
3585
3913
|
steal
|
|
3586
3914
|
}, {
|
|
3587
|
-
F:
|
|
3915
|
+
F: __dxlog_file15,
|
|
3588
3916
|
L: 81,
|
|
3589
3917
|
S: this,
|
|
3590
3918
|
C: (f, a) => f(...a)
|
|
@@ -3672,11 +4000,11 @@ var ServiceRegistry = class {
|
|
|
3672
4000
|
};
|
|
3673
4001
|
|
|
3674
4002
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
3675
|
-
import invariant12 from "tiny-invariant";
|
|
3676
4003
|
import { Event as Event8, synchronized as synchronized3 } from "@dxos/async";
|
|
3677
4004
|
import { clientServiceBundle } from "@dxos/client-protocol";
|
|
3678
4005
|
import { DocumentModel } from "@dxos/document-model";
|
|
3679
4006
|
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
4007
|
+
import { invariant as invariant12 } from "@dxos/invariant";
|
|
3680
4008
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
3681
4009
|
import { log as log15 } from "@dxos/log";
|
|
3682
4010
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
@@ -3931,7 +4259,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3931
4259
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3932
4260
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3933
4261
|
}
|
|
3934
|
-
var
|
|
4262
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
3935
4263
|
var createDefaultModelFactory = () => {
|
|
3936
4264
|
return new ModelFactory().registerModel(DocumentModel).registerModel(TextModel);
|
|
3937
4265
|
};
|
|
@@ -4012,9 +4340,25 @@ var ClientServicesHost = class {
|
|
|
4012
4340
|
*/
|
|
4013
4341
|
initialize({ config, ...options }) {
|
|
4014
4342
|
var _a, _b, _c;
|
|
4015
|
-
invariant12(!this._open, "service host is open"
|
|
4343
|
+
invariant12(!this._open, "service host is open", {
|
|
4344
|
+
F: __dxlog_file16,
|
|
4345
|
+
L: 167,
|
|
4346
|
+
S: this,
|
|
4347
|
+
A: [
|
|
4348
|
+
"!this._open",
|
|
4349
|
+
"'service host is open'"
|
|
4350
|
+
]
|
|
4351
|
+
});
|
|
4016
4352
|
if (config) {
|
|
4017
|
-
invariant12(!this._config, "config already set"
|
|
4353
|
+
invariant12(!this._config, "config already set", {
|
|
4354
|
+
F: __dxlog_file16,
|
|
4355
|
+
L: 170,
|
|
4356
|
+
S: this,
|
|
4357
|
+
A: [
|
|
4358
|
+
"!this._config",
|
|
4359
|
+
"'config already set'"
|
|
4360
|
+
]
|
|
4361
|
+
});
|
|
4018
4362
|
this._config = config;
|
|
4019
4363
|
if (!this._storage) {
|
|
4020
4364
|
this._storage = createStorageObjects(config.get("runtime.client.storage", {})).storage;
|
|
@@ -4024,7 +4368,15 @@ var ClientServicesHost = class {
|
|
|
4024
4368
|
iceServers: (_a = this._config) == null ? void 0 : _a.get("runtime.services.ice")
|
|
4025
4369
|
}), signalManager = new WebsocketSignalManager((_c = (_b = this._config) == null ? void 0 : _b.get("runtime.services.signaling")) != null ? _c : []) } = options;
|
|
4026
4370
|
this._signalManager = signalManager;
|
|
4027
|
-
invariant12(!this._networkManager, "network manager already set"
|
|
4371
|
+
invariant12(!this._networkManager, "network manager already set", {
|
|
4372
|
+
F: __dxlog_file16,
|
|
4373
|
+
L: 187,
|
|
4374
|
+
S: this,
|
|
4375
|
+
A: [
|
|
4376
|
+
"!this._networkManager",
|
|
4377
|
+
"'network manager already set'"
|
|
4378
|
+
]
|
|
4379
|
+
});
|
|
4028
4380
|
this._networkManager = new NetworkManager({
|
|
4029
4381
|
log: connectionLog,
|
|
4030
4382
|
transportFactory,
|
|
@@ -4040,21 +4392,53 @@ var ClientServicesHost = class {
|
|
|
4040
4392
|
log15.trace("dxos.sdk.client-services-host.open", trace6.begin({
|
|
4041
4393
|
id: traceId
|
|
4042
4394
|
}), {
|
|
4043
|
-
F:
|
|
4044
|
-
L:
|
|
4395
|
+
F: __dxlog_file16,
|
|
4396
|
+
L: 202,
|
|
4045
4397
|
S: this,
|
|
4046
4398
|
C: (f, a) => f(...a)
|
|
4047
4399
|
});
|
|
4048
|
-
invariant12(this._config, "config not set"
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4400
|
+
invariant12(this._config, "config not set", {
|
|
4401
|
+
F: __dxlog_file16,
|
|
4402
|
+
L: 204,
|
|
4403
|
+
S: this,
|
|
4404
|
+
A: [
|
|
4405
|
+
"this._config",
|
|
4406
|
+
"'config not set'"
|
|
4407
|
+
]
|
|
4408
|
+
});
|
|
4409
|
+
invariant12(this._storage, "storage not set", {
|
|
4410
|
+
F: __dxlog_file16,
|
|
4411
|
+
L: 205,
|
|
4412
|
+
S: this,
|
|
4413
|
+
A: [
|
|
4414
|
+
"this._storage",
|
|
4415
|
+
"'storage not set'"
|
|
4416
|
+
]
|
|
4417
|
+
});
|
|
4418
|
+
invariant12(this._signalManager, "signal manager not set", {
|
|
4419
|
+
F: __dxlog_file16,
|
|
4420
|
+
L: 206,
|
|
4421
|
+
S: this,
|
|
4422
|
+
A: [
|
|
4423
|
+
"this._signalManager",
|
|
4424
|
+
"'signal manager not set'"
|
|
4425
|
+
]
|
|
4426
|
+
});
|
|
4427
|
+
invariant12(this._networkManager, "network manager not set", {
|
|
4428
|
+
F: __dxlog_file16,
|
|
4429
|
+
L: 207,
|
|
4430
|
+
S: this,
|
|
4431
|
+
A: [
|
|
4432
|
+
"this._networkManager",
|
|
4433
|
+
"'network manager not set'"
|
|
4434
|
+
]
|
|
4435
|
+
});
|
|
4052
4436
|
this._opening = true;
|
|
4053
4437
|
log15("opening...", {
|
|
4054
4438
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
4055
4439
|
}, {
|
|
4056
|
-
F:
|
|
4057
|
-
L:
|
|
4440
|
+
F: __dxlog_file16,
|
|
4441
|
+
L: 210,
|
|
4058
4442
|
S: this,
|
|
4059
4443
|
C: (f, a) => f(...a)
|
|
4060
4444
|
});
|
|
@@ -4088,16 +4472,16 @@ var ClientServicesHost = class {
|
|
|
4088
4472
|
log15("opened", {
|
|
4089
4473
|
deviceKey
|
|
4090
4474
|
}, {
|
|
4091
|
-
F:
|
|
4092
|
-
L:
|
|
4475
|
+
F: __dxlog_file16,
|
|
4476
|
+
L: 265,
|
|
4093
4477
|
S: this,
|
|
4094
4478
|
C: (f, a) => f(...a)
|
|
4095
4479
|
});
|
|
4096
4480
|
log15.trace("dxos.sdk.client-services-host.open", trace6.end({
|
|
4097
4481
|
id: traceId
|
|
4098
4482
|
}), {
|
|
4099
|
-
F:
|
|
4100
|
-
L:
|
|
4483
|
+
F: __dxlog_file16,
|
|
4484
|
+
L: 266,
|
|
4101
4485
|
S: this,
|
|
4102
4486
|
C: (f, a) => f(...a)
|
|
4103
4487
|
});
|
|
@@ -4111,8 +4495,8 @@ var ClientServicesHost = class {
|
|
|
4111
4495
|
log15("closing...", {
|
|
4112
4496
|
deviceKey
|
|
4113
4497
|
}, {
|
|
4114
|
-
F:
|
|
4115
|
-
L:
|
|
4498
|
+
F: __dxlog_file16,
|
|
4499
|
+
L: 276,
|
|
4116
4500
|
S: this,
|
|
4117
4501
|
C: (f, a) => f(...a)
|
|
4118
4502
|
});
|
|
@@ -4126,8 +4510,8 @@ var ClientServicesHost = class {
|
|
|
4126
4510
|
log15("closed", {
|
|
4127
4511
|
deviceKey
|
|
4128
4512
|
}, {
|
|
4129
|
-
F:
|
|
4130
|
-
L:
|
|
4513
|
+
F: __dxlog_file16,
|
|
4514
|
+
L: 282,
|
|
4131
4515
|
S: this,
|
|
4132
4516
|
C: (f, a) => f(...a)
|
|
4133
4517
|
});
|
|
@@ -4138,30 +4522,30 @@ var ClientServicesHost = class {
|
|
|
4138
4522
|
log15.trace("dxos.sdk.client-services-host.reset", trace6.begin({
|
|
4139
4523
|
id: traceId
|
|
4140
4524
|
}), {
|
|
4141
|
-
F:
|
|
4142
|
-
L:
|
|
4525
|
+
F: __dxlog_file16,
|
|
4526
|
+
L: 287,
|
|
4143
4527
|
S: this,
|
|
4144
4528
|
C: (f, a) => f(...a)
|
|
4145
4529
|
});
|
|
4146
4530
|
log15("resetting...", void 0, {
|
|
4147
|
-
F:
|
|
4148
|
-
L:
|
|
4531
|
+
F: __dxlog_file16,
|
|
4532
|
+
L: 289,
|
|
4149
4533
|
S: this,
|
|
4150
4534
|
C: (f, a) => f(...a)
|
|
4151
4535
|
});
|
|
4152
4536
|
await ((_a = this._serviceContext) == null ? void 0 : _a.close());
|
|
4153
4537
|
await this._storage.reset();
|
|
4154
4538
|
log15("reset", void 0, {
|
|
4155
|
-
F:
|
|
4156
|
-
L:
|
|
4539
|
+
F: __dxlog_file16,
|
|
4540
|
+
L: 292,
|
|
4157
4541
|
S: this,
|
|
4158
4542
|
C: (f, a) => f(...a)
|
|
4159
4543
|
});
|
|
4160
4544
|
log15.trace("dxos.sdk.client-services-host.reset", trace6.end({
|
|
4161
4545
|
id: traceId
|
|
4162
4546
|
}), {
|
|
4163
|
-
F:
|
|
4164
|
-
L:
|
|
4547
|
+
F: __dxlog_file16,
|
|
4548
|
+
L: 293,
|
|
4165
4549
|
S: this,
|
|
4166
4550
|
C: (f, a) => f(...a)
|
|
4167
4551
|
});
|
|
@@ -4207,4 +4591,4 @@ export {
|
|
|
4207
4591
|
createDefaultModelFactory,
|
|
4208
4592
|
ClientServicesHost
|
|
4209
4593
|
};
|
|
4210
|
-
//# sourceMappingURL=chunk-
|
|
4594
|
+
//# sourceMappingURL=chunk-FD4L7N4K.mjs.map
|