@dxos/client-services 0.1.58-main.c4d3e15 → 0.1.58-main.ca7a0bc
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-AZ4J4TO4.mjs → chunk-VRV74Z4M.mjs} +193 -151
- package/dist/lib/browser/chunk-VRV74Z4M.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +3 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +242 -200
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +237 -195
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.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 +3 -3
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +2 -2
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +5 -5
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -35
- package/src/packlets/devices/devices-service.test.ts +1 -1
- package/src/packlets/devtools/devtools.ts +1 -1
- package/src/packlets/identity/authenticator.ts +2 -5
- package/src/packlets/identity/identity-manager.test.ts +1 -1
- package/src/packlets/identity/identity-service.test.ts +1 -1
- package/src/packlets/identity/identity.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -1
- package/src/packlets/invitations/invitation-extension.ts +1 -2
- package/src/packlets/invitations/invitations-handler.ts +7 -8
- package/src/packlets/invitations/invitations-service.ts +5 -5
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
- package/src/packlets/network/network-service.test.ts +1 -1
- package/src/packlets/network/network-service.ts +4 -1
- package/src/packlets/services/diagnostics.ts +2 -2
- package/src/packlets/services/service-context.ts +7 -13
- package/src/packlets/services/service-host.ts +3 -3
- package/src/packlets/services/service-registry.test.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +1 -1
- package/src/packlets/spaces/data-space.ts +11 -3
- package/src/packlets/spaces/spaces-service.test.ts +1 -1
- package/src/packlets/spaces/spaces-service.ts +31 -10
- package/src/packlets/storage/storage.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +9 -9
- package/src/packlets/vault/iframe-host-runtime.ts +1 -1
- package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/packlets/vault/worker-runtime.ts +9 -6
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-AZ4J4TO4.mjs.map +0 -7
|
@@ -357,7 +357,6 @@ var createAuthProvider = (signer) => async (nonce) => {
|
|
|
357
357
|
return Credential.encode(credential);
|
|
358
358
|
};
|
|
359
359
|
var TrustedKeySetAuthVerifier = class {
|
|
360
|
-
// prettier-ignore
|
|
361
360
|
constructor(_params) {
|
|
362
361
|
this._params = _params;
|
|
363
362
|
this._ctx = new Context2();
|
|
@@ -372,7 +371,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
372
371
|
credential
|
|
373
372
|
}, {
|
|
374
373
|
F: __dxlog_file,
|
|
375
|
-
L:
|
|
374
|
+
L: 56,
|
|
376
375
|
S: this,
|
|
377
376
|
C: (f, a) => f(...a)
|
|
378
377
|
});
|
|
@@ -382,7 +381,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
382
381
|
result
|
|
383
382
|
}, {
|
|
384
383
|
F: __dxlog_file,
|
|
385
|
-
L:
|
|
384
|
+
L: 60,
|
|
386
385
|
S: this,
|
|
387
386
|
C: (f, a) => f(...a)
|
|
388
387
|
});
|
|
@@ -394,7 +393,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
394
393
|
credential
|
|
395
394
|
}, {
|
|
396
395
|
F: __dxlog_file,
|
|
397
|
-
L:
|
|
396
|
+
L: 65,
|
|
398
397
|
S: this,
|
|
399
398
|
C: (f, a) => f(...a)
|
|
400
399
|
});
|
|
@@ -405,7 +404,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
405
404
|
key: credential.issuer
|
|
406
405
|
}, {
|
|
407
406
|
F: __dxlog_file,
|
|
408
|
-
L:
|
|
407
|
+
L: 70,
|
|
409
408
|
S: this,
|
|
410
409
|
C: (f, a) => f(...a)
|
|
411
410
|
});
|
|
@@ -421,7 +420,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
421
420
|
key: credential.issuer
|
|
422
421
|
}, {
|
|
423
422
|
F: __dxlog_file,
|
|
424
|
-
L:
|
|
423
|
+
L: 81,
|
|
425
424
|
S: this,
|
|
426
425
|
C: (f, a) => f(...a)
|
|
427
426
|
});
|
|
@@ -431,7 +430,7 @@ var TrustedKeySetAuthVerifier = class {
|
|
|
431
430
|
key: credential.issuer
|
|
432
431
|
}, {
|
|
433
432
|
F: __dxlog_file,
|
|
434
|
-
L:
|
|
433
|
+
L: 84,
|
|
435
434
|
S: this,
|
|
436
435
|
C: (f, a) => f(...a)
|
|
437
436
|
});
|
|
@@ -1158,26 +1157,24 @@ var DeviceInvitationProtocol = class {
|
|
|
1158
1157
|
|
|
1159
1158
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1160
1159
|
import { PushStream, scheduleTask as scheduleTask2, TimeoutError, Trigger as Trigger3 } from "@dxos/async";
|
|
1161
|
-
import {
|
|
1160
|
+
import { AuthenticatingInvitation, AUTHENTICATION_CODE_LENGTH, CancellableInvitation, INVITATION_TIMEOUT } from "@dxos/client-protocol";
|
|
1162
1161
|
import { Context as Context5 } from "@dxos/context";
|
|
1163
1162
|
import { generatePasscode } from "@dxos/credentials";
|
|
1164
|
-
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2 } from "@dxos/errors";
|
|
1165
1163
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1166
1164
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
1167
1165
|
import { log as log5 } from "@dxos/log";
|
|
1168
1166
|
import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
|
|
1169
|
-
import { trace as trace4 } from "@dxos/protocols";
|
|
1167
|
+
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2, trace as trace4 } from "@dxos/protocols";
|
|
1170
1168
|
import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1171
1169
|
import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1172
1170
|
|
|
1173
1171
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1174
1172
|
import { Trigger as Trigger2 } from "@dxos/async";
|
|
1175
1173
|
import { cancelWithContext, Context as Context4 } from "@dxos/context";
|
|
1176
|
-
import { InvalidInvitationExtensionRoleError } from "@dxos/errors";
|
|
1177
1174
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1178
1175
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1179
1176
|
import { log as log4 } from "@dxos/log";
|
|
1180
|
-
import { schema as schema2, trace as trace3 } from "@dxos/protocols";
|
|
1177
|
+
import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3 } from "@dxos/protocols";
|
|
1181
1178
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1182
1179
|
import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1183
1180
|
import { RpcExtension } from "@dxos/teleport";
|
|
@@ -1211,7 +1208,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1211
1208
|
options: async (options) => {
|
|
1212
1209
|
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1213
1210
|
F: __dxlog_file6,
|
|
1214
|
-
L:
|
|
1211
|
+
L: 87,
|
|
1215
1212
|
S: this,
|
|
1216
1213
|
A: [
|
|
1217
1214
|
"!this._remoteOptions",
|
|
@@ -1228,7 +1225,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1228
1225
|
id: traceId
|
|
1229
1226
|
}), {
|
|
1230
1227
|
F: __dxlog_file6,
|
|
1231
|
-
L:
|
|
1228
|
+
L: 96,
|
|
1232
1229
|
S: this,
|
|
1233
1230
|
C: (f, a) => f(...a)
|
|
1234
1231
|
});
|
|
@@ -1238,7 +1235,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1238
1235
|
invitationId
|
|
1239
1236
|
}, {
|
|
1240
1237
|
F: __dxlog_file6,
|
|
1241
|
-
L:
|
|
1238
|
+
L: 100,
|
|
1242
1239
|
S: this,
|
|
1243
1240
|
C: (f, a) => f(...a)
|
|
1244
1241
|
});
|
|
@@ -1252,7 +1249,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1252
1249
|
guestProfile: profile
|
|
1253
1250
|
}, {
|
|
1254
1251
|
F: __dxlog_file6,
|
|
1255
|
-
L:
|
|
1252
|
+
L: 109,
|
|
1256
1253
|
S: this,
|
|
1257
1254
|
C: (f, a) => f(...a)
|
|
1258
1255
|
});
|
|
@@ -1265,7 +1262,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1265
1262
|
id: traceId
|
|
1266
1263
|
}), {
|
|
1267
1264
|
F: __dxlog_file6,
|
|
1268
|
-
L:
|
|
1265
|
+
L: 116,
|
|
1269
1266
|
S: this,
|
|
1270
1267
|
C: (f, a) => f(...a)
|
|
1271
1268
|
});
|
|
@@ -1280,7 +1277,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1280
1277
|
id: traceId
|
|
1281
1278
|
}), {
|
|
1282
1279
|
F: __dxlog_file6,
|
|
1283
|
-
L:
|
|
1280
|
+
L: 125,
|
|
1284
1281
|
S: this,
|
|
1285
1282
|
C: (f, a) => f(...a)
|
|
1286
1283
|
});
|
|
@@ -1288,14 +1285,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1288
1285
|
authCode: code
|
|
1289
1286
|
}, {
|
|
1290
1287
|
F: __dxlog_file6,
|
|
1291
|
-
L:
|
|
1288
|
+
L: 126,
|
|
1292
1289
|
S: this,
|
|
1293
1290
|
C: (f, a) => f(...a)
|
|
1294
1291
|
});
|
|
1295
1292
|
let status = AuthenticationResponse.Status.OK;
|
|
1296
1293
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1297
1294
|
F: __dxlog_file6,
|
|
1298
|
-
L:
|
|
1295
|
+
L: 129,
|
|
1299
1296
|
S: this,
|
|
1300
1297
|
A: [
|
|
1301
1298
|
"this.invitation",
|
|
@@ -1306,7 +1303,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1306
1303
|
case Invitation2.AuthMethod.NONE: {
|
|
1307
1304
|
log4("authentication not required", void 0, {
|
|
1308
1305
|
F: __dxlog_file6,
|
|
1309
|
-
L:
|
|
1306
|
+
L: 132,
|
|
1310
1307
|
S: this,
|
|
1311
1308
|
C: (f, a) => f(...a)
|
|
1312
1309
|
});
|
|
@@ -1331,7 +1328,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1331
1328
|
authMethod: this.invitation.authMethod
|
|
1332
1329
|
}, {
|
|
1333
1330
|
F: __dxlog_file6,
|
|
1334
|
-
L:
|
|
1331
|
+
L: 150,
|
|
1335
1332
|
S: this,
|
|
1336
1333
|
C: (f, a) => f(...a)
|
|
1337
1334
|
});
|
|
@@ -1346,7 +1343,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1346
1343
|
}
|
|
1347
1344
|
}), {
|
|
1348
1345
|
F: __dxlog_file6,
|
|
1349
|
-
L:
|
|
1346
|
+
L: 156,
|
|
1350
1347
|
S: this,
|
|
1351
1348
|
C: (f, a) => f(...a)
|
|
1352
1349
|
});
|
|
@@ -1360,14 +1357,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1360
1357
|
id: traceId
|
|
1361
1358
|
}), {
|
|
1362
1359
|
F: __dxlog_file6,
|
|
1363
|
-
L:
|
|
1360
|
+
L: 162,
|
|
1364
1361
|
S: this,
|
|
1365
1362
|
C: (f, a) => f(...a)
|
|
1366
1363
|
});
|
|
1367
1364
|
try {
|
|
1368
1365
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1369
1366
|
F: __dxlog_file6,
|
|
1370
|
-
L:
|
|
1367
|
+
L: 165,
|
|
1371
1368
|
S: this,
|
|
1372
1369
|
A: [
|
|
1373
1370
|
"this.invitation",
|
|
@@ -1382,7 +1379,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1382
1379
|
id: traceId
|
|
1383
1380
|
}), {
|
|
1384
1381
|
F: __dxlog_file6,
|
|
1385
|
-
L:
|
|
1382
|
+
L: 173,
|
|
1386
1383
|
S: this,
|
|
1387
1384
|
C: (f, a) => f(...a)
|
|
1388
1385
|
});
|
|
@@ -1439,7 +1436,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1439
1436
|
options: async (options) => {
|
|
1440
1437
|
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1441
1438
|
F: __dxlog_file6,
|
|
1442
|
-
L:
|
|
1439
|
+
L: 240,
|
|
1443
1440
|
S: this,
|
|
1444
1441
|
A: [
|
|
1445
1442
|
"!this._remoteOptions",
|
|
@@ -1466,7 +1463,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1466
1463
|
try {
|
|
1467
1464
|
log4("begin options", void 0, {
|
|
1468
1465
|
F: __dxlog_file6,
|
|
1469
|
-
L:
|
|
1466
|
+
L: 261,
|
|
1470
1467
|
S: this,
|
|
1471
1468
|
C: (f, a) => f(...a)
|
|
1472
1469
|
});
|
|
@@ -1478,7 +1475,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1478
1475
|
}));
|
|
1479
1476
|
log4("end options", void 0, {
|
|
1480
1477
|
F: __dxlog_file6,
|
|
1481
|
-
L:
|
|
1478
|
+
L: 264,
|
|
1482
1479
|
S: this,
|
|
1483
1480
|
C: (f, a) => f(...a)
|
|
1484
1481
|
});
|
|
@@ -1492,7 +1489,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1492
1489
|
} catch (err) {
|
|
1493
1490
|
log4("openError", err, {
|
|
1494
1491
|
F: __dxlog_file6,
|
|
1495
|
-
L:
|
|
1492
|
+
L: 274,
|
|
1496
1493
|
S: this,
|
|
1497
1494
|
C: (f, a) => f(...a)
|
|
1498
1495
|
});
|
|
@@ -1502,7 +1499,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1502
1499
|
async onClose() {
|
|
1503
1500
|
log4("onClose", void 0, {
|
|
1504
1501
|
F: __dxlog_file6,
|
|
1505
|
-
L:
|
|
1502
|
+
L: 280,
|
|
1506
1503
|
S: this,
|
|
1507
1504
|
C: (f, a) => f(...a)
|
|
1508
1505
|
});
|
|
@@ -1525,7 +1522,7 @@ var InvitationsHandler = class {
|
|
|
1525
1522
|
const authCode = options?.authCode ?? (authMethod === Invitation3.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1526
1523
|
invariant6(protocol, void 0, {
|
|
1527
1524
|
F: __dxlog_file7,
|
|
1528
|
-
L:
|
|
1525
|
+
L: 75,
|
|
1529
1526
|
S: this,
|
|
1530
1527
|
A: [
|
|
1531
1528
|
"protocol",
|
|
@@ -1554,7 +1551,7 @@ var InvitationsHandler = class {
|
|
|
1554
1551
|
...protocol.toJSON()
|
|
1555
1552
|
}, {
|
|
1556
1553
|
F: __dxlog_file7,
|
|
1557
|
-
L:
|
|
1554
|
+
L: 97,
|
|
1558
1555
|
S: this,
|
|
1559
1556
|
C: (f, a) => f(...a)
|
|
1560
1557
|
});
|
|
@@ -1579,7 +1576,7 @@ var InvitationsHandler = class {
|
|
|
1579
1576
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1580
1577
|
invariant6(deviceKey, void 0, {
|
|
1581
1578
|
F: __dxlog_file7,
|
|
1582
|
-
L:
|
|
1579
|
+
L: 118,
|
|
1583
1580
|
S: this,
|
|
1584
1581
|
A: [
|
|
1585
1582
|
"deviceKey",
|
|
@@ -1602,7 +1599,7 @@ var InvitationsHandler = class {
|
|
|
1602
1599
|
id: traceId
|
|
1603
1600
|
}), {
|
|
1604
1601
|
F: __dxlog_file7,
|
|
1605
|
-
L:
|
|
1602
|
+
L: 136,
|
|
1606
1603
|
S: this,
|
|
1607
1604
|
C: (f, a) => f(...a)
|
|
1608
1605
|
});
|
|
@@ -1610,7 +1607,7 @@ var InvitationsHandler = class {
|
|
|
1610
1607
|
...protocol.toJSON()
|
|
1611
1608
|
}, {
|
|
1612
1609
|
F: __dxlog_file7,
|
|
1613
|
-
L:
|
|
1610
|
+
L: 137,
|
|
1614
1611
|
S: this,
|
|
1615
1612
|
C: (f, a) => f(...a)
|
|
1616
1613
|
});
|
|
@@ -1626,7 +1623,7 @@ var InvitationsHandler = class {
|
|
|
1626
1623
|
...protocol.toJSON()
|
|
1627
1624
|
}, {
|
|
1628
1625
|
F: __dxlog_file7,
|
|
1629
|
-
L:
|
|
1626
|
+
L: 140,
|
|
1630
1627
|
S: this,
|
|
1631
1628
|
C: (f, a) => f(...a)
|
|
1632
1629
|
});
|
|
@@ -1638,7 +1635,7 @@ var InvitationsHandler = class {
|
|
|
1638
1635
|
id: traceId
|
|
1639
1636
|
}), {
|
|
1640
1637
|
F: __dxlog_file7,
|
|
1641
|
-
L:
|
|
1638
|
+
L: 142,
|
|
1642
1639
|
S: this,
|
|
1643
1640
|
C: (f, a) => f(...a)
|
|
1644
1641
|
});
|
|
@@ -1648,7 +1645,7 @@ var InvitationsHandler = class {
|
|
|
1648
1645
|
...protocol.toJSON()
|
|
1649
1646
|
}, {
|
|
1650
1647
|
F: __dxlog_file7,
|
|
1651
|
-
L:
|
|
1648
|
+
L: 145,
|
|
1652
1649
|
S: this,
|
|
1653
1650
|
C: (f, a) => f(...a)
|
|
1654
1651
|
});
|
|
@@ -1659,7 +1656,7 @@ var InvitationsHandler = class {
|
|
|
1659
1656
|
} else {
|
|
1660
1657
|
log5.error("failed", err, {
|
|
1661
1658
|
F: __dxlog_file7,
|
|
1662
|
-
L:
|
|
1659
|
+
L: 148,
|
|
1663
1660
|
S: this,
|
|
1664
1661
|
C: (f, a) => f(...a)
|
|
1665
1662
|
});
|
|
@@ -1670,7 +1667,7 @@ var InvitationsHandler = class {
|
|
|
1670
1667
|
error: err
|
|
1671
1668
|
}), {
|
|
1672
1669
|
F: __dxlog_file7,
|
|
1673
|
-
L:
|
|
1670
|
+
L: 151,
|
|
1674
1671
|
S: this,
|
|
1675
1672
|
C: (f, a) => f(...a)
|
|
1676
1673
|
});
|
|
@@ -1691,7 +1688,7 @@ var InvitationsHandler = class {
|
|
|
1691
1688
|
...protocol.toJSON()
|
|
1692
1689
|
}, {
|
|
1693
1690
|
F: __dxlog_file7,
|
|
1694
|
-
L:
|
|
1691
|
+
L: 166,
|
|
1695
1692
|
S: this,
|
|
1696
1693
|
C: (f, a) => f(...a)
|
|
1697
1694
|
});
|
|
@@ -1702,7 +1699,7 @@ var InvitationsHandler = class {
|
|
|
1702
1699
|
} else {
|
|
1703
1700
|
log5.error("failed", err, {
|
|
1704
1701
|
F: __dxlog_file7,
|
|
1705
|
-
L:
|
|
1702
|
+
L: 169,
|
|
1706
1703
|
S: this,
|
|
1707
1704
|
C: (f, a) => f(...a)
|
|
1708
1705
|
});
|
|
@@ -1730,7 +1727,7 @@ var InvitationsHandler = class {
|
|
|
1730
1727
|
state: Invitation3.State.CONNECTING
|
|
1731
1728
|
});
|
|
1732
1729
|
});
|
|
1733
|
-
const observable = new
|
|
1730
|
+
const observable = new CancellableInvitation({
|
|
1734
1731
|
initialInvitation: invitation,
|
|
1735
1732
|
subscriber: stream.observable,
|
|
1736
1733
|
onCancel: async () => {
|
|
@@ -1747,7 +1744,7 @@ var InvitationsHandler = class {
|
|
|
1747
1744
|
const { timeout = INVITATION_TIMEOUT } = invitation;
|
|
1748
1745
|
invariant6(protocol, void 0, {
|
|
1749
1746
|
F: __dxlog_file7,
|
|
1750
|
-
L:
|
|
1747
|
+
L: 210,
|
|
1751
1748
|
S: this,
|
|
1752
1749
|
A: [
|
|
1753
1750
|
"protocol",
|
|
@@ -1761,7 +1758,7 @@ var InvitationsHandler = class {
|
|
|
1761
1758
|
const setState = (newData) => {
|
|
1762
1759
|
invariant6(newData.state !== void 0, void 0, {
|
|
1763
1760
|
F: __dxlog_file7,
|
|
1764
|
-
L:
|
|
1761
|
+
L: 221,
|
|
1765
1762
|
S: this,
|
|
1766
1763
|
A: [
|
|
1767
1764
|
"newData.state !== undefined",
|
|
@@ -1781,7 +1778,7 @@ var InvitationsHandler = class {
|
|
|
1781
1778
|
...protocol.toJSON()
|
|
1782
1779
|
}, {
|
|
1783
1780
|
F: __dxlog_file7,
|
|
1784
|
-
L:
|
|
1781
|
+
L: 229,
|
|
1785
1782
|
S: this,
|
|
1786
1783
|
C: (f, a) => f(...a)
|
|
1787
1784
|
});
|
|
@@ -1791,7 +1788,7 @@ var InvitationsHandler = class {
|
|
|
1791
1788
|
} else {
|
|
1792
1789
|
log5.warn("auth failed", err, {
|
|
1793
1790
|
F: __dxlog_file7,
|
|
1794
|
-
L:
|
|
1791
|
+
L: 232,
|
|
1795
1792
|
S: this,
|
|
1796
1793
|
C: (f, a) => f(...a)
|
|
1797
1794
|
});
|
|
@@ -1805,7 +1802,7 @@ var InvitationsHandler = class {
|
|
|
1805
1802
|
...protocol.toJSON()
|
|
1806
1803
|
}, {
|
|
1807
1804
|
F: __dxlog_file7,
|
|
1808
|
-
L:
|
|
1805
|
+
L: 240,
|
|
1809
1806
|
S: this,
|
|
1810
1807
|
C: (f, a) => f(...a)
|
|
1811
1808
|
});
|
|
@@ -1820,7 +1817,7 @@ var InvitationsHandler = class {
|
|
|
1820
1817
|
currentState
|
|
1821
1818
|
}, {
|
|
1822
1819
|
F: __dxlog_file7,
|
|
1823
|
-
L:
|
|
1820
|
+
L: 250,
|
|
1824
1821
|
S: this,
|
|
1825
1822
|
C: (f, a) => f(...a)
|
|
1826
1823
|
});
|
|
@@ -1835,7 +1832,7 @@ var InvitationsHandler = class {
|
|
|
1835
1832
|
id: traceId
|
|
1836
1833
|
}), {
|
|
1837
1834
|
F: __dxlog_file7,
|
|
1838
|
-
L:
|
|
1835
|
+
L: 259,
|
|
1839
1836
|
S: this,
|
|
1840
1837
|
C: (f, a) => f(...a)
|
|
1841
1838
|
});
|
|
@@ -1847,7 +1844,7 @@ var InvitationsHandler = class {
|
|
|
1847
1844
|
...protocol.toJSON()
|
|
1848
1845
|
}, {
|
|
1849
1846
|
F: __dxlog_file7,
|
|
1850
|
-
L:
|
|
1847
|
+
L: 267,
|
|
1851
1848
|
S: this,
|
|
1852
1849
|
C: (f, a) => f(...a)
|
|
1853
1850
|
});
|
|
@@ -1858,7 +1855,7 @@ var InvitationsHandler = class {
|
|
|
1858
1855
|
...protocol.toJSON()
|
|
1859
1856
|
}, {
|
|
1860
1857
|
F: __dxlog_file7,
|
|
1861
|
-
L:
|
|
1858
|
+
L: 271,
|
|
1862
1859
|
S: this,
|
|
1863
1860
|
C: (f, a) => f(...a)
|
|
1864
1861
|
});
|
|
@@ -1868,7 +1865,7 @@ var InvitationsHandler = class {
|
|
|
1868
1865
|
response: introductionResponse
|
|
1869
1866
|
}, {
|
|
1870
1867
|
F: __dxlog_file7,
|
|
1871
|
-
L:
|
|
1868
|
+
L: 275,
|
|
1872
1869
|
S: this,
|
|
1873
1870
|
C: (f, a) => f(...a)
|
|
1874
1871
|
});
|
|
@@ -1880,7 +1877,7 @@ var InvitationsHandler = class {
|
|
|
1880
1877
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1881
1878
|
log5("guest waiting for authentication code...", void 0, {
|
|
1882
1879
|
F: __dxlog_file7,
|
|
1883
|
-
L:
|
|
1880
|
+
L: 284,
|
|
1884
1881
|
S: this,
|
|
1885
1882
|
C: (f, a) => f(...a)
|
|
1886
1883
|
});
|
|
@@ -1892,7 +1889,7 @@ var InvitationsHandler = class {
|
|
|
1892
1889
|
});
|
|
1893
1890
|
log5("sending authentication request", void 0, {
|
|
1894
1891
|
F: __dxlog_file7,
|
|
1895
|
-
L:
|
|
1892
|
+
L: 288,
|
|
1896
1893
|
S: this,
|
|
1897
1894
|
C: (f, a) => f(...a)
|
|
1898
1895
|
});
|
|
@@ -1913,7 +1910,7 @@ var InvitationsHandler = class {
|
|
|
1913
1910
|
attempt
|
|
1914
1911
|
}, {
|
|
1915
1912
|
F: __dxlog_file7,
|
|
1916
|
-
L:
|
|
1913
|
+
L: 299,
|
|
1917
1914
|
S: this,
|
|
1918
1915
|
C: (f, a) => f(...a)
|
|
1919
1916
|
});
|
|
@@ -1930,7 +1927,7 @@ var InvitationsHandler = class {
|
|
|
1930
1927
|
...protocol.toJSON()
|
|
1931
1928
|
}, {
|
|
1932
1929
|
F: __dxlog_file7,
|
|
1933
|
-
L:
|
|
1930
|
+
L: 310,
|
|
1934
1931
|
S: this,
|
|
1935
1932
|
C: (f, a) => f(...a)
|
|
1936
1933
|
});
|
|
@@ -1942,7 +1939,7 @@ var InvitationsHandler = class {
|
|
|
1942
1939
|
...protocol.toJSON()
|
|
1943
1940
|
}, {
|
|
1944
1941
|
F: __dxlog_file7,
|
|
1945
|
-
L:
|
|
1942
|
+
L: 321,
|
|
1946
1943
|
S: this,
|
|
1947
1944
|
C: (f, a) => f(...a)
|
|
1948
1945
|
});
|
|
@@ -1954,7 +1951,7 @@ var InvitationsHandler = class {
|
|
|
1954
1951
|
id: traceId
|
|
1955
1952
|
}), {
|
|
1956
1953
|
F: __dxlog_file7,
|
|
1957
|
-
L:
|
|
1954
|
+
L: 323,
|
|
1958
1955
|
S: this,
|
|
1959
1956
|
C: (f, a) => f(...a)
|
|
1960
1957
|
});
|
|
@@ -1964,7 +1961,7 @@ var InvitationsHandler = class {
|
|
|
1964
1961
|
...protocol.toJSON()
|
|
1965
1962
|
}, {
|
|
1966
1963
|
F: __dxlog_file7,
|
|
1967
|
-
L:
|
|
1964
|
+
L: 326,
|
|
1968
1965
|
S: this,
|
|
1969
1966
|
C: (f, a) => f(...a)
|
|
1970
1967
|
});
|
|
@@ -1974,7 +1971,7 @@ var InvitationsHandler = class {
|
|
|
1974
1971
|
} else {
|
|
1975
1972
|
log5("auth failed", err, {
|
|
1976
1973
|
F: __dxlog_file7,
|
|
1977
|
-
L:
|
|
1974
|
+
L: 329,
|
|
1978
1975
|
S: this,
|
|
1979
1976
|
C: (f, a) => f(...a)
|
|
1980
1977
|
});
|
|
@@ -1985,7 +1982,7 @@ var InvitationsHandler = class {
|
|
|
1985
1982
|
error: err
|
|
1986
1983
|
}), {
|
|
1987
1984
|
F: __dxlog_file7,
|
|
1988
|
-
L:
|
|
1985
|
+
L: 332,
|
|
1989
1986
|
S: this,
|
|
1990
1987
|
C: (f, a) => f(...a)
|
|
1991
1988
|
});
|
|
@@ -2003,7 +2000,7 @@ var InvitationsHandler = class {
|
|
|
2003
2000
|
...protocol.toJSON()
|
|
2004
2001
|
}, {
|
|
2005
2002
|
F: __dxlog_file7,
|
|
2006
|
-
L:
|
|
2003
|
+
L: 343,
|
|
2007
2004
|
S: this,
|
|
2008
2005
|
C: (f, a) => f(...a)
|
|
2009
2006
|
});
|
|
@@ -2013,7 +2010,7 @@ var InvitationsHandler = class {
|
|
|
2013
2010
|
} else {
|
|
2014
2011
|
log5("auth failed", err, {
|
|
2015
2012
|
F: __dxlog_file7,
|
|
2016
|
-
L:
|
|
2013
|
+
L: 346,
|
|
2017
2014
|
S: this,
|
|
2018
2015
|
C: (f, a) => f(...a)
|
|
2019
2016
|
});
|
|
@@ -2026,7 +2023,7 @@ var InvitationsHandler = class {
|
|
|
2026
2023
|
scheduleTask2(ctx, async () => {
|
|
2027
2024
|
invariant6(invitation.swarmKey, void 0, {
|
|
2028
2025
|
F: __dxlog_file7,
|
|
2029
|
-
L:
|
|
2026
|
+
L: 356,
|
|
2030
2027
|
S: this,
|
|
2031
2028
|
A: [
|
|
2032
2029
|
"invitation.swarmKey",
|
|
@@ -2048,7 +2045,7 @@ var InvitationsHandler = class {
|
|
|
2048
2045
|
state: Invitation3.State.CONNECTING
|
|
2049
2046
|
});
|
|
2050
2047
|
});
|
|
2051
|
-
const observable = new
|
|
2048
|
+
const observable = new AuthenticatingInvitation({
|
|
2052
2049
|
initialInvitation: invitation,
|
|
2053
2050
|
subscriber: stream.observable,
|
|
2054
2051
|
onCancel: async () => {
|
|
@@ -2472,9 +2469,6 @@ import { log as log8 } from "@dxos/log";
|
|
|
2472
2469
|
import { STORAGE_VERSION } from "@dxos/protocols";
|
|
2473
2470
|
import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
2474
2471
|
|
|
2475
|
-
// packages/sdk/client-services/src/version.ts
|
|
2476
|
-
var DXOS_VERSION = "0.1.58-main.c4d3e15";
|
|
2477
|
-
|
|
2478
2472
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
2479
2473
|
var getPlatform = () => {
|
|
2480
2474
|
if (process.browser) {
|
|
@@ -2503,6 +2497,9 @@ var getPlatform = () => {
|
|
|
2503
2497
|
}
|
|
2504
2498
|
};
|
|
2505
2499
|
|
|
2500
|
+
// packages/sdk/client-services/src/version.ts
|
|
2501
|
+
var DXOS_VERSION = "0.1.58-main.ca7a0bc";
|
|
2502
|
+
|
|
2506
2503
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2507
2504
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2508
2505
|
var DEFAULT_TIMEOUT = 1e3;
|
|
@@ -2627,9 +2624,9 @@ import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
|
|
|
2627
2624
|
import { cancelWithContext as cancelWithContext2, Context as Context7 } from "@dxos/context";
|
|
2628
2625
|
import { timed } from "@dxos/debug";
|
|
2629
2626
|
import { createMappedFeedWriter } from "@dxos/echo-pipeline";
|
|
2630
|
-
import { CancelledError, SystemError } from "@dxos/errors";
|
|
2631
2627
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
2632
2628
|
import { log as log10 } from "@dxos/log";
|
|
2629
|
+
import { CancelledError, SystemError } from "@dxos/protocols";
|
|
2633
2630
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2634
2631
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2635
2632
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
@@ -2938,7 +2935,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2938
2935
|
this._signingContext = params.signingContext;
|
|
2939
2936
|
this._callbacks = params.callbacks ?? {};
|
|
2940
2937
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2941
|
-
trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.
|
|
2938
|
+
trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
2942
2939
|
update: this._inner.stateUpdate,
|
|
2943
2940
|
authTimeout: AUTH_TIMEOUT2
|
|
2944
2941
|
});
|
|
@@ -2948,7 +2945,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2948
2945
|
state: SpaceState[this._state]
|
|
2949
2946
|
}, {
|
|
2950
2947
|
F: __dxlog_file12,
|
|
2951
|
-
L:
|
|
2948
|
+
L: 118,
|
|
2952
2949
|
S: this,
|
|
2953
2950
|
C: (f, a) => f(...a)
|
|
2954
2951
|
});
|
|
@@ -2982,6 +2979,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2982
2979
|
await this._open();
|
|
2983
2980
|
}
|
|
2984
2981
|
async _open() {
|
|
2982
|
+
await this._gossip.open();
|
|
2985
2983
|
await this._notarizationPlugin.open();
|
|
2986
2984
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2987
2985
|
await this._inner.open(new Context7());
|
|
@@ -2990,7 +2988,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2990
2988
|
state: SpaceState[this._state]
|
|
2991
2989
|
}, {
|
|
2992
2990
|
F: __dxlog_file12,
|
|
2993
|
-
L:
|
|
2991
|
+
L: 165,
|
|
2994
2992
|
S: this,
|
|
2995
2993
|
C: (f, a) => f(...a)
|
|
2996
2994
|
});
|
|
@@ -3008,7 +3006,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3008
3006
|
state: SpaceState[this._state]
|
|
3009
3007
|
}, {
|
|
3010
3008
|
F: __dxlog_file12,
|
|
3011
|
-
L:
|
|
3009
|
+
L: 179,
|
|
3012
3010
|
S: this,
|
|
3013
3011
|
C: (f, a) => f(...a)
|
|
3014
3012
|
});
|
|
@@ -3019,6 +3017,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3019
3017
|
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
3020
3018
|
await this._notarizationPlugin.close();
|
|
3021
3019
|
await this._presence.destroy();
|
|
3020
|
+
await this._gossip.close();
|
|
3022
3021
|
}
|
|
3023
3022
|
async postMessage(channel, message) {
|
|
3024
3023
|
return this._gossip.postMessage(channel, message);
|
|
@@ -3038,7 +3037,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3038
3037
|
if (err instanceof CancelledError) {
|
|
3039
3038
|
log10("data pipeline initialization cancelled", err, {
|
|
3040
3039
|
F: __dxlog_file12,
|
|
3041
|
-
L:
|
|
3040
|
+
L: 211,
|
|
3042
3041
|
S: this,
|
|
3043
3042
|
C: (f, a) => f(...a)
|
|
3044
3043
|
});
|
|
@@ -3046,7 +3045,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3046
3045
|
}
|
|
3047
3046
|
log10.error("Error initializing data pipeline", err, {
|
|
3048
3047
|
F: __dxlog_file12,
|
|
3049
|
-
L:
|
|
3048
|
+
L: 215,
|
|
3050
3049
|
S: this,
|
|
3051
3050
|
C: (f, a) => f(...a)
|
|
3052
3051
|
});
|
|
@@ -3055,7 +3054,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3055
3054
|
state: SpaceState[this._state]
|
|
3056
3055
|
}, {
|
|
3057
3056
|
F: __dxlog_file12,
|
|
3058
|
-
L:
|
|
3057
|
+
L: 217,
|
|
3059
3058
|
S: this,
|
|
3060
3059
|
C: (f, a) => f(...a)
|
|
3061
3060
|
});
|
|
@@ -3075,7 +3074,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3075
3074
|
state: SpaceState[this._state]
|
|
3076
3075
|
}, {
|
|
3077
3076
|
F: __dxlog_file12,
|
|
3078
|
-
L:
|
|
3077
|
+
L: 233,
|
|
3079
3078
|
S: this,
|
|
3080
3079
|
C: (f, a) => f(...a)
|
|
3081
3080
|
});
|
|
@@ -3086,7 +3085,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3086
3085
|
await cancelWithContext2(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
3087
3086
|
log10("waiting for data pipeline to reach target timeframe", void 0, {
|
|
3088
3087
|
F: __dxlog_file12,
|
|
3089
|
-
L:
|
|
3088
|
+
L: 247,
|
|
3090
3089
|
S: this,
|
|
3091
3090
|
C: (f, a) => f(...a)
|
|
3092
3091
|
});
|
|
@@ -3097,7 +3096,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3097
3096
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
3098
3097
|
log10("data pipeline ready", void 0, {
|
|
3099
3098
|
F: __dxlog_file12,
|
|
3100
|
-
L:
|
|
3099
|
+
L: 256,
|
|
3101
3100
|
S: this,
|
|
3102
3101
|
C: (f, a) => f(...a)
|
|
3103
3102
|
});
|
|
@@ -3107,7 +3106,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3107
3106
|
state: SpaceState[this._state]
|
|
3108
3107
|
}, {
|
|
3109
3108
|
F: __dxlog_file12,
|
|
3110
|
-
L:
|
|
3109
|
+
L: 260,
|
|
3111
3110
|
S: this,
|
|
3112
3111
|
C: (f, a) => f(...a)
|
|
3113
3112
|
});
|
|
@@ -3123,7 +3122,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3123
3122
|
await this._createWritableFeeds();
|
|
3124
3123
|
log10("writable feeds created", void 0, {
|
|
3125
3124
|
F: __dxlog_file12,
|
|
3126
|
-
L:
|
|
3125
|
+
L: 276,
|
|
3127
3126
|
S: this,
|
|
3128
3127
|
C: (f, a) => f(...a)
|
|
3129
3128
|
});
|
|
@@ -3228,7 +3227,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3228
3227
|
state: SpaceState[this._state]
|
|
3229
3228
|
}, {
|
|
3230
3229
|
F: __dxlog_file12,
|
|
3231
|
-
L:
|
|
3230
|
+
L: 392,
|
|
3232
3231
|
S: this,
|
|
3233
3232
|
C: (f, a) => f(...a)
|
|
3234
3233
|
});
|
|
@@ -3682,10 +3681,9 @@ DataSpaceManager = _ts_decorate4([
|
|
|
3682
3681
|
import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTask as scheduleTask5 } from "@dxos/async";
|
|
3683
3682
|
import { Stream as Stream10 } from "@dxos/codec-protobuf";
|
|
3684
3683
|
import { raise as raise2 } from "@dxos/debug";
|
|
3685
|
-
import {
|
|
3686
|
-
import { ApiError } from "@dxos/errors";
|
|
3684
|
+
import { invariant as invariant12 } from "@dxos/invariant";
|
|
3687
3685
|
import { log as log12 } from "@dxos/log";
|
|
3688
|
-
import { encodeError } from "@dxos/protocols";
|
|
3686
|
+
import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
|
|
3689
3687
|
import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3690
3688
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3691
3689
|
var SpacesServiceImpl = class {
|
|
@@ -3748,7 +3746,7 @@ var SpacesServiceImpl = class {
|
|
|
3748
3746
|
subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.forceTrigger()));
|
|
3749
3747
|
subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
|
|
3750
3748
|
subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, () => scheduler.trigger()));
|
|
3751
|
-
space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger());
|
|
3749
|
+
subscriptions.add(space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger()));
|
|
3752
3750
|
if (space.dataPipeline.pipelineState) {
|
|
3753
3751
|
subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.on(ctx, () => scheduler.trigger()));
|
|
3754
3752
|
}
|
|
@@ -3785,8 +3783,8 @@ var SpacesServiceImpl = class {
|
|
|
3785
3783
|
});
|
|
3786
3784
|
});
|
|
3787
3785
|
}
|
|
3788
|
-
queryCredentials({ spaceKey }) {
|
|
3789
|
-
return new Stream10(({ ctx, next }) => {
|
|
3786
|
+
queryCredentials({ spaceKey, noTail }) {
|
|
3787
|
+
return new Stream10(({ ctx, next, close }) => {
|
|
3790
3788
|
const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
|
|
3791
3789
|
const processor = {
|
|
3792
3790
|
processCredential: async (credential) => {
|
|
@@ -3794,17 +3792,62 @@ var SpacesServiceImpl = class {
|
|
|
3794
3792
|
}
|
|
3795
3793
|
};
|
|
3796
3794
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3797
|
-
scheduleTask5(ctx, () =>
|
|
3795
|
+
scheduleTask5(ctx, async () => {
|
|
3796
|
+
await space.spaceState.addCredentialProcessor(processor);
|
|
3797
|
+
if (noTail) {
|
|
3798
|
+
close();
|
|
3799
|
+
}
|
|
3800
|
+
});
|
|
3798
3801
|
});
|
|
3799
3802
|
}
|
|
3800
3803
|
async writeCredentials({ spaceKey, credentials }) {
|
|
3801
3804
|
const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
|
|
3802
3805
|
for (const credential of credentials ?? []) {
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
credential
|
|
3806
|
-
|
|
3807
|
-
|
|
3806
|
+
if (credential.proof) {
|
|
3807
|
+
await space.controlPipeline.writer.write({
|
|
3808
|
+
credential: {
|
|
3809
|
+
credential
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3812
|
+
} else {
|
|
3813
|
+
invariant12(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
3814
|
+
F: __dxlog_file14,
|
|
3815
|
+
L: 168,
|
|
3816
|
+
S: this,
|
|
3817
|
+
A: [
|
|
3818
|
+
"!credential.id",
|
|
3819
|
+
"'Id on unsigned credentials is not allowed'"
|
|
3820
|
+
]
|
|
3821
|
+
});
|
|
3822
|
+
invariant12(this._identityManager.identity, "Identity is not available", {
|
|
3823
|
+
F: __dxlog_file14,
|
|
3824
|
+
L: 169,
|
|
3825
|
+
S: this,
|
|
3826
|
+
A: [
|
|
3827
|
+
"this._identityManager.identity",
|
|
3828
|
+
"'Identity is not available'"
|
|
3829
|
+
]
|
|
3830
|
+
});
|
|
3831
|
+
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
3832
|
+
invariant12(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
3833
|
+
F: __dxlog_file14,
|
|
3834
|
+
L: 171,
|
|
3835
|
+
S: this,
|
|
3836
|
+
A: [
|
|
3837
|
+
"credential.issuer.equals(signer.getIssuer())",
|
|
3838
|
+
""
|
|
3839
|
+
]
|
|
3840
|
+
});
|
|
3841
|
+
const signedCredential = await signer.createCredential({
|
|
3842
|
+
subject: credential.subject.id,
|
|
3843
|
+
assertion: credential.subject.assertion
|
|
3844
|
+
});
|
|
3845
|
+
await space.controlPipeline.writer.write({
|
|
3846
|
+
credential: {
|
|
3847
|
+
credential: signedCredential
|
|
3848
|
+
}
|
|
3849
|
+
});
|
|
3850
|
+
}
|
|
3808
3851
|
}
|
|
3809
3852
|
}
|
|
3810
3853
|
async createEpoch({ spaceKey }) {
|
|
@@ -3843,7 +3886,7 @@ var SpacesServiceImpl = class {
|
|
|
3843
3886
|
displayName: member.assertion.profile?.displayName
|
|
3844
3887
|
}
|
|
3845
3888
|
},
|
|
3846
|
-
presence: isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
|
|
3889
|
+
presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
|
|
3847
3890
|
peerStates: peers
|
|
3848
3891
|
};
|
|
3849
3892
|
}),
|
|
@@ -3862,11 +3905,11 @@ import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credent
|
|
|
3862
3905
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
3863
3906
|
import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
|
|
3864
3907
|
import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
3865
|
-
import { invariant as
|
|
3908
|
+
import { invariant as invariant13 } from "@dxos/invariant";
|
|
3866
3909
|
import { Keyring } from "@dxos/keyring";
|
|
3867
3910
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3868
3911
|
import { log as log13 } from "@dxos/log";
|
|
3869
|
-
import { STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
|
|
3912
|
+
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
|
|
3870
3913
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3871
3914
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3872
3915
|
import { trace as Trace2 } from "@dxos/tracing";
|
|
@@ -3883,7 +3926,6 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3883
3926
|
}
|
|
3884
3927
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3885
3928
|
var ServiceContext = class ServiceContext2 {
|
|
3886
|
-
// prettier-ignore
|
|
3887
3929
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
3888
3930
|
this.storage = storage;
|
|
3889
3931
|
this.networkManager = networkManager;
|
|
@@ -3923,7 +3965,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3923
3965
|
await this._checkStorageVersion();
|
|
3924
3966
|
log13("opening...", void 0, {
|
|
3925
3967
|
F: __dxlog_file15,
|
|
3926
|
-
L:
|
|
3968
|
+
L: 129,
|
|
3927
3969
|
S: this,
|
|
3928
3970
|
C: (f, a) => f(...a)
|
|
3929
3971
|
});
|
|
@@ -3931,7 +3973,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3931
3973
|
id: this._instanceId
|
|
3932
3974
|
}), {
|
|
3933
3975
|
F: __dxlog_file15,
|
|
3934
|
-
L:
|
|
3976
|
+
L: 130,
|
|
3935
3977
|
S: this,
|
|
3936
3978
|
C: (f, a) => f(...a)
|
|
3937
3979
|
});
|
|
@@ -3947,13 +3989,13 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3947
3989
|
id: this._instanceId
|
|
3948
3990
|
}), {
|
|
3949
3991
|
F: __dxlog_file15,
|
|
3950
|
-
L:
|
|
3992
|
+
L: 140,
|
|
3951
3993
|
S: this,
|
|
3952
3994
|
C: (f, a) => f(...a)
|
|
3953
3995
|
});
|
|
3954
3996
|
log13("opened", void 0, {
|
|
3955
3997
|
F: __dxlog_file15,
|
|
3956
|
-
L:
|
|
3998
|
+
L: 141,
|
|
3957
3999
|
S: this,
|
|
3958
4000
|
C: (f, a) => f(...a)
|
|
3959
4001
|
});
|
|
@@ -3961,7 +4003,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3961
4003
|
async close() {
|
|
3962
4004
|
log13("closing...", void 0, {
|
|
3963
4005
|
F: __dxlog_file15,
|
|
3964
|
-
L:
|
|
4006
|
+
L: 145,
|
|
3965
4007
|
S: this,
|
|
3966
4008
|
C: (f, a) => f(...a)
|
|
3967
4009
|
});
|
|
@@ -3978,7 +4020,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3978
4020
|
await this.metadataStore.close();
|
|
3979
4021
|
log13("closed", void 0, {
|
|
3980
4022
|
F: __dxlog_file15,
|
|
3981
|
-
L:
|
|
4023
|
+
L: 157,
|
|
3982
4024
|
S: this,
|
|
3983
4025
|
C: (f, a) => f(...a)
|
|
3984
4026
|
});
|
|
@@ -3990,9 +4032,9 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3990
4032
|
}
|
|
3991
4033
|
getInvitationHandler(invitation) {
|
|
3992
4034
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3993
|
-
|
|
4035
|
+
invariant13(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3994
4036
|
F: __dxlog_file15,
|
|
3995
|
-
L:
|
|
4037
|
+
L: 168,
|
|
3996
4038
|
S: this,
|
|
3997
4039
|
A: [
|
|
3998
4040
|
"factory",
|
|
@@ -4009,14 +4051,14 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4009
4051
|
async _checkStorageVersion() {
|
|
4010
4052
|
await this.metadataStore.load();
|
|
4011
4053
|
if (this.metadataStore.version !== STORAGE_VERSION2) {
|
|
4012
|
-
throw new
|
|
4054
|
+
throw new InvalidStorageVersionError(STORAGE_VERSION2, this.metadataStore.version);
|
|
4013
4055
|
}
|
|
4014
4056
|
}
|
|
4015
4057
|
// Called when identity is created.
|
|
4016
4058
|
async _initialize(ctx) {
|
|
4017
4059
|
log13("initializing spaces...", void 0, {
|
|
4018
4060
|
F: __dxlog_file15,
|
|
4019
|
-
L:
|
|
4061
|
+
L: 189,
|
|
4020
4062
|
S: this,
|
|
4021
4063
|
C: (f, a) => f(...a)
|
|
4022
4064
|
});
|
|
@@ -4037,9 +4079,9 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4037
4079
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
4038
4080
|
await this.dataSpaceManager.open();
|
|
4039
4081
|
this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
|
|
4040
|
-
|
|
4082
|
+
invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4041
4083
|
F: __dxlog_file15,
|
|
4042
|
-
L:
|
|
4084
|
+
L: 212,
|
|
4043
4085
|
S: this,
|
|
4044
4086
|
A: [
|
|
4045
4087
|
"this.dataSpaceManager",
|
|
@@ -4063,7 +4105,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4063
4105
|
details: assertion
|
|
4064
4106
|
}, {
|
|
4065
4107
|
F: __dxlog_file15,
|
|
4066
|
-
L:
|
|
4108
|
+
L: 228,
|
|
4067
4109
|
S: this,
|
|
4068
4110
|
C: (f, a) => f(...a)
|
|
4069
4111
|
});
|
|
@@ -4074,7 +4116,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4074
4116
|
details: assertion
|
|
4075
4117
|
}, {
|
|
4076
4118
|
F: __dxlog_file15,
|
|
4077
|
-
L:
|
|
4119
|
+
L: 232,
|
|
4078
4120
|
S: this,
|
|
4079
4121
|
C: (f, a) => f(...a)
|
|
4080
4122
|
});
|
|
@@ -4085,7 +4127,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4085
4127
|
details: assertion
|
|
4086
4128
|
}, {
|
|
4087
4129
|
F: __dxlog_file15,
|
|
4088
|
-
L:
|
|
4130
|
+
L: 237,
|
|
4089
4131
|
S: this,
|
|
4090
4132
|
C: (f, a) => f(...a)
|
|
4091
4133
|
});
|
|
@@ -4096,7 +4138,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4096
4138
|
} catch (err) {
|
|
4097
4139
|
log13.catch(err, void 0, {
|
|
4098
4140
|
F: __dxlog_file15,
|
|
4099
|
-
L:
|
|
4141
|
+
L: 243,
|
|
4100
4142
|
S: this,
|
|
4101
4143
|
C: (f, a) => f(...a)
|
|
4102
4144
|
});
|
|
@@ -4117,6 +4159,30 @@ ServiceContext = _ts_decorate5([
|
|
|
4117
4159
|
Trace2.resource()
|
|
4118
4160
|
], ServiceContext);
|
|
4119
4161
|
|
|
4162
|
+
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
4163
|
+
var ServiceRegistry = class {
|
|
4164
|
+
// prettier-ignore
|
|
4165
|
+
constructor(_serviceBundle, _handlers = {}) {
|
|
4166
|
+
this._serviceBundle = _serviceBundle;
|
|
4167
|
+
this._handlers = _handlers;
|
|
4168
|
+
}
|
|
4169
|
+
get descriptors() {
|
|
4170
|
+
return this._serviceBundle;
|
|
4171
|
+
}
|
|
4172
|
+
get services() {
|
|
4173
|
+
return this._handlers;
|
|
4174
|
+
}
|
|
4175
|
+
setServices(services) {
|
|
4176
|
+
this._handlers = services;
|
|
4177
|
+
}
|
|
4178
|
+
addService(name, service) {
|
|
4179
|
+
this._handlers[name] = service;
|
|
4180
|
+
}
|
|
4181
|
+
removeService(name) {
|
|
4182
|
+
delete this._handlers[name];
|
|
4183
|
+
}
|
|
4184
|
+
};
|
|
4185
|
+
|
|
4120
4186
|
// packages/sdk/client-services/src/packlets/locks/browser.ts
|
|
4121
4187
|
import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
|
|
4122
4188
|
import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
|
|
@@ -4243,7 +4309,7 @@ var isLocked = (lockPath) => {
|
|
|
4243
4309
|
|
|
4244
4310
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4245
4311
|
import { DX_DATA } from "@dxos/client-protocol";
|
|
4246
|
-
import { InvalidConfigError } from "@dxos/
|
|
4312
|
+
import { InvalidConfigError } from "@dxos/protocols";
|
|
4247
4313
|
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
4248
4314
|
import { createStorage, StorageType } from "@dxos/random-access-storage";
|
|
4249
4315
|
import { isNode } from "@dxos/util";
|
|
@@ -4290,37 +4356,13 @@ var toStorageType = (type) => {
|
|
|
4290
4356
|
}
|
|
4291
4357
|
};
|
|
4292
4358
|
|
|
4293
|
-
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
4294
|
-
var ServiceRegistry = class {
|
|
4295
|
-
// prettier-ignore
|
|
4296
|
-
constructor(_serviceBundle, _handlers = {}) {
|
|
4297
|
-
this._serviceBundle = _serviceBundle;
|
|
4298
|
-
this._handlers = _handlers;
|
|
4299
|
-
}
|
|
4300
|
-
get descriptors() {
|
|
4301
|
-
return this._serviceBundle;
|
|
4302
|
-
}
|
|
4303
|
-
get services() {
|
|
4304
|
-
return this._handlers;
|
|
4305
|
-
}
|
|
4306
|
-
setServices(services) {
|
|
4307
|
-
this._handlers = services;
|
|
4308
|
-
}
|
|
4309
|
-
addService(name, service) {
|
|
4310
|
-
this._handlers[name] = service;
|
|
4311
|
-
}
|
|
4312
|
-
removeService(name) {
|
|
4313
|
-
delete this._handlers[name];
|
|
4314
|
-
}
|
|
4315
|
-
};
|
|
4316
|
-
|
|
4317
4359
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4318
4360
|
import { Event as Event8, synchronized as synchronized3 } from "@dxos/async";
|
|
4319
4361
|
import { clientServiceBundle } from "@dxos/client-protocol";
|
|
4320
4362
|
import { Context as Context10 } from "@dxos/context";
|
|
4321
4363
|
import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
|
|
4322
4364
|
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
4323
|
-
import { invariant as
|
|
4365
|
+
import { invariant as invariant14 } from "@dxos/invariant";
|
|
4324
4366
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
4325
4367
|
import { log as log16 } from "@dxos/log";
|
|
4326
4368
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
@@ -4677,7 +4719,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4677
4719
|
* Can only be called once.
|
|
4678
4720
|
*/
|
|
4679
4721
|
initialize({ config, ...options }) {
|
|
4680
|
-
|
|
4722
|
+
invariant14(!this._open, "service host is open", {
|
|
4681
4723
|
F: __dxlog_file17,
|
|
4682
4724
|
L: 184,
|
|
4683
4725
|
S: this,
|
|
@@ -4693,7 +4735,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4693
4735
|
C: (f, a) => f(...a)
|
|
4694
4736
|
});
|
|
4695
4737
|
if (config) {
|
|
4696
|
-
|
|
4738
|
+
invariant14(!this._config, "config already set", {
|
|
4697
4739
|
F: __dxlog_file17,
|
|
4698
4740
|
L: 188,
|
|
4699
4741
|
S: this,
|
|
@@ -4711,7 +4753,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4711
4753
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4712
4754
|
}), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4713
4755
|
this._signalManager = signalManager;
|
|
4714
|
-
|
|
4756
|
+
invariant14(!this._networkManager, "network manager already set", {
|
|
4715
4757
|
F: __dxlog_file17,
|
|
4716
4758
|
L: 204,
|
|
4717
4759
|
S: this,
|
|
@@ -4745,7 +4787,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4745
4787
|
S: this,
|
|
4746
4788
|
C: (f, a) => f(...a)
|
|
4747
4789
|
});
|
|
4748
|
-
|
|
4790
|
+
invariant14(this._config, "config not set", {
|
|
4749
4791
|
F: __dxlog_file17,
|
|
4750
4792
|
L: 224,
|
|
4751
4793
|
S: this,
|
|
@@ -4754,7 +4796,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4754
4796
|
"'config not set'"
|
|
4755
4797
|
]
|
|
4756
4798
|
});
|
|
4757
|
-
|
|
4799
|
+
invariant14(this._storage, "storage not set", {
|
|
4758
4800
|
F: __dxlog_file17,
|
|
4759
4801
|
L: 225,
|
|
4760
4802
|
S: this,
|
|
@@ -4763,7 +4805,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4763
4805
|
"'storage not set'"
|
|
4764
4806
|
]
|
|
4765
4807
|
});
|
|
4766
|
-
|
|
4808
|
+
invariant14(this._signalManager, "signal manager not set", {
|
|
4767
4809
|
F: __dxlog_file17,
|
|
4768
4810
|
L: 226,
|
|
4769
4811
|
S: this,
|
|
@@ -4772,7 +4814,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4772
4814
|
"'signal manager not set'"
|
|
4773
4815
|
]
|
|
4774
4816
|
});
|
|
4775
|
-
|
|
4817
|
+
invariant14(this._networkManager, "network manager not set", {
|
|
4776
4818
|
F: __dxlog_file17,
|
|
4777
4819
|
L: 227,
|
|
4778
4820
|
S: this,
|
|
@@ -4954,11 +4996,11 @@ export {
|
|
|
4954
4996
|
DataSpaceManager,
|
|
4955
4997
|
SpacesServiceImpl,
|
|
4956
4998
|
ServiceContext,
|
|
4999
|
+
ServiceRegistry,
|
|
4957
5000
|
Lock,
|
|
4958
5001
|
isLocked,
|
|
4959
5002
|
createStorageObjects,
|
|
4960
|
-
ServiceRegistry,
|
|
4961
5003
|
createDefaultModelFactory,
|
|
4962
5004
|
ClientServicesHost
|
|
4963
5005
|
};
|
|
4964
|
-
//# sourceMappingURL=chunk-
|
|
5006
|
+
//# sourceMappingURL=chunk-VRV74Z4M.mjs.map
|