@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
|
@@ -1019,10 +1019,11 @@ import { todo } from "@dxos/debug";
|
|
|
1019
1019
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1020
1020
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1021
1021
|
var IdentityServiceImpl = class {
|
|
1022
|
-
constructor(_createIdentity, _identityManager, _keyring) {
|
|
1022
|
+
constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
|
|
1023
1023
|
this._createIdentity = _createIdentity;
|
|
1024
1024
|
this._identityManager = _identityManager;
|
|
1025
1025
|
this._keyring = _keyring;
|
|
1026
|
+
this._onProfileUpdate = _onProfileUpdate;
|
|
1026
1027
|
}
|
|
1027
1028
|
async createIdentity(request) {
|
|
1028
1029
|
await this._createIdentity(request);
|
|
@@ -1053,7 +1054,7 @@ var IdentityServiceImpl = class {
|
|
|
1053
1054
|
async updateProfile(profile) {
|
|
1054
1055
|
invariant3(this._identityManager.identity, "Identity not initialized.", {
|
|
1055
1056
|
F: __dxlog_file4,
|
|
1056
|
-
L:
|
|
1057
|
+
L: 60,
|
|
1057
1058
|
S: this,
|
|
1058
1059
|
A: [
|
|
1059
1060
|
"this._identityManager.identity",
|
|
@@ -1061,12 +1062,13 @@ var IdentityServiceImpl = class {
|
|
|
1061
1062
|
]
|
|
1062
1063
|
});
|
|
1063
1064
|
await this._identityManager.updateProfile(profile);
|
|
1065
|
+
await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
|
|
1064
1066
|
return this._getIdentity();
|
|
1065
1067
|
}
|
|
1066
1068
|
async signPresentation({ presentation, nonce }) {
|
|
1067
1069
|
invariant3(this._identityManager.identity, "Identity not initialized.", {
|
|
1068
1070
|
F: __dxlog_file4,
|
|
1069
|
-
L:
|
|
1071
|
+
L: 67,
|
|
1070
1072
|
S: this,
|
|
1071
1073
|
A: [
|
|
1072
1074
|
"this._identityManager.identity",
|
|
@@ -1285,7 +1287,6 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1285
1287
|
C: (f, a) => f(...a)
|
|
1286
1288
|
});
|
|
1287
1289
|
return {
|
|
1288
|
-
spaceKey: this.invitation.authMethod === Invitation2.AuthMethod.NONE ? this.invitation.spaceKey : void 0,
|
|
1289
1290
|
authMethod: this.invitation.authMethod
|
|
1290
1291
|
};
|
|
1291
1292
|
},
|
|
@@ -1295,7 +1296,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1295
1296
|
id: traceId
|
|
1296
1297
|
}), {
|
|
1297
1298
|
F: __dxlog_file6,
|
|
1298
|
-
L:
|
|
1299
|
+
L: 124,
|
|
1299
1300
|
S: this,
|
|
1300
1301
|
C: (f, a) => f(...a)
|
|
1301
1302
|
});
|
|
@@ -1303,14 +1304,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1303
1304
|
authCode: code
|
|
1304
1305
|
}, {
|
|
1305
1306
|
F: __dxlog_file6,
|
|
1306
|
-
L:
|
|
1307
|
+
L: 125,
|
|
1307
1308
|
S: this,
|
|
1308
1309
|
C: (f, a) => f(...a)
|
|
1309
1310
|
});
|
|
1310
1311
|
let status = AuthenticationResponse.Status.OK;
|
|
1311
1312
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1312
1313
|
F: __dxlog_file6,
|
|
1313
|
-
L:
|
|
1314
|
+
L: 128,
|
|
1314
1315
|
S: this,
|
|
1315
1316
|
A: [
|
|
1316
1317
|
"this.invitation",
|
|
@@ -1321,7 +1322,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1321
1322
|
case Invitation2.AuthMethod.NONE: {
|
|
1322
1323
|
log4("authentication not required", void 0, {
|
|
1323
1324
|
F: __dxlog_file6,
|
|
1324
|
-
L:
|
|
1325
|
+
L: 131,
|
|
1325
1326
|
S: this,
|
|
1326
1327
|
C: (f, a) => f(...a)
|
|
1327
1328
|
});
|
|
@@ -1346,7 +1347,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1346
1347
|
authMethod: this.invitation.authMethod
|
|
1347
1348
|
}, {
|
|
1348
1349
|
F: __dxlog_file6,
|
|
1349
|
-
L:
|
|
1350
|
+
L: 149,
|
|
1350
1351
|
S: this,
|
|
1351
1352
|
C: (f, a) => f(...a)
|
|
1352
1353
|
});
|
|
@@ -1361,7 +1362,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1361
1362
|
}
|
|
1362
1363
|
}), {
|
|
1363
1364
|
F: __dxlog_file6,
|
|
1364
|
-
L:
|
|
1365
|
+
L: 155,
|
|
1365
1366
|
S: this,
|
|
1366
1367
|
C: (f, a) => f(...a)
|
|
1367
1368
|
});
|
|
@@ -1375,14 +1376,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1375
1376
|
id: traceId
|
|
1376
1377
|
}), {
|
|
1377
1378
|
F: __dxlog_file6,
|
|
1378
|
-
L:
|
|
1379
|
+
L: 161,
|
|
1379
1380
|
S: this,
|
|
1380
1381
|
C: (f, a) => f(...a)
|
|
1381
1382
|
});
|
|
1382
1383
|
try {
|
|
1383
1384
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1384
1385
|
F: __dxlog_file6,
|
|
1385
|
-
L:
|
|
1386
|
+
L: 164,
|
|
1386
1387
|
S: this,
|
|
1387
1388
|
A: [
|
|
1388
1389
|
"this.invitation",
|
|
@@ -1397,7 +1398,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1397
1398
|
id: traceId
|
|
1398
1399
|
}), {
|
|
1399
1400
|
F: __dxlog_file6,
|
|
1400
|
-
L:
|
|
1401
|
+
L: 172,
|
|
1401
1402
|
S: this,
|
|
1402
1403
|
C: (f, a) => f(...a)
|
|
1403
1404
|
});
|
|
@@ -1454,7 +1455,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1454
1455
|
options: async (options) => {
|
|
1455
1456
|
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1456
1457
|
F: __dxlog_file6,
|
|
1457
|
-
L:
|
|
1458
|
+
L: 239,
|
|
1458
1459
|
S: this,
|
|
1459
1460
|
A: [
|
|
1460
1461
|
"!this._remoteOptions",
|
|
@@ -1481,7 +1482,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1481
1482
|
try {
|
|
1482
1483
|
log4("begin options", void 0, {
|
|
1483
1484
|
F: __dxlog_file6,
|
|
1484
|
-
L:
|
|
1485
|
+
L: 260,
|
|
1485
1486
|
S: this,
|
|
1486
1487
|
C: (f, a) => f(...a)
|
|
1487
1488
|
});
|
|
@@ -1493,7 +1494,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1493
1494
|
}));
|
|
1494
1495
|
log4("end options", void 0, {
|
|
1495
1496
|
F: __dxlog_file6,
|
|
1496
|
-
L:
|
|
1497
|
+
L: 263,
|
|
1497
1498
|
S: this,
|
|
1498
1499
|
C: (f, a) => f(...a)
|
|
1499
1500
|
});
|
|
@@ -1507,7 +1508,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1507
1508
|
} catch (err) {
|
|
1508
1509
|
log4("openError", err, {
|
|
1509
1510
|
F: __dxlog_file6,
|
|
1510
|
-
L:
|
|
1511
|
+
L: 273,
|
|
1511
1512
|
S: this,
|
|
1512
1513
|
C: (f, a) => f(...a)
|
|
1513
1514
|
});
|
|
@@ -1517,7 +1518,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1517
1518
|
async onClose() {
|
|
1518
1519
|
log4("onClose", void 0, {
|
|
1519
1520
|
F: __dxlog_file6,
|
|
1520
|
-
L:
|
|
1521
|
+
L: 279,
|
|
1521
1522
|
S: this,
|
|
1522
1523
|
C: (f, a) => f(...a)
|
|
1523
1524
|
});
|
|
@@ -1888,14 +1889,11 @@ var InvitationsHandler = class {
|
|
|
1888
1889
|
C: (f, a) => f(...a)
|
|
1889
1890
|
});
|
|
1890
1891
|
invitation.authMethod = introductionResponse.authMethod;
|
|
1891
|
-
if (introductionResponse.spaceKey) {
|
|
1892
|
-
invitation.spaceKey = introductionResponse.spaceKey;
|
|
1893
|
-
}
|
|
1894
1892
|
if (isAuthenticationRequired(invitation)) {
|
|
1895
1893
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1896
1894
|
log5("guest waiting for authentication code...", void 0, {
|
|
1897
1895
|
F: __dxlog_file7,
|
|
1898
|
-
L:
|
|
1896
|
+
L: 286,
|
|
1899
1897
|
S: this,
|
|
1900
1898
|
C: (f, a) => f(...a)
|
|
1901
1899
|
});
|
|
@@ -1907,7 +1905,7 @@ var InvitationsHandler = class {
|
|
|
1907
1905
|
});
|
|
1908
1906
|
log5("sending authentication request", void 0, {
|
|
1909
1907
|
F: __dxlog_file7,
|
|
1910
|
-
L:
|
|
1908
|
+
L: 290,
|
|
1911
1909
|
S: this,
|
|
1912
1910
|
C: (f, a) => f(...a)
|
|
1913
1911
|
});
|
|
@@ -1928,7 +1926,7 @@ var InvitationsHandler = class {
|
|
|
1928
1926
|
attempt
|
|
1929
1927
|
}, {
|
|
1930
1928
|
F: __dxlog_file7,
|
|
1931
|
-
L:
|
|
1929
|
+
L: 301,
|
|
1932
1930
|
S: this,
|
|
1933
1931
|
C: (f, a) => f(...a)
|
|
1934
1932
|
});
|
|
@@ -1945,7 +1943,7 @@ var InvitationsHandler = class {
|
|
|
1945
1943
|
...protocol.toJSON()
|
|
1946
1944
|
}, {
|
|
1947
1945
|
F: __dxlog_file7,
|
|
1948
|
-
L:
|
|
1946
|
+
L: 312,
|
|
1949
1947
|
S: this,
|
|
1950
1948
|
C: (f, a) => f(...a)
|
|
1951
1949
|
});
|
|
@@ -1957,7 +1955,7 @@ var InvitationsHandler = class {
|
|
|
1957
1955
|
...protocol.toJSON()
|
|
1958
1956
|
}, {
|
|
1959
1957
|
F: __dxlog_file7,
|
|
1960
|
-
L:
|
|
1958
|
+
L: 323,
|
|
1961
1959
|
S: this,
|
|
1962
1960
|
C: (f, a) => f(...a)
|
|
1963
1961
|
});
|
|
@@ -1969,7 +1967,7 @@ var InvitationsHandler = class {
|
|
|
1969
1967
|
id: traceId
|
|
1970
1968
|
}), {
|
|
1971
1969
|
F: __dxlog_file7,
|
|
1972
|
-
L:
|
|
1970
|
+
L: 325,
|
|
1973
1971
|
S: this,
|
|
1974
1972
|
C: (f, a) => f(...a)
|
|
1975
1973
|
});
|
|
@@ -1979,7 +1977,7 @@ var InvitationsHandler = class {
|
|
|
1979
1977
|
...protocol.toJSON()
|
|
1980
1978
|
}, {
|
|
1981
1979
|
F: __dxlog_file7,
|
|
1982
|
-
L:
|
|
1980
|
+
L: 328,
|
|
1983
1981
|
S: this,
|
|
1984
1982
|
C: (f, a) => f(...a)
|
|
1985
1983
|
});
|
|
@@ -1989,7 +1987,7 @@ var InvitationsHandler = class {
|
|
|
1989
1987
|
} else {
|
|
1990
1988
|
log5("auth failed", err, {
|
|
1991
1989
|
F: __dxlog_file7,
|
|
1992
|
-
L:
|
|
1990
|
+
L: 331,
|
|
1993
1991
|
S: this,
|
|
1994
1992
|
C: (f, a) => f(...a)
|
|
1995
1993
|
});
|
|
@@ -2000,7 +1998,7 @@ var InvitationsHandler = class {
|
|
|
2000
1998
|
error: err
|
|
2001
1999
|
}), {
|
|
2002
2000
|
F: __dxlog_file7,
|
|
2003
|
-
L:
|
|
2001
|
+
L: 334,
|
|
2004
2002
|
S: this,
|
|
2005
2003
|
C: (f, a) => f(...a)
|
|
2006
2004
|
});
|
|
@@ -2018,7 +2016,7 @@ var InvitationsHandler = class {
|
|
|
2018
2016
|
...protocol.toJSON()
|
|
2019
2017
|
}, {
|
|
2020
2018
|
F: __dxlog_file7,
|
|
2021
|
-
L:
|
|
2019
|
+
L: 345,
|
|
2022
2020
|
S: this,
|
|
2023
2021
|
C: (f, a) => f(...a)
|
|
2024
2022
|
});
|
|
@@ -2028,7 +2026,7 @@ var InvitationsHandler = class {
|
|
|
2028
2026
|
} else {
|
|
2029
2027
|
log5("auth failed", err, {
|
|
2030
2028
|
F: __dxlog_file7,
|
|
2031
|
-
L:
|
|
2029
|
+
L: 348,
|
|
2032
2030
|
S: this,
|
|
2033
2031
|
C: (f, a) => f(...a)
|
|
2034
2032
|
});
|
|
@@ -2041,7 +2039,7 @@ var InvitationsHandler = class {
|
|
|
2041
2039
|
scheduleTask2(ctx, async () => {
|
|
2042
2040
|
invariant6(invitation.swarmKey, void 0, {
|
|
2043
2041
|
F: __dxlog_file7,
|
|
2044
|
-
L:
|
|
2042
|
+
L: 358,
|
|
2045
2043
|
S: this,
|
|
2046
2044
|
A: [
|
|
2047
2045
|
"invitation.swarmKey",
|
|
@@ -2358,7 +2356,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2358
2356
|
}
|
|
2359
2357
|
createIntroduction() {
|
|
2360
2358
|
return {
|
|
2361
|
-
profile: this._signingContext.
|
|
2359
|
+
profile: this._signingContext.getProfile()
|
|
2362
2360
|
};
|
|
2363
2361
|
}
|
|
2364
2362
|
async createAdmissionRequest() {
|
|
@@ -2536,7 +2534,7 @@ var getPlatform = () => {
|
|
|
2536
2534
|
};
|
|
2537
2535
|
|
|
2538
2536
|
// packages/sdk/client-services/src/version.ts
|
|
2539
|
-
var DXOS_VERSION = "0.3.5-main.
|
|
2537
|
+
var DXOS_VERSION = "0.3.5-main.b6099e9";
|
|
2540
2538
|
|
|
2541
2539
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2542
2540
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -3222,6 +3220,21 @@ var DataSpace = class DataSpace2 {
|
|
|
3222
3220
|
await this._metadataStore.setWritableFeedKeys(this.key, this.inner.controlFeedKey, this.inner.dataFeedKey);
|
|
3223
3221
|
}
|
|
3224
3222
|
}
|
|
3223
|
+
// TODO(dmaretskyi): Use profile from signing context.
|
|
3224
|
+
async updateOwnProfile(profile) {
|
|
3225
|
+
const credential = await this._signingContext.credentialSigner.createCredential({
|
|
3226
|
+
subject: this._signingContext.identityKey,
|
|
3227
|
+
assertion: {
|
|
3228
|
+
"@type": "dxos.halo.credentials.MemberProfile",
|
|
3229
|
+
profile
|
|
3230
|
+
}
|
|
3231
|
+
});
|
|
3232
|
+
await this.inner.controlPipeline.writer.write({
|
|
3233
|
+
credential: {
|
|
3234
|
+
credential
|
|
3235
|
+
}
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3225
3238
|
async createEpoch() {
|
|
3226
3239
|
const epoch = await this.dataPipeline.createEpoch();
|
|
3227
3240
|
const receipt = await this.inner.controlPipeline.writer.write({
|
|
@@ -3270,7 +3283,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3270
3283
|
state: SpaceState[this._state]
|
|
3271
3284
|
}, {
|
|
3272
3285
|
F: __dxlog_file12,
|
|
3273
|
-
L:
|
|
3286
|
+
L: 404,
|
|
3274
3287
|
S: this,
|
|
3275
3288
|
C: (f, a) => f(...a)
|
|
3276
3289
|
});
|
|
@@ -3342,7 +3355,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3342
3355
|
"@type": "dxos.halo.credentials.SpaceMember",
|
|
3343
3356
|
spaceKey: space.key,
|
|
3344
3357
|
role: SpaceMember2.Role.ADMIN,
|
|
3345
|
-
profile: signingContext.
|
|
3358
|
+
profile: signingContext.getProfile(),
|
|
3346
3359
|
genesisFeedKey: space.controlFeedKey ?? failUndefined2()
|
|
3347
3360
|
}
|
|
3348
3361
|
}),
|
|
@@ -3399,6 +3412,8 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3399
3412
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3400
3413
|
}
|
|
3401
3414
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3415
|
+
var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
|
|
3416
|
+
var PRESENCE_OFFLINE_TIMEOUT = 2e4;
|
|
3402
3417
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3403
3418
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3404
3419
|
this._spaceManager = _spaceManager;
|
|
@@ -3420,7 +3435,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3420
3435
|
async open() {
|
|
3421
3436
|
log11("open", void 0, {
|
|
3422
3437
|
F: __dxlog_file13,
|
|
3423
|
-
L:
|
|
3438
|
+
L: 83,
|
|
3424
3439
|
S: this,
|
|
3425
3440
|
C: (f, a) => f(...a)
|
|
3426
3441
|
});
|
|
@@ -3428,7 +3443,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3428
3443
|
id: this._instanceId
|
|
3429
3444
|
}), {
|
|
3430
3445
|
F: __dxlog_file13,
|
|
3431
|
-
L:
|
|
3446
|
+
L: 84,
|
|
3432
3447
|
S: this,
|
|
3433
3448
|
C: (f, a) => f(...a)
|
|
3434
3449
|
});
|
|
@@ -3436,7 +3451,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3436
3451
|
spaces: this._metadataStore.spaces.length
|
|
3437
3452
|
}, {
|
|
3438
3453
|
F: __dxlog_file13,
|
|
3439
|
-
L:
|
|
3454
|
+
L: 85,
|
|
3440
3455
|
S: this,
|
|
3441
3456
|
C: (f, a) => f(...a)
|
|
3442
3457
|
});
|
|
@@ -3446,7 +3461,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3446
3461
|
spaceMetadata
|
|
3447
3462
|
}, {
|
|
3448
3463
|
F: __dxlog_file13,
|
|
3449
|
-
L:
|
|
3464
|
+
L: 89,
|
|
3450
3465
|
S: this,
|
|
3451
3466
|
C: (f, a) => f(...a)
|
|
3452
3467
|
});
|
|
@@ -3457,7 +3472,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3457
3472
|
err
|
|
3458
3473
|
}, {
|
|
3459
3474
|
F: __dxlog_file13,
|
|
3460
|
-
L:
|
|
3475
|
+
L: 92,
|
|
3461
3476
|
S: this,
|
|
3462
3477
|
C: (f, a) => f(...a)
|
|
3463
3478
|
});
|
|
@@ -3474,7 +3489,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3474
3489
|
id: this._instanceId
|
|
3475
3490
|
}), {
|
|
3476
3491
|
F: __dxlog_file13,
|
|
3477
|
-
L:
|
|
3492
|
+
L: 105,
|
|
3478
3493
|
S: this,
|
|
3479
3494
|
C: (f, a) => f(...a)
|
|
3480
3495
|
});
|
|
@@ -3482,7 +3497,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3482
3497
|
async close() {
|
|
3483
3498
|
log11("close", void 0, {
|
|
3484
3499
|
F: __dxlog_file13,
|
|
3485
|
-
L:
|
|
3500
|
+
L: 110,
|
|
3486
3501
|
S: this,
|
|
3487
3502
|
C: (f, a) => f(...a)
|
|
3488
3503
|
});
|
|
@@ -3498,7 +3513,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3498
3513
|
async createSpace() {
|
|
3499
3514
|
invariant11(this._isOpen, "Not open.", {
|
|
3500
3515
|
F: __dxlog_file13,
|
|
3501
|
-
L:
|
|
3516
|
+
L: 123,
|
|
3502
3517
|
S: this,
|
|
3503
3518
|
A: [
|
|
3504
3519
|
"this._isOpen",
|
|
@@ -3519,7 +3534,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3519
3534
|
spaceKey
|
|
3520
3535
|
}, {
|
|
3521
3536
|
F: __dxlog_file13,
|
|
3522
|
-
L:
|
|
3537
|
+
L: 135,
|
|
3523
3538
|
S: this,
|
|
3524
3539
|
C: (f, a) => f(...a)
|
|
3525
3540
|
});
|
|
@@ -3529,7 +3544,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3529
3544
|
const memberCredential = credentials[1];
|
|
3530
3545
|
invariant11(getCredentialAssertion2(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3531
3546
|
F: __dxlog_file13,
|
|
3532
|
-
L:
|
|
3547
|
+
L: 142,
|
|
3533
3548
|
S: this,
|
|
3534
3549
|
A: [
|
|
3535
3550
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -3547,13 +3562,13 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3547
3562
|
opts
|
|
3548
3563
|
}, {
|
|
3549
3564
|
F: __dxlog_file13,
|
|
3550
|
-
L:
|
|
3565
|
+
L: 154,
|
|
3551
3566
|
S: this,
|
|
3552
3567
|
C: (f, a) => f(...a)
|
|
3553
3568
|
});
|
|
3554
3569
|
invariant11(this._isOpen, "Not open.", {
|
|
3555
3570
|
F: __dxlog_file13,
|
|
3556
|
-
L:
|
|
3571
|
+
L: 155,
|
|
3557
3572
|
S: this,
|
|
3558
3573
|
A: [
|
|
3559
3574
|
"this._isOpen",
|
|
@@ -3562,7 +3577,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3562
3577
|
});
|
|
3563
3578
|
invariant11(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3564
3579
|
F: __dxlog_file13,
|
|
3565
|
-
L:
|
|
3580
|
+
L: 156,
|
|
3566
3581
|
S: this,
|
|
3567
3582
|
A: [
|
|
3568
3583
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -3597,7 +3612,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3597
3612
|
metadata
|
|
3598
3613
|
}, {
|
|
3599
3614
|
F: __dxlog_file13,
|
|
3600
|
-
L:
|
|
3615
|
+
L: 189,
|
|
3601
3616
|
S: this,
|
|
3602
3617
|
C: (f, a) => f(...a)
|
|
3603
3618
|
});
|
|
@@ -3605,8 +3620,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3605
3620
|
localPeerId: this._signingContext.deviceKey
|
|
3606
3621
|
});
|
|
3607
3622
|
const presence = new Presence({
|
|
3608
|
-
announceInterval:
|
|
3609
|
-
offlineTimeout:
|
|
3623
|
+
announceInterval: PRESENCE_ANNOUNCE_INTERVAL,
|
|
3624
|
+
offlineTimeout: PRESENCE_OFFLINE_TIMEOUT,
|
|
3610
3625
|
identityKey: this._signingContext.identityKey,
|
|
3611
3626
|
gossip
|
|
3612
3627
|
});
|
|
@@ -3633,7 +3648,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3633
3648
|
onAuthFailure: () => {
|
|
3634
3649
|
log11.warn("auth failure", void 0, {
|
|
3635
3650
|
F: __dxlog_file13,
|
|
3636
|
-
L:
|
|
3651
|
+
L: 224,
|
|
3637
3652
|
S: this,
|
|
3638
3653
|
C: (f, a) => f(...a)
|
|
3639
3654
|
});
|
|
@@ -3657,7 +3672,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3657
3672
|
space: space.key
|
|
3658
3673
|
}, {
|
|
3659
3674
|
F: __dxlog_file13,
|
|
3660
|
-
L:
|
|
3675
|
+
L: 242,
|
|
3661
3676
|
S: this,
|
|
3662
3677
|
C: (f, a) => f(...a)
|
|
3663
3678
|
});
|
|
@@ -3669,7 +3684,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3669
3684
|
open: this._isOpen
|
|
3670
3685
|
}, {
|
|
3671
3686
|
F: __dxlog_file13,
|
|
3672
|
-
L:
|
|
3687
|
+
L: 249,
|
|
3673
3688
|
S: this,
|
|
3674
3689
|
C: (f, a) => f(...a)
|
|
3675
3690
|
});
|
|
@@ -3682,7 +3697,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3682
3697
|
space: space.key
|
|
3683
3698
|
}, {
|
|
3684
3699
|
F: __dxlog_file13,
|
|
3685
|
-
L:
|
|
3700
|
+
L: 255,
|
|
3686
3701
|
S: this,
|
|
3687
3702
|
C: (f, a) => f(...a)
|
|
3688
3703
|
});
|
|
@@ -3926,7 +3941,7 @@ var SpacesServiceImpl = class {
|
|
|
3926
3941
|
identity: {
|
|
3927
3942
|
identityKey: member.key,
|
|
3928
3943
|
profile: {
|
|
3929
|
-
displayName: member.
|
|
3944
|
+
displayName: member.profile?.displayName
|
|
3930
3945
|
}
|
|
3931
3946
|
},
|
|
3932
3947
|
presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
|
|
@@ -4086,6 +4101,14 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4086
4101
|
});
|
|
4087
4102
|
return factory(invitation);
|
|
4088
4103
|
}
|
|
4104
|
+
async broadcastProfileUpdate(profile) {
|
|
4105
|
+
if (!profile || !this.dataSpaceManager) {
|
|
4106
|
+
return;
|
|
4107
|
+
}
|
|
4108
|
+
for (const space of this.dataSpaceManager.spaces.values()) {
|
|
4109
|
+
await space.updateOwnProfile(profile);
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4089
4112
|
async _acceptIdentity(params) {
|
|
4090
4113
|
const identity = await this.identityManager.acceptIdentity(params);
|
|
4091
4114
|
await this._initialize(new Context9());
|
|
@@ -4101,7 +4124,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4101
4124
|
async _initialize(ctx) {
|
|
4102
4125
|
log13("initializing spaces...", void 0, {
|
|
4103
4126
|
F: __dxlog_file15,
|
|
4104
|
-
L:
|
|
4127
|
+
L: 199,
|
|
4105
4128
|
S: this,
|
|
4106
4129
|
C: (f, a) => f(...a)
|
|
4107
4130
|
});
|
|
@@ -4110,7 +4133,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4110
4133
|
credentialSigner: identity.getIdentityCredentialSigner(),
|
|
4111
4134
|
identityKey: identity.identityKey,
|
|
4112
4135
|
deviceKey: identity.deviceKey,
|
|
4113
|
-
|
|
4136
|
+
getProfile: () => identity.profileDocument,
|
|
4114
4137
|
recordCredential: async (credential) => {
|
|
4115
4138
|
await identity.controlPipeline.writer.write({
|
|
4116
4139
|
credential: {
|
|
@@ -4124,7 +4147,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4124
4147
|
this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
|
|
4125
4148
|
invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4126
4149
|
F: __dxlog_file15,
|
|
4127
|
-
L:
|
|
4150
|
+
L: 222,
|
|
4128
4151
|
S: this,
|
|
4129
4152
|
A: [
|
|
4130
4153
|
"this.dataSpaceManager",
|
|
@@ -4148,7 +4171,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4148
4171
|
details: assertion
|
|
4149
4172
|
}, {
|
|
4150
4173
|
F: __dxlog_file15,
|
|
4151
|
-
L:
|
|
4174
|
+
L: 238,
|
|
4152
4175
|
S: this,
|
|
4153
4176
|
C: (f, a) => f(...a)
|
|
4154
4177
|
});
|
|
@@ -4159,7 +4182,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4159
4182
|
details: assertion
|
|
4160
4183
|
}, {
|
|
4161
4184
|
F: __dxlog_file15,
|
|
4162
|
-
L:
|
|
4185
|
+
L: 242,
|
|
4163
4186
|
S: this,
|
|
4164
4187
|
C: (f, a) => f(...a)
|
|
4165
4188
|
});
|
|
@@ -4170,7 +4193,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4170
4193
|
details: assertion
|
|
4171
4194
|
}, {
|
|
4172
4195
|
F: __dxlog_file15,
|
|
4173
|
-
L:
|
|
4196
|
+
L: 247,
|
|
4174
4197
|
S: this,
|
|
4175
4198
|
C: (f, a) => f(...a)
|
|
4176
4199
|
});
|
|
@@ -4181,7 +4204,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4181
4204
|
} catch (err) {
|
|
4182
4205
|
log13.catch(err, void 0, {
|
|
4183
4206
|
F: __dxlog_file15,
|
|
4184
|
-
L:
|
|
4207
|
+
L: 253,
|
|
4185
4208
|
S: this,
|
|
4186
4209
|
C: (f, a) => f(...a)
|
|
4187
4210
|
});
|
|
@@ -4894,7 +4917,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4894
4917
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
4895
4918
|
this._serviceRegistry.setServices({
|
|
4896
4919
|
SystemService: this._systemService,
|
|
4897
|
-
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
|
|
4920
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
4898
4921
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
4899
4922
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
4900
4923
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -4931,7 +4954,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4931
4954
|
deviceKey
|
|
4932
4955
|
}, {
|
|
4933
4956
|
F: __dxlog_file17,
|
|
4934
|
-
L:
|
|
4957
|
+
L: 317,
|
|
4935
4958
|
S: this,
|
|
4936
4959
|
C: (f, a) => f(...a)
|
|
4937
4960
|
});
|
|
@@ -4939,7 +4962,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4939
4962
|
id: traceId
|
|
4940
4963
|
}), {
|
|
4941
4964
|
F: __dxlog_file17,
|
|
4942
|
-
L:
|
|
4965
|
+
L: 318,
|
|
4943
4966
|
S: this,
|
|
4944
4967
|
C: (f, a) => f(...a)
|
|
4945
4968
|
});
|
|
@@ -4953,7 +4976,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4953
4976
|
deviceKey
|
|
4954
4977
|
}, {
|
|
4955
4978
|
F: __dxlog_file17,
|
|
4956
|
-
L:
|
|
4979
|
+
L: 329,
|
|
4957
4980
|
S: this,
|
|
4958
4981
|
C: (f, a) => f(...a)
|
|
4959
4982
|
});
|
|
@@ -4969,7 +4992,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4969
4992
|
deviceKey
|
|
4970
4993
|
}, {
|
|
4971
4994
|
F: __dxlog_file17,
|
|
4972
|
-
L:
|
|
4995
|
+
L: 336,
|
|
4973
4996
|
S: this,
|
|
4974
4997
|
C: (f, a) => f(...a)
|
|
4975
4998
|
});
|
|
@@ -4980,13 +5003,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4980
5003
|
id: traceId
|
|
4981
5004
|
}), {
|
|
4982
5005
|
F: __dxlog_file17,
|
|
4983
|
-
L:
|
|
5006
|
+
L: 341,
|
|
4984
5007
|
S: this,
|
|
4985
5008
|
C: (f, a) => f(...a)
|
|
4986
5009
|
});
|
|
4987
5010
|
log16("resetting...", void 0, {
|
|
4988
5011
|
F: __dxlog_file17,
|
|
4989
|
-
L:
|
|
5012
|
+
L: 343,
|
|
4990
5013
|
S: this,
|
|
4991
5014
|
C: (f, a) => f(...a)
|
|
4992
5015
|
});
|
|
@@ -4994,7 +5017,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4994
5017
|
await this._storage.reset();
|
|
4995
5018
|
log16("reset", void 0, {
|
|
4996
5019
|
F: __dxlog_file17,
|
|
4997
|
-
L:
|
|
5020
|
+
L: 346,
|
|
4998
5021
|
S: this,
|
|
4999
5022
|
C: (f, a) => f(...a)
|
|
5000
5023
|
});
|
|
@@ -5002,7 +5025,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
5002
5025
|
id: traceId
|
|
5003
5026
|
}), {
|
|
5004
5027
|
F: __dxlog_file17,
|
|
5005
|
-
L:
|
|
5028
|
+
L: 347,
|
|
5006
5029
|
S: this,
|
|
5007
5030
|
C: (f, a) => f(...a)
|
|
5008
5031
|
});
|
|
@@ -5079,4 +5102,4 @@ export {
|
|
|
5079
5102
|
createDefaultModelFactory,
|
|
5080
5103
|
ClientServicesHost
|
|
5081
5104
|
};
|
|
5082
|
-
//# sourceMappingURL=chunk-
|
|
5105
|
+
//# sourceMappingURL=chunk-5J2S5YZY.mjs.map
|