@dxos/client-services 0.3.2-main.ce2190e → 0.3.2-main.d3a33b8
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-ZGPBGQ4M.mjs → chunk-543AQCXG.mjs} +72 -126
- package/dist/lib/browser/chunk-543AQCXG.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 +115 -159
- 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 +91 -135
- 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/packlets/invitations/invitations-service.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 +4 -2
- package/src/packlets/invitations/invitations-service.ts +0 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-ZGPBGQ4M.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.d3a33b8";
|
|
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";
|
|
@@ -381,6 +391,14 @@ var Identity = class Identity2 {
|
|
|
381
391
|
this._signer = signer;
|
|
382
392
|
this.identityKey = identityKey;
|
|
383
393
|
this.deviceKey = deviceKey;
|
|
394
|
+
import_log3.log.trace("dxos.halo.device", {
|
|
395
|
+
deviceKey
|
|
396
|
+
}, {
|
|
397
|
+
F: __dxlog_file3,
|
|
398
|
+
L: 60,
|
|
399
|
+
S: this,
|
|
400
|
+
C: (f, a) => f(...a)
|
|
401
|
+
});
|
|
384
402
|
this._deviceStateMachine = new import_credentials4.DeviceStateMachine({
|
|
385
403
|
identityKey: this.identityKey,
|
|
386
404
|
deviceKey: this.deviceKey,
|
|
@@ -449,7 +467,7 @@ var Identity = class Identity2 {
|
|
|
449
467
|
getIdentityCredentialSigner() {
|
|
450
468
|
(0, import_invariant2.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
451
469
|
F: __dxlog_file3,
|
|
452
|
-
L:
|
|
470
|
+
L: 141,
|
|
453
471
|
S: this,
|
|
454
472
|
A: [
|
|
455
473
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -473,7 +491,7 @@ var Identity = class Identity2 {
|
|
|
473
491
|
dataFeedKey
|
|
474
492
|
}, {
|
|
475
493
|
F: __dxlog_file3,
|
|
476
|
-
L:
|
|
494
|
+
L: 157,
|
|
477
495
|
S: this,
|
|
478
496
|
C: (f, a) => f(...a)
|
|
479
497
|
});
|
|
@@ -525,6 +543,7 @@ Identity = _ts_decorate([
|
|
|
525
543
|
], Identity);
|
|
526
544
|
|
|
527
545
|
// packages/sdk/client-services/src/packlets/identity/identity-manager.ts
|
|
546
|
+
var import_platform2 = __toESM(require("platform"));
|
|
528
547
|
var import_async3 = require("@dxos/async");
|
|
529
548
|
var import_context2 = require("@dxos/context");
|
|
530
549
|
var import_credentials6 = require("@dxos/credentials");
|
|
@@ -566,7 +585,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
566
585
|
id: traceId
|
|
567
586
|
}), {
|
|
568
587
|
F: __dxlog_file4,
|
|
569
|
-
L:
|
|
588
|
+
L: 75,
|
|
570
589
|
S: this,
|
|
571
590
|
C: (f, a) => f(...a)
|
|
572
591
|
});
|
|
@@ -575,7 +594,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
575
594
|
identityRecord
|
|
576
595
|
}, {
|
|
577
596
|
F: __dxlog_file4,
|
|
578
|
-
L:
|
|
597
|
+
L: 78,
|
|
579
598
|
S: this,
|
|
580
599
|
C: (f, a) => f(...a)
|
|
581
600
|
});
|
|
@@ -588,7 +607,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
588
607
|
displayName: this._identity.profileDocument?.displayName
|
|
589
608
|
}, {
|
|
590
609
|
F: __dxlog_file4,
|
|
591
|
-
L:
|
|
610
|
+
L: 83,
|
|
592
611
|
S: this,
|
|
593
612
|
C: (f, a) => f(...a)
|
|
594
613
|
});
|
|
@@ -598,7 +617,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
598
617
|
id: traceId
|
|
599
618
|
}), {
|
|
600
619
|
F: __dxlog_file4,
|
|
601
|
-
L:
|
|
620
|
+
L: 89,
|
|
602
621
|
S: this,
|
|
603
622
|
C: (f, a) => f(...a)
|
|
604
623
|
});
|
|
@@ -609,7 +628,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
609
628
|
async createIdentity({ displayName } = {}) {
|
|
610
629
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
611
630
|
F: __dxlog_file4,
|
|
612
|
-
L:
|
|
631
|
+
L: 97,
|
|
613
632
|
S: this,
|
|
614
633
|
A: [
|
|
615
634
|
"!this._identity",
|
|
@@ -618,7 +637,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
618
637
|
});
|
|
619
638
|
(0, import_log4.log)("creating identity...", void 0, {
|
|
620
639
|
F: __dxlog_file4,
|
|
621
|
-
L:
|
|
640
|
+
L: 98,
|
|
622
641
|
S: this,
|
|
623
642
|
C: (f, a) => f(...a)
|
|
624
643
|
});
|
|
@@ -639,7 +658,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
639
658
|
const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
640
659
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
641
660
|
F: __dxlog_file4,
|
|
642
|
-
L:
|
|
661
|
+
L: 117,
|
|
643
662
|
S: this,
|
|
644
663
|
A: [
|
|
645
664
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -648,7 +667,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
648
667
|
});
|
|
649
668
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
650
669
|
F: __dxlog_file4,
|
|
651
|
-
L:
|
|
670
|
+
L: 118,
|
|
652
671
|
S: this,
|
|
653
672
|
A: [
|
|
654
673
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -667,6 +686,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
667
686
|
}));
|
|
668
687
|
}
|
|
669
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
|
+
}));
|
|
670
696
|
for (const credential of credentials) {
|
|
671
697
|
await identity.controlPipeline.writer.write({
|
|
672
698
|
credential: {
|
|
@@ -683,7 +709,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
683
709
|
displayName: this._identity.profileDocument?.displayName
|
|
684
710
|
}, {
|
|
685
711
|
F: __dxlog_file4,
|
|
686
|
-
L:
|
|
712
|
+
L: 163,
|
|
687
713
|
S: this,
|
|
688
714
|
C: (f, a) => f(...a)
|
|
689
715
|
});
|
|
@@ -693,7 +719,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
693
719
|
deviceKey: identity.deviceKey
|
|
694
720
|
}, {
|
|
695
721
|
F: __dxlog_file4,
|
|
696
|
-
L:
|
|
722
|
+
L: 169,
|
|
697
723
|
S: this,
|
|
698
724
|
C: (f, a) => f(...a)
|
|
699
725
|
});
|
|
@@ -707,13 +733,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
707
733
|
params
|
|
708
734
|
}, {
|
|
709
735
|
F: __dxlog_file4,
|
|
710
|
-
L:
|
|
736
|
+
L: 177,
|
|
711
737
|
S: this,
|
|
712
738
|
C: (f, a) => f(...a)
|
|
713
739
|
});
|
|
714
740
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
715
741
|
F: __dxlog_file4,
|
|
716
|
-
L:
|
|
742
|
+
L: 178,
|
|
717
743
|
S: this,
|
|
718
744
|
A: [
|
|
719
745
|
"!this._identity",
|
|
@@ -741,7 +767,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
741
767
|
displayName: this._identity.profileDocument?.displayName
|
|
742
768
|
}, {
|
|
743
769
|
F: __dxlog_file4,
|
|
744
|
-
L:
|
|
770
|
+
L: 197,
|
|
745
771
|
S: this,
|
|
746
772
|
C: (f, a) => f(...a)
|
|
747
773
|
});
|
|
@@ -751,7 +777,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
751
777
|
deviceKey: identity.deviceKey
|
|
752
778
|
}, {
|
|
753
779
|
F: __dxlog_file4,
|
|
754
|
-
L:
|
|
780
|
+
L: 203,
|
|
755
781
|
S: this,
|
|
756
782
|
C: (f, a) => f(...a)
|
|
757
783
|
});
|
|
@@ -763,7 +789,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
763
789
|
async updateProfile(profile) {
|
|
764
790
|
(0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
|
|
765
791
|
F: __dxlog_file4,
|
|
766
|
-
L:
|
|
792
|
+
L: 211,
|
|
767
793
|
S: this,
|
|
768
794
|
A: [
|
|
769
795
|
"this._identity",
|
|
@@ -791,51 +817,10 @@ var IdentityManager = class IdentityManager2 {
|
|
|
791
817
|
this.stateUpdate.emit();
|
|
792
818
|
return profile;
|
|
793
819
|
}
|
|
794
|
-
async updateDevice({ deviceKey, profile }) {
|
|
795
|
-
(0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
|
|
796
|
-
F: __dxlog_file4,
|
|
797
|
-
L: 216,
|
|
798
|
-
S: this,
|
|
799
|
-
A: [
|
|
800
|
-
"this._identity",
|
|
801
|
-
"'Identity not initialized.'"
|
|
802
|
-
]
|
|
803
|
-
});
|
|
804
|
-
(0, import_invariant3.invariant)(this._identity.authorizedDeviceKeys.has(deviceKey), "Device not authorized.", {
|
|
805
|
-
F: __dxlog_file4,
|
|
806
|
-
L: 218,
|
|
807
|
-
S: this,
|
|
808
|
-
A: [
|
|
809
|
-
"this._identity.authorizedDeviceKeys.has(deviceKey)",
|
|
810
|
-
"'Device not authorized.'"
|
|
811
|
-
]
|
|
812
|
-
});
|
|
813
|
-
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
814
|
-
subject: this._identity.identityKey,
|
|
815
|
-
assertion: {
|
|
816
|
-
"@type": "dxos.halo.credentials.DeviceProfile",
|
|
817
|
-
deviceKey,
|
|
818
|
-
profile
|
|
819
|
-
}
|
|
820
|
-
});
|
|
821
|
-
const receipt = await this._identity.controlPipeline.writer.write({
|
|
822
|
-
credential: {
|
|
823
|
-
credential
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
await this._identity.controlPipeline.state.waitUntilTimeframe(new import_timeframe.Timeframe([
|
|
827
|
-
[
|
|
828
|
-
receipt.feedKey,
|
|
829
|
-
receipt.seq
|
|
830
|
-
]
|
|
831
|
-
]));
|
|
832
|
-
this.stateUpdate.emit();
|
|
833
|
-
return profile;
|
|
834
|
-
}
|
|
835
820
|
async _constructIdentity(identityRecord) {
|
|
836
821
|
(0, import_invariant3.invariant)(!this._identity, void 0, {
|
|
837
822
|
F: __dxlog_file4,
|
|
838
|
-
L:
|
|
823
|
+
L: 228,
|
|
839
824
|
S: this,
|
|
840
825
|
A: [
|
|
841
826
|
"!this._identity",
|
|
@@ -846,13 +831,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
846
831
|
identityRecord
|
|
847
832
|
}, {
|
|
848
833
|
F: __dxlog_file4,
|
|
849
|
-
L:
|
|
834
|
+
L: 229,
|
|
850
835
|
S: this,
|
|
851
836
|
C: (f, a) => f(...a)
|
|
852
837
|
});
|
|
853
838
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
854
839
|
F: __dxlog_file4,
|
|
855
|
-
L:
|
|
840
|
+
L: 232,
|
|
856
841
|
S: this,
|
|
857
842
|
A: [
|
|
858
843
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -864,7 +849,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
864
849
|
});
|
|
865
850
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
866
851
|
F: __dxlog_file4,
|
|
867
|
-
L:
|
|
852
|
+
L: 236,
|
|
868
853
|
S: this,
|
|
869
854
|
A: [
|
|
870
855
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -896,7 +881,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
896
881
|
identityKey: identityRecord.identityKey
|
|
897
882
|
}, {
|
|
898
883
|
F: __dxlog_file4,
|
|
899
|
-
L:
|
|
884
|
+
L: 260,
|
|
900
885
|
S: this,
|
|
901
886
|
C: (f, a) => f(...a)
|
|
902
887
|
});
|
|
@@ -917,7 +902,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
917
902
|
onAuthFailure: () => {
|
|
918
903
|
import_log4.log.warn("auth failure", void 0, {
|
|
919
904
|
F: __dxlog_file4,
|
|
920
|
-
L:
|
|
905
|
+
L: 279,
|
|
921
906
|
S: this,
|
|
922
907
|
C: (f, a) => f(...a)
|
|
923
908
|
});
|
|
@@ -2131,15 +2116,6 @@ var InvitationsServiceImpl = class {
|
|
|
2131
2116
|
await accepted.cancel();
|
|
2132
2117
|
this._acceptInvitations.delete(invitationId);
|
|
2133
2118
|
this._removedAccepted.emit(accepted.get());
|
|
2134
|
-
} else {
|
|
2135
|
-
import_log7.log.warn("invalid invitation", {
|
|
2136
|
-
invitationId
|
|
2137
|
-
}, {
|
|
2138
|
-
F: __dxlog_file9,
|
|
2139
|
-
L: 132,
|
|
2140
|
-
S: this,
|
|
2141
|
-
C: (f, a) => f(...a)
|
|
2142
|
-
});
|
|
2143
2119
|
}
|
|
2144
2120
|
}
|
|
2145
2121
|
queryInvitations() {
|
|
@@ -3881,7 +3857,7 @@ var import_context10 = require("@dxos/context");
|
|
|
3881
3857
|
var import_document_model2 = require("@dxos/document-model");
|
|
3882
3858
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
3883
3859
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
3884
|
-
var
|
|
3860
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
3885
3861
|
var import_keys13 = require("@dxos/keys");
|
|
3886
3862
|
var import_log16 = require("@dxos/log");
|
|
3887
3863
|
var import_messaging = require("@dxos/messaging");
|
|
@@ -3920,33 +3896,13 @@ var ServiceRegistry = class {
|
|
|
3920
3896
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3921
3897
|
var import_async12 = require("@dxos/async");
|
|
3922
3898
|
var import_codec_protobuf6 = require("@dxos/codec-protobuf");
|
|
3923
|
-
var import_invariant14 = require("@dxos/invariant");
|
|
3924
3899
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3925
|
-
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
|
|
3926
3900
|
var DevicesServiceImpl = class {
|
|
3927
3901
|
constructor(_identityManager) {
|
|
3928
3902
|
this._identityManager = _identityManager;
|
|
3929
3903
|
}
|
|
3930
3904
|
async updateDevice(profile) {
|
|
3931
|
-
|
|
3932
|
-
F: __dxlog_file16,
|
|
3933
|
-
L: 17,
|
|
3934
|
-
S: this,
|
|
3935
|
-
A: [
|
|
3936
|
-
"this._identityManager.identity",
|
|
3937
|
-
"'Identity not initialized'"
|
|
3938
|
-
]
|
|
3939
|
-
});
|
|
3940
|
-
const deviceKey = this._identityManager.identity.deviceKey;
|
|
3941
|
-
await this._identityManager.updateDevice({
|
|
3942
|
-
deviceKey,
|
|
3943
|
-
profile
|
|
3944
|
-
});
|
|
3945
|
-
return {
|
|
3946
|
-
deviceKey,
|
|
3947
|
-
kind: import_services11.DeviceKind.CURRENT,
|
|
3948
|
-
profile
|
|
3949
|
-
};
|
|
3905
|
+
throw new Error("Method not implemented.");
|
|
3950
3906
|
}
|
|
3951
3907
|
queryDevices() {
|
|
3952
3908
|
return new import_codec_protobuf6.Stream(({ next }) => {
|
|
@@ -4290,7 +4246,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4290
4246
|
};
|
|
4291
4247
|
|
|
4292
4248
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4293
|
-
var
|
|
4249
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
4294
4250
|
var import_lock_file = require("@dxos/lock-file");
|
|
4295
4251
|
var import_log14 = require("@dxos/log");
|
|
4296
4252
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4303,7 +4259,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4303
4259
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4304
4260
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4305
4261
|
}
|
|
4306
|
-
var
|
|
4262
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4307
4263
|
var Lock = class {
|
|
4308
4264
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4309
4265
|
this._lockPath = lockPath;
|
|
@@ -4315,7 +4271,7 @@ var Lock = class {
|
|
|
4315
4271
|
}
|
|
4316
4272
|
async acquire() {
|
|
4317
4273
|
(0, import_log14.log)("acquiring lock...", void 0, {
|
|
4318
|
-
F:
|
|
4274
|
+
F: __dxlog_file16,
|
|
4319
4275
|
L: 32,
|
|
4320
4276
|
S: this,
|
|
4321
4277
|
C: (f, a) => f(...a)
|
|
@@ -4323,7 +4279,7 @@ var Lock = class {
|
|
|
4323
4279
|
this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
|
|
4324
4280
|
await this._onAcquire?.();
|
|
4325
4281
|
(0, import_log14.log)("acquired lock", void 0, {
|
|
4326
|
-
F:
|
|
4282
|
+
F: __dxlog_file16,
|
|
4327
4283
|
L: 37,
|
|
4328
4284
|
S: this,
|
|
4329
4285
|
C: (f, a) => f(...a)
|
|
@@ -4331,8 +4287,8 @@ var Lock = class {
|
|
|
4331
4287
|
}
|
|
4332
4288
|
async release() {
|
|
4333
4289
|
await this._onRelease?.();
|
|
4334
|
-
(0,
|
|
4335
|
-
F:
|
|
4290
|
+
(0, import_invariant14.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4291
|
+
F: __dxlog_file16,
|
|
4336
4292
|
L: 42,
|
|
4337
4293
|
S: this,
|
|
4338
4294
|
A: [
|
|
@@ -4610,7 +4566,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4610
4566
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4611
4567
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4612
4568
|
}
|
|
4613
|
-
var
|
|
4569
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4614
4570
|
var createDefaultModelFactory = () => {
|
|
4615
4571
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4616
4572
|
};
|
|
@@ -4710,8 +4666,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4710
4666
|
* Can only be called once.
|
|
4711
4667
|
*/
|
|
4712
4668
|
initialize({ config, ...options }) {
|
|
4713
|
-
(0,
|
|
4714
|
-
F:
|
|
4669
|
+
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4670
|
+
F: __dxlog_file17,
|
|
4715
4671
|
L: 201,
|
|
4716
4672
|
S: this,
|
|
4717
4673
|
A: [
|
|
@@ -4720,14 +4676,14 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4720
4676
|
]
|
|
4721
4677
|
});
|
|
4722
4678
|
(0, import_log16.log)("initializing...", void 0, {
|
|
4723
|
-
F:
|
|
4679
|
+
F: __dxlog_file17,
|
|
4724
4680
|
L: 202,
|
|
4725
4681
|
S: this,
|
|
4726
4682
|
C: (f, a) => f(...a)
|
|
4727
4683
|
});
|
|
4728
4684
|
if (config) {
|
|
4729
|
-
(0,
|
|
4730
|
-
F:
|
|
4685
|
+
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4686
|
+
F: __dxlog_file17,
|
|
4731
4687
|
L: 205,
|
|
4732
4688
|
S: this,
|
|
4733
4689
|
A: [
|
|
@@ -4744,8 +4700,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4744
4700
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4745
4701
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4746
4702
|
this._signalManager = signalManager;
|
|
4747
|
-
(0,
|
|
4748
|
-
F:
|
|
4703
|
+
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4704
|
+
F: __dxlog_file17,
|
|
4749
4705
|
L: 221,
|
|
4750
4706
|
S: this,
|
|
4751
4707
|
A: [
|
|
@@ -4759,7 +4715,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4759
4715
|
signalManager
|
|
4760
4716
|
});
|
|
4761
4717
|
(0, import_log16.log)("initialized", void 0, {
|
|
4762
|
-
F:
|
|
4718
|
+
F: __dxlog_file17,
|
|
4763
4719
|
L: 228,
|
|
4764
4720
|
S: this,
|
|
4765
4721
|
C: (f, a) => f(...a)
|
|
@@ -4773,13 +4729,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4773
4729
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4774
4730
|
id: traceId
|
|
4775
4731
|
}), {
|
|
4776
|
-
F:
|
|
4732
|
+
F: __dxlog_file17,
|
|
4777
4733
|
L: 239,
|
|
4778
4734
|
S: this,
|
|
4779
4735
|
C: (f, a) => f(...a)
|
|
4780
4736
|
});
|
|
4781
|
-
(0,
|
|
4782
|
-
F:
|
|
4737
|
+
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4738
|
+
F: __dxlog_file17,
|
|
4783
4739
|
L: 241,
|
|
4784
4740
|
S: this,
|
|
4785
4741
|
A: [
|
|
@@ -4787,8 +4743,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4787
4743
|
"'config not set'"
|
|
4788
4744
|
]
|
|
4789
4745
|
});
|
|
4790
|
-
(0,
|
|
4791
|
-
F:
|
|
4746
|
+
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4747
|
+
F: __dxlog_file17,
|
|
4792
4748
|
L: 242,
|
|
4793
4749
|
S: this,
|
|
4794
4750
|
A: [
|
|
@@ -4796,8 +4752,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4796
4752
|
"'storage not set'"
|
|
4797
4753
|
]
|
|
4798
4754
|
});
|
|
4799
|
-
(0,
|
|
4800
|
-
F:
|
|
4755
|
+
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4756
|
+
F: __dxlog_file17,
|
|
4801
4757
|
L: 243,
|
|
4802
4758
|
S: this,
|
|
4803
4759
|
A: [
|
|
@@ -4805,8 +4761,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4805
4761
|
"'signal manager not set'"
|
|
4806
4762
|
]
|
|
4807
4763
|
});
|
|
4808
|
-
(0,
|
|
4809
|
-
F:
|
|
4764
|
+
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4765
|
+
F: __dxlog_file17,
|
|
4810
4766
|
L: 244,
|
|
4811
4767
|
S: this,
|
|
4812
4768
|
A: [
|
|
@@ -4818,7 +4774,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4818
4774
|
(0, import_log16.log)("opening...", {
|
|
4819
4775
|
lockKey: this._resourceLock?.lockKey
|
|
4820
4776
|
}, {
|
|
4821
|
-
F:
|
|
4777
|
+
F: __dxlog_file17,
|
|
4822
4778
|
L: 247,
|
|
4823
4779
|
S: this,
|
|
4824
4780
|
C: (f, a) => f(...a)
|
|
@@ -4864,7 +4820,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4864
4820
|
(0, import_log16.log)("opened", {
|
|
4865
4821
|
deviceKey
|
|
4866
4822
|
}, {
|
|
4867
|
-
F:
|
|
4823
|
+
F: __dxlog_file17,
|
|
4868
4824
|
L: 316,
|
|
4869
4825
|
S: this,
|
|
4870
4826
|
C: (f, a) => f(...a)
|
|
@@ -4872,7 +4828,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4872
4828
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4873
4829
|
id: traceId
|
|
4874
4830
|
}), {
|
|
4875
|
-
F:
|
|
4831
|
+
F: __dxlog_file17,
|
|
4876
4832
|
L: 317,
|
|
4877
4833
|
S: this,
|
|
4878
4834
|
C: (f, a) => f(...a)
|
|
@@ -4886,7 +4842,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4886
4842
|
(0, import_log16.log)("closing...", {
|
|
4887
4843
|
deviceKey
|
|
4888
4844
|
}, {
|
|
4889
|
-
F:
|
|
4845
|
+
F: __dxlog_file17,
|
|
4890
4846
|
L: 328,
|
|
4891
4847
|
S: this,
|
|
4892
4848
|
C: (f, a) => f(...a)
|
|
@@ -4902,7 +4858,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4902
4858
|
(0, import_log16.log)("closed", {
|
|
4903
4859
|
deviceKey
|
|
4904
4860
|
}, {
|
|
4905
|
-
F:
|
|
4861
|
+
F: __dxlog_file17,
|
|
4906
4862
|
L: 335,
|
|
4907
4863
|
S: this,
|
|
4908
4864
|
C: (f, a) => f(...a)
|
|
@@ -4913,13 +4869,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4913
4869
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4914
4870
|
id: traceId
|
|
4915
4871
|
}), {
|
|
4916
|
-
F:
|
|
4872
|
+
F: __dxlog_file17,
|
|
4917
4873
|
L: 340,
|
|
4918
4874
|
S: this,
|
|
4919
4875
|
C: (f, a) => f(...a)
|
|
4920
4876
|
});
|
|
4921
4877
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4922
|
-
F:
|
|
4878
|
+
F: __dxlog_file17,
|
|
4923
4879
|
L: 342,
|
|
4924
4880
|
S: this,
|
|
4925
4881
|
C: (f, a) => f(...a)
|
|
@@ -4927,7 +4883,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4927
4883
|
await this._serviceContext?.close();
|
|
4928
4884
|
await this._storage.reset();
|
|
4929
4885
|
(0, import_log16.log)("reset", void 0, {
|
|
4930
|
-
F:
|
|
4886
|
+
F: __dxlog_file17,
|
|
4931
4887
|
L: 345,
|
|
4932
4888
|
S: this,
|
|
4933
4889
|
C: (f, a) => f(...a)
|
|
@@ -4935,7 +4891,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4935
4891
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4936
4892
|
id: traceId
|
|
4937
4893
|
}), {
|
|
4938
|
-
F:
|
|
4894
|
+
F: __dxlog_file17,
|
|
4939
4895
|
L: 346,
|
|
4940
4896
|
S: this,
|
|
4941
4897
|
C: (f, a) => f(...a)
|
|
@@ -4981,7 +4937,7 @@ ClientServicesHost = _ts_decorate7([
|
|
|
4981
4937
|
], ClientServicesHost);
|
|
4982
4938
|
|
|
4983
4939
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
4984
|
-
var
|
|
4940
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
|
|
4985
4941
|
var sanitizeInvitation = (invitation) => {
|
|
4986
4942
|
return {
|
|
4987
4943
|
invitationId: invitation.invitationId,
|
|
@@ -5011,8 +4967,8 @@ var performInvitation = ({ host, guest, options, hooks }) => {
|
|
|
5011
4967
|
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
5012
4968
|
break;
|
|
5013
4969
|
}
|
|
5014
|
-
(0,
|
|
5015
|
-
F:
|
|
4970
|
+
(0, import_invariant16.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
4971
|
+
F: __dxlog_file18,
|
|
5016
4972
|
L: 84,
|
|
5017
4973
|
S: void 0,
|
|
5018
4974
|
A: [
|