@dxos/client-services 0.1.58-main.353d0d1 → 0.1.58-main.44da53d
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-FJAPMZDU.mjs → chunk-PSL7MYD4.mjs} +164 -116
- package/dist/lib/browser/chunk-PSL7MYD4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -6
- 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 +204 -155
- 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 +203 -155
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- 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/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- 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/shell-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -35
- package/src/packlets/identity/authenticator.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 +11 -7
- package/src/packlets/services/service-context.ts +2 -2
- package/src/packlets/spaces/data-space.ts +10 -2
- package/src/packlets/spaces/spaces-service.ts +29 -8
- package/src/packlets/storage/storage.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +9 -9
- package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-FJAPMZDU.mjs.map +0 -7
|
@@ -52,7 +52,7 @@ var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.
|
|
|
52
52
|
|
|
53
53
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
54
54
|
var import_async18 = require("@dxos/async");
|
|
55
|
-
var
|
|
55
|
+
var import_invariant16 = require("@dxos/invariant");
|
|
56
56
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
57
57
|
|
|
58
58
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
@@ -71,7 +71,7 @@ var import_protocols = require("@dxos/protocols");
|
|
|
71
71
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
72
72
|
|
|
73
73
|
// packages/sdk/client-services/src/version.ts
|
|
74
|
-
var DXOS_VERSION = "0.1.58-main.
|
|
74
|
+
var DXOS_VERSION = "0.1.58-main.44da53d";
|
|
75
75
|
|
|
76
76
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
77
77
|
var getPlatform = () => {
|
|
@@ -224,13 +224,13 @@ var import_async11 = require("@dxos/async");
|
|
|
224
224
|
var import_context8 = require("@dxos/context");
|
|
225
225
|
var import_credentials15 = require("@dxos/credentials");
|
|
226
226
|
var import_debug7 = require("@dxos/debug");
|
|
227
|
-
var
|
|
227
|
+
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
228
228
|
var import_feed_store3 = require("@dxos/feed-store");
|
|
229
|
-
var
|
|
229
|
+
var import_invariant13 = require("@dxos/invariant");
|
|
230
230
|
var import_keyring = require("@dxos/keyring");
|
|
231
231
|
var import_keys8 = require("@dxos/keys");
|
|
232
232
|
var import_log13 = require("@dxos/log");
|
|
233
|
-
var
|
|
233
|
+
var import_protocols10 = require("@dxos/protocols");
|
|
234
234
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
235
235
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
236
236
|
var import_tracing4 = require("@dxos/tracing");
|
|
@@ -1059,7 +1059,6 @@ var import_async5 = require("@dxos/async");
|
|
|
1059
1059
|
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
1060
1060
|
var import_context4 = require("@dxos/context");
|
|
1061
1061
|
var import_credentials9 = require("@dxos/credentials");
|
|
1062
|
-
var import_errors2 = require("@dxos/errors");
|
|
1063
1062
|
var import_invariant7 = require("@dxos/invariant");
|
|
1064
1063
|
var import_keys4 = require("@dxos/keys");
|
|
1065
1064
|
var import_log6 = require("@dxos/log");
|
|
@@ -1071,7 +1070,6 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
1071
1070
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1072
1071
|
var import_async4 = require("@dxos/async");
|
|
1073
1072
|
var import_context3 = require("@dxos/context");
|
|
1074
|
-
var import_errors = require("@dxos/errors");
|
|
1075
1073
|
var import_invariant6 = require("@dxos/invariant");
|
|
1076
1074
|
var import_keys3 = require("@dxos/keys");
|
|
1077
1075
|
var import_log5 = require("@dxos/log");
|
|
@@ -1109,7 +1107,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1109
1107
|
options: async (options) => {
|
|
1110
1108
|
(0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1111
1109
|
F: __dxlog_file7,
|
|
1112
|
-
L:
|
|
1110
|
+
L: 87,
|
|
1113
1111
|
S: this,
|
|
1114
1112
|
A: [
|
|
1115
1113
|
"!this._remoteOptions",
|
|
@@ -1126,7 +1124,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1126
1124
|
id: traceId
|
|
1127
1125
|
}), {
|
|
1128
1126
|
F: __dxlog_file7,
|
|
1129
|
-
L:
|
|
1127
|
+
L: 96,
|
|
1130
1128
|
S: this,
|
|
1131
1129
|
C: (f, a) => f(...a)
|
|
1132
1130
|
});
|
|
@@ -1136,7 +1134,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1136
1134
|
invitationId
|
|
1137
1135
|
}, {
|
|
1138
1136
|
F: __dxlog_file7,
|
|
1139
|
-
L:
|
|
1137
|
+
L: 100,
|
|
1140
1138
|
S: this,
|
|
1141
1139
|
C: (f, a) => f(...a)
|
|
1142
1140
|
});
|
|
@@ -1150,7 +1148,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1150
1148
|
guestProfile: profile
|
|
1151
1149
|
}, {
|
|
1152
1150
|
F: __dxlog_file7,
|
|
1153
|
-
L:
|
|
1151
|
+
L: 109,
|
|
1154
1152
|
S: this,
|
|
1155
1153
|
C: (f, a) => f(...a)
|
|
1156
1154
|
});
|
|
@@ -1163,7 +1161,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1163
1161
|
id: traceId
|
|
1164
1162
|
}), {
|
|
1165
1163
|
F: __dxlog_file7,
|
|
1166
|
-
L:
|
|
1164
|
+
L: 116,
|
|
1167
1165
|
S: this,
|
|
1168
1166
|
C: (f, a) => f(...a)
|
|
1169
1167
|
});
|
|
@@ -1178,7 +1176,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1178
1176
|
id: traceId
|
|
1179
1177
|
}), {
|
|
1180
1178
|
F: __dxlog_file7,
|
|
1181
|
-
L:
|
|
1179
|
+
L: 125,
|
|
1182
1180
|
S: this,
|
|
1183
1181
|
C: (f, a) => f(...a)
|
|
1184
1182
|
});
|
|
@@ -1186,14 +1184,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1186
1184
|
authCode: code
|
|
1187
1185
|
}, {
|
|
1188
1186
|
F: __dxlog_file7,
|
|
1189
|
-
L:
|
|
1187
|
+
L: 126,
|
|
1190
1188
|
S: this,
|
|
1191
1189
|
C: (f, a) => f(...a)
|
|
1192
1190
|
});
|
|
1193
1191
|
let status = import_invitations.AuthenticationResponse.Status.OK;
|
|
1194
1192
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1195
1193
|
F: __dxlog_file7,
|
|
1196
|
-
L:
|
|
1194
|
+
L: 129,
|
|
1197
1195
|
S: this,
|
|
1198
1196
|
A: [
|
|
1199
1197
|
"this.invitation",
|
|
@@ -1204,7 +1202,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1204
1202
|
case import_services3.Invitation.AuthMethod.NONE: {
|
|
1205
1203
|
(0, import_log5.log)("authentication not required", void 0, {
|
|
1206
1204
|
F: __dxlog_file7,
|
|
1207
|
-
L:
|
|
1205
|
+
L: 132,
|
|
1208
1206
|
S: this,
|
|
1209
1207
|
C: (f, a) => f(...a)
|
|
1210
1208
|
});
|
|
@@ -1229,7 +1227,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1229
1227
|
authMethod: this.invitation.authMethod
|
|
1230
1228
|
}, {
|
|
1231
1229
|
F: __dxlog_file7,
|
|
1232
|
-
L:
|
|
1230
|
+
L: 150,
|
|
1233
1231
|
S: this,
|
|
1234
1232
|
C: (f, a) => f(...a)
|
|
1235
1233
|
});
|
|
@@ -1244,7 +1242,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1244
1242
|
}
|
|
1245
1243
|
}), {
|
|
1246
1244
|
F: __dxlog_file7,
|
|
1247
|
-
L:
|
|
1245
|
+
L: 156,
|
|
1248
1246
|
S: this,
|
|
1249
1247
|
C: (f, a) => f(...a)
|
|
1250
1248
|
});
|
|
@@ -1258,14 +1256,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1258
1256
|
id: traceId
|
|
1259
1257
|
}), {
|
|
1260
1258
|
F: __dxlog_file7,
|
|
1261
|
-
L:
|
|
1259
|
+
L: 162,
|
|
1262
1260
|
S: this,
|
|
1263
1261
|
C: (f, a) => f(...a)
|
|
1264
1262
|
});
|
|
1265
1263
|
try {
|
|
1266
1264
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1267
1265
|
F: __dxlog_file7,
|
|
1268
|
-
L:
|
|
1266
|
+
L: 165,
|
|
1269
1267
|
S: this,
|
|
1270
1268
|
A: [
|
|
1271
1269
|
"this.invitation",
|
|
@@ -1280,7 +1278,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1280
1278
|
id: traceId
|
|
1281
1279
|
}), {
|
|
1282
1280
|
F: __dxlog_file7,
|
|
1283
|
-
L:
|
|
1281
|
+
L: 173,
|
|
1284
1282
|
S: this,
|
|
1285
1283
|
C: (f, a) => f(...a)
|
|
1286
1284
|
});
|
|
@@ -1303,7 +1301,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1303
1301
|
timeout: OPTIONS_TIMEOUT
|
|
1304
1302
|
}));
|
|
1305
1303
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.GUEST) {
|
|
1306
|
-
throw new
|
|
1304
|
+
throw new import_protocols4.InvalidInvitationExtensionRoleError(void 0, {
|
|
1307
1305
|
expected: import_invitations.Options.Role.GUEST,
|
|
1308
1306
|
remoteOptions: this._remoteOptions
|
|
1309
1307
|
});
|
|
@@ -1337,7 +1335,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1337
1335
|
options: async (options) => {
|
|
1338
1336
|
(0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1339
1337
|
F: __dxlog_file7,
|
|
1340
|
-
L:
|
|
1338
|
+
L: 240,
|
|
1341
1339
|
S: this,
|
|
1342
1340
|
A: [
|
|
1343
1341
|
"!this._remoteOptions",
|
|
@@ -1364,7 +1362,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1364
1362
|
try {
|
|
1365
1363
|
(0, import_log5.log)("begin options", void 0, {
|
|
1366
1364
|
F: __dxlog_file7,
|
|
1367
|
-
L:
|
|
1365
|
+
L: 261,
|
|
1368
1366
|
S: this,
|
|
1369
1367
|
C: (f, a) => f(...a)
|
|
1370
1368
|
});
|
|
@@ -1376,12 +1374,12 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1376
1374
|
}));
|
|
1377
1375
|
(0, import_log5.log)("end options", void 0, {
|
|
1378
1376
|
F: __dxlog_file7,
|
|
1379
|
-
L:
|
|
1377
|
+
L: 264,
|
|
1380
1378
|
S: this,
|
|
1381
1379
|
C: (f, a) => f(...a)
|
|
1382
1380
|
});
|
|
1383
1381
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.HOST) {
|
|
1384
|
-
throw new
|
|
1382
|
+
throw new import_protocols4.InvalidInvitationExtensionRoleError(void 0, {
|
|
1385
1383
|
expected: import_invitations.Options.Role.HOST,
|
|
1386
1384
|
remoteOptions: this._remoteOptions
|
|
1387
1385
|
});
|
|
@@ -1390,7 +1388,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1390
1388
|
} catch (err) {
|
|
1391
1389
|
(0, import_log5.log)("openError", err, {
|
|
1392
1390
|
F: __dxlog_file7,
|
|
1393
|
-
L:
|
|
1391
|
+
L: 274,
|
|
1394
1392
|
S: this,
|
|
1395
1393
|
C: (f, a) => f(...a)
|
|
1396
1394
|
});
|
|
@@ -1400,7 +1398,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1400
1398
|
async onClose() {
|
|
1401
1399
|
(0, import_log5.log)("onClose", void 0, {
|
|
1402
1400
|
F: __dxlog_file7,
|
|
1403
|
-
L:
|
|
1401
|
+
L: 280,
|
|
1404
1402
|
S: this,
|
|
1405
1403
|
C: (f, a) => f(...a)
|
|
1406
1404
|
});
|
|
@@ -1423,7 +1421,7 @@ var InvitationsHandler = class {
|
|
|
1423
1421
|
const authCode = options?.authCode ?? (authMethod === import_services4.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials9.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1424
1422
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1425
1423
|
F: __dxlog_file8,
|
|
1426
|
-
L:
|
|
1424
|
+
L: 75,
|
|
1427
1425
|
S: this,
|
|
1428
1426
|
A: [
|
|
1429
1427
|
"protocol",
|
|
@@ -1452,7 +1450,7 @@ var InvitationsHandler = class {
|
|
|
1452
1450
|
...protocol.toJSON()
|
|
1453
1451
|
}, {
|
|
1454
1452
|
F: __dxlog_file8,
|
|
1455
|
-
L:
|
|
1453
|
+
L: 97,
|
|
1456
1454
|
S: this,
|
|
1457
1455
|
C: (f, a) => f(...a)
|
|
1458
1456
|
});
|
|
@@ -1477,7 +1475,7 @@ var InvitationsHandler = class {
|
|
|
1477
1475
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1478
1476
|
(0, import_invariant7.invariant)(deviceKey, void 0, {
|
|
1479
1477
|
F: __dxlog_file8,
|
|
1480
|
-
L:
|
|
1478
|
+
L: 118,
|
|
1481
1479
|
S: this,
|
|
1482
1480
|
A: [
|
|
1483
1481
|
"deviceKey",
|
|
@@ -1500,7 +1498,7 @@ var InvitationsHandler = class {
|
|
|
1500
1498
|
id: traceId
|
|
1501
1499
|
}), {
|
|
1502
1500
|
F: __dxlog_file8,
|
|
1503
|
-
L:
|
|
1501
|
+
L: 136,
|
|
1504
1502
|
S: this,
|
|
1505
1503
|
C: (f, a) => f(...a)
|
|
1506
1504
|
});
|
|
@@ -1508,7 +1506,7 @@ var InvitationsHandler = class {
|
|
|
1508
1506
|
...protocol.toJSON()
|
|
1509
1507
|
}, {
|
|
1510
1508
|
F: __dxlog_file8,
|
|
1511
|
-
L:
|
|
1509
|
+
L: 137,
|
|
1512
1510
|
S: this,
|
|
1513
1511
|
C: (f, a) => f(...a)
|
|
1514
1512
|
});
|
|
@@ -1524,7 +1522,7 @@ var InvitationsHandler = class {
|
|
|
1524
1522
|
...protocol.toJSON()
|
|
1525
1523
|
}, {
|
|
1526
1524
|
F: __dxlog_file8,
|
|
1527
|
-
L:
|
|
1525
|
+
L: 140,
|
|
1528
1526
|
S: this,
|
|
1529
1527
|
C: (f, a) => f(...a)
|
|
1530
1528
|
});
|
|
@@ -1536,7 +1534,7 @@ var InvitationsHandler = class {
|
|
|
1536
1534
|
id: traceId
|
|
1537
1535
|
}), {
|
|
1538
1536
|
F: __dxlog_file8,
|
|
1539
|
-
L:
|
|
1537
|
+
L: 142,
|
|
1540
1538
|
S: this,
|
|
1541
1539
|
C: (f, a) => f(...a)
|
|
1542
1540
|
});
|
|
@@ -1546,7 +1544,7 @@ var InvitationsHandler = class {
|
|
|
1546
1544
|
...protocol.toJSON()
|
|
1547
1545
|
}, {
|
|
1548
1546
|
F: __dxlog_file8,
|
|
1549
|
-
L:
|
|
1547
|
+
L: 145,
|
|
1550
1548
|
S: this,
|
|
1551
1549
|
C: (f, a) => f(...a)
|
|
1552
1550
|
});
|
|
@@ -1557,7 +1555,7 @@ var InvitationsHandler = class {
|
|
|
1557
1555
|
} else {
|
|
1558
1556
|
import_log6.log.error("failed", err, {
|
|
1559
1557
|
F: __dxlog_file8,
|
|
1560
|
-
L:
|
|
1558
|
+
L: 148,
|
|
1561
1559
|
S: this,
|
|
1562
1560
|
C: (f, a) => f(...a)
|
|
1563
1561
|
});
|
|
@@ -1568,7 +1566,7 @@ var InvitationsHandler = class {
|
|
|
1568
1566
|
error: err
|
|
1569
1567
|
}), {
|
|
1570
1568
|
F: __dxlog_file8,
|
|
1571
|
-
L:
|
|
1569
|
+
L: 151,
|
|
1572
1570
|
S: this,
|
|
1573
1571
|
C: (f, a) => f(...a)
|
|
1574
1572
|
});
|
|
@@ -1581,7 +1579,7 @@ var InvitationsHandler = class {
|
|
|
1581
1579
|
});
|
|
1582
1580
|
},
|
|
1583
1581
|
onError: (err) => {
|
|
1584
|
-
if (err instanceof
|
|
1582
|
+
if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
|
|
1585
1583
|
return;
|
|
1586
1584
|
}
|
|
1587
1585
|
if (err instanceof import_async5.TimeoutError) {
|
|
@@ -1589,7 +1587,7 @@ var InvitationsHandler = class {
|
|
|
1589
1587
|
...protocol.toJSON()
|
|
1590
1588
|
}, {
|
|
1591
1589
|
F: __dxlog_file8,
|
|
1592
|
-
L:
|
|
1590
|
+
L: 166,
|
|
1593
1591
|
S: this,
|
|
1594
1592
|
C: (f, a) => f(...a)
|
|
1595
1593
|
});
|
|
@@ -1600,7 +1598,7 @@ var InvitationsHandler = class {
|
|
|
1600
1598
|
} else {
|
|
1601
1599
|
import_log6.log.error("failed", err, {
|
|
1602
1600
|
F: __dxlog_file8,
|
|
1603
|
-
L:
|
|
1601
|
+
L: 169,
|
|
1604
1602
|
S: this,
|
|
1605
1603
|
C: (f, a) => f(...a)
|
|
1606
1604
|
});
|
|
@@ -1628,7 +1626,7 @@ var InvitationsHandler = class {
|
|
|
1628
1626
|
state: import_services4.Invitation.State.CONNECTING
|
|
1629
1627
|
});
|
|
1630
1628
|
});
|
|
1631
|
-
const observable = new import_client_protocol2.
|
|
1629
|
+
const observable = new import_client_protocol2.CancellableInvitation({
|
|
1632
1630
|
initialInvitation: invitation,
|
|
1633
1631
|
subscriber: stream.observable,
|
|
1634
1632
|
onCancel: async () => {
|
|
@@ -1645,7 +1643,7 @@ var InvitationsHandler = class {
|
|
|
1645
1643
|
const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
|
|
1646
1644
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1647
1645
|
F: __dxlog_file8,
|
|
1648
|
-
L:
|
|
1646
|
+
L: 210,
|
|
1649
1647
|
S: this,
|
|
1650
1648
|
A: [
|
|
1651
1649
|
"protocol",
|
|
@@ -1659,7 +1657,7 @@ var InvitationsHandler = class {
|
|
|
1659
1657
|
const setState = (newData) => {
|
|
1660
1658
|
(0, import_invariant7.invariant)(newData.state !== void 0, void 0, {
|
|
1661
1659
|
F: __dxlog_file8,
|
|
1662
|
-
L:
|
|
1660
|
+
L: 221,
|
|
1663
1661
|
S: this,
|
|
1664
1662
|
A: [
|
|
1665
1663
|
"newData.state !== undefined",
|
|
@@ -1679,7 +1677,7 @@ var InvitationsHandler = class {
|
|
|
1679
1677
|
...protocol.toJSON()
|
|
1680
1678
|
}, {
|
|
1681
1679
|
F: __dxlog_file8,
|
|
1682
|
-
L:
|
|
1680
|
+
L: 229,
|
|
1683
1681
|
S: this,
|
|
1684
1682
|
C: (f, a) => f(...a)
|
|
1685
1683
|
});
|
|
@@ -1689,7 +1687,7 @@ var InvitationsHandler = class {
|
|
|
1689
1687
|
} else {
|
|
1690
1688
|
import_log6.log.warn("auth failed", err, {
|
|
1691
1689
|
F: __dxlog_file8,
|
|
1692
|
-
L:
|
|
1690
|
+
L: 232,
|
|
1693
1691
|
S: this,
|
|
1694
1692
|
C: (f, a) => f(...a)
|
|
1695
1693
|
});
|
|
@@ -1703,7 +1701,7 @@ var InvitationsHandler = class {
|
|
|
1703
1701
|
...protocol.toJSON()
|
|
1704
1702
|
}, {
|
|
1705
1703
|
F: __dxlog_file8,
|
|
1706
|
-
L:
|
|
1704
|
+
L: 240,
|
|
1707
1705
|
S: this,
|
|
1708
1706
|
C: (f, a) => f(...a)
|
|
1709
1707
|
});
|
|
@@ -1718,7 +1716,7 @@ var InvitationsHandler = class {
|
|
|
1718
1716
|
currentState
|
|
1719
1717
|
}, {
|
|
1720
1718
|
F: __dxlog_file8,
|
|
1721
|
-
L:
|
|
1719
|
+
L: 250,
|
|
1722
1720
|
S: this,
|
|
1723
1721
|
C: (f, a) => f(...a)
|
|
1724
1722
|
});
|
|
@@ -1733,7 +1731,7 @@ var InvitationsHandler = class {
|
|
|
1733
1731
|
id: traceId
|
|
1734
1732
|
}), {
|
|
1735
1733
|
F: __dxlog_file8,
|
|
1736
|
-
L:
|
|
1734
|
+
L: 259,
|
|
1737
1735
|
S: this,
|
|
1738
1736
|
C: (f, a) => f(...a)
|
|
1739
1737
|
});
|
|
@@ -1745,7 +1743,7 @@ var InvitationsHandler = class {
|
|
|
1745
1743
|
...protocol.toJSON()
|
|
1746
1744
|
}, {
|
|
1747
1745
|
F: __dxlog_file8,
|
|
1748
|
-
L:
|
|
1746
|
+
L: 267,
|
|
1749
1747
|
S: this,
|
|
1750
1748
|
C: (f, a) => f(...a)
|
|
1751
1749
|
});
|
|
@@ -1756,7 +1754,7 @@ var InvitationsHandler = class {
|
|
|
1756
1754
|
...protocol.toJSON()
|
|
1757
1755
|
}, {
|
|
1758
1756
|
F: __dxlog_file8,
|
|
1759
|
-
L:
|
|
1757
|
+
L: 271,
|
|
1760
1758
|
S: this,
|
|
1761
1759
|
C: (f, a) => f(...a)
|
|
1762
1760
|
});
|
|
@@ -1766,7 +1764,7 @@ var InvitationsHandler = class {
|
|
|
1766
1764
|
response: introductionResponse
|
|
1767
1765
|
}, {
|
|
1768
1766
|
F: __dxlog_file8,
|
|
1769
|
-
L:
|
|
1767
|
+
L: 275,
|
|
1770
1768
|
S: this,
|
|
1771
1769
|
C: (f, a) => f(...a)
|
|
1772
1770
|
});
|
|
@@ -1778,7 +1776,7 @@ var InvitationsHandler = class {
|
|
|
1778
1776
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1779
1777
|
(0, import_log6.log)("guest waiting for authentication code...", void 0, {
|
|
1780
1778
|
F: __dxlog_file8,
|
|
1781
|
-
L:
|
|
1779
|
+
L: 284,
|
|
1782
1780
|
S: this,
|
|
1783
1781
|
C: (f, a) => f(...a)
|
|
1784
1782
|
});
|
|
@@ -1790,7 +1788,7 @@ var InvitationsHandler = class {
|
|
|
1790
1788
|
});
|
|
1791
1789
|
(0, import_log6.log)("sending authentication request", void 0, {
|
|
1792
1790
|
F: __dxlog_file8,
|
|
1793
|
-
L:
|
|
1791
|
+
L: 288,
|
|
1794
1792
|
S: this,
|
|
1795
1793
|
C: (f, a) => f(...a)
|
|
1796
1794
|
});
|
|
@@ -1811,7 +1809,7 @@ var InvitationsHandler = class {
|
|
|
1811
1809
|
attempt
|
|
1812
1810
|
}, {
|
|
1813
1811
|
F: __dxlog_file8,
|
|
1814
|
-
L:
|
|
1812
|
+
L: 299,
|
|
1815
1813
|
S: this,
|
|
1816
1814
|
C: (f, a) => f(...a)
|
|
1817
1815
|
});
|
|
@@ -1828,7 +1826,7 @@ var InvitationsHandler = class {
|
|
|
1828
1826
|
...protocol.toJSON()
|
|
1829
1827
|
}, {
|
|
1830
1828
|
F: __dxlog_file8,
|
|
1831
|
-
L:
|
|
1829
|
+
L: 310,
|
|
1832
1830
|
S: this,
|
|
1833
1831
|
C: (f, a) => f(...a)
|
|
1834
1832
|
});
|
|
@@ -1840,7 +1838,7 @@ var InvitationsHandler = class {
|
|
|
1840
1838
|
...protocol.toJSON()
|
|
1841
1839
|
}, {
|
|
1842
1840
|
F: __dxlog_file8,
|
|
1843
|
-
L:
|
|
1841
|
+
L: 321,
|
|
1844
1842
|
S: this,
|
|
1845
1843
|
C: (f, a) => f(...a)
|
|
1846
1844
|
});
|
|
@@ -1852,7 +1850,7 @@ var InvitationsHandler = class {
|
|
|
1852
1850
|
id: traceId
|
|
1853
1851
|
}), {
|
|
1854
1852
|
F: __dxlog_file8,
|
|
1855
|
-
L:
|
|
1853
|
+
L: 323,
|
|
1856
1854
|
S: this,
|
|
1857
1855
|
C: (f, a) => f(...a)
|
|
1858
1856
|
});
|
|
@@ -1862,7 +1860,7 @@ var InvitationsHandler = class {
|
|
|
1862
1860
|
...protocol.toJSON()
|
|
1863
1861
|
}, {
|
|
1864
1862
|
F: __dxlog_file8,
|
|
1865
|
-
L:
|
|
1863
|
+
L: 326,
|
|
1866
1864
|
S: this,
|
|
1867
1865
|
C: (f, a) => f(...a)
|
|
1868
1866
|
});
|
|
@@ -1872,7 +1870,7 @@ var InvitationsHandler = class {
|
|
|
1872
1870
|
} else {
|
|
1873
1871
|
(0, import_log6.log)("auth failed", err, {
|
|
1874
1872
|
F: __dxlog_file8,
|
|
1875
|
-
L:
|
|
1873
|
+
L: 329,
|
|
1876
1874
|
S: this,
|
|
1877
1875
|
C: (f, a) => f(...a)
|
|
1878
1876
|
});
|
|
@@ -1883,7 +1881,7 @@ var InvitationsHandler = class {
|
|
|
1883
1881
|
error: err
|
|
1884
1882
|
}), {
|
|
1885
1883
|
F: __dxlog_file8,
|
|
1886
|
-
L:
|
|
1884
|
+
L: 332,
|
|
1887
1885
|
S: this,
|
|
1888
1886
|
C: (f, a) => f(...a)
|
|
1889
1887
|
});
|
|
@@ -1893,7 +1891,7 @@ var InvitationsHandler = class {
|
|
|
1893
1891
|
});
|
|
1894
1892
|
},
|
|
1895
1893
|
onError: (err) => {
|
|
1896
|
-
if (err instanceof
|
|
1894
|
+
if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
|
|
1897
1895
|
return;
|
|
1898
1896
|
}
|
|
1899
1897
|
if (err instanceof import_async5.TimeoutError) {
|
|
@@ -1901,7 +1899,7 @@ var InvitationsHandler = class {
|
|
|
1901
1899
|
...protocol.toJSON()
|
|
1902
1900
|
}, {
|
|
1903
1901
|
F: __dxlog_file8,
|
|
1904
|
-
L:
|
|
1902
|
+
L: 343,
|
|
1905
1903
|
S: this,
|
|
1906
1904
|
C: (f, a) => f(...a)
|
|
1907
1905
|
});
|
|
@@ -1911,7 +1909,7 @@ var InvitationsHandler = class {
|
|
|
1911
1909
|
} else {
|
|
1912
1910
|
(0, import_log6.log)("auth failed", err, {
|
|
1913
1911
|
F: __dxlog_file8,
|
|
1914
|
-
L:
|
|
1912
|
+
L: 346,
|
|
1915
1913
|
S: this,
|
|
1916
1914
|
C: (f, a) => f(...a)
|
|
1917
1915
|
});
|
|
@@ -1924,7 +1922,7 @@ var InvitationsHandler = class {
|
|
|
1924
1922
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
1925
1923
|
(0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
|
|
1926
1924
|
F: __dxlog_file8,
|
|
1927
|
-
L:
|
|
1925
|
+
L: 356,
|
|
1928
1926
|
S: this,
|
|
1929
1927
|
A: [
|
|
1930
1928
|
"invitation.swarmKey",
|
|
@@ -1946,7 +1944,7 @@ var InvitationsHandler = class {
|
|
|
1946
1944
|
state: import_services4.Invitation.State.CONNECTING
|
|
1947
1945
|
});
|
|
1948
1946
|
});
|
|
1949
|
-
const observable = new import_client_protocol2.
|
|
1947
|
+
const observable = new import_client_protocol2.AuthenticatingInvitation({
|
|
1950
1948
|
initialInvitation: invitation,
|
|
1951
1949
|
subscriber: stream.observable,
|
|
1952
1950
|
onCancel: async () => {
|
|
@@ -2004,7 +2002,9 @@ var InvitationsServiceImpl = class {
|
|
|
2004
2002
|
}, () => {
|
|
2005
2003
|
close();
|
|
2006
2004
|
this._createInvitations.delete(invitation.get().invitationId);
|
|
2007
|
-
|
|
2005
|
+
if (invitation.get().type !== import_services5.Invitation.Type.MULTIUSE) {
|
|
2006
|
+
this._removedCreated.emit(invitation.get());
|
|
2007
|
+
}
|
|
2008
2008
|
});
|
|
2009
2009
|
});
|
|
2010
2010
|
}
|
|
@@ -2027,20 +2027,22 @@ var InvitationsServiceImpl = class {
|
|
|
2027
2027
|
}, () => {
|
|
2028
2028
|
close();
|
|
2029
2029
|
this._acceptInvitations.delete(invitation.get().invitationId);
|
|
2030
|
-
|
|
2030
|
+
if (invitation.get().type !== import_services5.Invitation.Type.MULTIUSE) {
|
|
2031
|
+
this._removedAccepted.emit(invitation.get());
|
|
2032
|
+
}
|
|
2031
2033
|
});
|
|
2032
2034
|
});
|
|
2033
2035
|
}
|
|
2034
2036
|
async authenticate({ invitationId, authCode }) {
|
|
2035
2037
|
(0, import_log7.log)("authenticating...", void 0, {
|
|
2036
2038
|
F: __dxlog_file9,
|
|
2037
|
-
L:
|
|
2039
|
+
L: 108,
|
|
2038
2040
|
S: this,
|
|
2039
2041
|
C: (f, a) => f(...a)
|
|
2040
2042
|
});
|
|
2041
2043
|
(0, import_invariant8.invariant)(invitationId, void 0, {
|
|
2042
2044
|
F: __dxlog_file9,
|
|
2043
|
-
L:
|
|
2045
|
+
L: 109,
|
|
2044
2046
|
S: this,
|
|
2045
2047
|
A: [
|
|
2046
2048
|
"invitationId",
|
|
@@ -2053,7 +2055,7 @@ var InvitationsServiceImpl = class {
|
|
|
2053
2055
|
invitationId
|
|
2054
2056
|
}, {
|
|
2055
2057
|
F: __dxlog_file9,
|
|
2056
|
-
L:
|
|
2058
|
+
L: 112,
|
|
2057
2059
|
S: this,
|
|
2058
2060
|
C: (f, a) => f(...a)
|
|
2059
2061
|
});
|
|
@@ -2064,13 +2066,13 @@ var InvitationsServiceImpl = class {
|
|
|
2064
2066
|
async cancelInvitation({ invitationId }) {
|
|
2065
2067
|
(0, import_log7.log)("deleting...", void 0, {
|
|
2066
2068
|
F: __dxlog_file9,
|
|
2067
|
-
L:
|
|
2069
|
+
L: 119,
|
|
2068
2070
|
S: this,
|
|
2069
2071
|
C: (f, a) => f(...a)
|
|
2070
2072
|
});
|
|
2071
2073
|
(0, import_invariant8.invariant)(invitationId, void 0, {
|
|
2072
2074
|
F: __dxlog_file9,
|
|
2073
|
-
L:
|
|
2075
|
+
L: 120,
|
|
2074
2076
|
S: this,
|
|
2075
2077
|
A: [
|
|
2076
2078
|
"invitationId",
|
|
@@ -2092,7 +2094,7 @@ var InvitationsServiceImpl = class {
|
|
|
2092
2094
|
invitationId
|
|
2093
2095
|
}, {
|
|
2094
2096
|
F: __dxlog_file9,
|
|
2095
|
-
L:
|
|
2097
|
+
L: 132,
|
|
2096
2098
|
S: this,
|
|
2097
2099
|
C: (f, a) => f(...a)
|
|
2098
2100
|
});
|
|
@@ -2311,7 +2313,7 @@ var import_credentials14 = require("@dxos/credentials");
|
|
|
2311
2313
|
var import_invariant11 = require("@dxos/invariant");
|
|
2312
2314
|
var import_keys7 = require("@dxos/keys");
|
|
2313
2315
|
var import_log11 = require("@dxos/log");
|
|
2314
|
-
var
|
|
2316
|
+
var import_protocols8 = require("@dxos/protocols");
|
|
2315
2317
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2316
2318
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2317
2319
|
var import_util4 = require("@dxos/util");
|
|
@@ -2322,9 +2324,9 @@ var import_client_protocol3 = require("@dxos/client-protocol");
|
|
|
2322
2324
|
var import_context6 = require("@dxos/context");
|
|
2323
2325
|
var import_debug4 = require("@dxos/debug");
|
|
2324
2326
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2325
|
-
var import_errors3 = require("@dxos/errors");
|
|
2326
2327
|
var import_keys6 = require("@dxos/keys");
|
|
2327
2328
|
var import_log10 = require("@dxos/log");
|
|
2329
|
+
var import_protocols7 = require("@dxos/protocols");
|
|
2328
2330
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2329
2331
|
var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2330
2332
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
@@ -2633,7 +2635,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2633
2635
|
this._signingContext = params.signingContext;
|
|
2634
2636
|
this._callbacks = params.callbacks ?? {};
|
|
2635
2637
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2636
|
-
trustedKeysProvider: () => new import_util3.ComplexSet(import_keys6.PublicKey.hash, Array.from(this._inner.spaceState.members.
|
|
2638
|
+
trustedKeysProvider: () => new import_util3.ComplexSet(import_keys6.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
2637
2639
|
update: this._inner.stateUpdate,
|
|
2638
2640
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
2639
2641
|
});
|
|
@@ -2643,7 +2645,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2643
2645
|
state: import_services7.SpaceState[this._state]
|
|
2644
2646
|
}, {
|
|
2645
2647
|
F: __dxlog_file12,
|
|
2646
|
-
L:
|
|
2648
|
+
L: 118,
|
|
2647
2649
|
S: this,
|
|
2648
2650
|
C: (f, a) => f(...a)
|
|
2649
2651
|
});
|
|
@@ -2677,6 +2679,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2677
2679
|
await this._open();
|
|
2678
2680
|
}
|
|
2679
2681
|
async _open() {
|
|
2682
|
+
await this._gossip.open();
|
|
2680
2683
|
await this._notarizationPlugin.open();
|
|
2681
2684
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2682
2685
|
await this._inner.open(new import_context6.Context());
|
|
@@ -2685,7 +2688,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2685
2688
|
state: import_services7.SpaceState[this._state]
|
|
2686
2689
|
}, {
|
|
2687
2690
|
F: __dxlog_file12,
|
|
2688
|
-
L:
|
|
2691
|
+
L: 165,
|
|
2689
2692
|
S: this,
|
|
2690
2693
|
C: (f, a) => f(...a)
|
|
2691
2694
|
});
|
|
@@ -2703,7 +2706,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2703
2706
|
state: import_services7.SpaceState[this._state]
|
|
2704
2707
|
}, {
|
|
2705
2708
|
F: __dxlog_file12,
|
|
2706
|
-
L:
|
|
2709
|
+
L: 179,
|
|
2707
2710
|
S: this,
|
|
2708
2711
|
C: (f, a) => f(...a)
|
|
2709
2712
|
});
|
|
@@ -2714,6 +2717,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2714
2717
|
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
2715
2718
|
await this._notarizationPlugin.close();
|
|
2716
2719
|
await this._presence.destroy();
|
|
2720
|
+
await this._gossip.close();
|
|
2717
2721
|
}
|
|
2718
2722
|
async postMessage(channel, message) {
|
|
2719
2723
|
return this._gossip.postMessage(channel, message);
|
|
@@ -2730,10 +2734,10 @@ var DataSpace = class DataSpace2 {
|
|
|
2730
2734
|
this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
|
|
2731
2735
|
await this.initializeDataPipeline();
|
|
2732
2736
|
} catch (err) {
|
|
2733
|
-
if (err instanceof
|
|
2737
|
+
if (err instanceof import_protocols7.CancelledError) {
|
|
2734
2738
|
(0, import_log10.log)("data pipeline initialization cancelled", err, {
|
|
2735
2739
|
F: __dxlog_file12,
|
|
2736
|
-
L:
|
|
2740
|
+
L: 211,
|
|
2737
2741
|
S: this,
|
|
2738
2742
|
C: (f, a) => f(...a)
|
|
2739
2743
|
});
|
|
@@ -2741,7 +2745,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2741
2745
|
}
|
|
2742
2746
|
import_log10.log.error("Error initializing data pipeline", err, {
|
|
2743
2747
|
F: __dxlog_file12,
|
|
2744
|
-
L:
|
|
2748
|
+
L: 215,
|
|
2745
2749
|
S: this,
|
|
2746
2750
|
C: (f, a) => f(...a)
|
|
2747
2751
|
});
|
|
@@ -2750,7 +2754,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2750
2754
|
state: import_services7.SpaceState[this._state]
|
|
2751
2755
|
}, {
|
|
2752
2756
|
F: __dxlog_file12,
|
|
2753
|
-
L:
|
|
2757
|
+
L: 217,
|
|
2754
2758
|
S: this,
|
|
2755
2759
|
C: (f, a) => f(...a)
|
|
2756
2760
|
});
|
|
@@ -2763,14 +2767,14 @@ var DataSpace = class DataSpace2 {
|
|
|
2763
2767
|
}
|
|
2764
2768
|
async initializeDataPipeline() {
|
|
2765
2769
|
if (this._state !== import_services7.SpaceState.CONTROL_ONLY) {
|
|
2766
|
-
throw new
|
|
2770
|
+
throw new import_protocols7.SystemError("Invalid operation");
|
|
2767
2771
|
}
|
|
2768
2772
|
this._state = import_services7.SpaceState.INITIALIZING;
|
|
2769
2773
|
(0, import_log10.log)("new state", {
|
|
2770
2774
|
state: import_services7.SpaceState[this._state]
|
|
2771
2775
|
}, {
|
|
2772
2776
|
F: __dxlog_file12,
|
|
2773
|
-
L:
|
|
2777
|
+
L: 233,
|
|
2774
2778
|
S: this,
|
|
2775
2779
|
C: (f, a) => f(...a)
|
|
2776
2780
|
});
|
|
@@ -2781,7 +2785,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2781
2785
|
await (0, import_context6.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
2782
2786
|
(0, import_log10.log)("waiting for data pipeline to reach target timeframe", void 0, {
|
|
2783
2787
|
F: __dxlog_file12,
|
|
2784
|
-
L:
|
|
2788
|
+
L: 247,
|
|
2785
2789
|
S: this,
|
|
2786
2790
|
C: (f, a) => f(...a)
|
|
2787
2791
|
});
|
|
@@ -2792,7 +2796,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2792
2796
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
2793
2797
|
(0, import_log10.log)("data pipeline ready", void 0, {
|
|
2794
2798
|
F: __dxlog_file12,
|
|
2795
|
-
L:
|
|
2799
|
+
L: 256,
|
|
2796
2800
|
S: this,
|
|
2797
2801
|
C: (f, a) => f(...a)
|
|
2798
2802
|
});
|
|
@@ -2802,7 +2806,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2802
2806
|
state: import_services7.SpaceState[this._state]
|
|
2803
2807
|
}, {
|
|
2804
2808
|
F: __dxlog_file12,
|
|
2805
|
-
L:
|
|
2809
|
+
L: 260,
|
|
2806
2810
|
S: this,
|
|
2807
2811
|
C: (f, a) => f(...a)
|
|
2808
2812
|
});
|
|
@@ -2818,7 +2822,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2818
2822
|
await this._createWritableFeeds();
|
|
2819
2823
|
(0, import_log10.log)("writable feeds created", void 0, {
|
|
2820
2824
|
F: __dxlog_file12,
|
|
2821
|
-
L:
|
|
2825
|
+
L: 276,
|
|
2822
2826
|
S: this,
|
|
2823
2827
|
C: (f, a) => f(...a)
|
|
2824
2828
|
});
|
|
@@ -2923,7 +2927,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2923
2927
|
state: import_services7.SpaceState[this._state]
|
|
2924
2928
|
}, {
|
|
2925
2929
|
F: __dxlog_file12,
|
|
2926
|
-
L:
|
|
2930
|
+
L: 392,
|
|
2927
2931
|
S: this,
|
|
2928
2932
|
C: (f, a) => f(...a)
|
|
2929
2933
|
});
|
|
@@ -3065,7 +3069,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3065
3069
|
S: this,
|
|
3066
3070
|
C: (f, a) => f(...a)
|
|
3067
3071
|
});
|
|
3068
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3072
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.begin({
|
|
3069
3073
|
id: this._instanceId
|
|
3070
3074
|
}), {
|
|
3071
3075
|
F: __dxlog_file13,
|
|
@@ -3111,7 +3115,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3111
3115
|
space.initializeDataPipelineAsync();
|
|
3112
3116
|
}
|
|
3113
3117
|
}
|
|
3114
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3118
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.end({
|
|
3115
3119
|
id: this._instanceId
|
|
3116
3120
|
}), {
|
|
3117
3121
|
F: __dxlog_file13,
|
|
@@ -3365,10 +3369,9 @@ DataSpaceManager = _ts_decorate4([
|
|
|
3365
3369
|
var import_async10 = require("@dxos/async");
|
|
3366
3370
|
var import_codec_protobuf5 = require("@dxos/codec-protobuf");
|
|
3367
3371
|
var import_debug6 = require("@dxos/debug");
|
|
3368
|
-
var
|
|
3369
|
-
var import_errors4 = require("@dxos/errors");
|
|
3372
|
+
var import_invariant12 = require("@dxos/invariant");
|
|
3370
3373
|
var import_log12 = require("@dxos/log");
|
|
3371
|
-
var
|
|
3374
|
+
var import_protocols9 = require("@dxos/protocols");
|
|
3372
3375
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3373
3376
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3374
3377
|
var SpacesServiceImpl = class {
|
|
@@ -3388,7 +3391,7 @@ var SpacesServiceImpl = class {
|
|
|
3388
3391
|
}
|
|
3389
3392
|
async updateSpace({ spaceKey, state }) {
|
|
3390
3393
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3391
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3394
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3392
3395
|
if (state) {
|
|
3393
3396
|
switch (state) {
|
|
3394
3397
|
case import_services9.SpaceState.ACTIVE:
|
|
@@ -3398,7 +3401,7 @@ var SpacesServiceImpl = class {
|
|
|
3398
3401
|
await space.deactivate();
|
|
3399
3402
|
break;
|
|
3400
3403
|
default:
|
|
3401
|
-
throw new
|
|
3404
|
+
throw new import_protocols9.ApiError("Invalid space state");
|
|
3402
3405
|
}
|
|
3403
3406
|
}
|
|
3404
3407
|
}
|
|
@@ -3453,14 +3456,14 @@ var SpacesServiceImpl = class {
|
|
|
3453
3456
|
}
|
|
3454
3457
|
async postMessage({ spaceKey, channel, message }) {
|
|
3455
3458
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3456
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3459
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3457
3460
|
await space.postMessage(getChannelId(channel), message);
|
|
3458
3461
|
}
|
|
3459
3462
|
subscribeMessages({ spaceKey, channel }) {
|
|
3460
3463
|
return new import_codec_protobuf5.Stream(({ ctx, next }) => {
|
|
3461
3464
|
(0, import_async10.scheduleTask)(ctx, async () => {
|
|
3462
3465
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3463
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3466
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3464
3467
|
const handle = space.listen(getChannelId(channel), (message) => {
|
|
3465
3468
|
next(message);
|
|
3466
3469
|
});
|
|
@@ -3468,38 +3471,83 @@ var SpacesServiceImpl = class {
|
|
|
3468
3471
|
});
|
|
3469
3472
|
});
|
|
3470
3473
|
}
|
|
3471
|
-
queryCredentials({ spaceKey }) {
|
|
3472
|
-
return new import_codec_protobuf5.Stream(({ ctx, next }) => {
|
|
3473
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3474
|
+
queryCredentials({ spaceKey, noTail }) {
|
|
3475
|
+
return new import_codec_protobuf5.Stream(({ ctx, next, close }) => {
|
|
3476
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3474
3477
|
const processor = {
|
|
3475
3478
|
processCredential: async (credential) => {
|
|
3476
3479
|
next(credential);
|
|
3477
3480
|
}
|
|
3478
3481
|
};
|
|
3479
3482
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3480
|
-
(0, import_async10.scheduleTask)(ctx, () =>
|
|
3483
|
+
(0, import_async10.scheduleTask)(ctx, async () => {
|
|
3484
|
+
await space.spaceState.addCredentialProcessor(processor);
|
|
3485
|
+
if (noTail) {
|
|
3486
|
+
close();
|
|
3487
|
+
}
|
|
3488
|
+
});
|
|
3481
3489
|
});
|
|
3482
3490
|
}
|
|
3483
3491
|
async writeCredentials({ spaceKey, credentials }) {
|
|
3484
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3492
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3485
3493
|
for (const credential of credentials ?? []) {
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
credential
|
|
3489
|
-
|
|
3490
|
-
|
|
3494
|
+
if (credential.proof) {
|
|
3495
|
+
await space.controlPipeline.writer.write({
|
|
3496
|
+
credential: {
|
|
3497
|
+
credential
|
|
3498
|
+
}
|
|
3499
|
+
});
|
|
3500
|
+
} else {
|
|
3501
|
+
(0, import_invariant12.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
3502
|
+
F: __dxlog_file14,
|
|
3503
|
+
L: 168,
|
|
3504
|
+
S: this,
|
|
3505
|
+
A: [
|
|
3506
|
+
"!credential.id",
|
|
3507
|
+
"'Id on unsigned credentials is not allowed'"
|
|
3508
|
+
]
|
|
3509
|
+
});
|
|
3510
|
+
(0, import_invariant12.invariant)(this._identityManager.identity, "Identity is not available", {
|
|
3511
|
+
F: __dxlog_file14,
|
|
3512
|
+
L: 169,
|
|
3513
|
+
S: this,
|
|
3514
|
+
A: [
|
|
3515
|
+
"this._identityManager.identity",
|
|
3516
|
+
"'Identity is not available'"
|
|
3517
|
+
]
|
|
3518
|
+
});
|
|
3519
|
+
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
3520
|
+
(0, import_invariant12.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
3521
|
+
F: __dxlog_file14,
|
|
3522
|
+
L: 171,
|
|
3523
|
+
S: this,
|
|
3524
|
+
A: [
|
|
3525
|
+
"credential.issuer.equals(signer.getIssuer())",
|
|
3526
|
+
""
|
|
3527
|
+
]
|
|
3528
|
+
});
|
|
3529
|
+
const signedCredential = await signer.createCredential({
|
|
3530
|
+
subject: credential.subject.id,
|
|
3531
|
+
assertion: credential.subject.assertion
|
|
3532
|
+
});
|
|
3533
|
+
await space.controlPipeline.writer.write({
|
|
3534
|
+
credential: {
|
|
3535
|
+
credential: signedCredential
|
|
3536
|
+
}
|
|
3537
|
+
});
|
|
3538
|
+
}
|
|
3491
3539
|
}
|
|
3492
3540
|
}
|
|
3493
3541
|
async createEpoch({ spaceKey }) {
|
|
3494
3542
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3495
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3543
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3496
3544
|
await space.createEpoch();
|
|
3497
3545
|
}
|
|
3498
3546
|
_serializeSpace(space) {
|
|
3499
3547
|
return {
|
|
3500
3548
|
spaceKey: space.key,
|
|
3501
3549
|
state: space.state,
|
|
3502
|
-
error: space.error ? (0,
|
|
3550
|
+
error: space.error ? (0, import_protocols9.encodeError)(space.error) : void 0,
|
|
3503
3551
|
pipeline: {
|
|
3504
3552
|
currentEpoch: space.dataPipeline.currentEpoch,
|
|
3505
3553
|
appliedEpoch: space.dataPipeline.appliedEpoch,
|
|
@@ -3526,7 +3574,7 @@ var SpacesServiceImpl = class {
|
|
|
3526
3574
|
displayName: member.assertion.profile?.displayName
|
|
3527
3575
|
}
|
|
3528
3576
|
},
|
|
3529
|
-
presence: isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3577
|
+
presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3530
3578
|
peerStates: peers
|
|
3531
3579
|
};
|
|
3532
3580
|
}),
|
|
@@ -3558,11 +3606,11 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3558
3606
|
this.signalManager = signalManager;
|
|
3559
3607
|
this.modelFactory = modelFactory;
|
|
3560
3608
|
this.initialized = new import_async11.Trigger();
|
|
3561
|
-
this.dataServiceSubscriptions = new
|
|
3609
|
+
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
3562
3610
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3563
3611
|
this._instanceId = import_keys8.PublicKey.random().toHex();
|
|
3564
|
-
this.metadataStore = new
|
|
3565
|
-
this.snapshotStore = new
|
|
3612
|
+
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
3613
|
+
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
3566
3614
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
3567
3615
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
3568
3616
|
this.feedStore = new import_feed_store3.FeedStore({
|
|
@@ -3570,12 +3618,12 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3570
3618
|
root: storage.createDirectory("feeds"),
|
|
3571
3619
|
signer: this.keyring,
|
|
3572
3620
|
hypercore: {
|
|
3573
|
-
valueEncoding:
|
|
3621
|
+
valueEncoding: import_echo_pipeline2.valueEncoding,
|
|
3574
3622
|
stats: true
|
|
3575
3623
|
}
|
|
3576
3624
|
})
|
|
3577
3625
|
});
|
|
3578
|
-
this.spaceManager = new
|
|
3626
|
+
this.spaceManager = new import_echo_pipeline2.SpaceManager({
|
|
3579
3627
|
feedStore: this.feedStore,
|
|
3580
3628
|
networkManager: this.networkManager,
|
|
3581
3629
|
blobStore: this.blobStore,
|
|
@@ -3595,7 +3643,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3595
3643
|
S: this,
|
|
3596
3644
|
C: (f, a) => f(...a)
|
|
3597
3645
|
});
|
|
3598
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
3646
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.begin({
|
|
3599
3647
|
id: this._instanceId
|
|
3600
3648
|
}), {
|
|
3601
3649
|
F: __dxlog_file15,
|
|
@@ -3611,7 +3659,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3611
3659
|
if (this.identityManager.identity) {
|
|
3612
3660
|
await this._initialize(ctx);
|
|
3613
3661
|
}
|
|
3614
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
3662
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.end({
|
|
3615
3663
|
id: this._instanceId
|
|
3616
3664
|
}), {
|
|
3617
3665
|
F: __dxlog_file15,
|
|
@@ -3658,7 +3706,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3658
3706
|
}
|
|
3659
3707
|
getInvitationHandler(invitation) {
|
|
3660
3708
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3661
|
-
(0,
|
|
3709
|
+
(0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3662
3710
|
F: __dxlog_file15,
|
|
3663
3711
|
L: 174,
|
|
3664
3712
|
S: this,
|
|
@@ -3676,8 +3724,8 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3676
3724
|
}
|
|
3677
3725
|
async _checkStorageVersion() {
|
|
3678
3726
|
await this.metadataStore.load();
|
|
3679
|
-
if (this.metadataStore.version !==
|
|
3680
|
-
throw new
|
|
3727
|
+
if (this.metadataStore.version !== import_protocols10.STORAGE_VERSION) {
|
|
3728
|
+
throw new import_protocols10.InvalidStorageVersionError(import_protocols10.STORAGE_VERSION, this.metadataStore.version);
|
|
3681
3729
|
}
|
|
3682
3730
|
}
|
|
3683
3731
|
// Called when identity is created.
|
|
@@ -3705,7 +3753,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3705
3753
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
3706
3754
|
await this.dataSpaceManager.open();
|
|
3707
3755
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
3708
|
-
(0,
|
|
3756
|
+
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
3709
3757
|
F: __dxlog_file15,
|
|
3710
3758
|
L: 218,
|
|
3711
3759
|
S: this,
|
|
@@ -3790,14 +3838,14 @@ var import_async17 = require("@dxos/async");
|
|
|
3790
3838
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
3791
3839
|
var import_context10 = require("@dxos/context");
|
|
3792
3840
|
var import_document_model2 = require("@dxos/document-model");
|
|
3793
|
-
var
|
|
3794
|
-
var
|
|
3841
|
+
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
3842
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
3795
3843
|
var import_keys12 = require("@dxos/keys");
|
|
3796
3844
|
var import_log16 = require("@dxos/log");
|
|
3797
3845
|
var import_messaging = require("@dxos/messaging");
|
|
3798
3846
|
var import_model_factory = require("@dxos/model-factory");
|
|
3799
3847
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
3800
|
-
var
|
|
3848
|
+
var import_protocols12 = require("@dxos/protocols");
|
|
3801
3849
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3802
3850
|
var import_text_model = require("@dxos/text-model");
|
|
3803
3851
|
var import_tracing5 = require("@dxos/tracing");
|
|
@@ -4155,7 +4203,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4155
4203
|
};
|
|
4156
4204
|
|
|
4157
4205
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4158
|
-
var
|
|
4206
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
4159
4207
|
var import_lock_file = require("@dxos/lock-file");
|
|
4160
4208
|
var import_log14 = require("@dxos/log");
|
|
4161
4209
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4196,7 +4244,7 @@ var Lock = class {
|
|
|
4196
4244
|
}
|
|
4197
4245
|
async release() {
|
|
4198
4246
|
await this._onRelease?.();
|
|
4199
|
-
(0,
|
|
4247
|
+
(0, import_invariant14.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4200
4248
|
F: __dxlog_file16,
|
|
4201
4249
|
L: 42,
|
|
4202
4250
|
S: this,
|
|
@@ -4363,7 +4411,7 @@ var NetworkServiceImpl = class {
|
|
|
4363
4411
|
|
|
4364
4412
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4365
4413
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
4366
|
-
var
|
|
4414
|
+
var import_protocols11 = require("@dxos/protocols");
|
|
4367
4415
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
4368
4416
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
4369
4417
|
var import_util8 = require("@dxos/util");
|
|
@@ -4371,16 +4419,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
4371
4419
|
var createStorageObjects = (config) => {
|
|
4372
4420
|
const { path = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config ?? {};
|
|
4373
4421
|
if (persistent && storageType === StorageDriver.RAM) {
|
|
4374
|
-
throw new
|
|
4422
|
+
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4375
4423
|
}
|
|
4376
4424
|
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
4377
|
-
throw new
|
|
4425
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4378
4426
|
}
|
|
4379
4427
|
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
4380
|
-
throw new
|
|
4428
|
+
throw new import_protocols11.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4381
4429
|
}
|
|
4382
4430
|
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
4383
|
-
throw new
|
|
4431
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4384
4432
|
}
|
|
4385
4433
|
return {
|
|
4386
4434
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -4587,7 +4635,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4587
4635
|
* Can only be called once.
|
|
4588
4636
|
*/
|
|
4589
4637
|
initialize({ config, ...options }) {
|
|
4590
|
-
(0,
|
|
4638
|
+
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4591
4639
|
F: __dxlog_file17,
|
|
4592
4640
|
L: 184,
|
|
4593
4641
|
S: this,
|
|
@@ -4603,7 +4651,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4603
4651
|
C: (f, a) => f(...a)
|
|
4604
4652
|
});
|
|
4605
4653
|
if (config) {
|
|
4606
|
-
(0,
|
|
4654
|
+
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4607
4655
|
F: __dxlog_file17,
|
|
4608
4656
|
L: 188,
|
|
4609
4657
|
S: this,
|
|
@@ -4621,7 +4669,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4621
4669
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4622
4670
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4623
4671
|
this._signalManager = signalManager;
|
|
4624
|
-
(0,
|
|
4672
|
+
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4625
4673
|
F: __dxlog_file17,
|
|
4626
4674
|
L: 204,
|
|
4627
4675
|
S: this,
|
|
@@ -4647,7 +4695,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4647
4695
|
return;
|
|
4648
4696
|
}
|
|
4649
4697
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4650
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4698
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4651
4699
|
id: traceId
|
|
4652
4700
|
}), {
|
|
4653
4701
|
F: __dxlog_file17,
|
|
@@ -4655,7 +4703,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4655
4703
|
S: this,
|
|
4656
4704
|
C: (f, a) => f(...a)
|
|
4657
4705
|
});
|
|
4658
|
-
(0,
|
|
4706
|
+
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4659
4707
|
F: __dxlog_file17,
|
|
4660
4708
|
L: 224,
|
|
4661
4709
|
S: this,
|
|
@@ -4664,7 +4712,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4664
4712
|
"'config not set'"
|
|
4665
4713
|
]
|
|
4666
4714
|
});
|
|
4667
|
-
(0,
|
|
4715
|
+
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4668
4716
|
F: __dxlog_file17,
|
|
4669
4717
|
L: 225,
|
|
4670
4718
|
S: this,
|
|
@@ -4673,7 +4721,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4673
4721
|
"'storage not set'"
|
|
4674
4722
|
]
|
|
4675
4723
|
});
|
|
4676
|
-
(0,
|
|
4724
|
+
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4677
4725
|
F: __dxlog_file17,
|
|
4678
4726
|
L: 226,
|
|
4679
4727
|
S: this,
|
|
@@ -4682,7 +4730,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4682
4730
|
"'signal manager not set'"
|
|
4683
4731
|
]
|
|
4684
4732
|
});
|
|
4685
|
-
(0,
|
|
4733
|
+
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4686
4734
|
F: __dxlog_file17,
|
|
4687
4735
|
L: 227,
|
|
4688
4736
|
S: this,
|
|
@@ -4712,7 +4760,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4712
4760
|
await this._serviceContext.initialized.wait();
|
|
4713
4761
|
return this._serviceContext.dataSpaceManager;
|
|
4714
4762
|
}),
|
|
4715
|
-
DataService: new
|
|
4763
|
+
DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.dataServiceSubscriptions),
|
|
4716
4764
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
4717
4765
|
LoggingService: this._loggingService,
|
|
4718
4766
|
TracingService: this._tracingService,
|
|
@@ -4746,7 +4794,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4746
4794
|
S: this,
|
|
4747
4795
|
C: (f, a) => f(...a)
|
|
4748
4796
|
});
|
|
4749
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4797
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4750
4798
|
id: traceId
|
|
4751
4799
|
}), {
|
|
4752
4800
|
F: __dxlog_file17,
|
|
@@ -4787,7 +4835,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4787
4835
|
}
|
|
4788
4836
|
async reset() {
|
|
4789
4837
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4790
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4838
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4791
4839
|
id: traceId
|
|
4792
4840
|
}), {
|
|
4793
4841
|
F: __dxlog_file17,
|
|
@@ -4809,7 +4857,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4809
4857
|
S: this,
|
|
4810
4858
|
C: (f, a) => f(...a)
|
|
4811
4859
|
});
|
|
4812
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4860
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4813
4861
|
id: traceId
|
|
4814
4862
|
}), {
|
|
4815
4863
|
F: __dxlog_file17,
|
|
@@ -4869,7 +4917,7 @@ var performInvitation = ({ host, guest, options, hooks }) => {
|
|
|
4869
4917
|
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
4870
4918
|
break;
|
|
4871
4919
|
}
|
|
4872
|
-
(0,
|
|
4920
|
+
(0, import_invariant16.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
4873
4921
|
F: __dxlog_file18,
|
|
4874
4922
|
L: 84,
|
|
4875
4923
|
S: void 0,
|
|
@@ -5002,7 +5050,7 @@ var createInvitation = (host, options) => {
|
|
|
5002
5050
|
});
|
|
5003
5051
|
return host.invitations.createInvitation(hostHandler, options);
|
|
5004
5052
|
}
|
|
5005
|
-
return host.
|
|
5053
|
+
return host.share(options);
|
|
5006
5054
|
};
|
|
5007
5055
|
var acceptInvitation = (guest, invitation) => {
|
|
5008
5056
|
invitation = sanitizeInvitation(invitation);
|
|
@@ -5012,14 +5060,14 @@ var acceptInvitation = (guest, invitation) => {
|
|
|
5012
5060
|
});
|
|
5013
5061
|
return guest.invitations.acceptInvitation(guestHandler, invitation);
|
|
5014
5062
|
}
|
|
5015
|
-
return guest.
|
|
5063
|
+
return guest.join(invitation);
|
|
5016
5064
|
};
|
|
5017
5065
|
|
|
5018
5066
|
// packages/sdk/client-services/src/packlets/testing/test-builder.ts
|
|
5019
5067
|
var import_context11 = require("@dxos/context");
|
|
5020
5068
|
var import_credentials16 = require("@dxos/credentials");
|
|
5021
5069
|
var import_debug8 = require("@dxos/debug");
|
|
5022
|
-
var
|
|
5070
|
+
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
5023
5071
|
var import_testing = require("@dxos/echo-pipeline/testing");
|
|
5024
5072
|
var import_feed_store5 = require("@dxos/feed-store");
|
|
5025
5073
|
var import_keyring2 = require("@dxos/keyring");
|
|
@@ -5102,19 +5150,19 @@ var TestPeer = class {
|
|
|
5102
5150
|
root: this.storage.createDirectory("feeds"),
|
|
5103
5151
|
signer: this.keyring,
|
|
5104
5152
|
hypercore: {
|
|
5105
|
-
valueEncoding:
|
|
5153
|
+
valueEncoding: import_echo_pipeline4.valueEncoding
|
|
5106
5154
|
}
|
|
5107
5155
|
})
|
|
5108
5156
|
});
|
|
5109
5157
|
}
|
|
5110
5158
|
get metadataStore() {
|
|
5111
|
-
return this._props.metadataStore ??= new
|
|
5159
|
+
return this._props.metadataStore ??= new import_echo_pipeline4.MetadataStore(this.storage.createDirectory("metadata"));
|
|
5112
5160
|
}
|
|
5113
5161
|
get blobStore() {
|
|
5114
5162
|
return this._props.blobStore ??= new import_teleport_extension_object_sync2.BlobStore(this.storage.createDirectory("blobs"));
|
|
5115
5163
|
}
|
|
5116
5164
|
get snapshotStore() {
|
|
5117
|
-
return this._props.snapshotStore ??= new
|
|
5165
|
+
return this._props.snapshotStore ??= new import_echo_pipeline4.SnapshotStore(this.storage.createDirectory("snapshots"));
|
|
5118
5166
|
}
|
|
5119
5167
|
get networkManager() {
|
|
5120
5168
|
return this._props.networkManager ??= new import_network_manager3.NetworkManager({
|
|
@@ -5123,7 +5171,7 @@ var TestPeer = class {
|
|
|
5123
5171
|
});
|
|
5124
5172
|
}
|
|
5125
5173
|
get spaceManager() {
|
|
5126
|
-
return this._props.spaceManager ??= new
|
|
5174
|
+
return this._props.spaceManager ??= new import_echo_pipeline4.SpaceManager({
|
|
5127
5175
|
feedStore: this.feedStore,
|
|
5128
5176
|
networkManager: this.networkManager,
|
|
5129
5177
|
metadataStore: this.metadataStore,
|
|
@@ -5136,7 +5184,7 @@ var TestPeer = class {
|
|
|
5136
5184
|
return this._props.signingContext ?? (0, import_debug8.failUndefined)();
|
|
5137
5185
|
}
|
|
5138
5186
|
get dataSpaceManager() {
|
|
5139
|
-
return this._props.dataSpaceManager ??= new DataSpaceManager(this.spaceManager, this.metadataStore, new
|
|
5187
|
+
return this._props.dataSpaceManager ??= new DataSpaceManager(this.spaceManager, this.metadataStore, new import_echo_pipeline4.DataServiceSubscriptions(), this.keyring, this.identity, this.feedStore);
|
|
5140
5188
|
}
|
|
5141
5189
|
async createIdentity() {
|
|
5142
5190
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|