@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
|
@@ -185,7 +185,7 @@ var getPlatform = () => {
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
// packages/sdk/client-services/src/version.ts
|
|
188
|
-
var DXOS_VERSION = "0.3.5-main.
|
|
188
|
+
var DXOS_VERSION = "0.3.5-main.b6099e9";
|
|
189
189
|
|
|
190
190
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
191
191
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -1008,10 +1008,11 @@ var import_debug3 = require("@dxos/debug");
|
|
|
1008
1008
|
var import_invariant4 = require("@dxos/invariant");
|
|
1009
1009
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1010
1010
|
var IdentityServiceImpl = class {
|
|
1011
|
-
constructor(_createIdentity, _identityManager, _keyring) {
|
|
1011
|
+
constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
|
|
1012
1012
|
this._createIdentity = _createIdentity;
|
|
1013
1013
|
this._identityManager = _identityManager;
|
|
1014
1014
|
this._keyring = _keyring;
|
|
1015
|
+
this._onProfileUpdate = _onProfileUpdate;
|
|
1015
1016
|
}
|
|
1016
1017
|
async createIdentity(request) {
|
|
1017
1018
|
await this._createIdentity(request);
|
|
@@ -1042,7 +1043,7 @@ var IdentityServiceImpl = class {
|
|
|
1042
1043
|
async updateProfile(profile) {
|
|
1043
1044
|
(0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1044
1045
|
F: __dxlog_file5,
|
|
1045
|
-
L:
|
|
1046
|
+
L: 60,
|
|
1046
1047
|
S: this,
|
|
1047
1048
|
A: [
|
|
1048
1049
|
"this._identityManager.identity",
|
|
@@ -1050,12 +1051,13 @@ var IdentityServiceImpl = class {
|
|
|
1050
1051
|
]
|
|
1051
1052
|
});
|
|
1052
1053
|
await this._identityManager.updateProfile(profile);
|
|
1054
|
+
await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
|
|
1053
1055
|
return this._getIdentity();
|
|
1054
1056
|
}
|
|
1055
1057
|
async signPresentation({ presentation, nonce }) {
|
|
1056
1058
|
(0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
|
|
1057
1059
|
F: __dxlog_file5,
|
|
1058
|
-
L:
|
|
1060
|
+
L: 67,
|
|
1059
1061
|
S: this,
|
|
1060
1062
|
A: [
|
|
1061
1063
|
"this._identityManager.identity",
|
|
@@ -1274,7 +1276,6 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1274
1276
|
C: (f, a) => f(...a)
|
|
1275
1277
|
});
|
|
1276
1278
|
return {
|
|
1277
|
-
spaceKey: this.invitation.authMethod === import_services3.Invitation.AuthMethod.NONE ? this.invitation.spaceKey : void 0,
|
|
1278
1279
|
authMethod: this.invitation.authMethod
|
|
1279
1280
|
};
|
|
1280
1281
|
},
|
|
@@ -1284,7 +1285,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1284
1285
|
id: traceId
|
|
1285
1286
|
}), {
|
|
1286
1287
|
F: __dxlog_file7,
|
|
1287
|
-
L:
|
|
1288
|
+
L: 124,
|
|
1288
1289
|
S: this,
|
|
1289
1290
|
C: (f, a) => f(...a)
|
|
1290
1291
|
});
|
|
@@ -1292,14 +1293,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1292
1293
|
authCode: code
|
|
1293
1294
|
}, {
|
|
1294
1295
|
F: __dxlog_file7,
|
|
1295
|
-
L:
|
|
1296
|
+
L: 125,
|
|
1296
1297
|
S: this,
|
|
1297
1298
|
C: (f, a) => f(...a)
|
|
1298
1299
|
});
|
|
1299
1300
|
let status = import_invitations.AuthenticationResponse.Status.OK;
|
|
1300
1301
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1301
1302
|
F: __dxlog_file7,
|
|
1302
|
-
L:
|
|
1303
|
+
L: 128,
|
|
1303
1304
|
S: this,
|
|
1304
1305
|
A: [
|
|
1305
1306
|
"this.invitation",
|
|
@@ -1310,7 +1311,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1310
1311
|
case import_services3.Invitation.AuthMethod.NONE: {
|
|
1311
1312
|
(0, import_log5.log)("authentication not required", void 0, {
|
|
1312
1313
|
F: __dxlog_file7,
|
|
1313
|
-
L:
|
|
1314
|
+
L: 131,
|
|
1314
1315
|
S: this,
|
|
1315
1316
|
C: (f, a) => f(...a)
|
|
1316
1317
|
});
|
|
@@ -1335,7 +1336,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1335
1336
|
authMethod: this.invitation.authMethod
|
|
1336
1337
|
}, {
|
|
1337
1338
|
F: __dxlog_file7,
|
|
1338
|
-
L:
|
|
1339
|
+
L: 149,
|
|
1339
1340
|
S: this,
|
|
1340
1341
|
C: (f, a) => f(...a)
|
|
1341
1342
|
});
|
|
@@ -1350,7 +1351,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1350
1351
|
}
|
|
1351
1352
|
}), {
|
|
1352
1353
|
F: __dxlog_file7,
|
|
1353
|
-
L:
|
|
1354
|
+
L: 155,
|
|
1354
1355
|
S: this,
|
|
1355
1356
|
C: (f, a) => f(...a)
|
|
1356
1357
|
});
|
|
@@ -1364,14 +1365,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1364
1365
|
id: traceId
|
|
1365
1366
|
}), {
|
|
1366
1367
|
F: __dxlog_file7,
|
|
1367
|
-
L:
|
|
1368
|
+
L: 161,
|
|
1368
1369
|
S: this,
|
|
1369
1370
|
C: (f, a) => f(...a)
|
|
1370
1371
|
});
|
|
1371
1372
|
try {
|
|
1372
1373
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1373
1374
|
F: __dxlog_file7,
|
|
1374
|
-
L:
|
|
1375
|
+
L: 164,
|
|
1375
1376
|
S: this,
|
|
1376
1377
|
A: [
|
|
1377
1378
|
"this.invitation",
|
|
@@ -1386,7 +1387,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1386
1387
|
id: traceId
|
|
1387
1388
|
}), {
|
|
1388
1389
|
F: __dxlog_file7,
|
|
1389
|
-
L:
|
|
1390
|
+
L: 172,
|
|
1390
1391
|
S: this,
|
|
1391
1392
|
C: (f, a) => f(...a)
|
|
1392
1393
|
});
|
|
@@ -1443,7 +1444,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1443
1444
|
options: async (options) => {
|
|
1444
1445
|
(0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1445
1446
|
F: __dxlog_file7,
|
|
1446
|
-
L:
|
|
1447
|
+
L: 239,
|
|
1447
1448
|
S: this,
|
|
1448
1449
|
A: [
|
|
1449
1450
|
"!this._remoteOptions",
|
|
@@ -1470,7 +1471,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1470
1471
|
try {
|
|
1471
1472
|
(0, import_log5.log)("begin options", void 0, {
|
|
1472
1473
|
F: __dxlog_file7,
|
|
1473
|
-
L:
|
|
1474
|
+
L: 260,
|
|
1474
1475
|
S: this,
|
|
1475
1476
|
C: (f, a) => f(...a)
|
|
1476
1477
|
});
|
|
@@ -1482,7 +1483,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1482
1483
|
}));
|
|
1483
1484
|
(0, import_log5.log)("end options", void 0, {
|
|
1484
1485
|
F: __dxlog_file7,
|
|
1485
|
-
L:
|
|
1486
|
+
L: 263,
|
|
1486
1487
|
S: this,
|
|
1487
1488
|
C: (f, a) => f(...a)
|
|
1488
1489
|
});
|
|
@@ -1496,7 +1497,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1496
1497
|
} catch (err) {
|
|
1497
1498
|
(0, import_log5.log)("openError", err, {
|
|
1498
1499
|
F: __dxlog_file7,
|
|
1499
|
-
L:
|
|
1500
|
+
L: 273,
|
|
1500
1501
|
S: this,
|
|
1501
1502
|
C: (f, a) => f(...a)
|
|
1502
1503
|
});
|
|
@@ -1506,7 +1507,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1506
1507
|
async onClose() {
|
|
1507
1508
|
(0, import_log5.log)("onClose", void 0, {
|
|
1508
1509
|
F: __dxlog_file7,
|
|
1509
|
-
L:
|
|
1510
|
+
L: 279,
|
|
1510
1511
|
S: this,
|
|
1511
1512
|
C: (f, a) => f(...a)
|
|
1512
1513
|
});
|
|
@@ -1877,14 +1878,11 @@ var InvitationsHandler = class {
|
|
|
1877
1878
|
C: (f, a) => f(...a)
|
|
1878
1879
|
});
|
|
1879
1880
|
invitation.authMethod = introductionResponse.authMethod;
|
|
1880
|
-
if (introductionResponse.spaceKey) {
|
|
1881
|
-
invitation.spaceKey = introductionResponse.spaceKey;
|
|
1882
|
-
}
|
|
1883
1881
|
if (isAuthenticationRequired(invitation)) {
|
|
1884
1882
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1885
1883
|
(0, import_log6.log)("guest waiting for authentication code...", void 0, {
|
|
1886
1884
|
F: __dxlog_file8,
|
|
1887
|
-
L:
|
|
1885
|
+
L: 286,
|
|
1888
1886
|
S: this,
|
|
1889
1887
|
C: (f, a) => f(...a)
|
|
1890
1888
|
});
|
|
@@ -1896,7 +1894,7 @@ var InvitationsHandler = class {
|
|
|
1896
1894
|
});
|
|
1897
1895
|
(0, import_log6.log)("sending authentication request", void 0, {
|
|
1898
1896
|
F: __dxlog_file8,
|
|
1899
|
-
L:
|
|
1897
|
+
L: 290,
|
|
1900
1898
|
S: this,
|
|
1901
1899
|
C: (f, a) => f(...a)
|
|
1902
1900
|
});
|
|
@@ -1917,7 +1915,7 @@ var InvitationsHandler = class {
|
|
|
1917
1915
|
attempt
|
|
1918
1916
|
}, {
|
|
1919
1917
|
F: __dxlog_file8,
|
|
1920
|
-
L:
|
|
1918
|
+
L: 301,
|
|
1921
1919
|
S: this,
|
|
1922
1920
|
C: (f, a) => f(...a)
|
|
1923
1921
|
});
|
|
@@ -1934,7 +1932,7 @@ var InvitationsHandler = class {
|
|
|
1934
1932
|
...protocol.toJSON()
|
|
1935
1933
|
}, {
|
|
1936
1934
|
F: __dxlog_file8,
|
|
1937
|
-
L:
|
|
1935
|
+
L: 312,
|
|
1938
1936
|
S: this,
|
|
1939
1937
|
C: (f, a) => f(...a)
|
|
1940
1938
|
});
|
|
@@ -1946,7 +1944,7 @@ var InvitationsHandler = class {
|
|
|
1946
1944
|
...protocol.toJSON()
|
|
1947
1945
|
}, {
|
|
1948
1946
|
F: __dxlog_file8,
|
|
1949
|
-
L:
|
|
1947
|
+
L: 323,
|
|
1950
1948
|
S: this,
|
|
1951
1949
|
C: (f, a) => f(...a)
|
|
1952
1950
|
});
|
|
@@ -1958,7 +1956,7 @@ var InvitationsHandler = class {
|
|
|
1958
1956
|
id: traceId
|
|
1959
1957
|
}), {
|
|
1960
1958
|
F: __dxlog_file8,
|
|
1961
|
-
L:
|
|
1959
|
+
L: 325,
|
|
1962
1960
|
S: this,
|
|
1963
1961
|
C: (f, a) => f(...a)
|
|
1964
1962
|
});
|
|
@@ -1968,7 +1966,7 @@ var InvitationsHandler = class {
|
|
|
1968
1966
|
...protocol.toJSON()
|
|
1969
1967
|
}, {
|
|
1970
1968
|
F: __dxlog_file8,
|
|
1971
|
-
L:
|
|
1969
|
+
L: 328,
|
|
1972
1970
|
S: this,
|
|
1973
1971
|
C: (f, a) => f(...a)
|
|
1974
1972
|
});
|
|
@@ -1978,7 +1976,7 @@ var InvitationsHandler = class {
|
|
|
1978
1976
|
} else {
|
|
1979
1977
|
(0, import_log6.log)("auth failed", err, {
|
|
1980
1978
|
F: __dxlog_file8,
|
|
1981
|
-
L:
|
|
1979
|
+
L: 331,
|
|
1982
1980
|
S: this,
|
|
1983
1981
|
C: (f, a) => f(...a)
|
|
1984
1982
|
});
|
|
@@ -1989,7 +1987,7 @@ var InvitationsHandler = class {
|
|
|
1989
1987
|
error: err
|
|
1990
1988
|
}), {
|
|
1991
1989
|
F: __dxlog_file8,
|
|
1992
|
-
L:
|
|
1990
|
+
L: 334,
|
|
1993
1991
|
S: this,
|
|
1994
1992
|
C: (f, a) => f(...a)
|
|
1995
1993
|
});
|
|
@@ -2007,7 +2005,7 @@ var InvitationsHandler = class {
|
|
|
2007
2005
|
...protocol.toJSON()
|
|
2008
2006
|
}, {
|
|
2009
2007
|
F: __dxlog_file8,
|
|
2010
|
-
L:
|
|
2008
|
+
L: 345,
|
|
2011
2009
|
S: this,
|
|
2012
2010
|
C: (f, a) => f(...a)
|
|
2013
2011
|
});
|
|
@@ -2017,7 +2015,7 @@ var InvitationsHandler = class {
|
|
|
2017
2015
|
} else {
|
|
2018
2016
|
(0, import_log6.log)("auth failed", err, {
|
|
2019
2017
|
F: __dxlog_file8,
|
|
2020
|
-
L:
|
|
2018
|
+
L: 348,
|
|
2021
2019
|
S: this,
|
|
2022
2020
|
C: (f, a) => f(...a)
|
|
2023
2021
|
});
|
|
@@ -2030,7 +2028,7 @@ var InvitationsHandler = class {
|
|
|
2030
2028
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
2031
2029
|
(0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
|
|
2032
2030
|
F: __dxlog_file8,
|
|
2033
|
-
L:
|
|
2031
|
+
L: 358,
|
|
2034
2032
|
S: this,
|
|
2035
2033
|
A: [
|
|
2036
2034
|
"invitation.swarmKey",
|
|
@@ -2347,7 +2345,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2347
2345
|
}
|
|
2348
2346
|
createIntroduction() {
|
|
2349
2347
|
return {
|
|
2350
|
-
profile: this._signingContext.
|
|
2348
|
+
profile: this._signingContext.getProfile()
|
|
2351
2349
|
};
|
|
2352
2350
|
}
|
|
2353
2351
|
async createAdmissionRequest() {
|
|
@@ -2978,6 +2976,21 @@ var DataSpace = class DataSpace2 {
|
|
|
2978
2976
|
await this._metadataStore.setWritableFeedKeys(this.key, this.inner.controlFeedKey, this.inner.dataFeedKey);
|
|
2979
2977
|
}
|
|
2980
2978
|
}
|
|
2979
|
+
// TODO(dmaretskyi): Use profile from signing context.
|
|
2980
|
+
async updateOwnProfile(profile) {
|
|
2981
|
+
const credential = await this._signingContext.credentialSigner.createCredential({
|
|
2982
|
+
subject: this._signingContext.identityKey,
|
|
2983
|
+
assertion: {
|
|
2984
|
+
"@type": "dxos.halo.credentials.MemberProfile",
|
|
2985
|
+
profile
|
|
2986
|
+
}
|
|
2987
|
+
});
|
|
2988
|
+
await this.inner.controlPipeline.writer.write({
|
|
2989
|
+
credential: {
|
|
2990
|
+
credential
|
|
2991
|
+
}
|
|
2992
|
+
});
|
|
2993
|
+
}
|
|
2981
2994
|
async createEpoch() {
|
|
2982
2995
|
const epoch = await this.dataPipeline.createEpoch();
|
|
2983
2996
|
const receipt = await this.inner.controlPipeline.writer.write({
|
|
@@ -3026,7 +3039,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3026
3039
|
state: import_services7.SpaceState[this._state]
|
|
3027
3040
|
}, {
|
|
3028
3041
|
F: __dxlog_file12,
|
|
3029
|
-
L:
|
|
3042
|
+
L: 404,
|
|
3030
3043
|
S: this,
|
|
3031
3044
|
C: (f, a) => f(...a)
|
|
3032
3045
|
});
|
|
@@ -3086,7 +3099,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
3086
3099
|
"@type": "dxos.halo.credentials.SpaceMember",
|
|
3087
3100
|
spaceKey: space.key,
|
|
3088
3101
|
role: import_credentials13.SpaceMember.Role.ADMIN,
|
|
3089
|
-
profile: signingContext.
|
|
3102
|
+
profile: signingContext.getProfile(),
|
|
3090
3103
|
genesisFeedKey: space.controlFeedKey ?? (0, import_debug5.failUndefined)()
|
|
3091
3104
|
}
|
|
3092
3105
|
}),
|
|
@@ -3143,6 +3156,8 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3143
3156
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3144
3157
|
}
|
|
3145
3158
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3159
|
+
var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
|
|
3160
|
+
var PRESENCE_OFFLINE_TIMEOUT = 2e4;
|
|
3146
3161
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3147
3162
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3148
3163
|
this._spaceManager = _spaceManager;
|
|
@@ -3164,7 +3179,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3164
3179
|
async open() {
|
|
3165
3180
|
(0, import_log11.log)("open", void 0, {
|
|
3166
3181
|
F: __dxlog_file13,
|
|
3167
|
-
L:
|
|
3182
|
+
L: 83,
|
|
3168
3183
|
S: this,
|
|
3169
3184
|
C: (f, a) => f(...a)
|
|
3170
3185
|
});
|
|
@@ -3172,7 +3187,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3172
3187
|
id: this._instanceId
|
|
3173
3188
|
}), {
|
|
3174
3189
|
F: __dxlog_file13,
|
|
3175
|
-
L:
|
|
3190
|
+
L: 84,
|
|
3176
3191
|
S: this,
|
|
3177
3192
|
C: (f, a) => f(...a)
|
|
3178
3193
|
});
|
|
@@ -3180,7 +3195,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3180
3195
|
spaces: this._metadataStore.spaces.length
|
|
3181
3196
|
}, {
|
|
3182
3197
|
F: __dxlog_file13,
|
|
3183
|
-
L:
|
|
3198
|
+
L: 85,
|
|
3184
3199
|
S: this,
|
|
3185
3200
|
C: (f, a) => f(...a)
|
|
3186
3201
|
});
|
|
@@ -3190,7 +3205,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3190
3205
|
spaceMetadata
|
|
3191
3206
|
}, {
|
|
3192
3207
|
F: __dxlog_file13,
|
|
3193
|
-
L:
|
|
3208
|
+
L: 89,
|
|
3194
3209
|
S: this,
|
|
3195
3210
|
C: (f, a) => f(...a)
|
|
3196
3211
|
});
|
|
@@ -3201,7 +3216,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3201
3216
|
err
|
|
3202
3217
|
}, {
|
|
3203
3218
|
F: __dxlog_file13,
|
|
3204
|
-
L:
|
|
3219
|
+
L: 92,
|
|
3205
3220
|
S: this,
|
|
3206
3221
|
C: (f, a) => f(...a)
|
|
3207
3222
|
});
|
|
@@ -3218,7 +3233,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3218
3233
|
id: this._instanceId
|
|
3219
3234
|
}), {
|
|
3220
3235
|
F: __dxlog_file13,
|
|
3221
|
-
L:
|
|
3236
|
+
L: 105,
|
|
3222
3237
|
S: this,
|
|
3223
3238
|
C: (f, a) => f(...a)
|
|
3224
3239
|
});
|
|
@@ -3226,7 +3241,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3226
3241
|
async close() {
|
|
3227
3242
|
(0, import_log11.log)("close", void 0, {
|
|
3228
3243
|
F: __dxlog_file13,
|
|
3229
|
-
L:
|
|
3244
|
+
L: 110,
|
|
3230
3245
|
S: this,
|
|
3231
3246
|
C: (f, a) => f(...a)
|
|
3232
3247
|
});
|
|
@@ -3242,7 +3257,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3242
3257
|
async createSpace() {
|
|
3243
3258
|
(0, import_invariant11.invariant)(this._isOpen, "Not open.", {
|
|
3244
3259
|
F: __dxlog_file13,
|
|
3245
|
-
L:
|
|
3260
|
+
L: 123,
|
|
3246
3261
|
S: this,
|
|
3247
3262
|
A: [
|
|
3248
3263
|
"this._isOpen",
|
|
@@ -3263,7 +3278,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3263
3278
|
spaceKey
|
|
3264
3279
|
}, {
|
|
3265
3280
|
F: __dxlog_file13,
|
|
3266
|
-
L:
|
|
3281
|
+
L: 135,
|
|
3267
3282
|
S: this,
|
|
3268
3283
|
C: (f, a) => f(...a)
|
|
3269
3284
|
});
|
|
@@ -3273,7 +3288,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3273
3288
|
const memberCredential = credentials[1];
|
|
3274
3289
|
(0, import_invariant11.invariant)((0, import_credentials14.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3275
3290
|
F: __dxlog_file13,
|
|
3276
|
-
L:
|
|
3291
|
+
L: 142,
|
|
3277
3292
|
S: this,
|
|
3278
3293
|
A: [
|
|
3279
3294
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -3291,13 +3306,13 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3291
3306
|
opts
|
|
3292
3307
|
}, {
|
|
3293
3308
|
F: __dxlog_file13,
|
|
3294
|
-
L:
|
|
3309
|
+
L: 154,
|
|
3295
3310
|
S: this,
|
|
3296
3311
|
C: (f, a) => f(...a)
|
|
3297
3312
|
});
|
|
3298
3313
|
(0, import_invariant11.invariant)(this._isOpen, "Not open.", {
|
|
3299
3314
|
F: __dxlog_file13,
|
|
3300
|
-
L:
|
|
3315
|
+
L: 155,
|
|
3301
3316
|
S: this,
|
|
3302
3317
|
A: [
|
|
3303
3318
|
"this._isOpen",
|
|
@@ -3306,7 +3321,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3306
3321
|
});
|
|
3307
3322
|
(0, import_invariant11.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3308
3323
|
F: __dxlog_file13,
|
|
3309
|
-
L:
|
|
3324
|
+
L: 156,
|
|
3310
3325
|
S: this,
|
|
3311
3326
|
A: [
|
|
3312
3327
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -3341,7 +3356,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3341
3356
|
metadata
|
|
3342
3357
|
}, {
|
|
3343
3358
|
F: __dxlog_file13,
|
|
3344
|
-
L:
|
|
3359
|
+
L: 189,
|
|
3345
3360
|
S: this,
|
|
3346
3361
|
C: (f, a) => f(...a)
|
|
3347
3362
|
});
|
|
@@ -3349,8 +3364,8 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3349
3364
|
localPeerId: this._signingContext.deviceKey
|
|
3350
3365
|
});
|
|
3351
3366
|
const presence = new import_teleport_extension_gossip.Presence({
|
|
3352
|
-
announceInterval:
|
|
3353
|
-
offlineTimeout:
|
|
3367
|
+
announceInterval: PRESENCE_ANNOUNCE_INTERVAL,
|
|
3368
|
+
offlineTimeout: PRESENCE_OFFLINE_TIMEOUT,
|
|
3354
3369
|
identityKey: this._signingContext.identityKey,
|
|
3355
3370
|
gossip
|
|
3356
3371
|
});
|
|
@@ -3377,7 +3392,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3377
3392
|
onAuthFailure: () => {
|
|
3378
3393
|
import_log11.log.warn("auth failure", void 0, {
|
|
3379
3394
|
F: __dxlog_file13,
|
|
3380
|
-
L:
|
|
3395
|
+
L: 224,
|
|
3381
3396
|
S: this,
|
|
3382
3397
|
C: (f, a) => f(...a)
|
|
3383
3398
|
});
|
|
@@ -3401,7 +3416,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3401
3416
|
space: space.key
|
|
3402
3417
|
}, {
|
|
3403
3418
|
F: __dxlog_file13,
|
|
3404
|
-
L:
|
|
3419
|
+
L: 242,
|
|
3405
3420
|
S: this,
|
|
3406
3421
|
C: (f, a) => f(...a)
|
|
3407
3422
|
});
|
|
@@ -3413,7 +3428,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3413
3428
|
open: this._isOpen
|
|
3414
3429
|
}, {
|
|
3415
3430
|
F: __dxlog_file13,
|
|
3416
|
-
L:
|
|
3431
|
+
L: 249,
|
|
3417
3432
|
S: this,
|
|
3418
3433
|
C: (f, a) => f(...a)
|
|
3419
3434
|
});
|
|
@@ -3426,7 +3441,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3426
3441
|
space: space.key
|
|
3427
3442
|
}, {
|
|
3428
3443
|
F: __dxlog_file13,
|
|
3429
|
-
L:
|
|
3444
|
+
L: 255,
|
|
3430
3445
|
S: this,
|
|
3431
3446
|
C: (f, a) => f(...a)
|
|
3432
3447
|
});
|
|
@@ -3670,7 +3685,7 @@ var SpacesServiceImpl = class {
|
|
|
3670
3685
|
identity: {
|
|
3671
3686
|
identityKey: member.key,
|
|
3672
3687
|
profile: {
|
|
3673
|
-
displayName: member.
|
|
3688
|
+
displayName: member.profile?.displayName
|
|
3674
3689
|
}
|
|
3675
3690
|
},
|
|
3676
3691
|
presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
@@ -3815,6 +3830,14 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3815
3830
|
});
|
|
3816
3831
|
return factory(invitation);
|
|
3817
3832
|
}
|
|
3833
|
+
async broadcastProfileUpdate(profile) {
|
|
3834
|
+
if (!profile || !this.dataSpaceManager) {
|
|
3835
|
+
return;
|
|
3836
|
+
}
|
|
3837
|
+
for (const space of this.dataSpaceManager.spaces.values()) {
|
|
3838
|
+
await space.updateOwnProfile(profile);
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3818
3841
|
async _acceptIdentity(params) {
|
|
3819
3842
|
const identity = await this.identityManager.acceptIdentity(params);
|
|
3820
3843
|
await this._initialize(new import_context8.Context());
|
|
@@ -3830,7 +3853,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3830
3853
|
async _initialize(ctx) {
|
|
3831
3854
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
3832
3855
|
F: __dxlog_file15,
|
|
3833
|
-
L:
|
|
3856
|
+
L: 199,
|
|
3834
3857
|
S: this,
|
|
3835
3858
|
C: (f, a) => f(...a)
|
|
3836
3859
|
});
|
|
@@ -3839,7 +3862,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3839
3862
|
credentialSigner: identity.getIdentityCredentialSigner(),
|
|
3840
3863
|
identityKey: identity.identityKey,
|
|
3841
3864
|
deviceKey: identity.deviceKey,
|
|
3842
|
-
|
|
3865
|
+
getProfile: () => identity.profileDocument,
|
|
3843
3866
|
recordCredential: async (credential) => {
|
|
3844
3867
|
await identity.controlPipeline.writer.write({
|
|
3845
3868
|
credential: {
|
|
@@ -3853,7 +3876,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3853
3876
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
3854
3877
|
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
3855
3878
|
F: __dxlog_file15,
|
|
3856
|
-
L:
|
|
3879
|
+
L: 222,
|
|
3857
3880
|
S: this,
|
|
3858
3881
|
A: [
|
|
3859
3882
|
"this.dataSpaceManager",
|
|
@@ -3877,7 +3900,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3877
3900
|
details: assertion
|
|
3878
3901
|
}, {
|
|
3879
3902
|
F: __dxlog_file15,
|
|
3880
|
-
L:
|
|
3903
|
+
L: 238,
|
|
3881
3904
|
S: this,
|
|
3882
3905
|
C: (f, a) => f(...a)
|
|
3883
3906
|
});
|
|
@@ -3888,7 +3911,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3888
3911
|
details: assertion
|
|
3889
3912
|
}, {
|
|
3890
3913
|
F: __dxlog_file15,
|
|
3891
|
-
L:
|
|
3914
|
+
L: 242,
|
|
3892
3915
|
S: this,
|
|
3893
3916
|
C: (f, a) => f(...a)
|
|
3894
3917
|
});
|
|
@@ -3899,7 +3922,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3899
3922
|
details: assertion
|
|
3900
3923
|
}, {
|
|
3901
3924
|
F: __dxlog_file15,
|
|
3902
|
-
L:
|
|
3925
|
+
L: 247,
|
|
3903
3926
|
S: this,
|
|
3904
3927
|
C: (f, a) => f(...a)
|
|
3905
3928
|
});
|
|
@@ -3910,7 +3933,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3910
3933
|
} catch (err) {
|
|
3911
3934
|
import_log13.log.catch(err, void 0, {
|
|
3912
3935
|
F: __dxlog_file15,
|
|
3913
|
-
L:
|
|
3936
|
+
L: 253,
|
|
3914
3937
|
S: this,
|
|
3915
3938
|
C: (f, a) => f(...a)
|
|
3916
3939
|
});
|
|
@@ -4865,7 +4888,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4865
4888
|
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
4866
4889
|
this._serviceRegistry.setServices({
|
|
4867
4890
|
SystemService: this._systemService,
|
|
4868
|
-
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
|
|
4891
|
+
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
4869
4892
|
InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
|
|
4870
4893
|
DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
|
|
4871
4894
|
SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
|
|
@@ -4902,7 +4925,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4902
4925
|
deviceKey
|
|
4903
4926
|
}, {
|
|
4904
4927
|
F: __dxlog_file17,
|
|
4905
|
-
L:
|
|
4928
|
+
L: 317,
|
|
4906
4929
|
S: this,
|
|
4907
4930
|
C: (f, a) => f(...a)
|
|
4908
4931
|
});
|
|
@@ -4910,7 +4933,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4910
4933
|
id: traceId
|
|
4911
4934
|
}), {
|
|
4912
4935
|
F: __dxlog_file17,
|
|
4913
|
-
L:
|
|
4936
|
+
L: 318,
|
|
4914
4937
|
S: this,
|
|
4915
4938
|
C: (f, a) => f(...a)
|
|
4916
4939
|
});
|
|
@@ -4924,7 +4947,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4924
4947
|
deviceKey
|
|
4925
4948
|
}, {
|
|
4926
4949
|
F: __dxlog_file17,
|
|
4927
|
-
L:
|
|
4950
|
+
L: 329,
|
|
4928
4951
|
S: this,
|
|
4929
4952
|
C: (f, a) => f(...a)
|
|
4930
4953
|
});
|
|
@@ -4940,7 +4963,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4940
4963
|
deviceKey
|
|
4941
4964
|
}, {
|
|
4942
4965
|
F: __dxlog_file17,
|
|
4943
|
-
L:
|
|
4966
|
+
L: 336,
|
|
4944
4967
|
S: this,
|
|
4945
4968
|
C: (f, a) => f(...a)
|
|
4946
4969
|
});
|
|
@@ -4951,13 +4974,13 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4951
4974
|
id: traceId
|
|
4952
4975
|
}), {
|
|
4953
4976
|
F: __dxlog_file17,
|
|
4954
|
-
L:
|
|
4977
|
+
L: 341,
|
|
4955
4978
|
S: this,
|
|
4956
4979
|
C: (f, a) => f(...a)
|
|
4957
4980
|
});
|
|
4958
4981
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4959
4982
|
F: __dxlog_file17,
|
|
4960
|
-
L:
|
|
4983
|
+
L: 343,
|
|
4961
4984
|
S: this,
|
|
4962
4985
|
C: (f, a) => f(...a)
|
|
4963
4986
|
});
|
|
@@ -4965,7 +4988,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4965
4988
|
await this._storage.reset();
|
|
4966
4989
|
(0, import_log16.log)("reset", void 0, {
|
|
4967
4990
|
F: __dxlog_file17,
|
|
4968
|
-
L:
|
|
4991
|
+
L: 346,
|
|
4969
4992
|
S: this,
|
|
4970
4993
|
C: (f, a) => f(...a)
|
|
4971
4994
|
});
|
|
@@ -4973,7 +4996,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4973
4996
|
id: traceId
|
|
4974
4997
|
}), {
|
|
4975
4998
|
F: __dxlog_file17,
|
|
4976
|
-
L:
|
|
4999
|
+
L: 347,
|
|
4977
5000
|
S: this,
|
|
4978
5001
|
C: (f, a) => f(...a)
|
|
4979
5002
|
});
|
|
@@ -5334,7 +5357,8 @@ var createSigningContext = async (keyring) => {
|
|
|
5334
5357
|
credential: await new import_credentials16.CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey)
|
|
5335
5358
|
}, deviceKey),
|
|
5336
5359
|
recordCredential: async () => {
|
|
5337
|
-
}
|
|
5360
|
+
},
|
|
5361
|
+
getProfile: () => void 0
|
|
5338
5362
|
};
|
|
5339
5363
|
};
|
|
5340
5364
|
// Annotate the CommonJS export names for ESM import in node:
|