@dxos/client-services 0.3.2-main.d77d2bc → 0.3.2-main.ec06501
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-WOH6JPED.mjs → chunk-KLSDV4XQ.mjs} +62 -115
- package/dist/lib/browser/chunk-KLSDV4XQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +105 -148
- 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 +81 -124
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devices/devices-service.d.ts +2 -2
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +0 -4
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +37 -35
- package/src/packlets/devices/devices-service.ts +3 -15
- package/src/packlets/identity/identity-manager.test.ts +6 -5
- package/src/packlets/identity/identity-manager.ts +12 -20
- package/src/packlets/identity/identity.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-WOH6JPED.mjs.map +0 -7
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// packages/sdk/client-services/src/packlets/testing/index.ts
|
|
@@ -52,7 +62,7 @@ var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.
|
|
|
52
62
|
|
|
53
63
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
54
64
|
var import_async18 = require("@dxos/async");
|
|
55
|
-
var
|
|
65
|
+
var import_invariant16 = require("@dxos/invariant");
|
|
56
66
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
57
67
|
|
|
58
68
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
@@ -87,10 +97,10 @@ var getPlatform = () => {
|
|
|
87
97
|
};
|
|
88
98
|
}
|
|
89
99
|
} else {
|
|
90
|
-
const { platform, version, arch } = process;
|
|
100
|
+
const { platform: platform2, version, arch } = process;
|
|
91
101
|
return {
|
|
92
102
|
type: "node",
|
|
93
|
-
platform: `${
|
|
103
|
+
platform: `${platform2} ${version} ${arch}`,
|
|
94
104
|
runtime: process.version,
|
|
95
105
|
uptime: Math.floor(process.uptime()),
|
|
96
106
|
memory: process.memoryUsage()
|
|
@@ -99,7 +109,7 @@ var getPlatform = () => {
|
|
|
99
109
|
};
|
|
100
110
|
|
|
101
111
|
// packages/sdk/client-services/src/version.ts
|
|
102
|
-
var DXOS_VERSION = "0.3.2-main.
|
|
112
|
+
var DXOS_VERSION = "0.3.2-main.ec06501";
|
|
103
113
|
|
|
104
114
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
105
115
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -533,6 +543,7 @@ Identity = _ts_decorate([
|
|
|
533
543
|
], Identity);
|
|
534
544
|
|
|
535
545
|
// packages/sdk/client-services/src/packlets/identity/identity-manager.ts
|
|
546
|
+
var import_platform2 = __toESM(require("platform"));
|
|
536
547
|
var import_async3 = require("@dxos/async");
|
|
537
548
|
var import_context2 = require("@dxos/context");
|
|
538
549
|
var import_credentials6 = require("@dxos/credentials");
|
|
@@ -574,7 +585,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
574
585
|
id: traceId
|
|
575
586
|
}), {
|
|
576
587
|
F: __dxlog_file4,
|
|
577
|
-
L:
|
|
588
|
+
L: 75,
|
|
578
589
|
S: this,
|
|
579
590
|
C: (f, a) => f(...a)
|
|
580
591
|
});
|
|
@@ -583,7 +594,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
583
594
|
identityRecord
|
|
584
595
|
}, {
|
|
585
596
|
F: __dxlog_file4,
|
|
586
|
-
L:
|
|
597
|
+
L: 78,
|
|
587
598
|
S: this,
|
|
588
599
|
C: (f, a) => f(...a)
|
|
589
600
|
});
|
|
@@ -596,7 +607,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
596
607
|
displayName: this._identity.profileDocument?.displayName
|
|
597
608
|
}, {
|
|
598
609
|
F: __dxlog_file4,
|
|
599
|
-
L:
|
|
610
|
+
L: 83,
|
|
600
611
|
S: this,
|
|
601
612
|
C: (f, a) => f(...a)
|
|
602
613
|
});
|
|
@@ -606,7 +617,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
606
617
|
id: traceId
|
|
607
618
|
}), {
|
|
608
619
|
F: __dxlog_file4,
|
|
609
|
-
L:
|
|
620
|
+
L: 89,
|
|
610
621
|
S: this,
|
|
611
622
|
C: (f, a) => f(...a)
|
|
612
623
|
});
|
|
@@ -617,7 +628,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
617
628
|
async createIdentity({ displayName } = {}) {
|
|
618
629
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
619
630
|
F: __dxlog_file4,
|
|
620
|
-
L:
|
|
631
|
+
L: 97,
|
|
621
632
|
S: this,
|
|
622
633
|
A: [
|
|
623
634
|
"!this._identity",
|
|
@@ -626,7 +637,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
626
637
|
});
|
|
627
638
|
(0, import_log4.log)("creating identity...", void 0, {
|
|
628
639
|
F: __dxlog_file4,
|
|
629
|
-
L:
|
|
640
|
+
L: 98,
|
|
630
641
|
S: this,
|
|
631
642
|
C: (f, a) => f(...a)
|
|
632
643
|
});
|
|
@@ -647,7 +658,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
647
658
|
const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
648
659
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
649
660
|
F: __dxlog_file4,
|
|
650
|
-
L:
|
|
661
|
+
L: 117,
|
|
651
662
|
S: this,
|
|
652
663
|
A: [
|
|
653
664
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -656,7 +667,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
656
667
|
});
|
|
657
668
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
658
669
|
F: __dxlog_file4,
|
|
659
|
-
L:
|
|
670
|
+
L: 118,
|
|
660
671
|
S: this,
|
|
661
672
|
A: [
|
|
662
673
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -675,6 +686,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
675
686
|
}));
|
|
676
687
|
}
|
|
677
688
|
credentials.push(await generator.createDeviceAuthorization(identityRecord.deviceKey));
|
|
689
|
+
credentials.push(await generator.createDeviceProfile({
|
|
690
|
+
platform: import_platform2.default.name,
|
|
691
|
+
platformVersion: import_platform2.default.version,
|
|
692
|
+
architecture: typeof import_platform2.default.os?.architecture === "number" ? String(import_platform2.default.os.architecture) : void 0,
|
|
693
|
+
os: import_platform2.default.os?.family,
|
|
694
|
+
osVersion: import_platform2.default.os?.version
|
|
695
|
+
}));
|
|
678
696
|
for (const credential of credentials) {
|
|
679
697
|
await identity.controlPipeline.writer.write({
|
|
680
698
|
credential: {
|
|
@@ -691,7 +709,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
691
709
|
displayName: this._identity.profileDocument?.displayName
|
|
692
710
|
}, {
|
|
693
711
|
F: __dxlog_file4,
|
|
694
|
-
L:
|
|
712
|
+
L: 163,
|
|
695
713
|
S: this,
|
|
696
714
|
C: (f, a) => f(...a)
|
|
697
715
|
});
|
|
@@ -701,7 +719,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
701
719
|
deviceKey: identity.deviceKey
|
|
702
720
|
}, {
|
|
703
721
|
F: __dxlog_file4,
|
|
704
|
-
L:
|
|
722
|
+
L: 169,
|
|
705
723
|
S: this,
|
|
706
724
|
C: (f, a) => f(...a)
|
|
707
725
|
});
|
|
@@ -715,13 +733,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
715
733
|
params
|
|
716
734
|
}, {
|
|
717
735
|
F: __dxlog_file4,
|
|
718
|
-
L:
|
|
736
|
+
L: 177,
|
|
719
737
|
S: this,
|
|
720
738
|
C: (f, a) => f(...a)
|
|
721
739
|
});
|
|
722
740
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
723
741
|
F: __dxlog_file4,
|
|
724
|
-
L:
|
|
742
|
+
L: 178,
|
|
725
743
|
S: this,
|
|
726
744
|
A: [
|
|
727
745
|
"!this._identity",
|
|
@@ -749,7 +767,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
749
767
|
displayName: this._identity.profileDocument?.displayName
|
|
750
768
|
}, {
|
|
751
769
|
F: __dxlog_file4,
|
|
752
|
-
L:
|
|
770
|
+
L: 197,
|
|
753
771
|
S: this,
|
|
754
772
|
C: (f, a) => f(...a)
|
|
755
773
|
});
|
|
@@ -759,7 +777,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
759
777
|
deviceKey: identity.deviceKey
|
|
760
778
|
}, {
|
|
761
779
|
F: __dxlog_file4,
|
|
762
|
-
L:
|
|
780
|
+
L: 203,
|
|
763
781
|
S: this,
|
|
764
782
|
C: (f, a) => f(...a)
|
|
765
783
|
});
|
|
@@ -771,7 +789,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
771
789
|
async updateProfile(profile) {
|
|
772
790
|
(0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
|
|
773
791
|
F: __dxlog_file4,
|
|
774
|
-
L:
|
|
792
|
+
L: 211,
|
|
775
793
|
S: this,
|
|
776
794
|
A: [
|
|
777
795
|
"this._identity",
|
|
@@ -799,51 +817,10 @@ var IdentityManager = class IdentityManager2 {
|
|
|
799
817
|
this.stateUpdate.emit();
|
|
800
818
|
return profile;
|
|
801
819
|
}
|
|
802
|
-
async updateDevice({ deviceKey, profile }) {
|
|
803
|
-
(0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
|
|
804
|
-
F: __dxlog_file4,
|
|
805
|
-
L: 216,
|
|
806
|
-
S: this,
|
|
807
|
-
A: [
|
|
808
|
-
"this._identity",
|
|
809
|
-
"'Identity not initialized.'"
|
|
810
|
-
]
|
|
811
|
-
});
|
|
812
|
-
(0, import_invariant3.invariant)(this._identity.authorizedDeviceKeys.has(deviceKey), "Device not authorized.", {
|
|
813
|
-
F: __dxlog_file4,
|
|
814
|
-
L: 218,
|
|
815
|
-
S: this,
|
|
816
|
-
A: [
|
|
817
|
-
"this._identity.authorizedDeviceKeys.has(deviceKey)",
|
|
818
|
-
"'Device not authorized.'"
|
|
819
|
-
]
|
|
820
|
-
});
|
|
821
|
-
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
822
|
-
subject: this._identity.identityKey,
|
|
823
|
-
assertion: {
|
|
824
|
-
"@type": "dxos.halo.credentials.DeviceProfile",
|
|
825
|
-
deviceKey,
|
|
826
|
-
profile
|
|
827
|
-
}
|
|
828
|
-
});
|
|
829
|
-
const receipt = await this._identity.controlPipeline.writer.write({
|
|
830
|
-
credential: {
|
|
831
|
-
credential
|
|
832
|
-
}
|
|
833
|
-
});
|
|
834
|
-
await this._identity.controlPipeline.state.waitUntilTimeframe(new import_timeframe.Timeframe([
|
|
835
|
-
[
|
|
836
|
-
receipt.feedKey,
|
|
837
|
-
receipt.seq
|
|
838
|
-
]
|
|
839
|
-
]));
|
|
840
|
-
this.stateUpdate.emit();
|
|
841
|
-
return profile;
|
|
842
|
-
}
|
|
843
820
|
async _constructIdentity(identityRecord) {
|
|
844
821
|
(0, import_invariant3.invariant)(!this._identity, void 0, {
|
|
845
822
|
F: __dxlog_file4,
|
|
846
|
-
L:
|
|
823
|
+
L: 228,
|
|
847
824
|
S: this,
|
|
848
825
|
A: [
|
|
849
826
|
"!this._identity",
|
|
@@ -854,13 +831,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
854
831
|
identityRecord
|
|
855
832
|
}, {
|
|
856
833
|
F: __dxlog_file4,
|
|
857
|
-
L:
|
|
834
|
+
L: 229,
|
|
858
835
|
S: this,
|
|
859
836
|
C: (f, a) => f(...a)
|
|
860
837
|
});
|
|
861
838
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
862
839
|
F: __dxlog_file4,
|
|
863
|
-
L:
|
|
840
|
+
L: 232,
|
|
864
841
|
S: this,
|
|
865
842
|
A: [
|
|
866
843
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -872,7 +849,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
872
849
|
});
|
|
873
850
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
874
851
|
F: __dxlog_file4,
|
|
875
|
-
L:
|
|
852
|
+
L: 236,
|
|
876
853
|
S: this,
|
|
877
854
|
A: [
|
|
878
855
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -904,7 +881,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
904
881
|
identityKey: identityRecord.identityKey
|
|
905
882
|
}, {
|
|
906
883
|
F: __dxlog_file4,
|
|
907
|
-
L:
|
|
884
|
+
L: 260,
|
|
908
885
|
S: this,
|
|
909
886
|
C: (f, a) => f(...a)
|
|
910
887
|
});
|
|
@@ -925,7 +902,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
925
902
|
onAuthFailure: () => {
|
|
926
903
|
import_log4.log.warn("auth failure", void 0, {
|
|
927
904
|
F: __dxlog_file4,
|
|
928
|
-
L:
|
|
905
|
+
L: 279,
|
|
929
906
|
S: this,
|
|
930
907
|
C: (f, a) => f(...a)
|
|
931
908
|
});
|
|
@@ -3880,7 +3857,7 @@ var import_context10 = require("@dxos/context");
|
|
|
3880
3857
|
var import_document_model2 = require("@dxos/document-model");
|
|
3881
3858
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
3882
3859
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
3883
|
-
var
|
|
3860
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
3884
3861
|
var import_keys13 = require("@dxos/keys");
|
|
3885
3862
|
var import_log16 = require("@dxos/log");
|
|
3886
3863
|
var import_messaging = require("@dxos/messaging");
|
|
@@ -3919,33 +3896,13 @@ var ServiceRegistry = class {
|
|
|
3919
3896
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3920
3897
|
var import_async12 = require("@dxos/async");
|
|
3921
3898
|
var import_codec_protobuf6 = require("@dxos/codec-protobuf");
|
|
3922
|
-
var import_invariant14 = require("@dxos/invariant");
|
|
3923
3899
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3924
|
-
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
|
|
3925
3900
|
var DevicesServiceImpl = class {
|
|
3926
3901
|
constructor(_identityManager) {
|
|
3927
3902
|
this._identityManager = _identityManager;
|
|
3928
3903
|
}
|
|
3929
3904
|
async updateDevice(profile) {
|
|
3930
|
-
|
|
3931
|
-
F: __dxlog_file16,
|
|
3932
|
-
L: 17,
|
|
3933
|
-
S: this,
|
|
3934
|
-
A: [
|
|
3935
|
-
"this._identityManager.identity",
|
|
3936
|
-
"'Identity not initialized'"
|
|
3937
|
-
]
|
|
3938
|
-
});
|
|
3939
|
-
const deviceKey = this._identityManager.identity.deviceKey;
|
|
3940
|
-
await this._identityManager.updateDevice({
|
|
3941
|
-
deviceKey,
|
|
3942
|
-
profile
|
|
3943
|
-
});
|
|
3944
|
-
return {
|
|
3945
|
-
deviceKey,
|
|
3946
|
-
kind: import_services11.DeviceKind.CURRENT,
|
|
3947
|
-
profile
|
|
3948
|
-
};
|
|
3905
|
+
throw new Error("Method not implemented.");
|
|
3949
3906
|
}
|
|
3950
3907
|
queryDevices() {
|
|
3951
3908
|
return new import_codec_protobuf6.Stream(({ next }) => {
|
|
@@ -4289,7 +4246,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4289
4246
|
};
|
|
4290
4247
|
|
|
4291
4248
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4292
|
-
var
|
|
4249
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
4293
4250
|
var import_lock_file = require("@dxos/lock-file");
|
|
4294
4251
|
var import_log14 = require("@dxos/log");
|
|
4295
4252
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4302,7 +4259,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4302
4259
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4303
4260
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4304
4261
|
}
|
|
4305
|
-
var
|
|
4262
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4306
4263
|
var Lock = class {
|
|
4307
4264
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4308
4265
|
this._lockPath = lockPath;
|
|
@@ -4314,7 +4271,7 @@ var Lock = class {
|
|
|
4314
4271
|
}
|
|
4315
4272
|
async acquire() {
|
|
4316
4273
|
(0, import_log14.log)("acquiring lock...", void 0, {
|
|
4317
|
-
F:
|
|
4274
|
+
F: __dxlog_file16,
|
|
4318
4275
|
L: 32,
|
|
4319
4276
|
S: this,
|
|
4320
4277
|
C: (f, a) => f(...a)
|
|
@@ -4322,7 +4279,7 @@ var Lock = class {
|
|
|
4322
4279
|
this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
|
|
4323
4280
|
await this._onAcquire?.();
|
|
4324
4281
|
(0, import_log14.log)("acquired lock", void 0, {
|
|
4325
|
-
F:
|
|
4282
|
+
F: __dxlog_file16,
|
|
4326
4283
|
L: 37,
|
|
4327
4284
|
S: this,
|
|
4328
4285
|
C: (f, a) => f(...a)
|
|
@@ -4330,8 +4287,8 @@ var Lock = class {
|
|
|
4330
4287
|
}
|
|
4331
4288
|
async release() {
|
|
4332
4289
|
await this._onRelease?.();
|
|
4333
|
-
(0,
|
|
4334
|
-
F:
|
|
4290
|
+
(0, import_invariant14.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4291
|
+
F: __dxlog_file16,
|
|
4335
4292
|
L: 42,
|
|
4336
4293
|
S: this,
|
|
4337
4294
|
A: [
|
|
@@ -4609,7 +4566,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4609
4566
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4610
4567
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4611
4568
|
}
|
|
4612
|
-
var
|
|
4569
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4613
4570
|
var createDefaultModelFactory = () => {
|
|
4614
4571
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4615
4572
|
};
|
|
@@ -4709,8 +4666,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4709
4666
|
* Can only be called once.
|
|
4710
4667
|
*/
|
|
4711
4668
|
initialize({ config, ...options }) {
|
|
4712
|
-
(0,
|
|
4713
|
-
F:
|
|
4669
|
+
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4670
|
+
F: __dxlog_file17,
|
|
4714
4671
|
L: 201,
|
|
4715
4672
|
S: this,
|
|
4716
4673
|
A: [
|
|
@@ -4719,14 +4676,14 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4719
4676
|
]
|
|
4720
4677
|
});
|
|
4721
4678
|
(0, import_log16.log)("initializing...", void 0, {
|
|
4722
|
-
F:
|
|
4679
|
+
F: __dxlog_file17,
|
|
4723
4680
|
L: 202,
|
|
4724
4681
|
S: this,
|
|
4725
4682
|
C: (f, a) => f(...a)
|
|
4726
4683
|
});
|
|
4727
4684
|
if (config) {
|
|
4728
|
-
(0,
|
|
4729
|
-
F:
|
|
4685
|
+
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4686
|
+
F: __dxlog_file17,
|
|
4730
4687
|
L: 205,
|
|
4731
4688
|
S: this,
|
|
4732
4689
|
A: [
|
|
@@ -4743,8 +4700,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4743
4700
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4744
4701
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4745
4702
|
this._signalManager = signalManager;
|
|
4746
|
-
(0,
|
|
4747
|
-
F:
|
|
4703
|
+
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4704
|
+
F: __dxlog_file17,
|
|
4748
4705
|
L: 221,
|
|
4749
4706
|
S: this,
|
|
4750
4707
|
A: [
|
|
@@ -4758,7 +4715,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4758
4715
|
signalManager
|
|
4759
4716
|
});
|
|
4760
4717
|
(0, import_log16.log)("initialized", void 0, {
|
|
4761
|
-
F:
|
|
4718
|
+
F: __dxlog_file17,
|
|
4762
4719
|
L: 228,
|
|
4763
4720
|
S: this,
|
|
4764
4721
|
C: (f, a) => f(...a)
|
|
@@ -4772,13 +4729,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4772
4729
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4773
4730
|
id: traceId
|
|
4774
4731
|
}), {
|
|
4775
|
-
F:
|
|
4732
|
+
F: __dxlog_file17,
|
|
4776
4733
|
L: 239,
|
|
4777
4734
|
S: this,
|
|
4778
4735
|
C: (f, a) => f(...a)
|
|
4779
4736
|
});
|
|
4780
|
-
(0,
|
|
4781
|
-
F:
|
|
4737
|
+
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4738
|
+
F: __dxlog_file17,
|
|
4782
4739
|
L: 241,
|
|
4783
4740
|
S: this,
|
|
4784
4741
|
A: [
|
|
@@ -4786,8 +4743,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4786
4743
|
"'config not set'"
|
|
4787
4744
|
]
|
|
4788
4745
|
});
|
|
4789
|
-
(0,
|
|
4790
|
-
F:
|
|
4746
|
+
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4747
|
+
F: __dxlog_file17,
|
|
4791
4748
|
L: 242,
|
|
4792
4749
|
S: this,
|
|
4793
4750
|
A: [
|
|
@@ -4795,8 +4752,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4795
4752
|
"'storage not set'"
|
|
4796
4753
|
]
|
|
4797
4754
|
});
|
|
4798
|
-
(0,
|
|
4799
|
-
F:
|
|
4755
|
+
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4756
|
+
F: __dxlog_file17,
|
|
4800
4757
|
L: 243,
|
|
4801
4758
|
S: this,
|
|
4802
4759
|
A: [
|
|
@@ -4804,8 +4761,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4804
4761
|
"'signal manager not set'"
|
|
4805
4762
|
]
|
|
4806
4763
|
});
|
|
4807
|
-
(0,
|
|
4808
|
-
F:
|
|
4764
|
+
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4765
|
+
F: __dxlog_file17,
|
|
4809
4766
|
L: 244,
|
|
4810
4767
|
S: this,
|
|
4811
4768
|
A: [
|
|
@@ -4817,7 +4774,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4817
4774
|
(0, import_log16.log)("opening...", {
|
|
4818
4775
|
lockKey: this._resourceLock?.lockKey
|
|
4819
4776
|
}, {
|
|
4820
|
-
F:
|
|
4777
|
+
F: __dxlog_file17,
|
|
4821
4778
|
L: 247,
|
|
4822
4779
|
S: this,
|
|
4823
4780
|
C: (f, a) => f(...a)
|
|
@@ -4863,7 +4820,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4863
4820
|
(0, import_log16.log)("opened", {
|
|
4864
4821
|
deviceKey
|
|
4865
4822
|
}, {
|
|
4866
|
-
F:
|
|
4823
|
+
F: __dxlog_file17,
|
|
4867
4824
|
L: 316,
|
|
4868
4825
|
S: this,
|
|
4869
4826
|
C: (f, a) => f(...a)
|
|
@@ -4871,7 +4828,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4871
4828
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4872
4829
|
id: traceId
|
|
4873
4830
|
}), {
|
|
4874
|
-
F:
|
|
4831
|
+
F: __dxlog_file17,
|
|
4875
4832
|
L: 317,
|
|
4876
4833
|
S: this,
|
|
4877
4834
|
C: (f, a) => f(...a)
|
|
@@ -4885,7 +4842,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4885
4842
|
(0, import_log16.log)("closing...", {
|
|
4886
4843
|
deviceKey
|
|
4887
4844
|
}, {
|
|
4888
|
-
F:
|
|
4845
|
+
F: __dxlog_file17,
|
|
4889
4846
|
L: 328,
|
|
4890
4847
|
S: this,
|
|
4891
4848
|
C: (f, a) => f(...a)
|
|
@@ -4901,7 +4858,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4901
4858
|
(0, import_log16.log)("closed", {
|
|
4902
4859
|
deviceKey
|
|
4903
4860
|
}, {
|
|
4904
|
-
F:
|
|
4861
|
+
F: __dxlog_file17,
|
|
4905
4862
|
L: 335,
|
|
4906
4863
|
S: this,
|
|
4907
4864
|
C: (f, a) => f(...a)
|
|
@@ -4912,13 +4869,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4912
4869
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4913
4870
|
id: traceId
|
|
4914
4871
|
}), {
|
|
4915
|
-
F:
|
|
4872
|
+
F: __dxlog_file17,
|
|
4916
4873
|
L: 340,
|
|
4917
4874
|
S: this,
|
|
4918
4875
|
C: (f, a) => f(...a)
|
|
4919
4876
|
});
|
|
4920
4877
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4921
|
-
F:
|
|
4878
|
+
F: __dxlog_file17,
|
|
4922
4879
|
L: 342,
|
|
4923
4880
|
S: this,
|
|
4924
4881
|
C: (f, a) => f(...a)
|
|
@@ -4926,7 +4883,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4926
4883
|
await this._serviceContext?.close();
|
|
4927
4884
|
await this._storage.reset();
|
|
4928
4885
|
(0, import_log16.log)("reset", void 0, {
|
|
4929
|
-
F:
|
|
4886
|
+
F: __dxlog_file17,
|
|
4930
4887
|
L: 345,
|
|
4931
4888
|
S: this,
|
|
4932
4889
|
C: (f, a) => f(...a)
|
|
@@ -4934,7 +4891,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4934
4891
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4935
4892
|
id: traceId
|
|
4936
4893
|
}), {
|
|
4937
|
-
F:
|
|
4894
|
+
F: __dxlog_file17,
|
|
4938
4895
|
L: 346,
|
|
4939
4896
|
S: this,
|
|
4940
4897
|
C: (f, a) => f(...a)
|
|
@@ -4980,7 +4937,7 @@ ClientServicesHost = _ts_decorate7([
|
|
|
4980
4937
|
], ClientServicesHost);
|
|
4981
4938
|
|
|
4982
4939
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
4983
|
-
var
|
|
4940
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
|
|
4984
4941
|
var sanitizeInvitation = (invitation) => {
|
|
4985
4942
|
return {
|
|
4986
4943
|
invitationId: invitation.invitationId,
|
|
@@ -5010,8 +4967,8 @@ var performInvitation = ({ host, guest, options, hooks }) => {
|
|
|
5010
4967
|
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
5011
4968
|
break;
|
|
5012
4969
|
}
|
|
5013
|
-
(0,
|
|
5014
|
-
F:
|
|
4970
|
+
(0, import_invariant16.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
4971
|
+
F: __dxlog_file18,
|
|
5015
4972
|
L: 84,
|
|
5016
4973
|
S: void 0,
|
|
5017
4974
|
A: [
|