@dxos/client-services 0.3.2-main.4291678 → 0.3.2-main.45ce889
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-U6UJTITP.mjs → chunk-VHN2XONA.mjs} +118 -172
- package/dist/lib/browser/chunk-VHN2XONA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs.map +2 -2
- package/dist/lib/node/index.cjs +162 -206
- 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 +137 -181
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devices/devices-service.d.ts +4 -4
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts +4 -4
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts +3 -3
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/keys.d.ts +2 -2
- package/dist/types/src/packlets/devtools/keys.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/metadata.d.ts +2 -2
- package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts +3 -3
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/spaces.d.ts +2 -2
- package/dist/types/src/packlets/devtools/spaces.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts +5 -5
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +5 -9
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +4 -4
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +8 -8
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +4 -4
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +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 +3 -3
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +6 -6
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/node.d.ts +1 -1
- package/dist/types/src/packlets/locks/node.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/resource-lock.d.ts +1 -1
- package/dist/types/src/packlets/locks/resource-lock.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts +3 -3
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +5 -5
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts +8 -8
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +6 -6
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +5 -5
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +7 -7
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +9 -9
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/genesis.d.ts +3 -3
- package/dist/types/src/packlets/spaces/genesis.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +5 -5
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +7 -7
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +5 -5
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/credential-utils.d.ts +2 -2
- package/dist/types/src/packlets/testing/credential-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +4 -4
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts +3 -3
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts +3 -3
- package/dist/types/src/packlets/vault/worker-session.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.test.ts +2 -2
- package/src/packlets/devices/devices-service.ts +10 -17
- package/src/packlets/devtools/devtools.ts +35 -35
- package/src/packlets/devtools/feeds.ts +6 -6
- package/src/packlets/devtools/keys.ts +2 -2
- package/src/packlets/devtools/metadata.ts +2 -2
- package/src/packlets/devtools/network.ts +8 -8
- package/src/packlets/devtools/spaces.ts +8 -5
- package/src/packlets/identity/authenticator.ts +5 -5
- package/src/packlets/identity/identity-manager.test.ts +7 -6
- package/src/packlets/identity/identity-manager.ts +18 -26
- package/src/packlets/identity/identity-service.test.ts +2 -2
- package/src/packlets/identity/identity-service.ts +8 -8
- package/src/packlets/identity/identity.test.ts +2 -2
- package/src/packlets/identity/identity.ts +15 -9
- package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.ts +8 -4
- package/src/packlets/invitations/invitation-extension.ts +6 -6
- package/src/packlets/invitations/invitation-protocol.ts +7 -3
- package/src/packlets/invitations/invitations-handler.ts +7 -2
- package/src/packlets/invitations/invitations-service.ts +5 -7
- package/src/packlets/invitations/space-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.ts +12 -8
- package/src/packlets/locks/browser.ts +1 -1
- package/src/packlets/locks/node.ts +2 -2
- package/src/packlets/locks/resource-lock.ts +1 -1
- package/src/packlets/logging/logging-service.ts +14 -8
- package/src/packlets/logging/logging.test.ts +1 -1
- package/src/packlets/network/network-service.test.ts +2 -2
- package/src/packlets/network/network-service.ts +7 -3
- package/src/packlets/services/client-rpc-server.ts +5 -5
- package/src/packlets/services/diagnostics.ts +13 -13
- package/src/packlets/services/service-context.test.ts +2 -2
- package/src/packlets/services/service-context.ts +9 -9
- package/src/packlets/services/service-host.test.ts +3 -3
- package/src/packlets/services/service-host.ts +9 -9
- package/src/packlets/services/service-registry.test.ts +2 -2
- package/src/packlets/services/service-registry.ts +1 -1
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space-manager.ts +8 -8
- package/src/packlets/spaces/data-space.ts +10 -10
- package/src/packlets/spaces/genesis.ts +3 -3
- package/src/packlets/spaces/notarization-plugin.test.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.ts +5 -5
- package/src/packlets/spaces/spaces-service.test.ts +2 -2
- package/src/packlets/spaces/spaces-service.ts +17 -17
- package/src/packlets/system/system-service.test.ts +1 -1
- package/src/packlets/system/system-service.ts +9 -9
- package/src/packlets/testing/credential-utils.ts +2 -2
- package/src/packlets/testing/invitation-utils.ts +1 -1
- package/src/packlets/testing/test-builder.ts +4 -4
- package/src/packlets/vault/iframe-host-runtime.ts +6 -6
- package/src/packlets/vault/iframe-proxy-runtime.ts +10 -5
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/packlets/vault/worker-runtime.ts +3 -3
- package/src/packlets/vault/worker-session.ts +5 -5
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-U6UJTITP.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.45ce889";
|
|
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: 64,
|
|
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: 145,
|
|
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: 161,
|
|
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
|
});
|
|
@@ -1027,7 +1012,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1027
1012
|
async admit(request) {
|
|
1028
1013
|
(0, import_invariant5.invariant)(request.device, void 0, {
|
|
1029
1014
|
F: __dxlog_file6,
|
|
1030
|
-
L:
|
|
1015
|
+
L: 35,
|
|
1031
1016
|
S: this,
|
|
1032
1017
|
A: [
|
|
1033
1018
|
"request.device",
|
|
@@ -1063,7 +1048,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1063
1048
|
async accept(response, request) {
|
|
1064
1049
|
(0, import_invariant5.invariant)(response.device, void 0, {
|
|
1065
1050
|
F: __dxlog_file6,
|
|
1066
|
-
L:
|
|
1051
|
+
L: 68,
|
|
1067
1052
|
S: this,
|
|
1068
1053
|
A: [
|
|
1069
1054
|
"response.device",
|
|
@@ -1073,7 +1058,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1073
1058
|
const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
|
|
1074
1059
|
(0, import_invariant5.invariant)(request.device, void 0, {
|
|
1075
1060
|
F: __dxlog_file6,
|
|
1076
|
-
L:
|
|
1061
|
+
L: 71,
|
|
1077
1062
|
S: this,
|
|
1078
1063
|
A: [
|
|
1079
1064
|
"request.device",
|
|
@@ -1463,7 +1448,7 @@ var InvitationsHandler = class {
|
|
|
1463
1448
|
const authCode = options?.authCode ?? (authMethod === import_services4.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials9.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1464
1449
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1465
1450
|
F: __dxlog_file8,
|
|
1466
|
-
L:
|
|
1451
|
+
L: 80,
|
|
1467
1452
|
S: this,
|
|
1468
1453
|
A: [
|
|
1469
1454
|
"protocol",
|
|
@@ -1492,7 +1477,7 @@ var InvitationsHandler = class {
|
|
|
1492
1477
|
...protocol.toJSON()
|
|
1493
1478
|
}, {
|
|
1494
1479
|
F: __dxlog_file8,
|
|
1495
|
-
L:
|
|
1480
|
+
L: 102,
|
|
1496
1481
|
S: this,
|
|
1497
1482
|
C: (f, a) => f(...a)
|
|
1498
1483
|
});
|
|
@@ -1517,7 +1502,7 @@ var InvitationsHandler = class {
|
|
|
1517
1502
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1518
1503
|
(0, import_invariant7.invariant)(deviceKey, void 0, {
|
|
1519
1504
|
F: __dxlog_file8,
|
|
1520
|
-
L:
|
|
1505
|
+
L: 123,
|
|
1521
1506
|
S: this,
|
|
1522
1507
|
A: [
|
|
1523
1508
|
"deviceKey",
|
|
@@ -1540,7 +1525,7 @@ var InvitationsHandler = class {
|
|
|
1540
1525
|
id: traceId
|
|
1541
1526
|
}), {
|
|
1542
1527
|
F: __dxlog_file8,
|
|
1543
|
-
L:
|
|
1528
|
+
L: 141,
|
|
1544
1529
|
S: this,
|
|
1545
1530
|
C: (f, a) => f(...a)
|
|
1546
1531
|
});
|
|
@@ -1548,7 +1533,7 @@ var InvitationsHandler = class {
|
|
|
1548
1533
|
...protocol.toJSON()
|
|
1549
1534
|
}, {
|
|
1550
1535
|
F: __dxlog_file8,
|
|
1551
|
-
L:
|
|
1536
|
+
L: 142,
|
|
1552
1537
|
S: this,
|
|
1553
1538
|
C: (f, a) => f(...a)
|
|
1554
1539
|
});
|
|
@@ -1564,7 +1549,7 @@ var InvitationsHandler = class {
|
|
|
1564
1549
|
...protocol.toJSON()
|
|
1565
1550
|
}, {
|
|
1566
1551
|
F: __dxlog_file8,
|
|
1567
|
-
L:
|
|
1552
|
+
L: 145,
|
|
1568
1553
|
S: this,
|
|
1569
1554
|
C: (f, a) => f(...a)
|
|
1570
1555
|
});
|
|
@@ -1576,7 +1561,7 @@ var InvitationsHandler = class {
|
|
|
1576
1561
|
id: traceId
|
|
1577
1562
|
}), {
|
|
1578
1563
|
F: __dxlog_file8,
|
|
1579
|
-
L:
|
|
1564
|
+
L: 147,
|
|
1580
1565
|
S: this,
|
|
1581
1566
|
C: (f, a) => f(...a)
|
|
1582
1567
|
});
|
|
@@ -1586,7 +1571,7 @@ var InvitationsHandler = class {
|
|
|
1586
1571
|
...protocol.toJSON()
|
|
1587
1572
|
}, {
|
|
1588
1573
|
F: __dxlog_file8,
|
|
1589
|
-
L:
|
|
1574
|
+
L: 150,
|
|
1590
1575
|
S: this,
|
|
1591
1576
|
C: (f, a) => f(...a)
|
|
1592
1577
|
});
|
|
@@ -1597,7 +1582,7 @@ var InvitationsHandler = class {
|
|
|
1597
1582
|
} else {
|
|
1598
1583
|
import_log6.log.error("failed", err, {
|
|
1599
1584
|
F: __dxlog_file8,
|
|
1600
|
-
L:
|
|
1585
|
+
L: 153,
|
|
1601
1586
|
S: this,
|
|
1602
1587
|
C: (f, a) => f(...a)
|
|
1603
1588
|
});
|
|
@@ -1608,7 +1593,7 @@ var InvitationsHandler = class {
|
|
|
1608
1593
|
error: err
|
|
1609
1594
|
}), {
|
|
1610
1595
|
F: __dxlog_file8,
|
|
1611
|
-
L:
|
|
1596
|
+
L: 156,
|
|
1612
1597
|
S: this,
|
|
1613
1598
|
C: (f, a) => f(...a)
|
|
1614
1599
|
});
|
|
@@ -1629,7 +1614,7 @@ var InvitationsHandler = class {
|
|
|
1629
1614
|
...protocol.toJSON()
|
|
1630
1615
|
}, {
|
|
1631
1616
|
F: __dxlog_file8,
|
|
1632
|
-
L:
|
|
1617
|
+
L: 171,
|
|
1633
1618
|
S: this,
|
|
1634
1619
|
C: (f, a) => f(...a)
|
|
1635
1620
|
});
|
|
@@ -1640,7 +1625,7 @@ var InvitationsHandler = class {
|
|
|
1640
1625
|
} else {
|
|
1641
1626
|
import_log6.log.error("failed", err, {
|
|
1642
1627
|
F: __dxlog_file8,
|
|
1643
|
-
L:
|
|
1628
|
+
L: 174,
|
|
1644
1629
|
S: this,
|
|
1645
1630
|
C: (f, a) => f(...a)
|
|
1646
1631
|
});
|
|
@@ -1685,7 +1670,7 @@ var InvitationsHandler = class {
|
|
|
1685
1670
|
const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
|
|
1686
1671
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1687
1672
|
F: __dxlog_file8,
|
|
1688
|
-
L:
|
|
1673
|
+
L: 215,
|
|
1689
1674
|
S: this,
|
|
1690
1675
|
A: [
|
|
1691
1676
|
"protocol",
|
|
@@ -1699,7 +1684,7 @@ var InvitationsHandler = class {
|
|
|
1699
1684
|
const setState = (newData) => {
|
|
1700
1685
|
(0, import_invariant7.invariant)(newData.state !== void 0, void 0, {
|
|
1701
1686
|
F: __dxlog_file8,
|
|
1702
|
-
L:
|
|
1687
|
+
L: 226,
|
|
1703
1688
|
S: this,
|
|
1704
1689
|
A: [
|
|
1705
1690
|
"newData.state !== undefined",
|
|
@@ -1719,7 +1704,7 @@ var InvitationsHandler = class {
|
|
|
1719
1704
|
...protocol.toJSON()
|
|
1720
1705
|
}, {
|
|
1721
1706
|
F: __dxlog_file8,
|
|
1722
|
-
L:
|
|
1707
|
+
L: 234,
|
|
1723
1708
|
S: this,
|
|
1724
1709
|
C: (f, a) => f(...a)
|
|
1725
1710
|
});
|
|
@@ -1729,7 +1714,7 @@ var InvitationsHandler = class {
|
|
|
1729
1714
|
} else {
|
|
1730
1715
|
import_log6.log.warn("auth failed", err, {
|
|
1731
1716
|
F: __dxlog_file8,
|
|
1732
|
-
L:
|
|
1717
|
+
L: 237,
|
|
1733
1718
|
S: this,
|
|
1734
1719
|
C: (f, a) => f(...a)
|
|
1735
1720
|
});
|
|
@@ -1743,7 +1728,7 @@ var InvitationsHandler = class {
|
|
|
1743
1728
|
...protocol.toJSON()
|
|
1744
1729
|
}, {
|
|
1745
1730
|
F: __dxlog_file8,
|
|
1746
|
-
L:
|
|
1731
|
+
L: 245,
|
|
1747
1732
|
S: this,
|
|
1748
1733
|
C: (f, a) => f(...a)
|
|
1749
1734
|
});
|
|
@@ -1758,7 +1743,7 @@ var InvitationsHandler = class {
|
|
|
1758
1743
|
currentState
|
|
1759
1744
|
}, {
|
|
1760
1745
|
F: __dxlog_file8,
|
|
1761
|
-
L:
|
|
1746
|
+
L: 255,
|
|
1762
1747
|
S: this,
|
|
1763
1748
|
C: (f, a) => f(...a)
|
|
1764
1749
|
});
|
|
@@ -1773,7 +1758,7 @@ var InvitationsHandler = class {
|
|
|
1773
1758
|
id: traceId
|
|
1774
1759
|
}), {
|
|
1775
1760
|
F: __dxlog_file8,
|
|
1776
|
-
L:
|
|
1761
|
+
L: 264,
|
|
1777
1762
|
S: this,
|
|
1778
1763
|
C: (f, a) => f(...a)
|
|
1779
1764
|
});
|
|
@@ -1785,7 +1770,7 @@ var InvitationsHandler = class {
|
|
|
1785
1770
|
...protocol.toJSON()
|
|
1786
1771
|
}, {
|
|
1787
1772
|
F: __dxlog_file8,
|
|
1788
|
-
L:
|
|
1773
|
+
L: 272,
|
|
1789
1774
|
S: this,
|
|
1790
1775
|
C: (f, a) => f(...a)
|
|
1791
1776
|
});
|
|
@@ -1796,7 +1781,7 @@ var InvitationsHandler = class {
|
|
|
1796
1781
|
...protocol.toJSON()
|
|
1797
1782
|
}, {
|
|
1798
1783
|
F: __dxlog_file8,
|
|
1799
|
-
L:
|
|
1784
|
+
L: 276,
|
|
1800
1785
|
S: this,
|
|
1801
1786
|
C: (f, a) => f(...a)
|
|
1802
1787
|
});
|
|
@@ -1806,7 +1791,7 @@ var InvitationsHandler = class {
|
|
|
1806
1791
|
response: introductionResponse
|
|
1807
1792
|
}, {
|
|
1808
1793
|
F: __dxlog_file8,
|
|
1809
|
-
L:
|
|
1794
|
+
L: 280,
|
|
1810
1795
|
S: this,
|
|
1811
1796
|
C: (f, a) => f(...a)
|
|
1812
1797
|
});
|
|
@@ -1818,7 +1803,7 @@ var InvitationsHandler = class {
|
|
|
1818
1803
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1819
1804
|
(0, import_log6.log)("guest waiting for authentication code...", void 0, {
|
|
1820
1805
|
F: __dxlog_file8,
|
|
1821
|
-
L:
|
|
1806
|
+
L: 289,
|
|
1822
1807
|
S: this,
|
|
1823
1808
|
C: (f, a) => f(...a)
|
|
1824
1809
|
});
|
|
@@ -1830,7 +1815,7 @@ var InvitationsHandler = class {
|
|
|
1830
1815
|
});
|
|
1831
1816
|
(0, import_log6.log)("sending authentication request", void 0, {
|
|
1832
1817
|
F: __dxlog_file8,
|
|
1833
|
-
L:
|
|
1818
|
+
L: 293,
|
|
1834
1819
|
S: this,
|
|
1835
1820
|
C: (f, a) => f(...a)
|
|
1836
1821
|
});
|
|
@@ -1851,7 +1836,7 @@ var InvitationsHandler = class {
|
|
|
1851
1836
|
attempt
|
|
1852
1837
|
}, {
|
|
1853
1838
|
F: __dxlog_file8,
|
|
1854
|
-
L:
|
|
1839
|
+
L: 304,
|
|
1855
1840
|
S: this,
|
|
1856
1841
|
C: (f, a) => f(...a)
|
|
1857
1842
|
});
|
|
@@ -1868,7 +1853,7 @@ var InvitationsHandler = class {
|
|
|
1868
1853
|
...protocol.toJSON()
|
|
1869
1854
|
}, {
|
|
1870
1855
|
F: __dxlog_file8,
|
|
1871
|
-
L:
|
|
1856
|
+
L: 315,
|
|
1872
1857
|
S: this,
|
|
1873
1858
|
C: (f, a) => f(...a)
|
|
1874
1859
|
});
|
|
@@ -1880,7 +1865,7 @@ var InvitationsHandler = class {
|
|
|
1880
1865
|
...protocol.toJSON()
|
|
1881
1866
|
}, {
|
|
1882
1867
|
F: __dxlog_file8,
|
|
1883
|
-
L:
|
|
1868
|
+
L: 326,
|
|
1884
1869
|
S: this,
|
|
1885
1870
|
C: (f, a) => f(...a)
|
|
1886
1871
|
});
|
|
@@ -1892,7 +1877,7 @@ var InvitationsHandler = class {
|
|
|
1892
1877
|
id: traceId
|
|
1893
1878
|
}), {
|
|
1894
1879
|
F: __dxlog_file8,
|
|
1895
|
-
L:
|
|
1880
|
+
L: 328,
|
|
1896
1881
|
S: this,
|
|
1897
1882
|
C: (f, a) => f(...a)
|
|
1898
1883
|
});
|
|
@@ -1902,7 +1887,7 @@ var InvitationsHandler = class {
|
|
|
1902
1887
|
...protocol.toJSON()
|
|
1903
1888
|
}, {
|
|
1904
1889
|
F: __dxlog_file8,
|
|
1905
|
-
L:
|
|
1890
|
+
L: 331,
|
|
1906
1891
|
S: this,
|
|
1907
1892
|
C: (f, a) => f(...a)
|
|
1908
1893
|
});
|
|
@@ -1912,7 +1897,7 @@ var InvitationsHandler = class {
|
|
|
1912
1897
|
} else {
|
|
1913
1898
|
(0, import_log6.log)("auth failed", err, {
|
|
1914
1899
|
F: __dxlog_file8,
|
|
1915
|
-
L:
|
|
1900
|
+
L: 334,
|
|
1916
1901
|
S: this,
|
|
1917
1902
|
C: (f, a) => f(...a)
|
|
1918
1903
|
});
|
|
@@ -1923,7 +1908,7 @@ var InvitationsHandler = class {
|
|
|
1923
1908
|
error: err
|
|
1924
1909
|
}), {
|
|
1925
1910
|
F: __dxlog_file8,
|
|
1926
|
-
L:
|
|
1911
|
+
L: 337,
|
|
1927
1912
|
S: this,
|
|
1928
1913
|
C: (f, a) => f(...a)
|
|
1929
1914
|
});
|
|
@@ -1941,7 +1926,7 @@ var InvitationsHandler = class {
|
|
|
1941
1926
|
...protocol.toJSON()
|
|
1942
1927
|
}, {
|
|
1943
1928
|
F: __dxlog_file8,
|
|
1944
|
-
L:
|
|
1929
|
+
L: 348,
|
|
1945
1930
|
S: this,
|
|
1946
1931
|
C: (f, a) => f(...a)
|
|
1947
1932
|
});
|
|
@@ -1951,7 +1936,7 @@ var InvitationsHandler = class {
|
|
|
1951
1936
|
} else {
|
|
1952
1937
|
(0, import_log6.log)("auth failed", err, {
|
|
1953
1938
|
F: __dxlog_file8,
|
|
1954
|
-
L:
|
|
1939
|
+
L: 351,
|
|
1955
1940
|
S: this,
|
|
1956
1941
|
C: (f, a) => f(...a)
|
|
1957
1942
|
});
|
|
@@ -1964,7 +1949,7 @@ var InvitationsHandler = class {
|
|
|
1964
1949
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
1965
1950
|
(0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
|
|
1966
1951
|
F: __dxlog_file8,
|
|
1967
|
-
L:
|
|
1952
|
+
L: 361,
|
|
1968
1953
|
S: this,
|
|
1969
1954
|
A: [
|
|
1970
1955
|
"invitation.swarmKey",
|
|
@@ -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() {
|
|
@@ -2223,7 +2199,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2223
2199
|
async admit(request, guestProfile) {
|
|
2224
2200
|
(0, import_invariant9.invariant)(this._spaceKey, void 0, {
|
|
2225
2201
|
F: __dxlog_file10,
|
|
2226
|
-
L:
|
|
2202
|
+
L: 46,
|
|
2227
2203
|
S: this,
|
|
2228
2204
|
A: [
|
|
2229
2205
|
"this._spaceKey",
|
|
@@ -2233,7 +2209,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2233
2209
|
const space = await this._spaceManager.spaces.get(this._spaceKey);
|
|
2234
2210
|
(0, import_invariant9.invariant)(space, void 0, {
|
|
2235
2211
|
F: __dxlog_file10,
|
|
2236
|
-
L:
|
|
2212
|
+
L: 48,
|
|
2237
2213
|
S: this,
|
|
2238
2214
|
A: [
|
|
2239
2215
|
"space",
|
|
@@ -2242,7 +2218,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2242
2218
|
});
|
|
2243
2219
|
(0, import_invariant9.invariant)(request.space, void 0, {
|
|
2244
2220
|
F: __dxlog_file10,
|
|
2245
|
-
L:
|
|
2221
|
+
L: 50,
|
|
2246
2222
|
S: this,
|
|
2247
2223
|
A: [
|
|
2248
2224
|
"request.space",
|
|
@@ -2255,14 +2231,14 @@ var SpaceInvitationProtocol = class {
|
|
|
2255
2231
|
guest: deviceKey
|
|
2256
2232
|
}, {
|
|
2257
2233
|
F: __dxlog_file10,
|
|
2258
|
-
L:
|
|
2234
|
+
L: 53,
|
|
2259
2235
|
S: this,
|
|
2260
2236
|
C: (f, a) => f(...a)
|
|
2261
2237
|
});
|
|
2262
2238
|
const credentials = await (0, import_credentials10.createAdmissionCredentials)(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, guestProfile);
|
|
2263
2239
|
(0, import_invariant9.invariant)(credentials[0].credential, void 0, {
|
|
2264
2240
|
F: __dxlog_file10,
|
|
2265
|
-
L:
|
|
2241
|
+
L: 64,
|
|
2266
2242
|
S: this,
|
|
2267
2243
|
A: [
|
|
2268
2244
|
"credentials[0].credential",
|
|
@@ -2272,7 +2248,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2272
2248
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2273
2249
|
(0, import_invariant9.invariant)((0, import_credentials10.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2274
2250
|
F: __dxlog_file10,
|
|
2275
|
-
L:
|
|
2251
|
+
L: 66,
|
|
2276
2252
|
S: this,
|
|
2277
2253
|
A: [
|
|
2278
2254
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2308,7 +2284,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2308
2284
|
async accept(response) {
|
|
2309
2285
|
(0, import_invariant9.invariant)(response.space, void 0, {
|
|
2310
2286
|
F: __dxlog_file10,
|
|
2311
|
-
L:
|
|
2287
|
+
L: 101,
|
|
2312
2288
|
S: this,
|
|
2313
2289
|
A: [
|
|
2314
2290
|
"response.space",
|
|
@@ -2319,7 +2295,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2319
2295
|
const assertion = (0, import_credentials10.getCredentialAssertion)(credential);
|
|
2320
2296
|
(0, import_invariant9.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2321
2297
|
F: __dxlog_file10,
|
|
2322
|
-
L:
|
|
2298
|
+
L: 104,
|
|
2323
2299
|
S: this,
|
|
2324
2300
|
A: [
|
|
2325
2301
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2328,7 +2304,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2328
2304
|
});
|
|
2329
2305
|
(0, import_invariant9.invariant)(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
2330
2306
|
F: __dxlog_file10,
|
|
2331
|
-
L:
|
|
2307
|
+
L: 105,
|
|
2332
2308
|
S: this,
|
|
2333
2309
|
A: [
|
|
2334
2310
|
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
@@ -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: [
|