@dxos/client-services 0.1.58-main.f117c08 → 0.1.58-main.f5feb2a
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-BHJQYBGX.mjs → chunk-L426VUEE.mjs} +146 -102
- package/dist/lib/browser/chunk-L426VUEE.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 +192 -147
- 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 +191 -147
- 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 +5 -5
- 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-BHJQYBGX.mjs.map +0 -7
|
@@ -1158,26 +1158,24 @@ var DeviceInvitationProtocol = class {
|
|
|
1158
1158
|
|
|
1159
1159
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1160
1160
|
import { PushStream, scheduleTask as scheduleTask2, TimeoutError, Trigger as Trigger3 } from "@dxos/async";
|
|
1161
|
-
import {
|
|
1161
|
+
import { AuthenticatingInvitation, AUTHENTICATION_CODE_LENGTH, CancellableInvitation, INVITATION_TIMEOUT } from "@dxos/client-protocol";
|
|
1162
1162
|
import { Context as Context5 } from "@dxos/context";
|
|
1163
1163
|
import { generatePasscode } from "@dxos/credentials";
|
|
1164
|
-
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2 } from "@dxos/errors";
|
|
1165
1164
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1166
1165
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
1167
1166
|
import { log as log5 } from "@dxos/log";
|
|
1168
1167
|
import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
|
|
1169
|
-
import { trace as trace4 } from "@dxos/protocols";
|
|
1168
|
+
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2, trace as trace4 } from "@dxos/protocols";
|
|
1170
1169
|
import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1171
1170
|
import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1172
1171
|
|
|
1173
1172
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1174
1173
|
import { Trigger as Trigger2 } from "@dxos/async";
|
|
1175
1174
|
import { cancelWithContext, Context as Context4 } from "@dxos/context";
|
|
1176
|
-
import { InvalidInvitationExtensionRoleError } from "@dxos/errors";
|
|
1177
1175
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1178
1176
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1179
1177
|
import { log as log4 } from "@dxos/log";
|
|
1180
|
-
import { schema as schema2, trace as trace3 } from "@dxos/protocols";
|
|
1178
|
+
import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3 } from "@dxos/protocols";
|
|
1181
1179
|
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1182
1180
|
import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1183
1181
|
import { RpcExtension } from "@dxos/teleport";
|
|
@@ -1211,7 +1209,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1211
1209
|
options: async (options) => {
|
|
1212
1210
|
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1213
1211
|
F: __dxlog_file6,
|
|
1214
|
-
L:
|
|
1212
|
+
L: 87,
|
|
1215
1213
|
S: this,
|
|
1216
1214
|
A: [
|
|
1217
1215
|
"!this._remoteOptions",
|
|
@@ -1228,7 +1226,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1228
1226
|
id: traceId
|
|
1229
1227
|
}), {
|
|
1230
1228
|
F: __dxlog_file6,
|
|
1231
|
-
L:
|
|
1229
|
+
L: 96,
|
|
1232
1230
|
S: this,
|
|
1233
1231
|
C: (f, a) => f(...a)
|
|
1234
1232
|
});
|
|
@@ -1238,7 +1236,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1238
1236
|
invitationId
|
|
1239
1237
|
}, {
|
|
1240
1238
|
F: __dxlog_file6,
|
|
1241
|
-
L:
|
|
1239
|
+
L: 100,
|
|
1242
1240
|
S: this,
|
|
1243
1241
|
C: (f, a) => f(...a)
|
|
1244
1242
|
});
|
|
@@ -1252,7 +1250,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1252
1250
|
guestProfile: profile
|
|
1253
1251
|
}, {
|
|
1254
1252
|
F: __dxlog_file6,
|
|
1255
|
-
L:
|
|
1253
|
+
L: 109,
|
|
1256
1254
|
S: this,
|
|
1257
1255
|
C: (f, a) => f(...a)
|
|
1258
1256
|
});
|
|
@@ -1265,7 +1263,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1265
1263
|
id: traceId
|
|
1266
1264
|
}), {
|
|
1267
1265
|
F: __dxlog_file6,
|
|
1268
|
-
L:
|
|
1266
|
+
L: 116,
|
|
1269
1267
|
S: this,
|
|
1270
1268
|
C: (f, a) => f(...a)
|
|
1271
1269
|
});
|
|
@@ -1280,7 +1278,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1280
1278
|
id: traceId
|
|
1281
1279
|
}), {
|
|
1282
1280
|
F: __dxlog_file6,
|
|
1283
|
-
L:
|
|
1281
|
+
L: 125,
|
|
1284
1282
|
S: this,
|
|
1285
1283
|
C: (f, a) => f(...a)
|
|
1286
1284
|
});
|
|
@@ -1288,14 +1286,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1288
1286
|
authCode: code
|
|
1289
1287
|
}, {
|
|
1290
1288
|
F: __dxlog_file6,
|
|
1291
|
-
L:
|
|
1289
|
+
L: 126,
|
|
1292
1290
|
S: this,
|
|
1293
1291
|
C: (f, a) => f(...a)
|
|
1294
1292
|
});
|
|
1295
1293
|
let status = AuthenticationResponse.Status.OK;
|
|
1296
1294
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1297
1295
|
F: __dxlog_file6,
|
|
1298
|
-
L:
|
|
1296
|
+
L: 129,
|
|
1299
1297
|
S: this,
|
|
1300
1298
|
A: [
|
|
1301
1299
|
"this.invitation",
|
|
@@ -1306,7 +1304,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1306
1304
|
case Invitation2.AuthMethod.NONE: {
|
|
1307
1305
|
log4("authentication not required", void 0, {
|
|
1308
1306
|
F: __dxlog_file6,
|
|
1309
|
-
L:
|
|
1307
|
+
L: 132,
|
|
1310
1308
|
S: this,
|
|
1311
1309
|
C: (f, a) => f(...a)
|
|
1312
1310
|
});
|
|
@@ -1331,7 +1329,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1331
1329
|
authMethod: this.invitation.authMethod
|
|
1332
1330
|
}, {
|
|
1333
1331
|
F: __dxlog_file6,
|
|
1334
|
-
L:
|
|
1332
|
+
L: 150,
|
|
1335
1333
|
S: this,
|
|
1336
1334
|
C: (f, a) => f(...a)
|
|
1337
1335
|
});
|
|
@@ -1346,7 +1344,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1346
1344
|
}
|
|
1347
1345
|
}), {
|
|
1348
1346
|
F: __dxlog_file6,
|
|
1349
|
-
L:
|
|
1347
|
+
L: 156,
|
|
1350
1348
|
S: this,
|
|
1351
1349
|
C: (f, a) => f(...a)
|
|
1352
1350
|
});
|
|
@@ -1360,14 +1358,14 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1360
1358
|
id: traceId
|
|
1361
1359
|
}), {
|
|
1362
1360
|
F: __dxlog_file6,
|
|
1363
|
-
L:
|
|
1361
|
+
L: 162,
|
|
1364
1362
|
S: this,
|
|
1365
1363
|
C: (f, a) => f(...a)
|
|
1366
1364
|
});
|
|
1367
1365
|
try {
|
|
1368
1366
|
invariant5(this.invitation, "Invitation is not set.", {
|
|
1369
1367
|
F: __dxlog_file6,
|
|
1370
|
-
L:
|
|
1368
|
+
L: 165,
|
|
1371
1369
|
S: this,
|
|
1372
1370
|
A: [
|
|
1373
1371
|
"this.invitation",
|
|
@@ -1382,7 +1380,7 @@ var InvitationHostExtension = class extends RpcExtension {
|
|
|
1382
1380
|
id: traceId
|
|
1383
1381
|
}), {
|
|
1384
1382
|
F: __dxlog_file6,
|
|
1385
|
-
L:
|
|
1383
|
+
L: 173,
|
|
1386
1384
|
S: this,
|
|
1387
1385
|
C: (f, a) => f(...a)
|
|
1388
1386
|
});
|
|
@@ -1439,7 +1437,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1439
1437
|
options: async (options) => {
|
|
1440
1438
|
invariant5(!this._remoteOptions, "Remote options already set.", {
|
|
1441
1439
|
F: __dxlog_file6,
|
|
1442
|
-
L:
|
|
1440
|
+
L: 240,
|
|
1443
1441
|
S: this,
|
|
1444
1442
|
A: [
|
|
1445
1443
|
"!this._remoteOptions",
|
|
@@ -1466,7 +1464,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1466
1464
|
try {
|
|
1467
1465
|
log4("begin options", void 0, {
|
|
1468
1466
|
F: __dxlog_file6,
|
|
1469
|
-
L:
|
|
1467
|
+
L: 261,
|
|
1470
1468
|
S: this,
|
|
1471
1469
|
C: (f, a) => f(...a)
|
|
1472
1470
|
});
|
|
@@ -1478,7 +1476,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1478
1476
|
}));
|
|
1479
1477
|
log4("end options", void 0, {
|
|
1480
1478
|
F: __dxlog_file6,
|
|
1481
|
-
L:
|
|
1479
|
+
L: 264,
|
|
1482
1480
|
S: this,
|
|
1483
1481
|
C: (f, a) => f(...a)
|
|
1484
1482
|
});
|
|
@@ -1492,7 +1490,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1492
1490
|
} catch (err) {
|
|
1493
1491
|
log4("openError", err, {
|
|
1494
1492
|
F: __dxlog_file6,
|
|
1495
|
-
L:
|
|
1493
|
+
L: 274,
|
|
1496
1494
|
S: this,
|
|
1497
1495
|
C: (f, a) => f(...a)
|
|
1498
1496
|
});
|
|
@@ -1502,7 +1500,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1502
1500
|
async onClose() {
|
|
1503
1501
|
log4("onClose", void 0, {
|
|
1504
1502
|
F: __dxlog_file6,
|
|
1505
|
-
L:
|
|
1503
|
+
L: 280,
|
|
1506
1504
|
S: this,
|
|
1507
1505
|
C: (f, a) => f(...a)
|
|
1508
1506
|
});
|
|
@@ -1525,7 +1523,7 @@ var InvitationsHandler = class {
|
|
|
1525
1523
|
const authCode = options?.authCode ?? (authMethod === Invitation3.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1526
1524
|
invariant6(protocol, void 0, {
|
|
1527
1525
|
F: __dxlog_file7,
|
|
1528
|
-
L:
|
|
1526
|
+
L: 75,
|
|
1529
1527
|
S: this,
|
|
1530
1528
|
A: [
|
|
1531
1529
|
"protocol",
|
|
@@ -1554,7 +1552,7 @@ var InvitationsHandler = class {
|
|
|
1554
1552
|
...protocol.toJSON()
|
|
1555
1553
|
}, {
|
|
1556
1554
|
F: __dxlog_file7,
|
|
1557
|
-
L:
|
|
1555
|
+
L: 97,
|
|
1558
1556
|
S: this,
|
|
1559
1557
|
C: (f, a) => f(...a)
|
|
1560
1558
|
});
|
|
@@ -1579,7 +1577,7 @@ var InvitationsHandler = class {
|
|
|
1579
1577
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1580
1578
|
invariant6(deviceKey, void 0, {
|
|
1581
1579
|
F: __dxlog_file7,
|
|
1582
|
-
L:
|
|
1580
|
+
L: 118,
|
|
1583
1581
|
S: this,
|
|
1584
1582
|
A: [
|
|
1585
1583
|
"deviceKey",
|
|
@@ -1602,7 +1600,7 @@ var InvitationsHandler = class {
|
|
|
1602
1600
|
id: traceId
|
|
1603
1601
|
}), {
|
|
1604
1602
|
F: __dxlog_file7,
|
|
1605
|
-
L:
|
|
1603
|
+
L: 136,
|
|
1606
1604
|
S: this,
|
|
1607
1605
|
C: (f, a) => f(...a)
|
|
1608
1606
|
});
|
|
@@ -1610,7 +1608,7 @@ var InvitationsHandler = class {
|
|
|
1610
1608
|
...protocol.toJSON()
|
|
1611
1609
|
}, {
|
|
1612
1610
|
F: __dxlog_file7,
|
|
1613
|
-
L:
|
|
1611
|
+
L: 137,
|
|
1614
1612
|
S: this,
|
|
1615
1613
|
C: (f, a) => f(...a)
|
|
1616
1614
|
});
|
|
@@ -1626,7 +1624,7 @@ var InvitationsHandler = class {
|
|
|
1626
1624
|
...protocol.toJSON()
|
|
1627
1625
|
}, {
|
|
1628
1626
|
F: __dxlog_file7,
|
|
1629
|
-
L:
|
|
1627
|
+
L: 140,
|
|
1630
1628
|
S: this,
|
|
1631
1629
|
C: (f, a) => f(...a)
|
|
1632
1630
|
});
|
|
@@ -1638,7 +1636,7 @@ var InvitationsHandler = class {
|
|
|
1638
1636
|
id: traceId
|
|
1639
1637
|
}), {
|
|
1640
1638
|
F: __dxlog_file7,
|
|
1641
|
-
L:
|
|
1639
|
+
L: 142,
|
|
1642
1640
|
S: this,
|
|
1643
1641
|
C: (f, a) => f(...a)
|
|
1644
1642
|
});
|
|
@@ -1648,7 +1646,7 @@ var InvitationsHandler = class {
|
|
|
1648
1646
|
...protocol.toJSON()
|
|
1649
1647
|
}, {
|
|
1650
1648
|
F: __dxlog_file7,
|
|
1651
|
-
L:
|
|
1649
|
+
L: 145,
|
|
1652
1650
|
S: this,
|
|
1653
1651
|
C: (f, a) => f(...a)
|
|
1654
1652
|
});
|
|
@@ -1659,7 +1657,7 @@ var InvitationsHandler = class {
|
|
|
1659
1657
|
} else {
|
|
1660
1658
|
log5.error("failed", err, {
|
|
1661
1659
|
F: __dxlog_file7,
|
|
1662
|
-
L:
|
|
1660
|
+
L: 148,
|
|
1663
1661
|
S: this,
|
|
1664
1662
|
C: (f, a) => f(...a)
|
|
1665
1663
|
});
|
|
@@ -1670,7 +1668,7 @@ var InvitationsHandler = class {
|
|
|
1670
1668
|
error: err
|
|
1671
1669
|
}), {
|
|
1672
1670
|
F: __dxlog_file7,
|
|
1673
|
-
L:
|
|
1671
|
+
L: 151,
|
|
1674
1672
|
S: this,
|
|
1675
1673
|
C: (f, a) => f(...a)
|
|
1676
1674
|
});
|
|
@@ -1691,7 +1689,7 @@ var InvitationsHandler = class {
|
|
|
1691
1689
|
...protocol.toJSON()
|
|
1692
1690
|
}, {
|
|
1693
1691
|
F: __dxlog_file7,
|
|
1694
|
-
L:
|
|
1692
|
+
L: 166,
|
|
1695
1693
|
S: this,
|
|
1696
1694
|
C: (f, a) => f(...a)
|
|
1697
1695
|
});
|
|
@@ -1702,7 +1700,7 @@ var InvitationsHandler = class {
|
|
|
1702
1700
|
} else {
|
|
1703
1701
|
log5.error("failed", err, {
|
|
1704
1702
|
F: __dxlog_file7,
|
|
1705
|
-
L:
|
|
1703
|
+
L: 169,
|
|
1706
1704
|
S: this,
|
|
1707
1705
|
C: (f, a) => f(...a)
|
|
1708
1706
|
});
|
|
@@ -1730,7 +1728,7 @@ var InvitationsHandler = class {
|
|
|
1730
1728
|
state: Invitation3.State.CONNECTING
|
|
1731
1729
|
});
|
|
1732
1730
|
});
|
|
1733
|
-
const observable = new
|
|
1731
|
+
const observable = new CancellableInvitation({
|
|
1734
1732
|
initialInvitation: invitation,
|
|
1735
1733
|
subscriber: stream.observable,
|
|
1736
1734
|
onCancel: async () => {
|
|
@@ -1747,7 +1745,7 @@ var InvitationsHandler = class {
|
|
|
1747
1745
|
const { timeout = INVITATION_TIMEOUT } = invitation;
|
|
1748
1746
|
invariant6(protocol, void 0, {
|
|
1749
1747
|
F: __dxlog_file7,
|
|
1750
|
-
L:
|
|
1748
|
+
L: 210,
|
|
1751
1749
|
S: this,
|
|
1752
1750
|
A: [
|
|
1753
1751
|
"protocol",
|
|
@@ -1761,7 +1759,7 @@ var InvitationsHandler = class {
|
|
|
1761
1759
|
const setState = (newData) => {
|
|
1762
1760
|
invariant6(newData.state !== void 0, void 0, {
|
|
1763
1761
|
F: __dxlog_file7,
|
|
1764
|
-
L:
|
|
1762
|
+
L: 221,
|
|
1765
1763
|
S: this,
|
|
1766
1764
|
A: [
|
|
1767
1765
|
"newData.state !== undefined",
|
|
@@ -1781,7 +1779,7 @@ var InvitationsHandler = class {
|
|
|
1781
1779
|
...protocol.toJSON()
|
|
1782
1780
|
}, {
|
|
1783
1781
|
F: __dxlog_file7,
|
|
1784
|
-
L:
|
|
1782
|
+
L: 229,
|
|
1785
1783
|
S: this,
|
|
1786
1784
|
C: (f, a) => f(...a)
|
|
1787
1785
|
});
|
|
@@ -1791,7 +1789,7 @@ var InvitationsHandler = class {
|
|
|
1791
1789
|
} else {
|
|
1792
1790
|
log5.warn("auth failed", err, {
|
|
1793
1791
|
F: __dxlog_file7,
|
|
1794
|
-
L:
|
|
1792
|
+
L: 232,
|
|
1795
1793
|
S: this,
|
|
1796
1794
|
C: (f, a) => f(...a)
|
|
1797
1795
|
});
|
|
@@ -1805,7 +1803,7 @@ var InvitationsHandler = class {
|
|
|
1805
1803
|
...protocol.toJSON()
|
|
1806
1804
|
}, {
|
|
1807
1805
|
F: __dxlog_file7,
|
|
1808
|
-
L:
|
|
1806
|
+
L: 240,
|
|
1809
1807
|
S: this,
|
|
1810
1808
|
C: (f, a) => f(...a)
|
|
1811
1809
|
});
|
|
@@ -1820,7 +1818,7 @@ var InvitationsHandler = class {
|
|
|
1820
1818
|
currentState
|
|
1821
1819
|
}, {
|
|
1822
1820
|
F: __dxlog_file7,
|
|
1823
|
-
L:
|
|
1821
|
+
L: 250,
|
|
1824
1822
|
S: this,
|
|
1825
1823
|
C: (f, a) => f(...a)
|
|
1826
1824
|
});
|
|
@@ -1835,7 +1833,7 @@ var InvitationsHandler = class {
|
|
|
1835
1833
|
id: traceId
|
|
1836
1834
|
}), {
|
|
1837
1835
|
F: __dxlog_file7,
|
|
1838
|
-
L:
|
|
1836
|
+
L: 259,
|
|
1839
1837
|
S: this,
|
|
1840
1838
|
C: (f, a) => f(...a)
|
|
1841
1839
|
});
|
|
@@ -1847,7 +1845,7 @@ var InvitationsHandler = class {
|
|
|
1847
1845
|
...protocol.toJSON()
|
|
1848
1846
|
}, {
|
|
1849
1847
|
F: __dxlog_file7,
|
|
1850
|
-
L:
|
|
1848
|
+
L: 267,
|
|
1851
1849
|
S: this,
|
|
1852
1850
|
C: (f, a) => f(...a)
|
|
1853
1851
|
});
|
|
@@ -1858,7 +1856,7 @@ var InvitationsHandler = class {
|
|
|
1858
1856
|
...protocol.toJSON()
|
|
1859
1857
|
}, {
|
|
1860
1858
|
F: __dxlog_file7,
|
|
1861
|
-
L:
|
|
1859
|
+
L: 271,
|
|
1862
1860
|
S: this,
|
|
1863
1861
|
C: (f, a) => f(...a)
|
|
1864
1862
|
});
|
|
@@ -1868,7 +1866,7 @@ var InvitationsHandler = class {
|
|
|
1868
1866
|
response: introductionResponse
|
|
1869
1867
|
}, {
|
|
1870
1868
|
F: __dxlog_file7,
|
|
1871
|
-
L:
|
|
1869
|
+
L: 275,
|
|
1872
1870
|
S: this,
|
|
1873
1871
|
C: (f, a) => f(...a)
|
|
1874
1872
|
});
|
|
@@ -1880,7 +1878,7 @@ var InvitationsHandler = class {
|
|
|
1880
1878
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1881
1879
|
log5("guest waiting for authentication code...", void 0, {
|
|
1882
1880
|
F: __dxlog_file7,
|
|
1883
|
-
L:
|
|
1881
|
+
L: 284,
|
|
1884
1882
|
S: this,
|
|
1885
1883
|
C: (f, a) => f(...a)
|
|
1886
1884
|
});
|
|
@@ -1892,7 +1890,7 @@ var InvitationsHandler = class {
|
|
|
1892
1890
|
});
|
|
1893
1891
|
log5("sending authentication request", void 0, {
|
|
1894
1892
|
F: __dxlog_file7,
|
|
1895
|
-
L:
|
|
1893
|
+
L: 288,
|
|
1896
1894
|
S: this,
|
|
1897
1895
|
C: (f, a) => f(...a)
|
|
1898
1896
|
});
|
|
@@ -1913,7 +1911,7 @@ var InvitationsHandler = class {
|
|
|
1913
1911
|
attempt
|
|
1914
1912
|
}, {
|
|
1915
1913
|
F: __dxlog_file7,
|
|
1916
|
-
L:
|
|
1914
|
+
L: 299,
|
|
1917
1915
|
S: this,
|
|
1918
1916
|
C: (f, a) => f(...a)
|
|
1919
1917
|
});
|
|
@@ -1930,7 +1928,7 @@ var InvitationsHandler = class {
|
|
|
1930
1928
|
...protocol.toJSON()
|
|
1931
1929
|
}, {
|
|
1932
1930
|
F: __dxlog_file7,
|
|
1933
|
-
L:
|
|
1931
|
+
L: 310,
|
|
1934
1932
|
S: this,
|
|
1935
1933
|
C: (f, a) => f(...a)
|
|
1936
1934
|
});
|
|
@@ -1942,7 +1940,7 @@ var InvitationsHandler = class {
|
|
|
1942
1940
|
...protocol.toJSON()
|
|
1943
1941
|
}, {
|
|
1944
1942
|
F: __dxlog_file7,
|
|
1945
|
-
L:
|
|
1943
|
+
L: 321,
|
|
1946
1944
|
S: this,
|
|
1947
1945
|
C: (f, a) => f(...a)
|
|
1948
1946
|
});
|
|
@@ -1954,7 +1952,7 @@ var InvitationsHandler = class {
|
|
|
1954
1952
|
id: traceId
|
|
1955
1953
|
}), {
|
|
1956
1954
|
F: __dxlog_file7,
|
|
1957
|
-
L:
|
|
1955
|
+
L: 323,
|
|
1958
1956
|
S: this,
|
|
1959
1957
|
C: (f, a) => f(...a)
|
|
1960
1958
|
});
|
|
@@ -1964,7 +1962,7 @@ var InvitationsHandler = class {
|
|
|
1964
1962
|
...protocol.toJSON()
|
|
1965
1963
|
}, {
|
|
1966
1964
|
F: __dxlog_file7,
|
|
1967
|
-
L:
|
|
1965
|
+
L: 326,
|
|
1968
1966
|
S: this,
|
|
1969
1967
|
C: (f, a) => f(...a)
|
|
1970
1968
|
});
|
|
@@ -1974,7 +1972,7 @@ var InvitationsHandler = class {
|
|
|
1974
1972
|
} else {
|
|
1975
1973
|
log5("auth failed", err, {
|
|
1976
1974
|
F: __dxlog_file7,
|
|
1977
|
-
L:
|
|
1975
|
+
L: 329,
|
|
1978
1976
|
S: this,
|
|
1979
1977
|
C: (f, a) => f(...a)
|
|
1980
1978
|
});
|
|
@@ -1985,7 +1983,7 @@ var InvitationsHandler = class {
|
|
|
1985
1983
|
error: err
|
|
1986
1984
|
}), {
|
|
1987
1985
|
F: __dxlog_file7,
|
|
1988
|
-
L:
|
|
1986
|
+
L: 332,
|
|
1989
1987
|
S: this,
|
|
1990
1988
|
C: (f, a) => f(...a)
|
|
1991
1989
|
});
|
|
@@ -2003,7 +2001,7 @@ var InvitationsHandler = class {
|
|
|
2003
2001
|
...protocol.toJSON()
|
|
2004
2002
|
}, {
|
|
2005
2003
|
F: __dxlog_file7,
|
|
2006
|
-
L:
|
|
2004
|
+
L: 343,
|
|
2007
2005
|
S: this,
|
|
2008
2006
|
C: (f, a) => f(...a)
|
|
2009
2007
|
});
|
|
@@ -2013,7 +2011,7 @@ var InvitationsHandler = class {
|
|
|
2013
2011
|
} else {
|
|
2014
2012
|
log5("auth failed", err, {
|
|
2015
2013
|
F: __dxlog_file7,
|
|
2016
|
-
L:
|
|
2014
|
+
L: 346,
|
|
2017
2015
|
S: this,
|
|
2018
2016
|
C: (f, a) => f(...a)
|
|
2019
2017
|
});
|
|
@@ -2026,7 +2024,7 @@ var InvitationsHandler = class {
|
|
|
2026
2024
|
scheduleTask2(ctx, async () => {
|
|
2027
2025
|
invariant6(invitation.swarmKey, void 0, {
|
|
2028
2026
|
F: __dxlog_file7,
|
|
2029
|
-
L:
|
|
2027
|
+
L: 356,
|
|
2030
2028
|
S: this,
|
|
2031
2029
|
A: [
|
|
2032
2030
|
"invitation.swarmKey",
|
|
@@ -2048,7 +2046,7 @@ var InvitationsHandler = class {
|
|
|
2048
2046
|
state: Invitation3.State.CONNECTING
|
|
2049
2047
|
});
|
|
2050
2048
|
});
|
|
2051
|
-
const observable = new
|
|
2049
|
+
const observable = new AuthenticatingInvitation({
|
|
2052
2050
|
initialInvitation: invitation,
|
|
2053
2051
|
subscriber: stream.observable,
|
|
2054
2052
|
onCancel: async () => {
|
|
@@ -2473,7 +2471,7 @@ import { STORAGE_VERSION } from "@dxos/protocols";
|
|
|
2473
2471
|
import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
2474
2472
|
|
|
2475
2473
|
// packages/sdk/client-services/src/version.ts
|
|
2476
|
-
var DXOS_VERSION = "0.1.58-main.
|
|
2474
|
+
var DXOS_VERSION = "0.1.58-main.f5feb2a";
|
|
2477
2475
|
|
|
2478
2476
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
2479
2477
|
var getPlatform = () => {
|
|
@@ -2627,9 +2625,9 @@ import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
|
|
|
2627
2625
|
import { cancelWithContext as cancelWithContext2, Context as Context7 } from "@dxos/context";
|
|
2628
2626
|
import { timed } from "@dxos/debug";
|
|
2629
2627
|
import { createMappedFeedWriter } from "@dxos/echo-pipeline";
|
|
2630
|
-
import { CancelledError, SystemError } from "@dxos/errors";
|
|
2631
2628
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
2632
2629
|
import { log as log10 } from "@dxos/log";
|
|
2630
|
+
import { CancelledError, SystemError } from "@dxos/protocols";
|
|
2633
2631
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
2634
2632
|
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2635
2633
|
import { Timeframe as Timeframe2 } from "@dxos/timeframe";
|
|
@@ -2938,7 +2936,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2938
2936
|
this._signingContext = params.signingContext;
|
|
2939
2937
|
this._callbacks = params.callbacks ?? {};
|
|
2940
2938
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2941
|
-
trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.
|
|
2939
|
+
trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
2942
2940
|
update: this._inner.stateUpdate,
|
|
2943
2941
|
authTimeout: AUTH_TIMEOUT2
|
|
2944
2942
|
});
|
|
@@ -2948,7 +2946,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2948
2946
|
state: SpaceState[this._state]
|
|
2949
2947
|
}, {
|
|
2950
2948
|
F: __dxlog_file12,
|
|
2951
|
-
L:
|
|
2949
|
+
L: 118,
|
|
2952
2950
|
S: this,
|
|
2953
2951
|
C: (f, a) => f(...a)
|
|
2954
2952
|
});
|
|
@@ -2982,6 +2980,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2982
2980
|
await this._open();
|
|
2983
2981
|
}
|
|
2984
2982
|
async _open() {
|
|
2983
|
+
await this._gossip.open();
|
|
2985
2984
|
await this._notarizationPlugin.open();
|
|
2986
2985
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2987
2986
|
await this._inner.open(new Context7());
|
|
@@ -2990,7 +2989,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2990
2989
|
state: SpaceState[this._state]
|
|
2991
2990
|
}, {
|
|
2992
2991
|
F: __dxlog_file12,
|
|
2993
|
-
L:
|
|
2992
|
+
L: 165,
|
|
2994
2993
|
S: this,
|
|
2995
2994
|
C: (f, a) => f(...a)
|
|
2996
2995
|
});
|
|
@@ -3008,7 +3007,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3008
3007
|
state: SpaceState[this._state]
|
|
3009
3008
|
}, {
|
|
3010
3009
|
F: __dxlog_file12,
|
|
3011
|
-
L:
|
|
3010
|
+
L: 179,
|
|
3012
3011
|
S: this,
|
|
3013
3012
|
C: (f, a) => f(...a)
|
|
3014
3013
|
});
|
|
@@ -3019,6 +3018,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3019
3018
|
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
3020
3019
|
await this._notarizationPlugin.close();
|
|
3021
3020
|
await this._presence.destroy();
|
|
3021
|
+
await this._gossip.close();
|
|
3022
3022
|
}
|
|
3023
3023
|
async postMessage(channel, message) {
|
|
3024
3024
|
return this._gossip.postMessage(channel, message);
|
|
@@ -3038,7 +3038,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3038
3038
|
if (err instanceof CancelledError) {
|
|
3039
3039
|
log10("data pipeline initialization cancelled", err, {
|
|
3040
3040
|
F: __dxlog_file12,
|
|
3041
|
-
L:
|
|
3041
|
+
L: 211,
|
|
3042
3042
|
S: this,
|
|
3043
3043
|
C: (f, a) => f(...a)
|
|
3044
3044
|
});
|
|
@@ -3046,7 +3046,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3046
3046
|
}
|
|
3047
3047
|
log10.error("Error initializing data pipeline", err, {
|
|
3048
3048
|
F: __dxlog_file12,
|
|
3049
|
-
L:
|
|
3049
|
+
L: 215,
|
|
3050
3050
|
S: this,
|
|
3051
3051
|
C: (f, a) => f(...a)
|
|
3052
3052
|
});
|
|
@@ -3055,7 +3055,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3055
3055
|
state: SpaceState[this._state]
|
|
3056
3056
|
}, {
|
|
3057
3057
|
F: __dxlog_file12,
|
|
3058
|
-
L:
|
|
3058
|
+
L: 217,
|
|
3059
3059
|
S: this,
|
|
3060
3060
|
C: (f, a) => f(...a)
|
|
3061
3061
|
});
|
|
@@ -3075,7 +3075,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3075
3075
|
state: SpaceState[this._state]
|
|
3076
3076
|
}, {
|
|
3077
3077
|
F: __dxlog_file12,
|
|
3078
|
-
L:
|
|
3078
|
+
L: 233,
|
|
3079
3079
|
S: this,
|
|
3080
3080
|
C: (f, a) => f(...a)
|
|
3081
3081
|
});
|
|
@@ -3086,7 +3086,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3086
3086
|
await cancelWithContext2(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
3087
3087
|
log10("waiting for data pipeline to reach target timeframe", void 0, {
|
|
3088
3088
|
F: __dxlog_file12,
|
|
3089
|
-
L:
|
|
3089
|
+
L: 247,
|
|
3090
3090
|
S: this,
|
|
3091
3091
|
C: (f, a) => f(...a)
|
|
3092
3092
|
});
|
|
@@ -3097,7 +3097,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3097
3097
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
3098
3098
|
log10("data pipeline ready", void 0, {
|
|
3099
3099
|
F: __dxlog_file12,
|
|
3100
|
-
L:
|
|
3100
|
+
L: 256,
|
|
3101
3101
|
S: this,
|
|
3102
3102
|
C: (f, a) => f(...a)
|
|
3103
3103
|
});
|
|
@@ -3107,7 +3107,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3107
3107
|
state: SpaceState[this._state]
|
|
3108
3108
|
}, {
|
|
3109
3109
|
F: __dxlog_file12,
|
|
3110
|
-
L:
|
|
3110
|
+
L: 260,
|
|
3111
3111
|
S: this,
|
|
3112
3112
|
C: (f, a) => f(...a)
|
|
3113
3113
|
});
|
|
@@ -3123,7 +3123,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3123
3123
|
await this._createWritableFeeds();
|
|
3124
3124
|
log10("writable feeds created", void 0, {
|
|
3125
3125
|
F: __dxlog_file12,
|
|
3126
|
-
L:
|
|
3126
|
+
L: 276,
|
|
3127
3127
|
S: this,
|
|
3128
3128
|
C: (f, a) => f(...a)
|
|
3129
3129
|
});
|
|
@@ -3228,7 +3228,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3228
3228
|
state: SpaceState[this._state]
|
|
3229
3229
|
}, {
|
|
3230
3230
|
F: __dxlog_file12,
|
|
3231
|
-
L:
|
|
3231
|
+
L: 392,
|
|
3232
3232
|
S: this,
|
|
3233
3233
|
C: (f, a) => f(...a)
|
|
3234
3234
|
});
|
|
@@ -3682,10 +3682,9 @@ DataSpaceManager = _ts_decorate4([
|
|
|
3682
3682
|
import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTask as scheduleTask5 } from "@dxos/async";
|
|
3683
3683
|
import { Stream as Stream10 } from "@dxos/codec-protobuf";
|
|
3684
3684
|
import { raise as raise2 } from "@dxos/debug";
|
|
3685
|
-
import {
|
|
3686
|
-
import { ApiError } from "@dxos/errors";
|
|
3685
|
+
import { invariant as invariant12 } from "@dxos/invariant";
|
|
3687
3686
|
import { log as log12 } from "@dxos/log";
|
|
3688
|
-
import { encodeError } from "@dxos/protocols";
|
|
3687
|
+
import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
|
|
3689
3688
|
import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3690
3689
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3691
3690
|
var SpacesServiceImpl = class {
|
|
@@ -3785,8 +3784,8 @@ var SpacesServiceImpl = class {
|
|
|
3785
3784
|
});
|
|
3786
3785
|
});
|
|
3787
3786
|
}
|
|
3788
|
-
queryCredentials({ spaceKey }) {
|
|
3789
|
-
return new Stream10(({ ctx, next }) => {
|
|
3787
|
+
queryCredentials({ spaceKey, noTail }) {
|
|
3788
|
+
return new Stream10(({ ctx, next, close }) => {
|
|
3790
3789
|
const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
|
|
3791
3790
|
const processor = {
|
|
3792
3791
|
processCredential: async (credential) => {
|
|
@@ -3794,17 +3793,62 @@ var SpacesServiceImpl = class {
|
|
|
3794
3793
|
}
|
|
3795
3794
|
};
|
|
3796
3795
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3797
|
-
scheduleTask5(ctx, () =>
|
|
3796
|
+
scheduleTask5(ctx, async () => {
|
|
3797
|
+
await space.spaceState.addCredentialProcessor(processor);
|
|
3798
|
+
if (noTail) {
|
|
3799
|
+
close();
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3798
3802
|
});
|
|
3799
3803
|
}
|
|
3800
3804
|
async writeCredentials({ spaceKey, credentials }) {
|
|
3801
3805
|
const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
|
|
3802
3806
|
for (const credential of credentials ?? []) {
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
credential
|
|
3806
|
-
|
|
3807
|
-
|
|
3807
|
+
if (credential.proof) {
|
|
3808
|
+
await space.controlPipeline.writer.write({
|
|
3809
|
+
credential: {
|
|
3810
|
+
credential
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3813
|
+
} else {
|
|
3814
|
+
invariant12(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
3815
|
+
F: __dxlog_file14,
|
|
3816
|
+
L: 168,
|
|
3817
|
+
S: this,
|
|
3818
|
+
A: [
|
|
3819
|
+
"!credential.id",
|
|
3820
|
+
"'Id on unsigned credentials is not allowed'"
|
|
3821
|
+
]
|
|
3822
|
+
});
|
|
3823
|
+
invariant12(this._identityManager.identity, "Identity is not available", {
|
|
3824
|
+
F: __dxlog_file14,
|
|
3825
|
+
L: 169,
|
|
3826
|
+
S: this,
|
|
3827
|
+
A: [
|
|
3828
|
+
"this._identityManager.identity",
|
|
3829
|
+
"'Identity is not available'"
|
|
3830
|
+
]
|
|
3831
|
+
});
|
|
3832
|
+
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
3833
|
+
invariant12(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
3834
|
+
F: __dxlog_file14,
|
|
3835
|
+
L: 171,
|
|
3836
|
+
S: this,
|
|
3837
|
+
A: [
|
|
3838
|
+
"credential.issuer.equals(signer.getIssuer())",
|
|
3839
|
+
""
|
|
3840
|
+
]
|
|
3841
|
+
});
|
|
3842
|
+
const signedCredential = await signer.createCredential({
|
|
3843
|
+
subject: credential.subject.id,
|
|
3844
|
+
assertion: credential.subject.assertion
|
|
3845
|
+
});
|
|
3846
|
+
await space.controlPipeline.writer.write({
|
|
3847
|
+
credential: {
|
|
3848
|
+
credential: signedCredential
|
|
3849
|
+
}
|
|
3850
|
+
});
|
|
3851
|
+
}
|
|
3808
3852
|
}
|
|
3809
3853
|
}
|
|
3810
3854
|
async createEpoch({ spaceKey }) {
|
|
@@ -3843,7 +3887,7 @@ var SpacesServiceImpl = class {
|
|
|
3843
3887
|
displayName: member.assertion.profile?.displayName
|
|
3844
3888
|
}
|
|
3845
3889
|
},
|
|
3846
|
-
presence: isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
|
|
3890
|
+
presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
|
|
3847
3891
|
peerStates: peers
|
|
3848
3892
|
};
|
|
3849
3893
|
}),
|
|
@@ -3862,11 +3906,11 @@ import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credent
|
|
|
3862
3906
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
3863
3907
|
import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
|
|
3864
3908
|
import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
3865
|
-
import { invariant as
|
|
3909
|
+
import { invariant as invariant13 } from "@dxos/invariant";
|
|
3866
3910
|
import { Keyring } from "@dxos/keyring";
|
|
3867
3911
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3868
3912
|
import { log as log13 } from "@dxos/log";
|
|
3869
|
-
import { STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
|
|
3913
|
+
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
|
|
3870
3914
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3871
3915
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
3872
3916
|
import { trace as Trace2 } from "@dxos/tracing";
|
|
@@ -3990,7 +4034,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3990
4034
|
}
|
|
3991
4035
|
getInvitationHandler(invitation) {
|
|
3992
4036
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3993
|
-
|
|
4037
|
+
invariant13(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3994
4038
|
F: __dxlog_file15,
|
|
3995
4039
|
L: 174,
|
|
3996
4040
|
S: this,
|
|
@@ -4009,7 +4053,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4009
4053
|
async _checkStorageVersion() {
|
|
4010
4054
|
await this.metadataStore.load();
|
|
4011
4055
|
if (this.metadataStore.version !== STORAGE_VERSION2) {
|
|
4012
|
-
throw new
|
|
4056
|
+
throw new InvalidStorageVersionError(STORAGE_VERSION2, this.metadataStore.version);
|
|
4013
4057
|
}
|
|
4014
4058
|
}
|
|
4015
4059
|
// Called when identity is created.
|
|
@@ -4037,7 +4081,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4037
4081
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
4038
4082
|
await this.dataSpaceManager.open();
|
|
4039
4083
|
this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
|
|
4040
|
-
|
|
4084
|
+
invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4041
4085
|
F: __dxlog_file15,
|
|
4042
4086
|
L: 218,
|
|
4043
4087
|
S: this,
|
|
@@ -4243,7 +4287,7 @@ var isLocked = (lockPath) => {
|
|
|
4243
4287
|
|
|
4244
4288
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4245
4289
|
import { DX_DATA } from "@dxos/client-protocol";
|
|
4246
|
-
import { InvalidConfigError } from "@dxos/
|
|
4290
|
+
import { InvalidConfigError } from "@dxos/protocols";
|
|
4247
4291
|
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
4248
4292
|
import { createStorage, StorageType } from "@dxos/random-access-storage";
|
|
4249
4293
|
import { isNode } from "@dxos/util";
|
|
@@ -4320,7 +4364,7 @@ import { clientServiceBundle } from "@dxos/client-protocol";
|
|
|
4320
4364
|
import { Context as Context10 } from "@dxos/context";
|
|
4321
4365
|
import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
|
|
4322
4366
|
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
4323
|
-
import { invariant as
|
|
4367
|
+
import { invariant as invariant14 } from "@dxos/invariant";
|
|
4324
4368
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
4325
4369
|
import { log as log16 } from "@dxos/log";
|
|
4326
4370
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
@@ -4677,7 +4721,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4677
4721
|
* Can only be called once.
|
|
4678
4722
|
*/
|
|
4679
4723
|
initialize({ config, ...options }) {
|
|
4680
|
-
|
|
4724
|
+
invariant14(!this._open, "service host is open", {
|
|
4681
4725
|
F: __dxlog_file17,
|
|
4682
4726
|
L: 184,
|
|
4683
4727
|
S: this,
|
|
@@ -4693,7 +4737,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4693
4737
|
C: (f, a) => f(...a)
|
|
4694
4738
|
});
|
|
4695
4739
|
if (config) {
|
|
4696
|
-
|
|
4740
|
+
invariant14(!this._config, "config already set", {
|
|
4697
4741
|
F: __dxlog_file17,
|
|
4698
4742
|
L: 188,
|
|
4699
4743
|
S: this,
|
|
@@ -4711,7 +4755,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4711
4755
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4712
4756
|
}), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4713
4757
|
this._signalManager = signalManager;
|
|
4714
|
-
|
|
4758
|
+
invariant14(!this._networkManager, "network manager already set", {
|
|
4715
4759
|
F: __dxlog_file17,
|
|
4716
4760
|
L: 204,
|
|
4717
4761
|
S: this,
|
|
@@ -4745,7 +4789,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4745
4789
|
S: this,
|
|
4746
4790
|
C: (f, a) => f(...a)
|
|
4747
4791
|
});
|
|
4748
|
-
|
|
4792
|
+
invariant14(this._config, "config not set", {
|
|
4749
4793
|
F: __dxlog_file17,
|
|
4750
4794
|
L: 224,
|
|
4751
4795
|
S: this,
|
|
@@ -4754,7 +4798,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4754
4798
|
"'config not set'"
|
|
4755
4799
|
]
|
|
4756
4800
|
});
|
|
4757
|
-
|
|
4801
|
+
invariant14(this._storage, "storage not set", {
|
|
4758
4802
|
F: __dxlog_file17,
|
|
4759
4803
|
L: 225,
|
|
4760
4804
|
S: this,
|
|
@@ -4763,7 +4807,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4763
4807
|
"'storage not set'"
|
|
4764
4808
|
]
|
|
4765
4809
|
});
|
|
4766
|
-
|
|
4810
|
+
invariant14(this._signalManager, "signal manager not set", {
|
|
4767
4811
|
F: __dxlog_file17,
|
|
4768
4812
|
L: 226,
|
|
4769
4813
|
S: this,
|
|
@@ -4772,7 +4816,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4772
4816
|
"'signal manager not set'"
|
|
4773
4817
|
]
|
|
4774
4818
|
});
|
|
4775
|
-
|
|
4819
|
+
invariant14(this._networkManager, "network manager not set", {
|
|
4776
4820
|
F: __dxlog_file17,
|
|
4777
4821
|
L: 227,
|
|
4778
4822
|
S: this,
|
|
@@ -4961,4 +5005,4 @@ export {
|
|
|
4961
5005
|
createDefaultModelFactory,
|
|
4962
5006
|
ClientServicesHost
|
|
4963
5007
|
};
|
|
4964
|
-
//# sourceMappingURL=chunk-
|
|
5008
|
+
//# sourceMappingURL=chunk-L426VUEE.mjs.map
|