@dxos/client-services 0.3.5-main.b34f027 → 0.3.5-main.b6099e9
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-2EGKVPTA.mjs → chunk-5J2S5YZY.mjs} +98 -75
- package/dist/lib/browser/chunk-5J2S5YZY.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 +3 -2
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +97 -74
- 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 +99 -75
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-service.d.ts +2 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +2 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +2 -0
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/identity/identity-service.ts +2 -0
- package/src/packlets/invitations/invitation-extension.ts +0 -1
- package/src/packlets/invitations/invitations-handler.ts +0 -3
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
- package/src/packlets/services/service-context.ts +12 -2
- package/src/packlets/services/service-host.ts +1 -0
- package/src/packlets/spaces/data-space-manager.ts +7 -3
- package/src/packlets/spaces/data-space.ts +13 -1
- package/src/packlets/spaces/genesis.ts +1 -1
- package/src/packlets/spaces/spaces-service.ts +1 -1
- package/src/packlets/testing/test-builder.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-2EGKVPTA.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -1088,10 +1088,11 @@ var import_debug2 = require("@dxos/debug");
|
|
|
1088
1088
|
var import_invariant3 = require("@dxos/invariant");
|
|
1089
1089
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1090
1090
|
var IdentityServiceImpl = class {
|
|
1091
|
-
constructor(_createIdentity, _identityManager, _keyring) {
|
|
1091
|
+
constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
|
|
1092
1092
|
this._createIdentity = _createIdentity;
|
|
1093
1093
|
this._identityManager = _identityManager;
|
|
1094
1094
|
this._keyring = _keyring;
|
|
1095
|
+
this._onProfileUpdate = _onProfileUpdate;
|
|
1095
1096
|
}
|
|
1096
1097
|
async createIdentity(request) {
|
|
1097
1098
|
await this._createIdentity(request);
|
|
@@ -1122,7 +1123,7 @@ var IdentityServiceImpl = class {
|
|
|
1122
1123
|
async updateProfile(profile) {
|
|
1123
1124
|
(0, import_invariant3.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1124
1125
|
F: __dxlog_file4,
|
|
1125
|
-
L:
|
|
1126
|
+
L: 60,
|
|
1126
1127
|
S: this,
|
|
1127
1128
|
A: [
|
|
1128
1129
|
"this._identityManager.identity",
|
|
@@ -1130,12 +1131,13 @@ var IdentityServiceImpl = class {
|
|
|
1130
1131
|
]
|
|
1131
1132
|
});
|
|
1132
1133
|
await this._identityManager.updateProfile(profile);
|
|
1134
|
+
await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
|
|
1133
1135
|
return this._getIdentity();
|
|
1134
1136
|
}
|
|
1135
1137
|
async signPresentation({ presentation, nonce }) {
|
|
1136
1138
|
(0, import_invariant3.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1137
1139
|
F: __dxlog_file4,
|
|
1138
|
-
L:
|
|
1140
|
+
L: 67,
|
|
1139
1141
|
S: this,
|
|
1140
1142
|
A: [
|
|
1141
1143
|
"this._identityManager.identity",
|
|
@@ -1354,7 +1356,6 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1354
1356
|
C: (f, a) => f(...a)
|
|
1355
1357
|
});
|
|
1356
1358
|
return {
|
|
1357
|
-
spaceKey: this.invitation.authMethod === import_services2.Invitation.AuthMethod.NONE ? this.invitation.spaceKey : void 0,
|
|
1358
1359
|
authMethod: this.invitation.authMethod
|
|
1359
1360
|
};
|
|
1360
1361
|
},
|
|
@@ -1364,7 +1365,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1364
1365
|
id: traceId
|
|
1365
1366
|
}), {
|
|
1366
1367
|
F: __dxlog_file6,
|
|
1367
|
-
L:
|
|
1368
|
+
L: 124,
|
|
1368
1369
|
S: this,
|
|
1369
1370
|
C: (f, a) => f(...a)
|
|
1370
1371
|
});
|
|
@@ -1372,14 +1373,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1372
1373
|
authCode: code
|
|
1373
1374
|
}, {
|
|
1374
1375
|
F: __dxlog_file6,
|
|
1375
|
-
L:
|
|
1376
|
+
L: 125,
|
|
1376
1377
|
S: this,
|
|
1377
1378
|
C: (f, a) => f(...a)
|
|
1378
1379
|
});
|
|
1379
1380
|
let status = import_invitations.AuthenticationResponse.Status.OK;
|
|
1380
1381
|
(0, import_invariant5.invariant)(this.invitation, "Invitation is not set.", {
|
|
1381
1382
|
F: __dxlog_file6,
|
|
1382
|
-
L:
|
|
1383
|
+
L: 128,
|
|
1383
1384
|
S: this,
|
|
1384
1385
|
A: [
|
|
1385
1386
|
"this.invitation",
|
|
@@ -1390,7 +1391,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1390
1391
|
case import_services2.Invitation.AuthMethod.NONE: {
|
|
1391
1392
|
(0, import_log4.log)("authentication not required", void 0, {
|
|
1392
1393
|
F: __dxlog_file6,
|
|
1393
|
-
L:
|
|
1394
|
+
L: 131,
|
|
1394
1395
|
S: this,
|
|
1395
1396
|
C: (f, a) => f(...a)
|
|
1396
1397
|
});
|
|
@@ -1415,7 +1416,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1415
1416
|
authMethod: this.invitation.authMethod
|
|
1416
1417
|
}, {
|
|
1417
1418
|
F: __dxlog_file6,
|
|
1418
|
-
L:
|
|
1419
|
+
L: 149,
|
|
1419
1420
|
S: this,
|
|
1420
1421
|
C: (f, a) => f(...a)
|
|
1421
1422
|
});
|
|
@@ -1430,7 +1431,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1430
1431
|
}
|
|
1431
1432
|
}), {
|
|
1432
1433
|
F: __dxlog_file6,
|
|
1433
|
-
L:
|
|
1434
|
+
L: 155,
|
|
1434
1435
|
S: this,
|
|
1435
1436
|
C: (f, a) => f(...a)
|
|
1436
1437
|
});
|
|
@@ -1444,14 +1445,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1444
1445
|
id: traceId
|
|
1445
1446
|
}), {
|
|
1446
1447
|
F: __dxlog_file6,
|
|
1447
|
-
L:
|
|
1448
|
+
L: 161,
|
|
1448
1449
|
S: this,
|
|
1449
1450
|
C: (f, a) => f(...a)
|
|
1450
1451
|
});
|
|
1451
1452
|
try {
|
|
1452
1453
|
(0, import_invariant5.invariant)(this.invitation, "Invitation is not set.", {
|
|
1453
1454
|
F: __dxlog_file6,
|
|
1454
|
-
L:
|
|
1455
|
+
L: 164,
|
|
1455
1456
|
S: this,
|
|
1456
1457
|
A: [
|
|
1457
1458
|
"this.invitation",
|
|
@@ -1466,7 +1467,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1466
1467
|
id: traceId
|
|
1467
1468
|
}), {
|
|
1468
1469
|
F: __dxlog_file6,
|
|
1469
|
-
L:
|
|
1470
|
+
L: 172,
|
|
1470
1471
|
S: this,
|
|
1471
1472
|
C: (f, a) => f(...a)
|
|
1472
1473
|
});
|
|
@@ -1523,7 +1524,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1523
1524
|
options: async (options) => {
|
|
1524
1525
|
(0, import_invariant5.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1525
1526
|
F: __dxlog_file6,
|
|
1526
|
-
L:
|
|
1527
|
+
L: 239,
|
|
1527
1528
|
S: this,
|
|
1528
1529
|
A: [
|
|
1529
1530
|
"!this._remoteOptions",
|
|
@@ -1550,7 +1551,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1550
1551
|
try {
|
|
1551
1552
|
(0, import_log4.log)("begin options", void 0, {
|
|
1552
1553
|
F: __dxlog_file6,
|
|
1553
|
-
L:
|
|
1554
|
+
L: 260,
|
|
1554
1555
|
S: this,
|
|
1555
1556
|
C: (f, a) => f(...a)
|
|
1556
1557
|
});
|
|
@@ -1562,7 +1563,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1562
1563
|
}));
|
|
1563
1564
|
(0, import_log4.log)("end options", void 0, {
|
|
1564
1565
|
F: __dxlog_file6,
|
|
1565
|
-
L:
|
|
1566
|
+
L: 263,
|
|
1566
1567
|
S: this,
|
|
1567
1568
|
C: (f, a) => f(...a)
|
|
1568
1569
|
});
|
|
@@ -1576,7 +1577,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1576
1577
|
} catch (err) {
|
|
1577
1578
|
(0, import_log4.log)("openError", err, {
|
|
1578
1579
|
F: __dxlog_file6,
|
|
1579
|
-
L:
|
|
1580
|
+
L: 273,
|
|
1580
1581
|
S: this,
|
|
1581
1582
|
C: (f, a) => f(...a)
|
|
1582
1583
|
});
|
|
@@ -1586,7 +1587,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1586
1587
|
async onClose() {
|
|
1587
1588
|
(0, import_log4.log)("onClose", void 0, {
|
|
1588
1589
|
F: __dxlog_file6,
|
|
1589
|
-
L:
|
|
1590
|
+
L: 279,
|
|
1590
1591
|
S: this,
|
|
1591
1592
|
C: (f, a) => f(...a)
|
|
1592
1593
|
});
|
|
@@ -1957,14 +1958,11 @@ var InvitationsHandler = class {
|
|
|
1957
1958
|
C: (f, a) => f(...a)
|
|
1958
1959
|
});
|
|
1959
1960
|
invitation.authMethod = introductionResponse.authMethod;
|
|
1960
|
-
if (introductionResponse.spaceKey) {
|
|
1961
|
-
invitation.spaceKey = introductionResponse.spaceKey;
|
|
1962
|
-
}
|
|
1963
1961
|
if (isAuthenticationRequired(invitation)) {
|
|
1964
1962
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1965
1963
|
(0, import_log5.log)("guest waiting for authentication code...", void 0, {
|
|
1966
1964
|
F: __dxlog_file7,
|
|
1967
|
-
L:
|
|
1965
|
+
L: 286,
|
|
1968
1966
|
S: this,
|
|
1969
1967
|
C: (f, a) => f(...a)
|
|
1970
1968
|
});
|
|
@@ -1976,7 +1974,7 @@ var InvitationsHandler = class {
|
|
|
1976
1974
|
});
|
|
1977
1975
|
(0, import_log5.log)("sending authentication request", void 0, {
|
|
1978
1976
|
F: __dxlog_file7,
|
|
1979
|
-
L:
|
|
1977
|
+
L: 290,
|
|
1980
1978
|
S: this,
|
|
1981
1979
|
C: (f, a) => f(...a)
|
|
1982
1980
|
});
|
|
@@ -1997,7 +1995,7 @@ var InvitationsHandler = class {
|
|
|
1997
1995
|
attempt
|
|
1998
1996
|
}, {
|
|
1999
1997
|
F: __dxlog_file7,
|
|
2000
|
-
L:
|
|
1998
|
+
L: 301,
|
|
2001
1999
|
S: this,
|
|
2002
2000
|
C: (f, a) => f(...a)
|
|
2003
2001
|
});
|
|
@@ -2014,7 +2012,7 @@ var InvitationsHandler = class {
|
|
|
2014
2012
|
...protocol.toJSON()
|
|
2015
2013
|
}, {
|
|
2016
2014
|
F: __dxlog_file7,
|
|
2017
|
-
L:
|
|
2015
|
+
L: 312,
|
|
2018
2016
|
S: this,
|
|
2019
2017
|
C: (f, a) => f(...a)
|
|
2020
2018
|
});
|
|
@@ -2026,7 +2024,7 @@ var InvitationsHandler = class {
|
|
|
2026
2024
|
...protocol.toJSON()
|
|
2027
2025
|
}, {
|
|
2028
2026
|
F: __dxlog_file7,
|
|
2029
|
-
L:
|
|
2027
|
+
L: 323,
|
|
2030
2028
|
S: this,
|
|
2031
2029
|
C: (f, a) => f(...a)
|
|
2032
2030
|
});
|
|
@@ -2038,7 +2036,7 @@ var InvitationsHandler = class {
|
|
|
2038
2036
|
id: traceId
|
|
2039
2037
|
}), {
|
|
2040
2038
|
F: __dxlog_file7,
|
|
2041
|
-
L:
|
|
2039
|
+
L: 325,
|
|
2042
2040
|
S: this,
|
|
2043
2041
|
C: (f, a) => f(...a)
|
|
2044
2042
|
});
|
|
@@ -2048,7 +2046,7 @@ var InvitationsHandler = class {
|
|
|
2048
2046
|
...protocol.toJSON()
|
|
2049
2047
|
}, {
|
|
2050
2048
|
F: __dxlog_file7,
|
|
2051
|
-
L:
|
|
2049
|
+
L: 328,
|
|
2052
2050
|
S: this,
|
|
2053
2051
|
C: (f, a) => f(...a)
|
|
2054
2052
|
});
|
|
@@ -2058,7 +2056,7 @@ var InvitationsHandler = class {
|
|
|
2058
2056
|
} else {
|
|
2059
2057
|
(0, import_log5.log)("auth failed", err, {
|
|
2060
2058
|
F: __dxlog_file7,
|
|
2061
|
-
L:
|
|
2059
|
+
L: 331,
|
|
2062
2060
|
S: this,
|
|
2063
2061
|
C: (f, a) => f(...a)
|
|
2064
2062
|
});
|
|
@@ -2069,7 +2067,7 @@ var InvitationsHandler = class {
|
|
|
2069
2067
|
error: err
|
|
2070
2068
|
}), {
|
|
2071
2069
|
F: __dxlog_file7,
|
|
2072
|
-
L:
|
|
2070
|
+
L: 334,
|
|
2073
2071
|
S: this,
|
|
2074
2072
|
C: (f, a) => f(...a)
|
|
2075
2073
|
});
|
|
@@ -2087,7 +2085,7 @@ var InvitationsHandler = class {
|
|
|
2087
2085
|
...protocol.toJSON()
|
|
2088
2086
|
}, {
|
|
2089
2087
|
F: __dxlog_file7,
|
|
2090
|
-
L:
|
|
2088
|
+
L: 345,
|
|
2091
2089
|
S: this,
|
|
2092
2090
|
C: (f, a) => f(...a)
|
|
2093
2091
|
});
|
|
@@ -2097,7 +2095,7 @@ var InvitationsHandler = class {
|
|
|
2097
2095
|
} else {
|
|
2098
2096
|
(0, import_log5.log)("auth failed", err, {
|
|
2099
2097
|
F: __dxlog_file7,
|
|
2100
|
-
L:
|
|
2098
|
+
L: 348,
|
|
2101
2099
|
S: this,
|
|
2102
2100
|
C: (f, a) => f(...a)
|
|
2103
2101
|
});
|
|
@@ -2110,7 +2108,7 @@ var InvitationsHandler = class {
|
|
|
2110
2108
|
(0, import_async8.scheduleTask)(ctx, async () => {
|
|
2111
2109
|
(0, import_invariant6.invariant)(invitation.swarmKey, void 0, {
|
|
2112
2110
|
F: __dxlog_file7,
|
|
2113
|
-
L:
|
|
2111
|
+
L: 358,
|
|
2114
2112
|
S: this,
|
|
2115
2113
|
A: [
|
|
2116
2114
|
"invitation.swarmKey",
|
|
@@ -2427,7 +2425,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2427
2425
|
}
|
|
2428
2426
|
createIntroduction() {
|
|
2429
2427
|
return {
|
|
2430
|
-
profile: this._signingContext.
|
|
2428
|
+
profile: this._signingContext.getProfile()
|
|
2431
2429
|
};
|
|
2432
2430
|
}
|
|
2433
2431
|
async createAdmissionRequest() {
|
|
@@ -2605,7 +2603,7 @@ var getPlatform = () => {
|
|
|
2605
2603
|
};
|
|
2606
2604
|
|
|
2607
2605
|
// packages/sdk/client-services/src/version.ts
|
|
2608
|
-
var DXOS_VERSION = "0.3.5-main.
|
|
2606
|
+
var DXOS_VERSION = "0.3.5-main.b6099e9";
|
|
2609
2607
|
|
|
2610
2608
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2611
2609
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -3320,6 +3318,21 @@ var DataSpace = class DataSpace2 {
|
|
|
3320
3318
|
await this._metadataStore.setWritableFeedKeys(this.key, this.inner.controlFeedKey, this.inner.dataFeedKey);
|
|
3321
3319
|
}
|
|
3322
3320
|
}
|
|
3321
|
+
// TODO(dmaretskyi): Use profile from signing context.
|
|
3322
|
+
async updateOwnProfile(profile) {
|
|
3323
|
+
const credential = await this._signingContext.credentialSigner.createCredential({
|
|
3324
|
+
subject: this._signingContext.identityKey,
|
|
3325
|
+
assertion: {
|
|
3326
|
+
"@type": "dxos.halo.credentials.MemberProfile",
|
|
3327
|
+
profile
|
|
3328
|
+
}
|
|
3329
|
+
});
|
|
3330
|
+
await this.inner.controlPipeline.writer.write({
|
|
3331
|
+
credential: {
|
|
3332
|
+
credential
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
}
|
|
3323
3336
|
async createEpoch() {
|
|
3324
3337
|
const epoch = await this.dataPipeline.createEpoch();
|
|
3325
3338
|
const receipt = await this.inner.controlPipeline.writer.write({
|
|
@@ -3368,7 +3381,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3368
3381
|
state: import_services7.SpaceState[this._state]
|
|
3369
3382
|
}, {
|
|
3370
3383
|
F: __dxlog_file12,
|
|
3371
|
-
L:
|
|
3384
|
+
L: 404,
|
|
3372
3385
|
S: this,
|
|
3373
3386
|
C: (f, a) => f(...a)
|
|
3374
3387
|
});
|
|
@@ -3428,7 +3441,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3428
3441
|
"@type": "dxos.halo.credentials.SpaceMember",
|
|
3429
3442
|
spaceKey: space.key,
|
|
3430
3443
|
role: import_credentials12.SpaceMember.Role.ADMIN,
|
|
3431
|
-
profile: signingContext.
|
|
3444
|
+
profile: signingContext.getProfile(),
|
|
3432
3445
|
genesisFeedKey: space.controlFeedKey ?? (0, import_debug5.failUndefined)()
|
|
3433
3446
|
}
|
|
3434
3447
|
}),
|
|
@@ -3485,6 +3498,8 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3485
3498
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3486
3499
|
}
|
|
3487
3500
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3501
|
+
var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
|
|
3502
|
+
var PRESENCE_OFFLINE_TIMEOUT = 2e4;
|
|
3488
3503
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3489
3504
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3490
3505
|
this._spaceManager = _spaceManager;
|
|
@@ -3506,7 +3521,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3506
3521
|
async open() {
|
|
3507
3522
|
(0, import_log11.log)("open", void 0, {
|
|
3508
3523
|
F: __dxlog_file13,
|
|
3509
|
-
L:
|
|
3524
|
+
L: 83,
|
|
3510
3525
|
S: this,
|
|
3511
3526
|
C: (f, a) => f(...a)
|
|
3512
3527
|
});
|
|
@@ -3514,7 +3529,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3514
3529
|
id: this._instanceId
|
|
3515
3530
|
}), {
|
|
3516
3531
|
F: __dxlog_file13,
|
|
3517
|
-
L:
|
|
3532
|
+
L: 84,
|
|
3518
3533
|
S: this,
|
|
3519
3534
|
C: (f, a) => f(...a)
|
|
3520
3535
|
});
|
|
@@ -3522,7 +3537,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3522
3537
|
spaces: this._metadataStore.spaces.length
|
|
3523
3538
|
}, {
|
|
3524
3539
|
F: __dxlog_file13,
|
|
3525
|
-
L:
|
|
3540
|
+
L: 85,
|
|
3526
3541
|
S: this,
|
|
3527
3542
|
C: (f, a) => f(...a)
|
|
3528
3543
|
});
|
|
@@ -3532,7 +3547,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3532
3547
|
spaceMetadata
|
|
3533
3548
|
}, {
|
|
3534
3549
|
F: __dxlog_file13,
|
|
3535
|
-
L:
|
|
3550
|
+
L: 89,
|
|
3536
3551
|
S: this,
|
|
3537
3552
|
C: (f, a) => f(...a)
|
|
3538
3553
|
});
|
|
@@ -3543,7 +3558,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3543
3558
|
err
|
|
3544
3559
|
}, {
|
|
3545
3560
|
F: __dxlog_file13,
|
|
3546
|
-
L:
|
|
3561
|
+
L: 92,
|
|
3547
3562
|
S: this,
|
|
3548
3563
|
C: (f, a) => f(...a)
|
|
3549
3564
|
});
|
|
@@ -3560,7 +3575,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3560
3575
|
id: this._instanceId
|
|
3561
3576
|
}), {
|
|
3562
3577
|
F: __dxlog_file13,
|
|
3563
|
-
L:
|
|
3578
|
+
L: 105,
|
|
3564
3579
|
S: this,
|
|
3565
3580
|
C: (f, a) => f(...a)
|
|
3566
3581
|
});
|
|
@@ -3568,7 +3583,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3568
3583
|
async close() {
|
|
3569
3584
|
(0, import_log11.log)("close", void 0, {
|
|
3570
3585
|
F: __dxlog_file13,
|
|
3571
|
-
L:
|
|
3586
|
+
L: 110,
|
|
3572
3587
|
S: this,
|
|
3573
3588
|
C: (f, a) => f(...a)
|
|
3574
3589
|
});
|
|
@@ -3584,7 +3599,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3584
3599
|
async createSpace() {
|
|
3585
3600
|
(0, import_invariant11.invariant)(this._isOpen, "Not open.", {
|
|
3586
3601
|
F: __dxlog_file13,
|
|
3587
|
-
L:
|
|
3602
|
+
L: 123,
|
|
3588
3603
|
S: this,
|
|
3589
3604
|
A: [
|
|
3590
3605
|
"this._isOpen",
|
|
@@ -3605,7 +3620,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3605
3620
|
spaceKey
|
|
3606
3621
|
}, {
|
|
3607
3622
|
F: __dxlog_file13,
|
|
3608
|
-
L:
|
|
3623
|
+
L: 135,
|
|
3609
3624
|
S: this,
|
|
3610
3625
|
C: (f, a) => f(...a)
|
|
3611
3626
|
});
|
|
@@ -3615,7 +3630,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3615
3630
|
const memberCredential = credentials[1];
|
|
3616
3631
|
(0, import_invariant11.invariant)((0, import_credentials13.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3617
3632
|
F: __dxlog_file13,
|
|
3618
|
-
L:
|
|
3633
|
+
L: 142,
|
|
3619
3634
|
S: this,
|
|
3620
3635
|
A: [
|
|
3621
3636
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -3633,13 +3648,13 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3633
3648
|
opts
|
|
3634
3649
|
}, {
|
|
3635
3650
|
F: __dxlog_file13,
|
|
3636
|
-
L:
|
|
3651
|
+
L: 154,
|
|
3637
3652
|
S: this,
|
|
3638
3653
|
C: (f, a) => f(...a)
|
|
3639
3654
|
});
|
|
3640
3655
|
(0, import_invariant11.invariant)(this._isOpen, "Not open.", {
|
|
3641
3656
|
F: __dxlog_file13,
|
|
3642
|
-
L:
|
|
3657
|
+
L: 155,
|
|
3643
3658
|
S: this,
|
|
3644
3659
|
A: [
|
|
3645
3660
|
"this._isOpen",
|
|
@@ -3648,7 +3663,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3648
3663
|
});
|
|
3649
3664
|
(0, import_invariant11.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3650
3665
|
F: __dxlog_file13,
|
|
3651
|
-
L:
|
|
3666
|
+
L: 156,
|
|
3652
3667
|
S: this,
|
|
3653
3668
|
A: [
|
|
3654
3669
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -3683,7 +3698,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3683
3698
|
metadata
|
|
3684
3699
|
}, {
|
|
3685
3700
|
F: __dxlog_file13,
|
|
3686
|
-
L:
|
|
3701
|
+
L: 189,
|
|
3687
3702
|
S: this,
|
|
3688
3703
|
C: (f, a) => f(...a)
|
|
3689
3704
|
});
|
|
@@ -3691,8 +3706,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3691
3706
|
localPeerId: this._signingContext.deviceKey
|
|
3692
3707
|
});
|
|
3693
3708
|
const presence = new import_teleport_extension_gossip.Presence({
|
|
3694
|
-
announceInterval:
|
|
3695
|
-
offlineTimeout:
|
|
3709
|
+
announceInterval: PRESENCE_ANNOUNCE_INTERVAL,
|
|
3710
|
+
offlineTimeout: PRESENCE_OFFLINE_TIMEOUT,
|
|
3696
3711
|
identityKey: this._signingContext.identityKey,
|
|
3697
3712
|
gossip
|
|
3698
3713
|
});
|
|
@@ -3719,7 +3734,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3719
3734
|
onAuthFailure: () => {
|
|
3720
3735
|
import_log11.log.warn("auth failure", void 0, {
|
|
3721
3736
|
F: __dxlog_file13,
|
|
3722
|
-
L:
|
|
3737
|
+
L: 224,
|
|
3723
3738
|
S: this,
|
|
3724
3739
|
C: (f, a) => f(...a)
|
|
3725
3740
|
});
|
|
@@ -3743,7 +3758,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3743
3758
|
space: space.key
|
|
3744
3759
|
}, {
|
|
3745
3760
|
F: __dxlog_file13,
|
|
3746
|
-
L:
|
|
3761
|
+
L: 242,
|
|
3747
3762
|
S: this,
|
|
3748
3763
|
C: (f, a) => f(...a)
|
|
3749
3764
|
});
|
|
@@ -3755,7 +3770,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3755
3770
|
open: this._isOpen
|
|
3756
3771
|
}, {
|
|
3757
3772
|
F: __dxlog_file13,
|
|
3758
|
-
L:
|
|
3773
|
+
L: 249,
|
|
3759
3774
|
S: this,
|
|
3760
3775
|
C: (f, a) => f(...a)
|
|
3761
3776
|
});
|
|
@@ -3768,7 +3783,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3768
3783
|
space: space.key
|
|
3769
3784
|
}, {
|
|
3770
3785
|
F: __dxlog_file13,
|
|
3771
|
-
L:
|
|
3786
|
+
L: 255,
|
|
3772
3787
|
S: this,
|
|
3773
3788
|
C: (f, a) => f(...a)
|
|
3774
3789
|
});
|
|
@@ -4012,7 +4027,7 @@ var SpacesServiceImpl = class {
|
|
|
4012
4027
|
identity: {
|
|
4013
4028
|
identityKey: member.key,
|
|
4014
4029
|
profile: {
|
|
4015
|
-
displayName: member.
|
|
4030
|
+
displayName: member.profile?.displayName
|
|
4016
4031
|
}
|
|
4017
4032
|
},
|
|
4018
4033
|
presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
@@ -4157,6 +4172,14 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4157
4172
|
});
|
|
4158
4173
|
return factory(invitation);
|
|
4159
4174
|
}
|
|
4175
|
+
async broadcastProfileUpdate(profile) {
|
|
4176
|
+
if (!profile || !this.dataSpaceManager) {
|
|
4177
|
+
return;
|
|
4178
|
+
}
|
|
4179
|
+
for (const space of this.dataSpaceManager.spaces.values()) {
|
|
4180
|
+
await space.updateOwnProfile(profile);
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4160
4183
|
async _acceptIdentity(params) {
|
|
4161
4184
|
const identity = await this.identityManager.acceptIdentity(params);
|
|
4162
4185
|
await this._initialize(new import_context9.Context());
|
|
@@ -4172,7 +4195,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4172
4195
|
async _initialize(ctx) {
|
|
4173
4196
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
4174
4197
|
F: __dxlog_file15,
|
|
4175
|
-
L:
|
|
4198
|
+
L: 199,
|
|
4176
4199
|
S: this,
|
|
4177
4200
|
C: (f, a) => f(...a)
|
|
4178
4201
|
});
|
|
@@ -4181,7 +4204,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4181
4204
|
credentialSigner: identity.getIdentityCredentialSigner(),
|
|
4182
4205
|
identityKey: identity.identityKey,
|
|
4183
4206
|
deviceKey: identity.deviceKey,
|
|
4184
|
-
|
|
4207
|
+
getProfile: () => identity.profileDocument,
|
|
4185
4208
|
recordCredential: async (credential) => {
|
|
4186
4209
|
await identity.controlPipeline.writer.write({
|
|
4187
4210
|
credential: {
|
|
@@ -4195,7 +4218,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4195
4218
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
4196
4219
|
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4197
4220
|
F: __dxlog_file15,
|
|
4198
|
-
L:
|
|
4221
|
+
L: 222,
|
|
4199
4222
|
S: this,
|
|
4200
4223
|
A: [
|
|
4201
4224
|
"this.dataSpaceManager",
|
|
@@ -4219,7 +4242,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4219
4242
|
details: assertion
|
|
4220
4243
|
}, {
|
|
4221
4244
|
F: __dxlog_file15,
|
|
4222
|
-
L:
|
|
4245
|
+
L: 238,
|
|
4223
4246
|
S: this,
|
|
4224
4247
|
C: (f, a) => f(...a)
|
|
4225
4248
|
});
|
|
@@ -4230,7 +4253,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4230
4253
|
details: assertion
|
|
4231
4254
|
}, {
|
|
4232
4255
|
F: __dxlog_file15,
|
|
4233
|
-
L:
|
|
4256
|
+
L: 242,
|
|
4234
4257
|
S: this,
|
|
4235
4258
|
C: (f, a) => f(...a)
|
|
4236
4259
|
});
|
|
@@ -4241,7 +4264,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4241
4264
|
details: assertion
|
|
4242
4265
|
}, {
|
|
4243
4266
|
F: __dxlog_file15,
|
|
4244
|
-
L:
|
|
4267
|
+
L: 247,
|
|
4245
4268
|
S: this,
|
|
4246
4269
|
C: (f, a) => f(...a)
|
|
4247
4270
|
});
|
|
@@ -4252,7 +4275,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4252
4275
|
} catch (err) {
|
|
4253
4276
|
import_log13.log.catch(err, void 0, {
|
|
4254
4277
|
F: __dxlog_file15,
|
|
4255
|
-
L:
|
|
4278
|
+
L: 253,
|
|
4256
4279
|
S: this,
|
|
4257
4280
|
C: (f, a) => f(...a)
|
|
4258
4281
|
});
|
|
@@ -4900,7 +4923,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4900
4923
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
4901
4924
|
this._serviceRegistry.setServices({
|
|
4902
4925
|
SystemService: this._systemService,
|
|
4903
|
-
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
|
|
4926
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
4904
4927
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
4905
4928
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
4906
4929
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -4937,7 +4960,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4937
4960
|
deviceKey
|
|
4938
4961
|
}, {
|
|
4939
4962
|
F: __dxlog_file17,
|
|
4940
|
-
L:
|
|
4963
|
+
L: 317,
|
|
4941
4964
|
S: this,
|
|
4942
4965
|
C: (f, a) => f(...a)
|
|
4943
4966
|
});
|
|
@@ -4945,7 +4968,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4945
4968
|
id: traceId
|
|
4946
4969
|
}), {
|
|
4947
4970
|
F: __dxlog_file17,
|
|
4948
|
-
L:
|
|
4971
|
+
L: 318,
|
|
4949
4972
|
S: this,
|
|
4950
4973
|
C: (f, a) => f(...a)
|
|
4951
4974
|
});
|
|
@@ -4959,7 +4982,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4959
4982
|
deviceKey
|
|
4960
4983
|
}, {
|
|
4961
4984
|
F: __dxlog_file17,
|
|
4962
|
-
L:
|
|
4985
|
+
L: 329,
|
|
4963
4986
|
S: this,
|
|
4964
4987
|
C: (f, a) => f(...a)
|
|
4965
4988
|
});
|
|
@@ -4975,7 +4998,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4975
4998
|
deviceKey
|
|
4976
4999
|
}, {
|
|
4977
5000
|
F: __dxlog_file17,
|
|
4978
|
-
L:
|
|
5001
|
+
L: 336,
|
|
4979
5002
|
S: this,
|
|
4980
5003
|
C: (f, a) => f(...a)
|
|
4981
5004
|
});
|
|
@@ -4986,13 +5009,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4986
5009
|
id: traceId
|
|
4987
5010
|
}), {
|
|
4988
5011
|
F: __dxlog_file17,
|
|
4989
|
-
L:
|
|
5012
|
+
L: 341,
|
|
4990
5013
|
S: this,
|
|
4991
5014
|
C: (f, a) => f(...a)
|
|
4992
5015
|
});
|
|
4993
5016
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4994
5017
|
F: __dxlog_file17,
|
|
4995
|
-
L:
|
|
5018
|
+
L: 343,
|
|
4996
5019
|
S: this,
|
|
4997
5020
|
C: (f, a) => f(...a)
|
|
4998
5021
|
});
|
|
@@ -5000,7 +5023,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
5000
5023
|
await this._storage.reset();
|
|
5001
5024
|
(0, import_log16.log)("reset", void 0, {
|
|
5002
5025
|
F: __dxlog_file17,
|
|
5003
|
-
L:
|
|
5026
|
+
L: 346,
|
|
5004
5027
|
S: this,
|
|
5005
5028
|
C: (f, a) => f(...a)
|
|
5006
5029
|
});
|
|
@@ -5008,7 +5031,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
5008
5031
|
id: traceId
|
|
5009
5032
|
}), {
|
|
5010
5033
|
F: __dxlog_file17,
|
|
5011
|
-
L:
|
|
5034
|
+
L: 347,
|
|
5012
5035
|
S: this,
|
|
5013
5036
|
C: (f, a) => f(...a)
|
|
5014
5037
|
});
|